From ee3a3d40017180613ad01755619d990b871b2d5d Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Tue, 22 Aug 2023 14:56:14 -0700 Subject: [PATCH 01/57] Add extension resource support for resource ID parser (#6110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This change adds support for extension resources to our resource ID parser. An extension resource is denoted by a **second** providers segment. In an extension resource ID the "root scope" resolves to a fully-qualified resource rather than a scope (resource group). This change also tweaks some tests to address minor issues that were found during work on the parser. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). This change is a prerequisite for #6089 - some of the resources we work with are extension resources, and we're blocked until we can parse the IDs ## Auto-generated summary ### 🤖 Generated by Copilot at b40b33e ### Summary 🛠️➕🚀 Add support for extension resources in the `resources` package and fix bugs in related functions. Update tests and other packages to handle the new format and logic of extension resource IDs. > _`MakeUCPID` is the key to the gate of hell_ > _Extension resources unleash the power of the shell_ > _We parse and manipulate the `ID` of doom_ > _We delete the azure with the `MakeRelativeID` of gloom_ ### Walkthrough * Fix bugs in `deploy.go` where `MakeUCPID` was called with variadic arguments instead of slices ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-17b18f64f220418f36ce3e3bac79ad8943df9fe3f810eae741705b6178119345L116-R116), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-17b18f64f220418f36ce3e3bac79ad8943df9fe3f810eae741705b6178119345L293-R300)) * Update `render_test.go` to use the new signature of `MakeUCPID` with nil as the third argument ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94L112-R114)) * Update `resourceclient.go` to include extension segments when calling `MakeRelativeID` for deleting extension resources ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-ecff9e07837e5ac9ee7f185977bb9d4b9940bd3cf4694e7ee8ac52fa72cb97afL101-R101)) * Add a new field `extensionSegments` to the `ID` struct in `id.go` to store the type segments of extension resources ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L58-R61)) * Rewrite `IsResource` and `IsResourceCollection` functions in `id.go` to handle both regular and extension resources ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L117-R131), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L138-R185)) * Add a condition to `IsScope` and `IsScopeCollection` functions in `id.go` to check that the ID has no extension segments ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624R110), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624R142)) * Add new functions `ExtensionSegments`, `Type`, `Name`, and `QualifiedName` to the `ID` struct in `id.go` to return the extension segments, the fully-qualified resource type, the resource or scope name, and the fully-qualified resource name of the ID ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624R201-R205), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624R354-R361), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L300-R408), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L309-R426)) * Update `RootScope`, `ProviderNamespace`, `RoutingScope`, `Append`, and `Truncate` functions in `id.go` to handle extension resources and use the new signature of `MakeUCPID` and `MakeRelativeID` with extension segments as the third argument ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L175-R229), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624R239-R247), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L222-R299), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L264-R346), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L353-R471), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L363-R478), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L374-R511), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L410-R518)) * Update `Parse` function in `id.go` to handle extension resources, remove the logic for UCP forwarded requests, remove the check for the minimum segment count, add a check for the last segment being `providers`, and use the new signature of `MakeUCPID` and `MakeRelativeID` with extension segments as the third argument ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L482-R590), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L492-R600), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L500-L507), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L513-R614), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L529-R634), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L558-L561), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L571-R667), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624R694-R703), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L617-R783)) * Update `MakeUCPID` and `MakeRelativeID` functions in `id.go` to accept extension segments as the third argument and update the logic for the empty ID case to return `/planes` instead of `/planes/` ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L636-R803), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-bb7df9e0b8753d8e6f7de3ef29f0c5baac042bc28949d2f11f0cfefbbed9a624L658-R828)) * Update `id_test.go` to add more test cases for invalid IDs, add new kinds for extension resources, add new fields and functions to the test values struct, add a log message for each test case, and use the new fields and functions for the test cases ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L38-R42), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L53-R78), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L79-R90), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L116-R127), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L129-R144), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L142-R156), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L168-R182), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L181-R195), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L194-R208), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L208-R222), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L222-R240), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L237-R254), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L252-R269), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L268-R285), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69R302-R313), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L301-R335), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L330-R455), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69R474), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L354-R506)) * Add new test functions `Test_Append_Extension`, `Test_Truncate_Success_Extension`, and `Test_Truncate_ReturnsSelfForTopLevelExtension` to `id_test.go` to test the `Append` and `Truncate` functions for extension resources ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69R698-R705), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69R722-R729), [link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69R770-R777)) * Remove a test case from `TestPlaneNamespace` in `id_test.go` that is no longer valid ([link](https://github.com/project-radius/radius/pull/6110/files?diff=unified&w=0#diff-e1f337f67df64809cd3a37497e7610eb8fea945720ef82bc3bfbfc5b31324b69L684-L689)) --- pkg/cli/deployment/deploy.go | 12 +- pkg/corerp/renderers/container/render_test.go | 7 +- pkg/linkrp/processors/resourceclient.go | 2 +- pkg/ucp/resources/id.go | 432 ++++++++++++------ pkg/ucp/resources/id_test.go | 288 +++++++++--- .../cosmosdb/cosmosdbstorageclient_test.go | 4 +- pkg/ucp/store/cosmosdb/util_test.go | 16 +- pkg/validator/validator_test.go | 3 +- 8 files changed, 547 insertions(+), 217 deletions(-) diff --git a/pkg/cli/deployment/deploy.go b/pkg/cli/deployment/deploy.go index 230f715512..c1a330ae20 100644 --- a/pkg/cli/deployment/deploy.go +++ b/pkg/cli/deployment/deploy.go @@ -113,7 +113,7 @@ func (dc *ResourceDeploymentClient) startDeployment(ctx context.Context, name st }, } - resourceId = ucpresources.MakeUCPID(scopes, types...) + resourceId = ucpresources.MakeUCPID(scopes, types, nil) providerConfig := dc.GetProviderConfigs(options) poller, err := dc.Client.CreateOrUpdate(ctx, @@ -290,12 +290,14 @@ func (dc *ResourceDeploymentClient) listOperations(ctx context.Context, name str {Type: "radius", Name: "local"}, {Type: "resourcegroups", Name: dc.RadiusResourceGroup}, } - types := ucpresources.TypeSegment{ - Type: "Microsoft.Resources/deployments", - Name: name, + types := []ucpresources.TypeSegment{ + { + Type: "Microsoft.Resources/deployments", + Name: name, + }, } - resourceId = ucpresources.MakeUCPID(scopes, types) + resourceId = ucpresources.MakeUCPID(scopes, types, nil) ops, err := dc.OperationsClient.List(ctx, dc.RadiusResourceGroup, name, resourceId, sdkclients.DeploymentOperationsClientAPIVersion, nil) if err != nil { diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index 5bf0dce5bb..b4920e6c34 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -109,10 +109,9 @@ func makeResourceID(t *testing.T, resourceType string, resourceName string) reso {Type: "subscriptions", Name: "test-subscription"}, {Type: "resourceGroups", Name: "test-resourcegroup"}, }, - resources.TypeSegment{ - Type: resourceType, - Name: resourceName, - })) + []resources.TypeSegment{ + {Type: resourceType, Name: resourceName}, + }, nil)) require.NoError(t, err) return id diff --git a/pkg/linkrp/processors/resourceclient.go b/pkg/linkrp/processors/resourceclient.go index ec7ff5e042..b04afbca5b 100644 --- a/pkg/linkrp/processors/resourceclient.go +++ b/pkg/linkrp/processors/resourceclient.go @@ -98,7 +98,7 @@ func (c *resourceClient) wrapError(id resources.ID, err error) error { func (c *resourceClient) deleteAzureResource(ctx context.Context, id resources.ID, apiVersion string) error { var err error if id.IsUCPQualfied() { - id, err = resources.ParseResource(resources.MakeRelativeID(id.ScopeSegments()[1:], id.TypeSegments()...)) + id, err = resources.ParseResource(resources.MakeRelativeID(id.ScopeSegments()[1:], id.TypeSegments(), id.ExtensionSegments())) if err != nil { return err } diff --git a/pkg/ucp/resources/id.go b/pkg/ucp/resources/id.go index 09b04c96e3..d43eb1de4c 100644 --- a/pkg/ucp/resources/id.go +++ b/pkg/ucp/resources/id.go @@ -55,9 +55,10 @@ var supportedNamespaces = []string{ // ID represents an ARM or UCP resource id. ID is immutable once created. Use Parse() or ParseXyz() // to create IDs and use String() to convert back to strings. type ID struct { - id string - scopeSegments []ScopeSegment - typeSegments []TypeSegment + id string + scopeSegments []ScopeSegment + typeSegments []TypeSegment + extensionSegments []TypeSegment } // ScopeSegment represents one of the root-scope pairs of a resource ID. @@ -106,6 +107,7 @@ func (ri ID) IsEmpty() bool { func (ri ID) IsScope() bool { return !ri.IsEmpty() && // Not empty len(ri.typeSegments) == 0 && // Not a type + len(ri.extensionSegments) == 0 && (len(ri.scopeSegments) == 0 || len(ri.scopeSegments[len(ri.scopeSegments)-1].Name) > 0) // No scope segments or last one is named } @@ -114,9 +116,19 @@ func (ri ID) IsScope() bool { // Example: // // /planes/radius/local/resourceGroups/rg1/providers/Applications.Core/applications/my-app +// /planes/radius/local/resourceGroups/rg1/providers/Applications.Core/applications/my-app/providers/Some.Other/type/my-extension func (ri ID) IsResource() bool { - return !ri.IsEmpty() && // Not empty - len(ri.typeSegments) > 0 && len(ri.typeSegments[len(ri.typeSegments)-1].Name) > 0 // Has type segments and last one is named + if ri.IsEmpty() { + return false + } + + if len(ri.extensionSegments) > 0 { + // Has at least one extension segment, and the last one is named. + return len(ri.extensionSegments) > 0 && len(ri.extensionSegments[len(ri.extensionSegments)-1].Name) > 0 + } + + // Has type segments and last one is named + return len(ri.typeSegments) > 0 && len(ri.typeSegments[len(ri.typeSegments)-1].Name) > 0 } // IsScopeCollection returns true if the ID represents a collection or custom action on a scope. @@ -127,6 +139,7 @@ func (ri ID) IsResource() bool { func (ri ID) IsScopeCollection() bool { return !ri.IsEmpty() && // Not empty len(ri.typeSegments) == 0 && // No type segments + len(ri.extensionSegments) == 0 && // No extension segments len(ri.scopeSegments) > 0 && len(ri.scopeSegments[len(ri.scopeSegments)-1].Name) == 0 // Has scope segments and last one is un-named } @@ -135,9 +148,39 @@ func (ri ID) IsScopeCollection() bool { // Example: // // /planes/radius/local/resourceGroups/rg1/providers/Applications.Core/applications +// /planes/radius/local/resourceGroups/rg1/providers/Applications.Core/applications/my-app/providers/Some.Other/type func (ri ID) IsResourceCollection() bool { - return !ri.IsEmpty() && // Not empty - len(ri.typeSegments) > 0 && len(ri.typeSegments[len(ri.typeSegments)-1].Name) == 0 // Has type segments and last one is un-named + if ri.IsEmpty() { + return false + } + + if len(ri.extensionSegments) > 0 { + // Has at least one extension segment, and the last one is un-named. + return len(ri.extensionSegments) > 0 && len(ri.extensionSegments[len(ri.extensionSegments)-1].Name) == 0 + } + + // Has type segments and last one is un-named + return len(ri.typeSegments) > 0 && len(ri.typeSegments[len(ri.typeSegments)-1].Name) == 0 +} + +// IsExtensionResource returns true if the ID represents an extension resource. +// +// Example: +// +// /planes/radius/local/resourceGroups/rg1/providers/Applications.Core/applications/my-app/providers/Some.Other/type/my-extension +func (ri ID) IsExtensionResource() bool { + // Has at least one extension segment, and the last one is named. + return len(ri.extensionSegments) > 0 && len(ri.extensionSegments[len(ri.extensionSegments)-1].Name) > 0 +} + +// IsExtensionCollection returns true if the ID represents a collection or custom action on an extension resource. +// +// Example: +// +// /planes/radius/local/resourceGroups/rg1/providers/Applications.Core/applications/my-app/providers/Some.Other/type +func (ri ID) IsExtensionCollection() bool { + // Has at least one extension segment, and the last one is named. + return len(ri.extensionSegments) > 0 && len(ri.extensionSegments[len(ri.extensionSegments)-1].Name) == 0 } // IsUCPQualfied checks if the ID has a prefix of SegmentSeparator and PlanesSegment. @@ -155,6 +198,11 @@ func (ri ID) TypeSegments() []TypeSegment { return ri.typeSegments } +// ExtensionSegments gets the slice of extension segments. +func (ri ID) ExtensionSegments() []TypeSegment { + return ri.extensionSegments +} + // This function returns the "id" field of the given ID instance. func (ri ID) String() string { return ri.id @@ -170,7 +218,9 @@ func (ri ID) FindScope(scopeType string) string { return "" } -// RootScope returns the root-scope (the part before 'providers'), taking into account whether the ID is qualified for UCP or not. +// RootScope returns the root-scope (the part before the first 'providers'), taking into account whether the ID is qualified for UCP or not. +// +// For an exension resource the root scope is the same as its parent resource's root scope. // // Examples: // @@ -219,16 +269,24 @@ func (ri ID) PlaneScope() string { return SegmentSeparator + joined } -// ProviderNamespace returns the providers part of the ID +// ProviderNamespace returns the namespace of the resource provider. Will be empty if the resource ID +// is empty or refers to a scope. +// // Examples: // // Applications.Core func (ri ID) ProviderNamespace() string { - if len(ri.typeSegments) == 0 { - return "" + if len(ri.extensionSegments) > 0 { + segments := strings.Split(ri.extensionSegments[0].Type, SegmentSeparator) + return segments[0] + } + + if len(ri.typeSegments) > 0 { + segments := strings.Split(ri.typeSegments[0].Type, SegmentSeparator) + return segments[0] } - segments := strings.Split(ri.typeSegments[0].Type, SegmentSeparator) - return segments[0] + + return "" } // IsRadiusRPResource checks if the given ID is a supported Radius resource. @@ -238,12 +296,9 @@ func (ri ID) IsRadiusRPResource() bool { // PlaneNamespace returns the plane part of the UCP ID, or an empty string if the ID is not UCP qualified. // -// Note: This function does NOT handle invalid IDs. If an invalid ID calls this function then there is -// a chance that it is going to trigger a panic. -// // Examples: // -// radius +// radius/local func (ri ID) PlaneNamespace() string { if !ri.IsUCPQualfied() { return "" @@ -261,21 +316,57 @@ func (ri ID) PlaneNamespace() string { // // Examples: // -// /Applications.Core/applications/my-app +// Applications.Core/applications/my-app func (ri ID) RoutingScope() string { segments := []string{} - for _, t := range ri.typeSegments { - segments = append(segments, t.Type) - if t.Name != "" { - segments = append(segments, t.Name) + + if len(ri.extensionSegments) > 0 { + for _, t := range ri.extensionSegments { + segments = append(segments, t.Type) + if t.Name != "" { + segments = append(segments, t.Name) + } + } + } else { + for _, t := range ri.typeSegments { + segments = append(segments, t.Type) + if t.Name != "" { + segments = append(segments, t.Name) + } } } return strings.Join(segments, SegmentSeparator) } +// ParentResource returns the parent resource of the resource ID, or an empty string if the ID is a scope or non-extension resource. +// +// Example: +// +// /planes/radius/local/resourceGroups/cool-group/providers/Applications.Core/application/my-app/providers/Applications.Core/someExtensionType/my-extension +// => /planes/radius/local/resourceGroups/cool-group/providers/Applications.Core/application/my-app +func (ri ID) ParentResource() string { + if len(ri.extensionSegments) == 0 { + return "" + } + + if ri.IsUCPQualfied() { + return MakeUCPID(ri.scopeSegments, ri.typeSegments, nil) + } else { + return MakeRelativeID(ri.scopeSegments, ri.typeSegments, nil) + } +} + // Type returns the fully-qualified resource type of a ResourceID, or an empty string if the type cannot be determined. func (ri ID) Type() string { + if len(ri.extensionSegments) > 0 { + types := make([]string, len(ri.extensionSegments)) + for i, t := range ri.extensionSegments { + types[i] = t.Type + } + return strings.Join(types, SegmentSeparator) + } + if len(ri.typeSegments) > 0 { types := make([]string, len(ri.typeSegments)) for i, t := range ri.typeSegments { @@ -297,24 +388,50 @@ func (ri ID) Type() string { // QualifiedName gets the fully-qualified resource name (eg. `radiusv3/myapp/mycontainer`) by joining the type segments with the SegmentSeparator. func (ri ID) QualifiedName() string { - names := make([]string, len(ri.typeSegments)) - for i, t := range ri.typeSegments { - names[i] = t.Name + names := []string{} + if len(ri.extensionSegments) > 0 { + for _, t := range ri.extensionSegments { + if t.Name != "" { + names = append(names, t.Name) + } + } + + } else if len(ri.typeSegments) > 0 { + for _, t := range ri.typeSegments { + if t.Name != "" { + names = append(names, t.Name) + } + } + } else if len(ri.scopeSegments) > 0 { + for _, t := range ri.scopeSegments { + if t.Name != "" { + names = append(names, t.Name) + } + } + } + + if len(names) == 0 { + return "" } + return strings.Join(names, SegmentSeparator) } // Name gets the resource or scope name. func (ri ID) Name() string { - if len(ri.typeSegments) == 0 && len(ri.scopeSegments) == 0 { - return "" + if len(ri.extensionSegments) > 0 { + return ri.extensionSegments[len(ri.extensionSegments)-1].Name } - if len(ri.typeSegments) == 0 { + if len(ri.typeSegments) > 0 { + return ri.typeSegments[len(ri.typeSegments)-1].Name + } + + if len(ri.scopeSegments) > 0 { return ri.scopeSegments[len(ri.scopeSegments)-1].Name } - return ri.typeSegments[len(ri.typeSegments)-1].Name + return "" } // ValidateResourceType validates that the resource ID type segment matches the expected type. @@ -350,17 +467,23 @@ func invalidType(id string) error { // Append appends a resource type segment to the ID and returns the resulting ID. If the ID is UCP qualified, it will // return a UCP qualified ID, otherwise it will return a relative ID. func (ri ID) Append(resourceType TypeSegment) ID { - types := append(ri.typeSegments, resourceType) + typeSegments := ri.typeSegments + extensionSegments := ri.extensionSegments + if len(ri.extensionSegments) > 0 { + extensionSegments = append(extensionSegments, resourceType) + } else { + typeSegments = append(typeSegments, resourceType) + } if ri.IsUCPQualfied() { - result, err := Parse(MakeUCPID(ri.scopeSegments, types...)) + result, err := Parse(MakeUCPID(ri.scopeSegments, typeSegments, extensionSegments)) if err != nil { panic(err) // Should not be possible. } return result } else { - result, err := Parse(MakeRelativeID(ri.scopeSegments, types...)) + result, err := Parse(MakeRelativeID(ri.scopeSegments, typeSegments, extensionSegments)) if err != nil { panic(err) // Should not be possible. } @@ -371,43 +494,34 @@ func (ri ID) Append(resourceType TypeSegment) ID { // Truncate removes the last type/name pair for a resource id or scope id. Calling truncate on a top level resource or scope has no effect. func (ri ID) Truncate() ID { - if len(ri.typeSegments) == 0 && len(ri.scopeSegments) == 0 { - return ri // Top level scope already - } - - if len(ri.typeSegments) > 0 && len(ri.typeSegments) < 2 { - return ri // Top level resource already - } - - if len(ri.typeSegments) == 0 { - // Truncate the root scope - if ri.IsUCPQualfied() { - result, err := Parse(MakeUCPID(ri.scopeSegments[0:len(ri.scopeSegments)-1], []TypeSegment{}...)) - if err != nil { - panic(err) // Should not be possible. - } - - return result - } else { - result, err := Parse(MakeRelativeID(ri.scopeSegments[0:len(ri.scopeSegments)-1], []TypeSegment{}...)) - if err != nil { - panic(err) // Should not be possible. - } - - return result - } + scopeSegments := ri.scopeSegments + typeSegments := ri.typeSegments + extensionSegments := ri.extensionSegments + + if len(ri.extensionSegments) > 1 { + extensionSegments = extensionSegments[0 : len(extensionSegments)-1] + } else if len(ri.extensionSegments) == 1 { + // Do nothing + return ri + } else if len(ri.typeSegments) > 1 { + typeSegments = typeSegments[0 : len(typeSegments)-1] + } else if len(ri.typeSegments) == 1 { + // Do nothing + return ri + } else if len(ri.scopeSegments) >= 1 { + // Allow the last scope to be truncated. An empty ID is still a "scope". + scopeSegments = scopeSegments[0 : len(scopeSegments)-1] } - // Truncate the resource type if ri.IsUCPQualfied() { - result, err := Parse(MakeUCPID(ri.scopeSegments, ri.typeSegments[0:len(ri.typeSegments)-1]...)) + result, err := Parse(MakeUCPID(scopeSegments, typeSegments, extensionSegments)) if err != nil { panic(err) // Should not be possible. } return result } else { - result, err := Parse(MakeRelativeID(ri.scopeSegments, ri.typeSegments[0:len(ri.typeSegments)-1]...)) + result, err := Parse(MakeRelativeID(scopeSegments, typeSegments, extensionSegments)) if err != nil { panic(err) // Should not be possible. } @@ -472,37 +586,14 @@ func ParseResource(id string) (ID, error) { // Most code should use a more specific function like ParseResource to parse the specific kind of ID // they want to handle. func Parse(id string) (ID, error) { - isUCPQualified := false - if strings.HasPrefix(id, SegmentSeparator+PlanesSegment) { - isUCPQualified = true - id = strings.TrimPrefix(id, SegmentSeparator+PlanesSegment) - - // Handles /planes and /planes/ - if id == "" || id == "/" { - normalized := MakeUCPID([]ScopeSegment{}, []TypeSegment{}...) - return ID{ - id: normalized, - scopeSegments: []ScopeSegment{}, - typeSegments: []TypeSegment{}, - }, nil - } - } - - if id == "/" { - normalized := MakeRelativeID([]ScopeSegment{}, []TypeSegment{}...) - return ID{ - id: normalized, - scopeSegments: []ScopeSegment{}, - typeSegments: []TypeSegment{}, - }, nil - } - - // If UCP forwards a request to the RP, the incoming URL - // will not have the UCP Prefix but will have a planes segment - isUCPForwarded := false - if strings.HasPrefix(id, SegmentSeparator+PlanesSegment) { - isUCPForwarded = true - id = strings.TrimPrefix(id, SegmentSeparator+PlanesSegment) + original := id + // We require the leading / for all IDs, and tolerate a trailing /. + // + // We block // for explicitly for security reasons so we can avoid a reflected redirect attack. + // A URL path that contains `//example.com` could end up in the Location header and result in an open + // redirect. + if !strings.HasPrefix(id, SegmentSeparator) || strings.HasPrefix(id, SegmentSeparator+SegmentSeparator) { + return ID{}, invalid(original) } // trim the leading and ending / so we don't end up with an empty segment - we disallow @@ -510,30 +601,54 @@ func Parse(id string) (ID, error) { id = strings.TrimPrefix(id, SegmentSeparator) id = strings.TrimSuffix(id, SegmentSeparator) - // The minimum segment count is 2 since we can parse "root scope only" ids. - segments := strings.Split(id, SegmentSeparator) + isUCPQualified := false + if strings.EqualFold(id, PlanesSegment) { + isUCPQualified = true - if len(segments) < 2 { - return ID{}, invalid(id) + // We don't need to process the planes segment while parsing. + id = strings.TrimPrefix(id, PlanesSegment) + } else if strings.HasPrefix(id, PlanesSegment+SegmentSeparator) { + isUCPQualified = true + + // We don't need to process the planes segment while parsing. + id = strings.TrimPrefix(id, PlanesSegment+SegmentSeparator) + } + + // Handle trivial case + if id == "" { + normalized := "" + if isUCPQualified { + normalized = MakeUCPID(nil, nil, nil) + } else { + normalized = MakeRelativeID(nil, nil, nil) + } + return ID{ + id: normalized, + }, nil } // Check up front for empty segments + segments := strings.Split(id, SegmentSeparator) for _, s := range segments { if s == "" { - return ID{}, invalid(id) + return ID{}, invalid(original) } } // Parse scopes - iterate until we get to "providers" // - // Each id has a 'scope' portion and an optional 'resource'. The 'providers' segment is the - // delimiter between these. + // Each id has a 'scope' portion and an optional 'resource' followed by an optional 'extension'. + // The '/providers/' segment is the delimiter between these. scopes := []ScopeSegment{} i := 0 for i < len(segments) { - // We're done parsing scopes + // We're done parsing scopes when we reach the providers segment. if strings.ToLower(segments[i]) == ProvidersSegment { + if len(segments) == i+1 { + // Last segment is "providers" + return ID{}, invalid(original) + } i++ // advance past "providers" break } @@ -552,13 +667,9 @@ func Parse(id string) (ID, error) { // odd number of non-providers segments inside the root scope followed by 'providers', this is invalid. // // eg: /planes/radius/local/resourceGroups/test-rg/|resources|/providers/.... - return ID{}, invalid(id) + return ID{}, invalid(original) } - if isUCPForwarded && i == 0 { - // Add the planes segment to the scope - segments[i] = PlanesSegment + SegmentSeparator + segments[i] - } scopes = append(scopes, ScopeSegment{Type: segments[i], Name: segments[i+1]}) i += 2 } @@ -568,22 +679,21 @@ func Parse(id string) (ID, error) { if len(segments)-i == 0 { normalized := "" if isUCPQualified { - normalized = MakeUCPID(scopes, []TypeSegment{}...) + normalized = MakeUCPID(scopes, nil, nil) } else { - normalized = MakeRelativeID(scopes, []TypeSegment{}...) + normalized = MakeRelativeID(scopes, nil, nil) } return ID{ id: normalized, scopeSegments: scopes, - typeSegments: []TypeSegment{}, }, nil } // Now that're past providers, we're looking for the namespace/type - that is // at least 2 segments. if len(segments)-i < 2 { - return ID{}, invalid(id) + return ID{}, invalid(original) } resourceType := TypeSegment{Type: fmt.Sprintf("%s/%s", segments[i], segments[i+1])} @@ -597,6 +707,16 @@ func Parse(id string) (ID, error) { types := []TypeSegment{resourceType} for i < len(segments) { + // We're done parsing types when we reach the providers segment. + if strings.ToLower(segments[i]) == ProvidersSegment { + if len(segments) == i+1 { + // Last segment is "providers" + return ID{}, invalid(original) + } + i++ // advance past "providers" + break + } + rt := TypeSegment{Type: segments[i]} i++ @@ -614,17 +734,69 @@ func Parse(id string) (ID, error) { types = append(types, rt) } + if len(segments)-i == 0 { + normalized := "" + if isUCPQualified { + normalized = MakeUCPID(scopes, types, nil) + } else { + normalized = MakeRelativeID(scopes, types, nil) + } + + return ID{ + id: normalized, + scopeSegments: scopes, + typeSegments: types, + }, nil + } + + // If we get here then this is an extension resource. We need to parse another type. + + // Now that're past providers, we're looking for the namespace/type - that is + // at least 2 segments. + if len(segments)-i < 2 { + return ID{}, invalid(original) + } + + extensionType := TypeSegment{Type: fmt.Sprintf("%s/%s", segments[i], segments[i+1])} + i += 2 + + // We intentionally tolerate a "collection" id that omits the last name segment + if len(segments)-i > 0 { + extensionType.Name = segments[i] + i++ + } + extensionTypes := []TypeSegment{extensionType} + + for i < len(segments) { + et := TypeSegment{Type: segments[i]} + i++ + + // check for a resource name + if len(segments)-i == 0 { + // This is a collection. + extensionTypes = append(extensionTypes, et) + break + } + + // we have a name - keep parsing + et.Name = segments[i] + i++ + + extensionTypes = append(extensionTypes, et) + } + normalized := "" if isUCPQualified { - normalized = MakeUCPID(scopes, types...) + normalized = MakeUCPID(scopes, types, extensionTypes) } else { - normalized = MakeRelativeID(scopes, types...) + normalized = MakeRelativeID(scopes, types, extensionTypes) } return ID{ - id: normalized, - scopeSegments: scopes, - typeSegments: types, + id: normalized, + scopeSegments: scopes, + typeSegments: types, + extensionSegments: extensionTypes, }, nil } @@ -633,10 +805,18 @@ func invalid(id string) error { } // MakeUCPID creates a fully-qualified UCP resource ID, from the given scopes and resource types. -func MakeUCPID(scopes []ScopeSegment, resourceTypes ...TypeSegment) string { - segments := []string{ - PlanesSegment, +func MakeUCPID(scopes []ScopeSegment, resourceTypes []TypeSegment, extensionTypes []TypeSegment) string { + relative := MakeRelativeID(scopes, resourceTypes, extensionTypes) + if relative == "/" { + return SegmentSeparator + PlanesSegment } + + return SegmentSeparator + PlanesSegment + relative +} + +// MakeRelativeID makes a plane-relative resource ID (ARM style) from a slice of ScopeSegment and a variadic of TypeSegment.. +func MakeRelativeID(scopes []ScopeSegment, resourceTypes []TypeSegment, extensionTypes []TypeSegment) string { + segments := []string{} for _, scope := range scopes { segments = append(segments, scope.Type) if scope.Name != "" { @@ -655,23 +835,13 @@ func MakeUCPID(scopes []ScopeSegment, resourceTypes ...TypeSegment) string { } } - return SegmentSeparator + strings.Join(segments, SegmentSeparator) -} - -// MakeRelativeID makes a plane-relative resource ID (ARM style) from a slice of ScopeSegment and a variadic of TypeSegment.. -func MakeRelativeID(scopes []ScopeSegment, resourceTypes ...TypeSegment) string { - segments := []string{} - for _, scope := range scopes { - segments = append(segments, scope.Type, scope.Name) - } - - if len(resourceTypes) != 0 { + if len(extensionTypes) != 0 { segments = append(segments, ProvidersSegment) - for _, rt := range resourceTypes { - segments = append(segments, rt.Type) - if rt.Name != "" { - segments = append(segments, rt.Name) + for _, et := range extensionTypes { + segments = append(segments, et.Type) + if et.Name != "" { + segments = append(segments, et.Name) } } } diff --git a/pkg/ucp/resources/id_test.go b/pkg/ucp/resources/id_test.go index e599070d53..20a538af24 100644 --- a/pkg/ucp/resources/id_test.go +++ b/pkg/ucp/resources/id_test.go @@ -29,14 +29,22 @@ import ( func Test_ParseInvalidIDs(t *testing.T) { values := []string{ "", + "invalid", + "//", + "//example.com", + "subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders/", "/subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders/", "//subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders/resourceProviders", "/subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders/resourceProviders//", "/subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders//", "/subscriptions/{%s}/resourceGroups//providers/Microsoft.CustomProviders/resourceProviders", "/subscriptions/{%s}/resourceGroups/providers/Microsoft.CustomProviders/resourceProviders", - "/planes/radius", - "/planes/radius/local/resourceGroups//providers/Microsoft.CustomProviders/resourceProviders", + "/subscriptions/{%s}/resourceGroups/providers", + "planes/radius/local/resourceGroups/test-rg/providers/Applications.Test/testType", + + // Missing extension type + "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Test/testType/testResource/providers", + "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Test/testType/testResource/providers/Some.Extension", } for i, v := range values { @@ -50,21 +58,30 @@ func Test_ParseInvalidIDs(t *testing.T) { type idkind string const ( - kindnone idkind = "none" - kindscope idkind = "scope" - kindscopecollection idkind = "scopecollection" - kindresource idkind = "resource" - kindresourcecollection idkind = "resourcecollection" + kindnone idkind = "none" + kindscope idkind = "scope" + kindscopecollection idkind = "scopecollection" + kindresource idkind = "resource" + kindresourcecollection idkind = "resourcecollection" + kindextension idkind = "extension" + kindextensioncollection idkind = "extensioncollection" ) func Test_ParseValidIDs(t *testing.T) { values := []struct { - id string - expected string - scopes []ScopeSegment - types []TypeSegment - kind idkind - provider string + id string + expected string + rootScope string + routingScope string + parentResource string + scopes []ScopeSegment + types []TypeSegment + extensions []TypeSegment + kind idkind + provider string + typeName string + name string + qualifiedName string }{ { id: "/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders", @@ -76,30 +93,24 @@ func Test_ParseValidIDs(t *testing.T) { types: []TypeSegment{ {Type: "Microsoft.CustomProviders/resourceProviders"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresourcecollection, }, { id: "/planes", expected: "/planes", - scopes: []ScopeSegment{}, - types: []TypeSegment{}, provider: "", kind: kindscope, }, { id: "/planes/", expected: "/planes", - scopes: []ScopeSegment{}, - types: []TypeSegment{}, provider: "", kind: kindscope, }, { id: "/", expected: "/", - scopes: []ScopeSegment{}, - types: []TypeSegment{}, provider: "", kind: kindscope, }, @@ -113,20 +124,7 @@ func Test_ParseValidIDs(t *testing.T) { types: []TypeSegment{ {Type: "Microsoft.CustomProviders/resourceProviders"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", - kind: kindresourcecollection, - }, - { - id: "subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders", - expected: "/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders", - scopes: []ScopeSegment{ - {Type: "subscriptions", Name: "s1"}, - {Type: "resourceGroups", Name: "r1"}, - }, - types: []TypeSegment{ - {Type: "Microsoft.CustomProviders/resourceProviders"}, - }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresourcecollection, }, { @@ -139,7 +137,7 @@ func Test_ParseValidIDs(t *testing.T) { types: []TypeSegment{ {Type: "Microsoft.CustomProviders/resourceProviders"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresourcecollection, }, { @@ -165,7 +163,7 @@ func Test_ParseValidIDs(t *testing.T) { types: []TypeSegment{ {Type: "Microsoft.CustomProviders/resourceProviders", Name: "radius"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresource, }, { @@ -178,7 +176,7 @@ func Test_ParseValidIDs(t *testing.T) { types: []TypeSegment{ {Type: "Microsoft.CustomProviders/resourceProviders", Name: "radius"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresource, }, { @@ -191,7 +189,7 @@ func Test_ParseValidIDs(t *testing.T) { types: []TypeSegment{ {Type: "Microsoft.CustomProviders/resourceProviders", Name: "radius"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresource, }, { @@ -205,7 +203,7 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "Microsoft.CustomProviders/resourceProviders", Name: "radius"}, {Type: "Applications"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresourcecollection, }, { @@ -219,8 +217,11 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "Microsoft.CustomProviders/resourceProviders", Name: "radius"}, {Type: "Applications", Name: "test-app"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", - kind: kindresource, + provider: "Microsoft.CustomProviders", + kind: kindresource, + typeName: "Microsoft.CustomProviders/resourceProviders/Applications", + name: "test-app", + qualifiedName: "radius/test-app", }, { id: "/Subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app/Containers", @@ -234,7 +235,7 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "Applications", Name: "test-app"}, {Type: "Containers"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresourcecollection, }, { @@ -249,7 +250,7 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "Applications", Name: "test-app"}, {Type: "Containers", Name: "test"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresource, }, { @@ -265,7 +266,7 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "Applications", Name: "test-app"}, {Type: "Containers", Name: "test"}, }, - provider: "Microsoft.CustomProviders/resourceProviders", + provider: "Microsoft.CustomProviders", kind: kindresource, }, { @@ -281,13 +282,29 @@ func Test_ParseValidIDs(t *testing.T) { provider: "Applications.Core", kind: kindresource, }, + { + id: "/planes", + expected: "/planes", + provider: "", + kind: kindscope, + }, + { + id: "/planes/test", + expected: "/planes/test", + scopes: []ScopeSegment{ + { + Type: "test", + }, + }, + provider: "", + kind: kindscopecollection, + }, { id: "/planes/radius/local/", expected: "/planes/radius/local", scopes: []ScopeSegment{ {Type: "radius", Name: "local"}, }, - types: []TypeSegment{}, provider: "", kind: kindscope, }, @@ -298,9 +315,11 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "radius", Name: "local"}, {Type: "resourceGroups", Name: "r1"}, }, - types: []TypeSegment{}, - provider: "", - kind: kindscope, + provider: "", + kind: kindscope, + typeName: "System.Resources/resourceGroups", + name: "r1", + qualifiedName: "local/r1", }, { id: "/planes/radius/local/resourceGroups/r1/resources", @@ -310,7 +329,6 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "resourceGroups", Name: "r1"}, {Type: "resources", Name: ""}, }, - types: []TypeSegment{}, provider: "", kind: kindscopecollection, }, @@ -327,7 +345,104 @@ func Test_ParseValidIDs(t *testing.T) { provider: "Applications.Core", kind: kindresource, }, - + { + id: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType", + expected: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType", + rootScope: "/planes/radius/local/resourceGroups/r1", + routingScope: "Some.Extension/extensionType", + parentResource: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", + scopes: []ScopeSegment{ + {Type: "radius", Name: "local"}, + {Type: "resourceGroups", Name: "r1"}, + }, + types: []TypeSegment{{ + Type: "Applications.Core/environments", Name: "env"}, + }, + extensions: []TypeSegment{{ + Type: "Some.Extension/extensionType", Name: "", + }}, + provider: "Some.Extension", + kind: kindextensioncollection, + typeName: "Some.Extension/extensionType", + name: "", + qualifiedName: "", + }, + { + id: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType/extensionResource", + expected: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType/extensionResource", + rootScope: "/planes/radius/local/resourceGroups/r1", + routingScope: "Some.Extension/extensionType/extensionResource", + parentResource: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", + scopes: []ScopeSegment{ + {Type: "radius", Name: "local"}, + {Type: "resourceGroups", Name: "r1"}, + }, + types: []TypeSegment{{ + Type: "Applications.Core/environments", Name: "env"}, + }, + extensions: []TypeSegment{{ + Type: "Some.Extension/extensionType", Name: "extensionResource", + }}, + provider: "Some.Extension", + kind: kindextension, + typeName: "Some.Extension/extensionType", + name: "extensionResource", + qualifiedName: "extensionResource", + }, + { + id: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType/extensionResource/anotherType", + expected: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType/extensionResource/anotherType", + rootScope: "/planes/radius/local/resourceGroups/r1", + routingScope: "Some.Extension/extensionType/extensionResource/anotherType", + parentResource: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", + scopes: []ScopeSegment{ + {Type: "radius", Name: "local"}, + {Type: "resourceGroups", Name: "r1"}, + }, + types: []TypeSegment{{ + Type: "Applications.Core/environments", Name: "env"}, + }, + extensions: []TypeSegment{ + { + Type: "Some.Extension/extensionType", Name: "extensionResource", + }, + { + Type: "anotherType", Name: "", + }, + }, + provider: "Some.Extension", + kind: kindextensioncollection, + typeName: "Some.Extension/extensionType/anotherType", + name: "", + qualifiedName: "extensionResource", + }, + { + id: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType/extensionResource/anotherType/anotherName", + expected: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env/providers/Some.Extension/extensionType/extensionResource/anotherType/anotherName", + rootScope: "/planes/radius/local/resourceGroups/r1", + routingScope: "Some.Extension/extensionType/extensionResource/anotherType/anotherName", + parentResource: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", + scopes: []ScopeSegment{ + {Type: "radius", Name: "local"}, + {Type: "resourceGroups", Name: "r1"}, + }, + types: []TypeSegment{{ + Type: "Applications.Core/environments", Name: "env"}, + }, + extensions: []TypeSegment{ + { + Type: "Some.Extension/extensionType", Name: "extensionResource", + }, + { + Type: "anotherType", Name: "anotherName", + }, + }, + provider: "Some.Extension", + kind: kindextension, + typeName: "Some.Extension/extensionType/anotherType", + name: "anotherName", + qualifiedName: "extensionResource/anotherName", + }, // NOTE: this is NOT actually invalid, just confusing. { id: "/planes/radius/local/resourceGroups/r1/Applications.Core/environments/env", @@ -338,7 +453,6 @@ func Test_ParseValidIDs(t *testing.T) { {Type: "Applications.Core", Name: "environments"}, {Type: "env", Name: ""}, }, - types: []TypeSegment{}, provider: "", kind: kindscopecollection, }, @@ -346,22 +460,40 @@ func Test_ParseValidIDs(t *testing.T) { for i, v := range values { t.Run(fmt.Sprintf("%d: %v", i, v.id), func(t *testing.T) { + t.Logf("parsing %q", v.id) id, err := Parse(v.id) require.NoError(t, err) require.Equalf(t, v.expected, id.id, "id comparison failed for %s", v.id) require.Equalf(t, v.scopes, id.scopeSegments, "scope comparison failed for %s", v.id) + require.Equalf(t, v.types, id.typeSegments, "type comparison failed for %s", v.id) + require.Equalf(t, v.extensions, id.extensionSegments, "extension comparison failed for %s", v.id) + require.Equal(t, v.provider, id.ProviderNamespace(), "Provider") + if v.rootScope != "" { + require.Equal(t, v.rootScope, id.RootScope(), "RootScope") + } + if v.routingScope != "" { + require.Equal(t, v.routingScope, id.RoutingScope(), "RoutingScope") + } + require.Equal(t, v.parentResource, id.ParentResource(), "ParentResource") + + if v.typeName != "" { + require.Equal(t, v.typeName, id.Type(), "Type") + } + if v.name != "" { + require.Equal(t, v.name, id.Name(), "Name") + } + if v.qualifiedName != "" { + require.Equal(t, v.qualifiedName, id.QualifiedName(), "QualifiedName") + } require.NotEqual(t, kindnone, v.kind, "test must specify id kind") - require.Equal(t, v.kind == kindresource, id.IsResource(), "IsResource") require.Equal(t, v.kind == kindscope, id.IsScope(), "IsScope") - require.Equal(t, v.kind == kindresourcecollection, id.IsResourceCollection(), "IsResourceCollection") require.Equal(t, v.kind == kindscopecollection, id.IsScopeCollection(), "IsScopeCollection") - - require.Lenf(t, id.typeSegments, len(v.types), "types comparison failed for %s", v.id) - for i := range id.typeSegments { - require.Equalf(t, v.types[i], id.typeSegments[i], "types comparison failed for %s", v.id) - } + require.Equal(t, (v.kind == kindresource || v.kind == kindextension), id.IsResource(), "IsResource") + require.Equal(t, (v.kind == kindresourcecollection || v.kind == kindextensioncollection), id.IsResourceCollection(), "IsResourceCollection") + require.Equal(t, v.kind == kindextension, id.IsExtensionResource(), "IsExtensionResource") + require.Equal(t, v.kind == kindextensioncollection, id.IsExtensionCollection(), "IsExtensionCollection") }) } } @@ -471,7 +603,7 @@ func Test_MakeRelativeID(t *testing.T) { {Type: "resourceGroups", Name: "r1"}, } t.Run(fmt.Sprintf("%d: %v", i, v.expected), func(t *testing.T) { - actual := MakeRelativeID(scopes, v.types...) + actual := MakeRelativeID(scopes, v.types, nil) require.Equal(t, v.expected, actual) }) } @@ -553,6 +685,14 @@ func Test_Append_NamedResource_UCP(t *testing.T) { require.Equal(t, "/planes/azure/azurecloud/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app/test-resource/test-name", appended.id) } +func Test_Append_Extension(t *testing.T) { + id, err := Parse("/planes/azure/azurecloud/subscriptions/s1/resourceGroups/r1/providers/Microsoft.Storage/storageAccounts/test-account/providers/Some.Extension/extensionType/extensionResource") + require.NoError(t, err) + + appended := id.Append(TypeSegment{Name: "test-name", Type: "test-resource"}) + require.Equal(t, "/planes/azure/azurecloud/subscriptions/s1/resourceGroups/r1/providers/Microsoft.Storage/storageAccounts/test-account/providers/Some.Extension/extensionType/extensionResource/test-resource/test-name", appended.id) +} + func Test_Truncate_Success(t *testing.T) { id, err := Parse("/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app") require.NoError(t, err) @@ -569,6 +709,14 @@ func Test_Truncate_Success_Scope(t *testing.T) { require.Equal(t, "/subscriptions/s1", truncated.id) } +func Test_Truncate_Success_Extension(t *testing.T) { + id, err := Parse("/subscriptions/s1/resourceGroups/r1/providers/Microsoft.Storage/storageAccounts/test-account/providers/Some.Extension/extensionType/extensionResource/anotherType/anotherName") + require.NoError(t, err) + + truncated := id.Truncate() + require.Equal(t, "/subscriptions/s1/resourceGroups/r1/providers/Microsoft.Storage/storageAccounts/test-account/providers/Some.Extension/extensionType/extensionResource", truncated.id) +} + func Test_Truncate_Success_Scope_UCP(t *testing.T) { id, err := Parse("/planes/azure/azurecloud/subscriptions/s1/resourceGroups/r1/") require.NoError(t, err) @@ -577,6 +725,14 @@ func Test_Truncate_Success_Scope_UCP(t *testing.T) { require.Equal(t, "/planes/azure/azurecloud/subscriptions/s1", truncated.id) } +func Test_Truncate_Success_Scope_Empty(t *testing.T) { + id, err := Parse("/planes/azure/azurecloud") + require.NoError(t, err) + + truncated := id.Truncate() + require.Equal(t, "/planes", truncated.id) +} + func Test_Truncate_Success_UCP(t *testing.T) { id, err := Parse("/planes/azure/azurecloud/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app") require.NoError(t, err) @@ -609,6 +765,14 @@ func Test_Truncate_ReturnsSelfForTopLevelScope_UCP(t *testing.T) { require.Equal(t, "/planes", truncated.id) } +func Test_Truncate_ReturnsSelfForTopLevelExtension(t *testing.T) { + id, err := Parse("/subscriptions/s1/resourceGroups/r1/providers/Microsoft.Storage/storageAccounts/test-account/providers/Some.Extension/extensionType/extensionResource") + require.NoError(t, err) + + truncated := id.Truncate() + require.Equal(t, "/subscriptions/s1/resourceGroups/r1/providers/Microsoft.Storage/storageAccounts/test-account/providers/Some.Extension/extensionType/extensionResource", truncated.id) +} + func Test_Truncate_WithCustomAction(t *testing.T) { id, err := Parse("/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0/listSecrets") require.NoError(t, err) @@ -680,12 +844,6 @@ func TestPlaneNamespace(t *testing.T) { false, "", }, - { - "ucp-invalid-resource", - "/planes/radius", - true, - "", - }, { "ucp-valid-resource", "/planes/radius/local/resourceGroups/radius-test-rg/providers/Applications.Core/containers/test-container-0", diff --git a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go index ce64d2c15f..4ef33ebd28 100644 --- a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go +++ b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go @@ -743,12 +743,12 @@ func TestGetPartitionKey(t *testing.T) { }{ { "env-partition-key", - "subscriptions/00000000-0000-0000-1000-000000000001/resourcegroups/testGroup/providers/applications.core/environments/env0", + "/subscriptions/00000000-0000-0000-1000-000000000001/resourcegroups/testGroup/providers/applications.core/environments/env0", "00000000000000001000000000000001", }, { "env-no-subscription-partition-key", - "resourcegroups/testGroup/providers/applications.core/environments/env0", + "/resourcegroups/testGroup/providers/applications.core/environments/env0", "", }, { diff --git a/pkg/ucp/store/cosmosdb/util_test.go b/pkg/ucp/store/cosmosdb/util_test.go index de25182b47..f1ab151762 100644 --- a/pkg/ucp/store/cosmosdb/util_test.go +++ b/pkg/ucp/store/cosmosdb/util_test.go @@ -132,49 +132,49 @@ func TestGenerateCosmosDBKey(t *testing.T) { }{ { "env-success-1", - "subscriptions/00000000-0000-0000-1000-000000000001/resourcegroups/testGroup/providers/applications.core/environments/env0", + "/subscriptions/00000000-0000-0000-1000-000000000001/resourcegroups/testGroup/providers/applications.core/environments/env0", "00000000000000001000000000000001-TESTGROUP-APPLICATIONS:2ECORE:2FENVIRONMENTS:2FENV0", nil, }, { "env-success-2", - "subscriptions/eaf9116d-84e7-4720-a841-67ca2b67f888/resourcegroups/testGroup/providers/Applications.Core/environments/appenv", + "/subscriptions/eaf9116d-84e7-4720-a841-67ca2b67f888/resourcegroups/testGroup/providers/Applications.Core/environments/appenv", "EAF9116D84E74720A84167CA2B67F888-TESTGROUP-APPLICATIONS:2ECORE:2FENVIRONMENTS:2FAPPENV", nil, }, { "env-no-rg-success", - "subscriptions/00000000-0000-0000-1000-000000000001/providers/Applications.Core/environments/env0", + "/subscriptions/00000000-0000-0000-1000-000000000001/providers/Applications.Core/environments/env0", "00000000000000001000000000000001-APPLICATIONS:2ECORE:2FENVIRONMENTS:2FENV0", nil, }, { "os-success", - "subscriptions/00000000-0000-0000-1000-000000000001/providers/Applications.Core/locations/westus/operationStatuses/os1", + "/subscriptions/00000000-0000-0000-1000-000000000001/providers/Applications.Core/locations/westus/operationStatuses/os1", "00000000000000001000000000000001-APPLICATIONS:2ECORE:2FLOCATIONS:2FWESTUS:2FOPERATIONSTATUSES:2FOS1", nil, }, { "app-success", - "subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/radius-westus/providers/Applications.Core/applications/todoapp", + "/subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/radius-westus/providers/Applications.Core/applications/todoapp", "7826D962510F407A92A25AEB37AA7B6E-RADIUS:2DWESTUS-APPLICATIONS:2ECORE:2FAPPLICATIONS:2FTODOAPP", nil, }, { "app-long-name-success", - "subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/radius-westus/providers/Applications.Core/applications/longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1", + "/subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/radius-westus/providers/Applications.Core/applications/longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1", "7826D962510F407A92A25AEB37AA7B6E-RADIUS:2DWESTUS-APPLICATIONS:2ECORE:2FAPPLICATIONS:2FLONGAPPLICATIONNAME1LONGAPPLICATIONNAME1LONGAPPLICATIONNAME1LONGAPPLICATIONNAME1LONGAPPLICATIONNAME1LON|651E511DBBDDC783", nil, }, { "app-long-resource-name-success", - "subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/radius-westus/providers/Applications.Core/longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0/longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1", + "/subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/radius-westus/providers/Applications.Core/longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0/longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1", "7826D962510F407A92A25AEB37AA7B6E-RADIUS:2DWESTUS-APPLICATIONS:2ECORE:2FLONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME|279366913EF52FC7", nil, }, { "app-long-rg-app-names-success", - "subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0/providers/Applications.Core/longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0/longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1", + "/subscriptions/7826d962-510f-407a-92a2-5aeb37aa7b6e/resourcegroups/longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0longresourcegroup0/providers/Applications.Core/longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0longresourcename0/longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1longapplicationname1", "7826D962510F407A92A25AEB37AA7B6E-LONGRESOURCEGROUP0LONGRESOURCEGROUP0LONGRESOURC|EF662FD5E8286859-APPLICATIONS:2ECORE:2FLONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME0LONGRESOURCENAME|279366913EF52FC7", nil, }, diff --git a/pkg/validator/validator_test.go b/pkg/validator/validator_test.go index c450731dde..29994f997a 100644 --- a/pkg/validator/validator_test.go +++ b/pkg/validator/validator_test.go @@ -60,7 +60,8 @@ func Test_ToRouteParams(t *testing.T) { } t.Run("non-match", func(t *testing.T) { - req, err := http.NewRequest("", "http://radius/test", nil) + // double slash is an invalid resource ID '//test' + req, err := http.NewRequest("", "http://radius//test", nil) require.NoError(t, err) ps := v.toRouteParams(req) require.Empty(t, ps) From da7f28c2376bdf472f1236be4aebe1a0842f4584 Mon Sep 17 00:00:00 2001 From: Vishwanath Hiremath <100623239+vishwahiremat@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:01:05 -0700 Subject: [PATCH 02/57] Adding recipe error codes (#6100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Added changes to return recipe error code for recipe related failures. New Error codes are added based on the discussion on this issue: https://dev.azure.com/azure-octo/Incubations/_workitems/edit/8561?src=WorkItemMention&src-action=artifact_link Updated the unit tests. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). https://github.com/project-radius/radius/issues/4446 ## Auto-generated summary ### 🤖 Generated by Copilot at 174acd6 ### Summary 🚧🧪📝 This pull request adds and improves error handling for recipe execution and deployment using a custom `recipeError` type and error codes from the `recipes` package. It also updates the test cases and files for the `worker`, `driver`, `terraform` and `bicep` packages to use and check for the recipe errors and details. Additionally, it modifies the `corerp-resources-rabbitmq-recipe.bicep` file to test the recipe deployment with different resource names and sources. Finally, it propagates the error details from the recipe execution to the async operation result. > _Sing, O Muse, of the valiant workers who toiled with recipes_ > _To deploy and prepare the cloud resources with skill and ease_ > _But many errors and failures they faced, from bicep and terraform_ > _So they crafted a custom error type, with codes and details to inform_ ### Walkthrough * Add a custom error type and functions for recipe failures (F7,F8,F9) * Wrap errors from recipe drivers, terraform and registry with recipe errors and codes (F3,F5,F10,F11,[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L76-R76),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L84-R84),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L95-R95),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L123-R133),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L146-R146),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L154-R154),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L163-R163),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-1b98bc9b02b96687752860c11c68d87d99ad99f24ecdfc5497fda6823abc0612L103-R108),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482L162-R163),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482L241-R242),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-8f42ae34c8baedfa511cbdfade906829f50e87e4151703dcb5c626f6f27b76ebL48-R54)) * Extract error details from recipe errors and assign them to async operation result (F0,F1,F2,[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-2a756eb6febca8885faee2e681ef34a657b0dab643140ea8f4aefbbdf01c8c33R60-R62),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5R34),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5R312-R313),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-63c99bcf90b780db4187f0350bd2fce63521e696465b1e13d3035b949602764aR27),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-63c99bcf90b780db4187f0350bd2fce63521e696465b1e13d3035b949602764aR155-R174)) * Modify test cases to expect recipe errors and codes and verify error details (F4,F6,F8,[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-a0a208a111e71713a21b404fdb3b31fd13f668e5716ab4331584027cc3d98debR25),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-a0a208a111e71713a21b404fdb3b31fd13f668e5716ab4331584027cc3d98debL430-R441),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-ae6e6fdc3b9219f2f1b2dbfd1cfaff3ff2d941a2a4d58fd33b910bd1fbf31e92L142-R152),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-ae6e6fdc3b9219f2f1b2dbfd1cfaff3ff2d941a2a4d58fd33b910bd1fbf31e92L185-R200),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-7f4de1074601fd966bbd28881fd64dc180b7d0435e7b579b0c8ac2e89bb469a4R1-R104)) * Change test data for bicep recipe to use different parameters, resources and source (F12,[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L6-R7),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L14-R21),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L27-R27),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L33-R33),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L44-R44),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L51-R51),[link](https://github.com/project-radius/radius/pull/6100/files?diff=unified&w=0#diff-28f6957261d4f6a7078225d5e10bfa9f7367fa1be7376c295e4a5764f1124a31L57-R79)) --- .../asyncoperation/controller/result.go | 5 +- .../controller/createorupdateresource.go | 3 + .../backend/controller/deleteresource.go | 3 + pkg/recipes/driver/bicep.go | 18 +-- pkg/recipes/driver/bicep_test.go | 8 ++ pkg/recipes/driver/terraform.go | 8 +- pkg/recipes/driver/terraform_test.go | 28 ++++- pkg/recipes/error.go | 58 ++++++++++ pkg/recipes/error_test.go | 104 ++++++++++++++++++ pkg/recipes/errorcodes.go | 31 ++++++ pkg/recipes/terraform/execute.go | 3 +- pkg/rp/util/registry.go | 5 +- .../shared/resources/recipe_bicep_test.go | 10 +- 13 files changed, 253 insertions(+), 31 deletions(-) create mode 100644 pkg/recipes/error.go create mode 100644 pkg/recipes/error_test.go create mode 100644 pkg/recipes/errorcodes.go diff --git a/pkg/armrpc/asyncoperation/controller/result.go b/pkg/armrpc/asyncoperation/controller/result.go index b77ec8a1a6..8cb3a7e68a 100644 --- a/pkg/armrpc/asyncoperation/controller/result.go +++ b/pkg/armrpc/asyncoperation/controller/result.go @@ -53,10 +53,7 @@ func (r *Result) SetFailed(err v1.ErrorDetails, requeue bool) { } r.Requeue = requeue r.SetProvisioningState(v1.ProvisioningStateFailed) - r.Error = &v1.ErrorDetails{ - Code: err.Code, - Message: err.Message, - } + r.Error = &err } // SetCanceled sets the Result's Requeue field to false, sets the ProvisioningState to Canceled and sets the Error field diff --git a/pkg/linkrp/backend/controller/createorupdateresource.go b/pkg/linkrp/backend/controller/createorupdateresource.go index aa96741971..fd947e572c 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource.go +++ b/pkg/linkrp/backend/controller/createorupdateresource.go @@ -75,6 +75,9 @@ func (c *CreateOrUpdateResource[P, T]) Run(ctx context.Context, req *ctrl.Reques // Now we're ready to process recipes (if needed). recipeOutput, err := c.executeRecipeIfNeeded(ctx, data) if err != nil { + if recipeError, ok := err.(*recipes.RecipeError); ok { + return ctrl.NewFailedResult(recipeError.ErrorDetails), nil + } return ctrl.Result{}, err } diff --git a/pkg/linkrp/backend/controller/deleteresource.go b/pkg/linkrp/backend/controller/deleteresource.go index 55d11a17e6..2c8df58948 100644 --- a/pkg/linkrp/backend/controller/deleteresource.go +++ b/pkg/linkrp/backend/controller/deleteresource.go @@ -87,6 +87,9 @@ func (c *DeleteResource) Run(ctx context.Context, request *ctrl.Request) (ctrl.R err = c.engine.Delete(ctx, recipeData, resourceDataModel.OutputResources()) if err != nil { + if recipeError, ok := err.(*recipes.RecipeError); ok { + return ctrl.NewFailedResult(recipeError.ErrorDetails), nil + } return ctrl.Result{}, err } } diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index 151cbe2a7e..75930d195c 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -75,7 +75,7 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu if err != nil { metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, recipe.Name, &definition, metrics.FailedOperationState)) - return nil, err + return nil, recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, recipe.Name, &definition, metrics.SuccessfulOperationState)) @@ -83,7 +83,7 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu // create the context object to be passed to the recipe deployment recipeContext, err := recipecontext.New(&recipe, &configuration) if err != nil { - return nil, err + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } // get the parameters after resolving the conflict between developer and operator parameters @@ -94,7 +94,7 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu deploymentName := deploymentPrefix + strconv.FormatInt(time.Now().UnixNano(), 10) deploymentID, err := createDeploymentID(recipeContext.Resource.ID, deploymentName) if err != nil { - return nil, err + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } // Provider config will specify the Azure and AWS scopes (if provided). @@ -122,17 +122,17 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu clients.DeploymentsClientAPIVersion, ) if err != nil { - return nil, err + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } resp, err := poller.PollUntilDone(ctx, &runtime.PollUntilDoneOptions{Frequency: pollFrequency}) if err != nil { - return nil, err + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } recipeResponse, err := d.prepareRecipeResponse(resp.Properties.Outputs, resp.Properties.OutputResources) if err != nil { - return nil, fmt.Errorf("failed to read the recipe output %q: %w", recipes.ResultPropertyName, err) + return nil, recipes.NewRecipeError(recipes.InvalidRecipeOutputs, fmt.Sprintf("failed to read the recipe output %q: %s", recipes.ResultPropertyName, err.Error()), recipes.GetRecipeErrorDetails(err)) } return recipeResponse, nil @@ -145,7 +145,7 @@ func (d *bicepDriver) Delete(ctx context.Context, outputResources []rpv1.OutputR orderedOutputResources, err := rpv1.OrderOutputResources(outputResources) if err != nil { - return err + return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } // Loop over each output resource and delete in reverse dependency order @@ -153,7 +153,7 @@ func (d *bicepDriver) Delete(ctx context.Context, outputResources []rpv1.OutputR outputResource := orderedOutputResources[i] id := outputResource.Identity.GetID() if err != nil { - return err + return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } logger.Info(fmt.Sprintf("Deleting output resource: %v, LocalID: %s, resource type: %s\n", outputResource.Identity, outputResource.LocalID, outputResource.ResourceType.Type)) if outputResource.RadiusManaged == nil || !*outputResource.RadiusManaged { @@ -162,7 +162,7 @@ func (d *bicepDriver) Delete(ctx context.Context, outputResources []rpv1.OutputR err = d.ResourceClient.Delete(ctx, id, resourcemodel.APIVersionUnknown) if err != nil { - return err + return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } logger.Info(fmt.Sprintf("Deleted output resource: %q", id), ucplog.LogFieldTargetResourceID, id) diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index 36e9a09921..a49846f7e0 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" gomock "github.com/golang/mock/gomock" + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" corerp_datamodel "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/recipes" @@ -427,8 +428,15 @@ func Test_Bicep_Delete_Error(t *testing.T) { RadiusManaged: to.Ptr(true), }, } + recipeError := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeDeletionFailed, + Message: fmt.Sprintf("could not find API version for type %q, no supported API versions", outputResources[0].Identity.ResourceType.Type), + }, + } client.EXPECT().Delete(ctx, "/planes/kubernetes/local/namespaces/recipe-app/providers/core/Deployment/redis", resourcemodel.APIVersionUnknown).Times(1).Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].Identity.ResourceType.Type)) err := driver.Delete(ctx, outputResources) require.Error(t, err) + require.Equal(t, err, &recipeError) } diff --git a/pkg/recipes/driver/terraform.go b/pkg/recipes/driver/terraform.go index a95445943f..9eb5b911ca 100644 --- a/pkg/recipes/driver/terraform.go +++ b/pkg/recipes/driver/terraform.go @@ -66,7 +66,7 @@ func (d *terraformDriver) Execute(ctx context.Context, configuration recipes.Con logger := ucplog.FromContextOrDiscard(ctx) if d.options.Path == "" { - return nil, errors.New("path is a required option for Terraform driver") + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, "path is a required option for Terraform driver", nil) } // We need a unique directory per execution of terraform. We generate this using the unique operation id of the async request so that names are always unique, @@ -85,7 +85,7 @@ func (d *terraformDriver) Execute(ctx context.Context, configuration recipes.Con logger.Info(fmt.Sprintf("Deploying terraform recipe: %q, template: %q, execution directory: %q", recipe.Name, definition.TemplatePath, requestDirPath)) if err := os.MkdirAll(requestDirPath, 0755); err != nil { - return nil, fmt.Errorf("failed to create directory %q to execute terraform: %w", requestDirPath, err) + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, fmt.Sprintf("failed to create directory %q to execute terraform: %s", requestDirPath, err.Error()), recipes.GetRecipeErrorDetails(err)) } defer func() { if err := os.RemoveAll(requestDirPath); err != nil { @@ -100,12 +100,12 @@ func (d *terraformDriver) Execute(ctx context.Context, configuration recipes.Con EnvRecipe: &definition, }) if err != nil { - return nil, err + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } recipeOutputs, err := d.prepareRecipeResponse(tfState) if err != nil { - return nil, err + return nil, recipes.NewRecipeError(recipes.InvalidRecipeOutputs, err.Error(), recipes.GetRecipeErrorDetails(err)) } return recipeOutputs, nil diff --git a/pkg/recipes/driver/terraform_test.go b/pkg/recipes/driver/terraform_test.go index b23ddb6f41..b2797d6bdd 100644 --- a/pkg/recipes/driver/terraform_test.go +++ b/pkg/recipes/driver/terraform_test.go @@ -139,12 +139,17 @@ func Test_Terraform_Execute_DeploymentFailure(t *testing.T) { ResourceRecipe: &recipeMetadata, EnvRecipe: &envRecipe, } - + recipeError := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeDeploymentFailed, + Message: "Failed to deploy terraform module", + }, + } tfExecutor.EXPECT().Deploy(ctx, options).Times(1).Return(nil, errors.New("Failed to deploy terraform module")) _, err := driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) require.Error(t, err) - require.Equal(t, "Failed to deploy terraform module", err.Error()) + require.Equal(t, err, &recipeError) // Verify directory cleanup _, err = os.Stat(tfDir) require.True(t, os.IsNotExist(err), "Expected directory %s to be removed, but it still exists", tfDir) @@ -182,12 +187,17 @@ func Test_Terraform_Execute_OutputsFailure(t *testing.T) { }, }, } - + recipeError := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.InvalidRecipeOutputs, + Message: "json: unknown field \"invalid\"", + }, + } tfExecutor.EXPECT().Deploy(ctx, options).Times(1).Return(expectedTFState, nil) _, err := driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) require.Error(t, err) - require.Equal(t, "json: unknown field \"invalid\"", err.Error()) + require.Equal(t, err, &recipeError) // Verify directory cleanup _, err = os.Stat(tfDir) require.True(t, os.IsNotExist(err), "Expected directory %s to be removed, but it still exists", tfDir) @@ -197,10 +207,16 @@ func Test_Terraform_Execute_EmptyPath(t *testing.T) { _, driver := setup(t) driver.options.Path = "" envConfig, recipeMetadata, envRecipe := buildTestInputs() - + expErr := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeDeploymentFailed, + Message: "path is a required option for Terraform driver", + }, + } _, err := driver.Execute(testcontext.New(t), envConfig, recipeMetadata, envRecipe) require.Error(t, err) - require.Equal(t, "path is a required option for Terraform driver", err.Error()) + require.Equal(t, err, &expErr) + } func Test_Terraform_Execute_EmptyOperationID_Success(t *testing.T) { diff --git a/pkg/recipes/error.go b/pkg/recipes/error.go new file mode 100644 index 0000000000..ca6b5f50f6 --- /dev/null +++ b/pkg/recipes/error.go @@ -0,0 +1,58 @@ +/* +Copyright 2023 The Radius Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package recipes + +import ( + "fmt" + + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" +) + +type RecipeError struct { + ErrorDetails v1.ErrorDetails +} + +// Error returns an error string describing the error code and message. +func (r *RecipeError) Error() string { + return fmt.Sprintf("code %v: err %v", r.ErrorDetails.Code, r.ErrorDetails.Message) +} + +func (e *RecipeError) Is(target error) bool { + _, ok := target.(*RecipeError) + return ok +} + +// NewRecipeError creates a new RecipeError error with a given code, message and error details. +func NewRecipeError(code string, message string, details ...*v1.ErrorDetails) *RecipeError { + err := new(RecipeError) + err.ErrorDetails.Message = message + err.ErrorDetails.Code = code + for _, val := range details { + if val != nil { + err.ErrorDetails.Details = append(err.ErrorDetails.Details, *val) + } + } + + return err +} + +// GetRecipeErrorDetails is used to get ErrorDetails if error is of type RecipeError else returns nil. +func GetRecipeErrorDetails(err error) *v1.ErrorDetails { + recipeError, _ := err.(*RecipeError) + if recipeError != nil { + return &recipeError.ErrorDetails + } + + return nil +} diff --git a/pkg/recipes/error_test.go b/pkg/recipes/error_test.go new file mode 100644 index 0000000000..d50c0a0354 --- /dev/null +++ b/pkg/recipes/error_test.go @@ -0,0 +1,104 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package recipes + +import ( + "errors" + "testing" + + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + "github.com/stretchr/testify/require" +) + +func TestNewRecipeError(t *testing.T) { + errorTests := []struct { + name string + errorCode string + errorMessage string + errorDetails *v1.ErrorDetails + expectedErr RecipeError + }{ + { + name: "error with details", + errorCode: RecipeDeploymentFailed, + errorMessage: "test-recipe-deployment-failed-message", + errorDetails: &v1.ErrorDetails{ + Code: RecipeLanguageFailure, + Message: "test-recipe-language-failure-message", + }, + expectedErr: RecipeError{ + v1.ErrorDetails{ + Code: RecipeDeploymentFailed, + Message: "test-recipe-deployment-failed-message", + Details: []v1.ErrorDetails{ + { + Code: RecipeLanguageFailure, + Message: "test-recipe-language-failure-message", + }, + }, + }, + }, + }, + { + name: "error without details", + errorCode: RecipeDeploymentFailed, + errorMessage: "test-recipe-deployment-failed-message", + errorDetails: nil, + expectedErr: RecipeError{ + v1.ErrorDetails{ + Code: RecipeDeploymentFailed, + Message: "test-recipe-deployment-failed-message", + }, + }, + }, + } + for _, tc := range errorTests { + err := NewRecipeError(tc.errorCode, tc.errorMessage, tc.errorDetails) + require.Equal(t, err, &tc.expectedErr) + } +} + +func TestGetRecipeErrorDetails(t *testing.T) { + errorTests := []struct { + name string + err error + expErrorDetails *v1.ErrorDetails + }{ + { + name: "", + err: errors.New("test-error"), + expErrorDetails: nil, + }, + { + name: "", + err: &RecipeError{ + v1.ErrorDetails{ + Code: RecipeDeploymentFailed, + Message: "test-recipe-deployment-failed-message", + }, + }, + expErrorDetails: &v1.ErrorDetails{ + Code: RecipeDeploymentFailed, + Message: "test-recipe-deployment-failed-message", + }, + }, + } + for _, tc := range errorTests { + details := GetRecipeErrorDetails(tc.err) + require.Equal(t, details, tc.expErrorDetails) + } +} diff --git a/pkg/recipes/errorcodes.go b/pkg/recipes/errorcodes.go new file mode 100644 index 0000000000..6075953570 --- /dev/null +++ b/pkg/recipes/errorcodes.go @@ -0,0 +1,31 @@ +/* +Copyright 2023 The Radius Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package recipes + +const ( + // Used for recipe download failures. + RecipeDownloadFailed = "RecipeDownloadFailed" + + // Used for recipe deployment failures. + RecipeDeploymentFailed = "RecipeDeploymentFailed" + + // Used for recipe deletion failures. + RecipeDeletionFailed = "RecipeDeletionFailed" + + // Used for errors encountered during processing recipe outputs. + InvalidRecipeOutputs = "InvalidRecipeOutputs" + + // Used for errors encountered while reading a recipe from registry. + RecipeLanguageFailure = "RecipeLanguageFailure" +) diff --git a/pkg/recipes/terraform/execute.go b/pkg/recipes/terraform/execute.go index a124f4f75b..e824ec880c 100644 --- a/pkg/recipes/terraform/execute.go +++ b/pkg/recipes/terraform/execute.go @@ -28,6 +28,7 @@ import ( install "github.com/hashicorp/hc-install" tfjson "github.com/hashicorp/terraform-json" "github.com/project-radius/radius/pkg/metrics" + "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/recipecontext" "github.com/project-radius/radius/pkg/recipes/terraform/config" "github.com/project-radius/radius/pkg/recipes/terraform/config/backends" @@ -163,7 +164,7 @@ func (e *executor) generateConfig(ctx context.Context, workingDir, execPath stri metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, options.EnvRecipe, metrics.FailedOperationState)) - return "", err + return "", recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, diff --git a/pkg/rp/util/registry.go b/pkg/rp/util/registry.go index 57010104e7..f0873620e9 100644 --- a/pkg/rp/util/registry.go +++ b/pkg/rp/util/registry.go @@ -23,6 +23,7 @@ import ( dockerParser "github.com/novln/docker-parser" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + "github.com/project-radius/radius/pkg/recipes" "oras.land/oras-go/v2/content" "oras.land/oras-go/v2/registry/remote" ) @@ -45,12 +46,12 @@ func ReadFromRegistry(ctx context.Context, path string, data *map[string]any) er digest, err := getDigestFromManifest(ctx, repo, tag) if err != nil { - return v1.NewClientErrInvalidRequest(fmt.Sprintf("failed to fetch repository from the path %q: %s", path, err.Error())) + return recipes.NewRecipeError(recipes.RecipeLanguageFailure, fmt.Sprintf("failed to fetch repository from the path %q: %s", path, err.Error()), nil) } bytes, err := getBytes(ctx, repo, digest) if err != nil { - return v1.NewClientErrInvalidRequest(fmt.Sprintf("failed to fetch repository from the path %q: %s", path, err.Error())) + return recipes.NewRecipeError(recipes.RecipeLanguageFailure, fmt.Sprintf("failed to fetch repository from the path %q: %s", path, err.Error()), nil) } err = json.Unmarshal(bytes, data) diff --git a/test/functional/shared/resources/recipe_bicep_test.go b/test/functional/shared/resources/recipe_bicep_test.go index acd6021d3e..2e5c2b034f 100644 --- a/test/functional/shared/resources/recipe_bicep_test.go +++ b/test/functional/shared/resources/recipe_bicep_test.go @@ -23,7 +23,7 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" @@ -266,7 +266,7 @@ func Test_BicepRecipe_ParameterNotDefined(t *testing.T) { Code: "ResourceDeploymentFailure", Details: []step.DeploymentErrorDetail{ { - Code: v1.CodeInternal, + Code: recipes.RecipeDeploymentFailed, // NOTE: There is a bug in our error handling for deployements. We return the JSON text of the deployment error inside the message // of our error. This is wrong. // @@ -312,7 +312,7 @@ func Test_BicepRecipe_WrongOutput(t *testing.T) { Code: "ResourceDeploymentFailure", Details: []step.DeploymentErrorDetail{ { - Code: v1.CodeInternal, + Code: recipes.InvalidRecipeOutputs, MessageContains: "failed to read the recipe output \"result\": json: unknown field \"error\"", }, }, @@ -353,7 +353,7 @@ func Test_BicepRecipe_LanguageFailure(t *testing.T) { Code: "ResourceDeploymentFailure", Details: []step.DeploymentErrorDetail{ { - Code: v1.CodeInternal, + Code: recipes.RecipeDeploymentFailed, // NOTE: There is a bug in our error handling for deployements. We return the JSON text of the deployment error inside the message // of our error. This is wrong. // @@ -399,7 +399,7 @@ func Test_BicepRecipe_ResourceCreationFailure(t *testing.T) { Code: "ResourceDeploymentFailure", Details: []step.DeploymentErrorDetail{ { - Code: v1.CodeInternal, + Code: recipes.RecipeDeploymentFailed, // NOTE: There is a bug in our error handling for deployements. We return the JSON text of the deployment error inside the message // of our error. This is wrong. // From c7ff9e65532582ecc0ed901d83d1e1688e6b1e81 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Tue, 22 Aug 2023 19:00:40 -0700 Subject: [PATCH 03/57] Remove ResourceIdentity (#6089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This change removes the ResourceIdentity abstraction from Radius. This is an old piece of tech we built to represent resources across many different resource management systems without a uniform way to refer to them. This has been outdated and not aligned with our thinking until we invented UCP. After this change we use UCP resource IDs everywhere that refer to an external resource. There are many changes in this PR aimed at simplifying both OutputResources and the things that they refer to. OutputResources have been streamlined to support two usecases: - Creating new resources (deployment processor) - Representing a resource that exists already (recipe, or post-deployment-processor). The `.CreateResource` field represents all of the data used in resource creation and cleanly segments it from the data we save in the database. Going forward we will also remove the deployment processor and fold the resource creation logic into the components that use it. This is a partial step towards that and removes pieces of the data structure that have a small impact. Additionally there's a lot of cleanup of testing of output resources in this PR. Many many test baselines have been updated in a uniform way. The best way to ensure that all of the old output resource data was updated was to touch all of these files. In doing so I made them consistent to simplify the test authoring. Believe me, it wasn't fun to go update all ~120 converter test files, but it was easier than chasing each test issue separately. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at c4a1109 ### Summary 🛠️🔄🧪 This pull request improves the consistency and clarity of the code that handles resource IDs and statuses across different packages and subdirectories. It also enables the worker service to interact with the Kubernetes API server using the discovery client. It refactors and updates some unit tests and test data files to align with the new output resource format and use helper functions. It fixes some minor formatting and import issues. > _`corerp/api` changes_ > _output resources have IDs_ > _spring cleaning the code_ ### Walkthrough * Import discovery package and add discovery client field to Service type in `pkg/armrpc/asyncoperation/worker/service.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R30), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R53-R54)) * Add blank line to separate imports from constants in `pkg/armrpc/asyncoperation/worker/worker.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-5d9b9964242d77606f4868e3fe049978ea1c3f1903afcfeb60c76e19d9785fc5R244)) * Update output resources to use resource ID format instead of local ID and provider in `pkg/armrpc/frontend/defaultoperation/testdata` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-e45c846e0522d1ba1dfa565fa6d86c8ee398c46018fa35101275eca45096365aL2-R31), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-d42d0ea658ab4c3f3303da63ff4af710e3c92d869177af2acfc9db89d9a5109aL2-R27)) * Import resources_azure package and use ScopeSubscriptions constant instead of SubscriptionsSegment in `pkg/azure/roleassignment/roleassignment.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-3a2a6eae0073a6144a423e6756d52eacdd25246738580cede836d0a8fc60fc88R34), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-3a2a6eae0073a6144a423e6756d52eacdd25246738580cede836d0a8fc60fc88L130-R131)) * Import resources_radius package and use ScopeResourceGroups constant instead of ResourceGroupsSegment in `pkg/cli/clients/management.go`, `pkg/cli/cmd/env/create/create.go`, and `pkg/cli/connections/factory.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaR35), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL463-R464), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-870b0a9ddae1c288c449a9832bae630c5ac691849c4638f97db83a3aff1474bfR38), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-870b0a9ddae1c288c449a9832bae630c5ac691849c4638f97db83a3aff1474bfL134-R135), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-d4132acf041f5a0725d02f79003aca9ad44bc2829ec159cb704b927f13d7b916R37), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-d4132acf041f5a0725d02f79003aca9ad44bc2829ec159cb704b927f13d7b916L98-R99)) * Remove unused import of fmt and add helper function nodeFromParsedID in `pkg/cli/cmd/app/connections/compute.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-ef65dc502b1e82b84929bb88995888d432dfcd5b22bae9617db4cc9e62c3ea75L21-R21), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-ef65dc502b1e82b84929bb88995888d432dfcd5b22bae9617db4cc9e62c3ea75R198-R206)) * Modify outputResourceEntryFromID and outputResourcesFromAPIData functions in `pkg/cli/cmd/app/connections/compute.go` to use nodeFromParsedID helper function, set Provider field based on resource ID scope segments, and handle invalid resource ID error ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-ef65dc502b1e82b84929bb88995888d432dfcd5b22bae9617db4cc9e62c3ea75L206-R222), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-ef65dc502b1e82b84929bb88995888d432dfcd5b22bae9617db4cc9e62c3ea75L243-R258), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-ef65dc502b1e82b84929bb88995888d432dfcd5b22bae9617db4cc9e62c3ea75L256-R270)) * Add ID field to expected and actual output resource entries for Kubernetes provider in Test_compute function of `pkg/cli/cmd/app/connections/compute_test.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-f1dd53d404af4e3426e2dbe0c4a3e916f29e8718bcedd7cffd2210f213a5ca9eR80), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-f1dd53d404af4e3426e2dbe0c4a3e916f29e8718bcedd7cffd2210f213a5ca9eR151)) * Update expected and actual output resource entries and input output resources in Test_outputResourcesFromAPIData function of `pkg/cli/cmd/app/connections/compute_test.go` to use resource ID format and handle invalid resource ID error ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-f1dd53d404af4e3426e2dbe0c4a3e916f29e8718bcedd7cffd2210f213a5ca9eL243-R249), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-f1dd53d404af4e3426e2dbe0c4a3e916f29e8718bcedd7cffd2210f213a5ca9eL261-R263), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-f1dd53d404af4e3426e2dbe0c4a3e916f29e8718bcedd7cffd2210f213a5ca9eL272-R286)) * Remove redundant test case for invalid output resource provider in Test_outputResourcesFromAPIData function of `pkg/cli/cmd/app/connections/compute_test.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-f1dd53d404af4e3426e2dbe0c4a3e916f29e8718bcedd7cffd2210f213a5ca9eL291-R295)) * Import resources_kubernetes package and use IDFromParts function for creating Kubernetes resource IDs in `pkg/cli/cmd/app/connections/shareddata_test.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-93eebb9e1838349eb065d882299ce573fa15aecbc82ac3b1bead75639f4d1482R19-R22), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-93eebb9e1838349eb065d882299ce573fa15aecbc82ac3b1bead75639f4d1482L33-R54)) * Remove unused import of resourcemodel package in `pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-0b79cd4550a36ea3f36875898eea2d0a9597fbc3c47780790e74b1889883ab39L25)) * Use TestResourceStatus function for comparing or setting expected and actual status of resources instead of output resources individually in `pkg/corerp/api/v20220315privatepreview` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-9274cd38510c44c63a4bdac8b580ea8325ad426d35f6eb22f779df13174f76d2L150-R150), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-bdb2119eb3545d9d4248e90cc22d8e305745c34e0261c27993de2c1df6c32274L164-R164), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-bdb2119eb3545d9d4248e90cc22d8e305745c34e0261c27993de2c1df6c32274L215-R207), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-cea35ff8fa843c923eab085ec2345fa1109868714214ff009efd93c832dfaa14L80-R80), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-cea35ff8fa843c923eab085ec2345fa1109868714214ff009efd93c832dfaa14L135-R134), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-cea35ff8fa843c923eab085ec2345fa1109868714214ff009efd93c832dfaa14L192-R190), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-cea35ff8fa843c923eab085ec2345fa1109868714214ff009efd93c832dfaa14L250-R247), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-1cef4fb4cd9b1c55f0c0861fd33b7ea54a97d96fe68e78a7fd004197aa7b11b3L77-R77), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-0b79cd4550a36ea3f36875898eea2d0a9597fbc3c47780790e74b1889883ab39L110-R109)) * Update output resources to use resource ID format instead of local ID and provider in `pkg/corerp/api/v20220315privatepreview/testdata` ([link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-82add608aacba3a92404012960401715fbdfcb061e010c7a4b4948a4ee4967b6L9-R9), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-7bdf69fc5a52f792c1f593900513bef1bd3fc3d107f1d58e01c3bb0b18c2cebaL21-R21), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-5f2761c21e8b3915017b3fcd93c6f2eff256e0cd4900b2e8378f96a427d4ff81L2-R84), [link](https://github.com/project-radius/radius/pull/6089/files?diff=unified&w=0#diff-1a30bf8aa4025697efc4169f825c885f08d0829244ee5841ac7f6b415b1de3cdL2-R69)) --- .gitignore | 3 +- .../contributing-code-organization/README.md | 4 +- pkg/armrpc/asyncoperation/worker/service.go | 13 + pkg/armrpc/asyncoperation/worker/worker.go | 1 + .../testdata/resource-datamodel.json | 70 ++- .../testdata/resource-response.json | 56 +- pkg/azure/roleassignment/roleassignment.go | 3 +- pkg/cli/clients/management.go | 3 +- pkg/cli/cmd/app/connections/compute.go | 54 +- pkg/cli/cmd/app/connections/compute_test.go | 43 +- .../cmd/app/connections/shareddata_test.go | 42 +- pkg/cli/cmd/env/create/create.go | 3 +- pkg/cli/connections/factory.go | 3 +- .../application_conversion_test.go | 3 +- .../container_conversion_test.go | 6 +- .../environment_conversion_test.go | 27 +- .../extender_conversion_test.go | 35 +- .../gateway_conversion_test.go | 15 +- .../httproute_conversion_test.go | 6 +- .../secretstore_conversion_test.go | 7 +- .../testdata/containerresource.json | 6 +- .../testdata/containerresourcedatamodel.json | 6 +- .../containerresourcedatamodelemptyext.json | 160 +++--- .../testdata/containerresourceemptyext.json | 134 +++-- .../testdata/containerresourceemptyext2.json | 130 +++-- .../containerresourcenegativetest.json | 6 +- .../testdata/extender_manual.json | 42 +- .../testdata/extender_recipe.json | 34 +- .../testdata/extenderdatamodel_manual.json | 66 ++- .../testdata/extenderdatamodel_recipe.json | 56 +- .../extenderresponseresourcedatamodel.json | 58 +- .../gatewayresource-with-sslpassthrough.json | 60 +-- ...h-tlstermination-nominprotocolversion.json | 60 +-- .../gatewayresource-with-tlstermination.json | 62 +-- .../testdata/gatewayresource.json | 54 +- ...resourcedatamodel-with-sslpassthrough.json | 78 ++- ...h-tlstermination-nominprotocolversion.json | 78 ++- ...resourcedatamodel-with-tlstermination.json | 80 ++- .../testdata/gatewayresourcedatamodel.json | 72 ++- .../testdata/httprouteresource.json | 38 +- .../testdata/httprouteresourcedatamodel.json | 58 +- .../secretstore-datamodel-resource.json | 87 ++- .../testdata/secretstore-datamodel.json | 77 ++- .../secretstore-versioned-resource.json | 71 ++- .../testdata/secretstore-versioned.json | 61 +-- .../testdata/volume-az-kv-datamodel.json | 126 +++-- .../testdata/volume-az-kv.json | 9 +- .../volume_conversion_test.go | 4 +- .../backend/deployment/deploymentprocessor.go | 49 +- .../deployment/deploymentprocessor_test.go | 150 +++--- .../testdata/containerresourcedatamodel.json | 6 +- .../containerresourcedatamodellowercase.json | 106 ++-- .../containerresourcedatamodeluppercase.json | 106 ++-- pkg/corerp/backend/service.go | 21 +- ...ainer20220315privatepreview_datamodel.json | 127 ++--- ...ontainer20220315privatepreview_output.json | 113 ++-- .../20220315privatepreview_output.json | 54 +- ...220315privatepreviewgetandlist_output.json | 48 +- ...teway20220315privatepreview_datamodel.json | 88 ++- .../gateway20220315privatepreview_output.json | 81 ++- ...route20220315privatepreview_datamodel.json | 72 ++- ...ttproute20220315privatepreview_output.json | 58 +- .../controller/secretstores/kubernetes.go | 51 +- .../secretstores/kubernetes_test.go | 21 +- ...secretstores_datamodel_cert_valuefrom.json | 13 +- pkg/corerp/handlers/arm_handler.go | 73 +-- .../handlers/azure_federatedidentity.go | 55 +- pkg/corerp/handlers/azure_fileshare.go | 64 --- .../azure_fileshare_storageaccount.go | 91 ---- pkg/corerp/handlers/azure_roleassignment.go | 20 +- .../azure_userassigned_managedidentity.go | 25 +- pkg/corerp/handlers/kubernetes.go | 97 +++- pkg/corerp/handlers/kubernetes_test.go | 131 ++--- pkg/corerp/handlers/util.go | 4 +- pkg/corerp/model/application_model.go | 101 +--- pkg/corerp/model/types.go | 12 +- .../renderers/container/azure/identity.go | 94 ++-- .../container/azure/identity_test.go | 41 +- .../container/azure/keyvaultvolume.go | 16 +- .../container/azure/keyvaultvolume_test.go | 2 +- pkg/corerp/renderers/container/rbac.go | 19 +- pkg/corerp/renderers/container/render.go | 72 ++- pkg/corerp/renderers/container/render_test.go | 384 +++++++------- .../renderers/daprextension/renderer.go | 5 +- .../renderers/daprextension/renderer_test.go | 14 +- pkg/corerp/renderers/gateway/render.go | 19 +- pkg/corerp/renderers/gateway/render_test.go | 97 ++-- pkg/corerp/renderers/httproute/render.go | 3 +- pkg/corerp/renderers/httproute/render_test.go | 3 +- .../renderers/kubernetesmetadata/render.go | 5 +- .../kubernetesmetadata/render_test.go | 15 +- pkg/corerp/renderers/manualscale/render.go | 5 +- .../renderers/manualscale/render_test.go | 15 +- pkg/corerp/renderers/types.go | 5 +- .../testdata/volume-az-kv-systemassigned.json | 102 ++-- .../pubsubbroker_conversion_test.go | 40 +- .../secretstore_conversion_test.go | 40 +- .../statestore_conversion_test.go | 30 +- .../pubsubbroker_manual_datamodel.json | 76 ++- ...pubsubbroker_manual_generic_datamodel.json | 68 ++- .../pubsubbroker_recipe_datamodel.json | 62 +-- .../secretstore_manual_resourcedatamodel.json | 70 ++- .../testdata/secretstore_recipe_resource.json | 46 +- .../secretstore_recipe_resourcedatamodel.json | 76 ++- .../statestore_recipe_resourcedatamodel.json | 6 +- .../statestore_values_resourcedatamodel.json | 6 +- .../converter/pubsubbroker_converter_test.go | 32 +- .../converter/secretstore_converter_test.go | 11 +- .../converter/statestore_converter_test.go | 11 +- pkg/daprrp/datamodel/daprstatestore_test.go | 38 +- .../processors/pubsubbrokers/processor.go | 3 +- .../pubsubbrokers/processor_test.go | 4 +- .../processors/secretstores/processor.go | 3 +- .../processors/secretstores/processor_test.go | 4 +- .../processors/statestores/processor.go | 3 +- .../processors/statestores/processor_test.go | 4 +- .../mongodatabase_conversion_test.go | 41 +- .../rediscache_conversion_test.go | 62 +-- .../sqldatabase_conversion_test.go | 47 +- .../testdata/mongodatabaseresource.json | 46 +- .../mongodatabaseresourcedatamodel.json | 68 ++- .../testdata/rediscacheresource_manual.json | 62 ++- .../rediscacheresourcedatamodel_manual.json | 58 +- ...cacheresourcedatamodel_recipe_default.json | 52 +- ...scacheresourcedatamodel_recipe_params.json | 62 ++- .../testdata/sqldatabase_manual_resource.json | 62 ++- .../sqldatabase_manual_resourcedatamodel.json | 72 ++- .../sqldatabase_recipe_resourcedatamodel.json | 72 ++- .../converter/mongodatabase_converter_test.go | 17 +- .../converter/rediscache_converter_test.go | 17 +- .../converter/sqldatabase_converter_test.go | 17 +- .../20220315privatepreview_datamodel.json | 7 +- .../20220315privatepreview_datamodel.json | 7 +- .../20220315privatepreview_datamodel.json | 7 +- .../20220315privatepreview_output.json | 68 +-- pkg/kubernetes/object.go | 42 +- .../daprpubsubbroker_conversion_test.go | 39 +- .../daprsecretstore_conversion_test.go | 39 +- .../daprstatestore_conversion_test.go | 29 +- .../extender_conversion_test.go | 36 +- .../mongodatabase_conversion_test.go | 49 +- .../rabbitmq_conversion_test.go | 51 +- .../rediscache_conversion_test.go | 65 +-- .../sqldatabase_conversion_test.go | 46 +- .../daprpubsubbroker_manual_datamodel.json | 76 ++- ...pubsubbroker_manual_generic_datamodel.json | 68 ++- .../daprpubsubbroker_recipe_datamodel.json | 62 +-- ...rsecretstore_manual_resourcedatamodel.json | 70 ++- .../daprsecretstore_recipe_resource.json | 46 +- ...rsecretstore_recipe_resourcedatamodel.json | 76 ++- ...prstatestore_recipe_resourcedatamodel.json | 6 +- ...prstatestore_values_resourcedatamodel.json | 6 +- .../testdata/extender_manual.json | 42 +- .../testdata/extender_recipe.json | 34 +- .../testdata/extenderdatamodel_manual.json | 66 ++- .../extenderdatamodel_manual_nosecrets.json | 49 +- .../testdata/extenderdatamodel_recipe.json | 56 +- .../extenderresponseresourcedatamodel.json | 58 +- .../testdata/mongodatabaseresource.json | 46 +- .../mongodatabaseresourcedatamodel.json | 68 ++- .../mongodatabaseresourcedatamodel2.json | 57 +- ...mongodatabaseresourcedatamodel_recipe.json | 57 +- .../testdata/rabbitmq_manual_datamodel.json | 72 ++- .../testdata/rabbitmq_recipe_datamodel.json | 76 ++- .../testdata/rabbitmq_recipe_resource.json | 48 +- .../testdata/rediscacheresource_manual.json | 62 ++- .../rediscacheresourcedatamodel_manual.json | 58 +- ...cheresourcedatamodel_manual_resources.json | 65 ++- ...cacheresourcedatamodel_recipe_default.json | 52 +- ...scacheresourcedatamodel_recipe_params.json | 62 ++- .../testdata/sqldatabase_manual_resource.json | 62 ++- .../sqldatabase_manual_resourcedatamodel.json | 72 ++- .../sqldatabase_recipe_resourcedatamodel.json | 72 ++- .../{test_util.go => util.go} | 20 - .../controller/createorupdateresource.go | 12 +- .../controller/createorupdateresource_test.go | 41 +- .../backend/controller/deleteresource_test.go | 13 +- pkg/linkrp/backend/service.go | 30 +- .../daprpubsubbroker_converter_test.go | 21 +- pkg/linkrp/datamodel/daprstatestore_test.go | 40 +- .../20220315privatepreview_output.json | 54 +- ...220315privatepreviewgetandlist_output.json | 48 +- .../20220315privatepreview_datamodel.json | 7 +- .../20220315privatepreview_datamodel.json | 82 +-- .../20220315privatepreview_datamodel.json | 7 +- .../20220315privatepreview_datamodel.json | 7 +- .../20220315privatepreview_output.json | 68 +-- .../processors/daprpubsubbrokers/processor.go | 3 +- .../daprpubsubbrokers/processor_test.go | 4 +- .../processors/daprsecretstores/processor.go | 3 +- .../daprsecretstores/processor_test.go | 4 +- .../processors/daprstatestores/processor.go | 3 +- .../daprstatestores/processor_test.go | 13 +- pkg/linkrp/processors/mock_resourceclient.go | 8 +- pkg/linkrp/processors/resourceclient.go | 70 ++- pkg/linkrp/processors/resourceclient_test.go | 119 +---- pkg/linkrp/processors/types.go | 2 +- pkg/linkrp/processors/util.go | 23 +- pkg/linkrp/processors/util_test.go | 32 +- pkg/linkrp/processors/validator_test.go | 15 +- .../rabbitmq_conversion_test.go | 52 +- .../testdata/rabbitmq_manual_datamodel.json | 72 ++- .../testdata/rabbitmq_recipe_datamodel.json | 58 +- .../testdata/rabbitmq_recipe_resource.json | 34 +- .../converter/rabbitmq_converter_test.go | 17 +- .../20220315privatepreview_datamodel.json | 82 +-- pkg/recipes/driver/bicep.go | 18 +- pkg/recipes/driver/bicep_test.go | 66 +-- pkg/recipes/engine/engine_test.go | 14 +- pkg/recipes/recipecontext/context.go | 10 +- pkg/recipes/terraform/config/providers/aws.go | 3 +- .../terraform/config/providers/azure.go | 3 +- pkg/resourcekinds/resource_kinds.go | 58 -- pkg/resourcemodel/identity.go | 499 ------------------ pkg/resourcemodel/identity_test.go | 170 ------ pkg/rp/v1/outputresource.go | 135 +++-- pkg/rp/v1/outputresource_test.go | 188 ++----- pkg/rp/v1/types.go | 9 +- .../plane_conversion_test.go | 10 +- .../resourcegroup_conversion_test.go | 3 +- .../aws/servicecontext/awsrequestcontext.go | 4 +- .../controller/awsproxy/awsparsing.go | 3 +- pkg/ucp/resources/{ => aws}/aws.go | 21 +- pkg/ucp/resources/{ => aws}/aws_test.go | 5 +- pkg/ucp/resources/aws/doc.go | 18 + pkg/ucp/resources/azure/azure.go | 34 ++ pkg/ucp/resources/azure/doc.go | 18 + pkg/ucp/resources/azure/resource_types.go | 26 + pkg/ucp/resources/id.go | 98 ++-- pkg/ucp/resources/id_test.go | 70 +-- pkg/ucp/resources/kubernetes/doc.go | 18 + pkg/ucp/resources/kubernetes/kubernetes.go | 86 +++ .../resources/kubernetes/resource_types.go | 68 +++ pkg/ucp/resources/radius/doc.go | 18 + pkg/ucp/resources/radius/radius.go | 43 ++ pkg/ucp/resources/radius/radius_test.go | 56 ++ .../store/cosmosdb/cosmosdbstorageclient.go | 3 +- pkg/ucp/store/cosmosdb/util.go | 5 +- pkg/ucp/store/map.go | 3 +- pkg/ucp/store/map_test.go | 29 + test/functional/daprrp/dapr_pubsub_test.go | 11 - .../functional/daprrp/dapr_statestore_test.go | 11 - .../datastoresrp/resources/mongodb_test.go | 21 - test/functional/shared/api_test.go | 3 +- .../shared/resources/dapr_pubsub_test.go | 11 - .../shared/resources/dapr_statestore_test.go | 11 - .../shared/resources/extender_test.go | 9 +- .../shared/resources/mongodb_test.go | 21 - .../shared/resources/recipe_bicep_test.go | 21 +- .../shared/resources/recipe_terraform_test.go | 11 +- test/k8sutil/fake.go | 32 ++ test/testutil/resourcetypeutil/types.go | 77 +++ test/testutil/util.go | 11 +- test/validation/aws.go | 3 +- test/validation/shared.go | 37 +- 255 files changed, 4972 insertions(+), 6634 deletions(-) delete mode 100644 pkg/corerp/handlers/azure_fileshare.go delete mode 100644 pkg/corerp/handlers/azure_fileshare_storageaccount.go rename pkg/linkrp/api/v20220315privatepreview/{test_util.go => util.go} (60%) delete mode 100644 pkg/resourcekinds/resource_kinds.go delete mode 100644 pkg/resourcemodel/identity_test.go rename pkg/ucp/resources/{ => aws}/aws.go (69%) rename pkg/ucp/resources/{ => aws}/aws_test.go (89%) create mode 100644 pkg/ucp/resources/aws/doc.go create mode 100644 pkg/ucp/resources/azure/azure.go create mode 100644 pkg/ucp/resources/azure/doc.go create mode 100644 pkg/ucp/resources/azure/resource_types.go create mode 100644 pkg/ucp/resources/kubernetes/doc.go create mode 100644 pkg/ucp/resources/kubernetes/kubernetes.go create mode 100644 pkg/ucp/resources/kubernetes/resource_types.go create mode 100644 pkg/ucp/resources/radius/doc.go create mode 100644 pkg/ucp/resources/radius/radius.go create mode 100644 pkg/ucp/resources/radius/radius_test.go create mode 100644 test/testutil/resourcetypeutil/types.go diff --git a/.gitignore b/.gitignore index e4a2b21912..33fc1778fe 100644 --- a/.gitignore +++ b/.gitignore @@ -44,8 +44,7 @@ main .DS_Store .idea/ creds.json -__debug_bin -__debug_bin.exe +__debug_bin* default.profraw # Editor backup files diff --git a/docs/contributing/contributing-code/contributing-code-organization/README.md b/docs/contributing/contributing-code/contributing-code-organization/README.md index f26d2eaadd..de9c255507 100644 --- a/docs/contributing/contributing-code/contributing-code-organization/README.md +++ b/docs/contributing/contributing-code/contributing-code-organization/README.md @@ -40,9 +40,7 @@ In general you should ask for guidance before creating a new top-level folder in | `metrics/` | Code generating Radius metrics | | `profiler/` | Code and configs for Radius profiler | | `recipes/` | Implementation for Radius Recipes | -| `resourcekinds/` | Definition of Radius resources | -| `resourcemodels/` | Code for identifying Radius resources in underlying system | -| `rp/` | Code shared by multiple rps | +| `rp/` | Code shared by multiple rps | | `sdk/` | Code for interfacing with Radius as a client | | `to/` | Code for pointer to value conversions | | `trace/` | Utility code for generating Radius traces | diff --git a/pkg/armrpc/asyncoperation/worker/service.go b/pkg/armrpc/asyncoperation/worker/service.go index 4eb68f9358..6b6d9c7aa4 100644 --- a/pkg/armrpc/asyncoperation/worker/service.go +++ b/pkg/armrpc/asyncoperation/worker/service.go @@ -27,6 +27,7 @@ import ( qprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" "github.com/project-radius/radius/pkg/ucp/ucplog" + "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -49,6 +50,8 @@ type Service struct { KubeClient controller_runtime.Client // KubeClientSet is the Kubernetes client. KubeClientSet kubernetes.Interface + // KubeDiscoveryClient is the Kubernetes discovery client. + KubeDiscoveryClient discovery.ServerResourcesInterface } // Init initializes worker service - it initializes the StorageProvider, RequestQueue, OperationStatusManager, Controllers, KubeClient and @@ -77,6 +80,16 @@ func (s *Service) Init(ctx context.Context) error { if err != nil { return err } + + discoveryClient, err := discovery.NewDiscoveryClientForConfig(s.Options.K8sConfig) + if err != nil { + return err + } + + // Use legacy discovery client to avoid the issue of the staled GroupVersion discovery(api.ucp.dev/v1alpha3). + // TODO: Disable UseLegacyDiscovery once https://github.com/project-radius/radius/issues/5974 is resolved. + discoveryClient.UseLegacyDiscovery = true + s.KubeDiscoveryClient = discoveryClient } return nil } diff --git a/pkg/armrpc/asyncoperation/worker/worker.go b/pkg/armrpc/asyncoperation/worker/worker.go index 6642dcdafe..47c4b491b7 100644 --- a/pkg/armrpc/asyncoperation/worker/worker.go +++ b/pkg/armrpc/asyncoperation/worker/worker.go @@ -241,6 +241,7 @@ func (w *AsyncRequestProcessWorker) runOperation(ctx context.Context, message *q if err := recover(); err != nil { msg := fmt.Errorf("recovering from panic %v: %s", err, debug.Stack()) logger.Error(msg, "recovering from panic") + // When backend controller has a critical bug such as nil reference, asyncCtrl.Run() is panicking. // If this happens, the message is requeued after message lock time (5 mins). // After message lock is expired, message will be reprocessed 'w.options.MaxOperationRetryCount' times and diff --git a/pkg/armrpc/frontend/defaultoperation/testdata/resource-datamodel.json b/pkg/armrpc/frontend/defaultoperation/testdata/resource-datamodel.json index 05fc7bad79..a9d36db4c1 100644 --- a/pkg/armrpc/frontend/defaultoperation/testdata/resource-datamodel.json +++ b/pkg/armrpc/frontend/defaultoperation/testdata/resource-datamodel.json @@ -1,43 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/resources/resource0", - "name": "resource0", - "type": "applications.core/resources", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/resources/resource0", + "name": "resource0", + "type": "applications.core/resources", + "location": "West US", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "resources", - "Provider": "aks" - }, - "Resource": null, - "Identity": { - "data": null, - "resourceType": { - "Type": "resources", - "Provider": "aks" - } - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "propertyA": "propertyAValue", - "propertyB": "propertyBValue" - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "propertyA": "propertyAValue", + "propertyB": "propertyBValue" + }, + "tenantId": "00000000-0000-0000-0000-000000000000", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroup": "radius-test-rg", + "createdApiVersion": "2022-03-15-privatepreview", + "updatedApiVersion": "2022-03-15-privatepreview" } \ No newline at end of file diff --git a/pkg/armrpc/frontend/defaultoperation/testdata/resource-response.json b/pkg/armrpc/frontend/defaultoperation/testdata/resource-response.json index 99ba1ee3da..bd3d2a8ef4 100644 --- a/pkg/armrpc/frontend/defaultoperation/testdata/resource-response.json +++ b/pkg/armrpc/frontend/defaultoperation/testdata/resource-response.json @@ -1,33 +1,29 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/resources/resource0", - "location": "global", - "name": "resource0", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "Provider": "aks", - "Identity": { - "aksClusterName": "", - "name": "", - "namespace": "" - } - }] - }, - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "propertyA": "propertyAValue", - "propertyB": "propertyBValue" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/resources/resource0", + "location": "global", + "name": "resource0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/resources" + "provisioningState": "Succeeded", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "propertyA": "propertyAValue", + "propertyB": "propertyBValue" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.core/resources" } \ No newline at end of file diff --git a/pkg/azure/roleassignment/roleassignment.go b/pkg/azure/roleassignment/roleassignment.go index 2e47b1649f..dac903064d 100644 --- a/pkg/azure/roleassignment/roleassignment.go +++ b/pkg/azure/roleassignment/roleassignment.go @@ -31,6 +31,7 @@ import ( "github.com/project-radius/radius/pkg/azure/armauth" "github.com/project-radius/radius/pkg/azure/clientv2" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/ucplog" ) @@ -127,7 +128,7 @@ func Delete(ctx context.Context, armConfig *armauth.ArmConfig, roleID string) er return err } - subscriptionID := rID.FindScope(resources.SubscriptionsSegment) + subscriptionID := rID.FindScope(resources_azure.ScopeSubscriptions) if subscriptionID == "" { return fmt.Errorf("invalid role id: %s", roleID) } diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index 81de3cc603..b722af9b81 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -32,6 +32,7 @@ import ( "github.com/project-radius/radius/pkg/linkrp" ucpv20220901 "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" ) type UCPApplicationsManagementClient struct { @@ -460,7 +461,7 @@ func (amc *UCPApplicationsManagementClient) ListEnvironmentsAll(ctx context.Cont // // - /planes/radius/local // - /planes/radius/local/resourceGroups/my-group - if scope.FindScope(resources.ResourceGroupsSegment) != "" { + if scope.FindScope(resources_radius.ScopeResourceGroups) != "" { scope = scope.Truncate() } diff --git a/pkg/cli/cmd/app/connections/compute.go b/pkg/cli/cmd/app/connections/compute.go index 640bdcf604..659602c73f 100644 --- a/pkg/cli/cmd/app/connections/compute.go +++ b/pkg/cli/cmd/app/connections/compute.go @@ -18,9 +18,7 @@ package connections import ( "encoding/json" - "fmt" "sort" - "strings" "github.com/go-openapi/jsonpointer" "github.com/project-radius/radius/pkg/cli/clients_new/generated" @@ -197,14 +195,31 @@ func nodeFromID(id string) node { } } +// nodeFromParsedID creates a node from a resource ID. +func nodeFromParsedID(id resources.ID) node { + return node{ + ID: id.String(), + Name: id.Name(), + Type: id.Type(), + } +} + // resourceEntryFromID creates a resourceEntry from a resource ID. func resourceEntryFromID(id string) resourceEntry { return resourceEntry{node: nodeFromID(id)} } // outputResourceEntryFromID creates a outputResourceEntry from a resource ID. -func outputResourceEntryFromID(id string) outputResourceEntry { - return outputResourceEntry{node: nodeFromID(id)} +func outputResourceEntryFromID(id resources.ID) outputResourceEntry { + entry := outputResourceEntry{node: nodeFromParsedID(id)} + if len(id.ScopeSegments()) > 0 && id.IsUCPQualfied() { + entry.Provider = id.ScopeSegments()[0].Type + } else if len(id.ScopeSegments()) > 0 { + // Relative Resource ID (ARM) + entry.Provider = resourcemodel.ProviderAzure + } + + return entry } // outputResourcesFromAPIData processes the generic resource representation returned by the Radius API @@ -240,9 +255,7 @@ func outputResourcesFromAPIData(resource generated.GenericResource) []outputReso for _, or := range ors { // This is the wire format returned by the API for an output resource. type outputResourceWireFormat struct { - Identity map[string]string `json:"Identity"` - LocalID string `json:"LocalID"` - Provider string `json:"Provider"` + ID resources.ID `json:"id"` } data := outputResourceWireFormat{} @@ -253,32 +266,7 @@ func outputResourcesFromAPIData(resource generated.GenericResource) []outputReso } // Now build the entry from the API data - entry := outputResourceEntry{} - switch data.Provider { - case resourcemodel.ProviderAzure: - fallthrough - case resourcemodel.ProviderRadius: - fallthrough - case resourcemodel.ProviderAWS: - entry = outputResourceEntryFromID(data.Identity["id"]) - entry.Provider = data.Provider - - case resourcemodel.ProviderKubernetes: - resourceType := data.Identity["kind"] - group, _, found := strings.Cut(data.Identity["apiVersion"], "/") - if found && group != "" { - resourceType = fmt.Sprintf("%s/%s", group, data.Identity["kind"]) - } - - // NOTE: we don't have a resource ID for a Kubernetes resource (yet). - entry.ID = "" - entry.Name = data.Identity["name"] - entry.Type = resourceType - entry.Provider = data.Provider - - default: - entry = outputResourceEntry{node: node{Error: fmt.Sprintf("unknown provider '%s'", data.Provider)}} - } + entry := outputResourceEntryFromID(data.ID) entries = append(entries, entry) } diff --git a/pkg/cli/cmd/app/connections/compute_test.go b/pkg/cli/cmd/app/connections/compute_test.go index 31bfd9044b..217904ef1a 100644 --- a/pkg/cli/cmd/app/connections/compute_test.go +++ b/pkg/cli/cmd/app/connections/compute_test.go @@ -77,6 +77,7 @@ func Test_compute(t *testing.T) { node: node{ Name: "demo", Type: "apps/Deployment", + ID: "/planes/kubernetes/local/namespaces/default-demo/providers/apps/Deployment/demo", }, Provider: "kubernetes", }, @@ -147,6 +148,7 @@ func Test_compute(t *testing.T) { node: node{ Name: "demo", Type: "apps/Deployment", + ID: "/planes/kubernetes/local/namespaces/default-demo/providers/apps/Deployment/demo", }, Provider: "kubernetes", }, @@ -240,11 +242,11 @@ func Test_outputResourcesFromAPIData(t *testing.T) { node: nodeFromID(azureRedisCacheResourceID), Provider: "azure", }, - // Kubernetes resources don't currently a resource ID. { node: node{ Name: "demo", Type: "apps/Deployment", + ID: "/planes/kubernetes/local/namespaces/default-demo/providers/apps/Deployment/demo", }, Provider: "kubernetes", }, @@ -258,7 +260,7 @@ func Test_outputResourcesFromAPIData(t *testing.T) { // An invalid output resource doesn't prevent other output resources from being parsed. outputResources := []any{ redisAWSOutputResource, - makeAzureOutputResource("asdf-invalid-YO"), + makeOutputResource("asdf-invalid-YO"), containerDeploymentOutputResource, } resource := generated.GenericResource{ @@ -269,18 +271,19 @@ func Test_outputResourcesFromAPIData(t *testing.T) { // Output is always sorted. expected := []outputResourceEntry{ { - node: nodeFromID(awsMemoryDBResourceID), - Provider: "aws", + node: node{ + Error: "failed to unmarshal JSON, value was not a valid resource ID: 'asdf-invalid-YO' is not a valid resource id", + }, }, { - node: nodeFromID("asdf-invalid-YO"), - Provider: "azure", + node: nodeFromID(awsMemoryDBResourceID), + Provider: "aws", }, - // Kubernetes resources don't currently a resource ID. { node: node{ Name: "demo", Type: "apps/Deployment", + ID: "/planes/kubernetes/local/namespaces/default-demo/providers/apps/Deployment/demo", }, Provider: "kubernetes", }, @@ -288,32 +291,6 @@ func Test_outputResourcesFromAPIData(t *testing.T) { actual := outputResourcesFromAPIData(resource) require.Equal(t, expected, actual) - require.Equal(t, "'asdf-invalid-YO' is not a valid resource id", actual[1].Error) - }) - - t.Run("parse invalid output resource provider", func(t *testing.T) { - outputResources := []any{ - map[string]any{ - "provider": "no idea", - }, - } - resource := generated.GenericResource{ - ID: to.Ptr(containerResourceID), - Properties: makeResourceProperties(nil, outputResources), - } - - // Output is always sorted. - expected := []outputResourceEntry{ - { - node: node{ - Error: "unknown provider 'no idea'", - }, - }, - } - - actual := outputResourcesFromAPIData(resource) - require.Equal(t, expected, actual) - require.Equal(t, "unknown provider 'no idea'", actual[0].Error) }) t.Run("no status", func(t *testing.T) { diff --git a/pkg/cli/cmd/app/connections/shareddata_test.go b/pkg/cli/cmd/app/connections/shareddata_test.go index c3271b2ce7..802f854bb8 100644 --- a/pkg/cli/cmd/app/connections/shareddata_test.go +++ b/pkg/cli/cmd/app/connections/shareddata_test.go @@ -16,6 +16,10 @@ limitations under the License. package connections +import ( + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" +) + // This file contains shared variables and functions used in tests. var environmentResourceID = "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/environments/test-env" @@ -30,43 +34,21 @@ func makeRedisResourceID(name string) string { return "/planes/radius/local/resourceGroups/test-group/providers/Applications.Datastores/redisCaches/" + name } -var containerDeploymentOutputResource any = makeKubernetesOutputResource("apps/v1", "Deployment", "default-demo", "demo") -var redisAWSOutputResource any = makeAWSOutputResource(awsMemoryDBResourceID) -var redisAzureOutputResource any = makeAzureOutputResource(azureRedisCacheResourceID) +var containerDeploymentOutputResource any = makeKubernetesOutputResource("apps", "Deployment", "default-demo", "demo") +var redisAWSOutputResource any = makeOutputResource(awsMemoryDBResourceID) +var redisAzureOutputResource any = makeOutputResource(azureRedisCacheResourceID) // makeKubernetesOutputResource creates a Kubernetes output resource. -func makeKubernetesOutputResource(apiVersion string, kind string, namespace string, name string) map[string]any { - return map[string]any{ - "Identity": map[string]any{ - "apiVersion": apiVersion, - "kind": kind, - "name": name, - "namespace": namespace, - }, - "LocalID": "Ignored", - "Provider": "kubernetes", - } -} - -// makeAWSOutputResource creates an AWS output resource. -func makeAWSOutputResource(id string) map[string]any { +func makeKubernetesOutputResource(group string, kind string, namespace string, name string) map[string]any { return map[string]any{ - "Identity": map[string]any{ - "id": id, - }, - "LocalID": "Ignored", - "Provider": "aws", + "id": resources_kubernetes.IDFromParts(resources_kubernetes.PlaneNameTODO, group, kind, namespace, name), } } -// makeAzureOutputResource creates an Azure output resource. -func makeAzureOutputResource(id string) map[string]any { +// makeOutputResource creates an AWS output resource. +func makeOutputResource(id string) map[string]any { return map[string]any{ - "Identity": map[string]any{ - "id": id, - }, - "LocalID": "Ignored", - "Provider": "azure", + "id": id, } } diff --git a/pkg/cli/cmd/env/create/create.go b/pkg/cli/cmd/env/create/create.go index 20ba44c4b4..61c13948e7 100644 --- a/pkg/cli/cmd/env/create/create.go +++ b/pkg/cli/cmd/env/create/create.go @@ -35,6 +35,7 @@ import ( "github.com/project-radius/radius/pkg/cli/output" "github.com/project-radius/radius/pkg/cli/workspaces" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" ) // NewCommand creates an instance of the command and runner for the `rad env create` command. @@ -131,7 +132,7 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { if err != nil { return err } - r.ResourceGroupName = scopeId.FindScope(resources.ResourceGroupsSegment) + r.ResourceGroupName = scopeId.FindScope(resources_radius.ScopeResourceGroups) _, err = client.ShowUCPGroup(cmd.Context(), "radius", "local", r.ResourceGroupName) if clients.Is404Error(err) { diff --git a/pkg/cli/connections/factory.go b/pkg/cli/connections/factory.go index 2f6b15176f..a633bb8a74 100644 --- a/pkg/cli/connections/factory.go +++ b/pkg/cli/connections/factory.go @@ -34,6 +34,7 @@ import ( sdkclients "github.com/project-radius/radius/pkg/sdk/clients" "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" ) // DefaultFactory provides easy access to the default implementation of the factory. DO NOT modify this in your code. Even if it's for tests. DO NOT DO IT. @@ -95,7 +96,7 @@ func (i *impl) CreateDeploymentClient(ctx context.Context, workspace workspaces. return &deployment.ResourceDeploymentClient{ Client: dc, OperationsClient: doc, - RadiusResourceGroup: id.FindScope(resources.ResourceGroupsSegment), + RadiusResourceGroup: id.FindScope(resources_radius.ScopeResourceGroups), }, nil } diff --git a/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go index 7b0294082c..d3c85fe1d3 100644 --- a/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go @@ -23,6 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -129,7 +130,7 @@ func TestApplicationConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go index 73e38c04d3..d90fb7264d 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go @@ -25,6 +25,7 @@ import ( rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -147,8 +148,7 @@ func TestContainerConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "azure", string(val.IAM.Kind)) require.Equal(t, "read", val.IAM.Roles[0]) require.Equal(t, "radius.azurecr.io/webapptutorial-todoapp", r.Properties.Container.Image) - require.Equal(t, "Deployment", versioned.Properties.Status.OutputResources[0]["LocalID"]) - require.Equal(t, "aks", versioned.Properties.Status.OutputResources[0]["Provider"]) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, "kubernetesMetadata", *versioned.Properties.Extensions[2].GetExtension().Kind) require.Equal(t, 3, len(versioned.Properties.Extensions)) require.Equal(t, to.SliceOfPtrs([]string{"/bin/sh"}...), versioned.Properties.Container.Command) @@ -200,7 +200,7 @@ func TestContainerConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go index d49bc506d2..78dfe02583 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go @@ -28,6 +28,7 @@ import ( rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -409,36 +410,12 @@ func TestConvertDataModelWithIdentityToVersioned(t *testing.T) { require.Equal(t, "https://oidcurl/guid", string(*versioned.Properties.Compute.GetEnvironmentCompute().Identity.OidcIssuer)) } -type fakeResource struct{} - -func (f *fakeResource) ResourceTypeName() string { - return "FakeResource" -} - -func (f *fakeResource) GetSystemData() *v1.SystemData { - return nil -} - -func (f *fakeResource) GetBaseResource() *v1.BaseResource { - return nil -} - -func (f *fakeResource) ProvisioningState() v1.ProvisioningState { - return v1.ProvisioningStateAccepted -} - -func (f *fakeResource) SetProvisioningState(state v1.ProvisioningState) { -} - -func (f *fakeResource) UpdateMetadata(ctx *v1.ARMRequestContext, oldResource *v1.BaseResource) { -} - func TestConvertFromValidation(t *testing.T) { validationTests := []struct { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go index 290bd7783a..6efd9da996 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go @@ -23,9 +23,10 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/linkrp" - linkrp_apiver "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -126,10 +127,9 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { for _, payload := range testset { // arrange - rawPayload, err := linkrp_apiver.LoadTestData("./testdata/" + payload.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload.file) versionedResource := &ExtenderResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -161,15 +161,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &ResourceRecipe{Name: to.Ptr(""), Parameters: nil}, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "ExtenderProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -212,15 +204,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &ResourceRecipe{Name: to.Ptr("test-recipe"), Parameters: nil}, - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "ExtenderProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -234,10 +218,9 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := linkrp_apiver.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.Extender{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &ExtenderResource{} @@ -257,7 +240,7 @@ func TestExtender_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go index 0512e53451..eb419ed673 100644 --- a/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go @@ -24,6 +24,7 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -77,8 +78,7 @@ func TestGatewayConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "myreplaceprefix", *versioned.Properties.Routes[0].ReplacePrefix) require.Equal(t, "mypath", *versioned.Properties.Routes[0].Path) require.Equal(t, "http://myprefix.myapp.mydomain.com", *versioned.Properties.URL) - require.Equal(t, "Deployment", versioned.Properties.Status.OutputResources[0]["LocalID"]) - require.Equal(t, "kubernetes", versioned.Properties.Status.OutputResources[0]["Provider"]) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) } func TestGatewaySSLPassthroughConvertVersionedToDataModel(t *testing.T) { @@ -132,8 +132,7 @@ func TestGatewaySSLPassthroughConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "mypath", *versioned.Properties.Routes[0].Path) require.Equal(t, "myreplaceprefix", *versioned.Properties.Routes[0].ReplacePrefix) require.Equal(t, "http://myprefix.myapp.mydomain.com", *versioned.Properties.URL) - require.Equal(t, "Deployment", versioned.Properties.Status.OutputResources[0]["LocalID"]) - require.Equal(t, "kubernetes", versioned.Properties.Status.OutputResources[0]["Provider"]) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, true, *versioned.Properties.TLS.SSLPassthrough) } @@ -189,8 +188,7 @@ func TestGatewayTLSTerminationConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "mypath", *versioned.Properties.Routes[0].Path) require.Equal(t, "myreplaceprefix", *versioned.Properties.Routes[0].ReplacePrefix) require.Equal(t, "http://myprefix.myapp.mydomain.com", *versioned.Properties.URL) - require.Equal(t, "Deployment", versioned.Properties.Status.OutputResources[0]["LocalID"]) - require.Equal(t, "kubernetes", versioned.Properties.Status.OutputResources[0]["Provider"]) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, "secretname", *versioned.Properties.TLS.CertificateFrom) require.Equal(t, TLSMinVersionOne3, *versioned.Properties.TLS.MinimumProtocolVersion) } @@ -247,8 +245,7 @@ func TestGatewayTLSTerminationConvertDataModelToVersioned_NoMinProtocolVersion(t require.Equal(t, "mypath", *versioned.Properties.Routes[0].Path) require.Equal(t, "myreplaceprefix", *versioned.Properties.Routes[0].ReplacePrefix) require.Equal(t, "http://myprefix.myapp.mydomain.com", *versioned.Properties.URL) - require.Equal(t, "Deployment", versioned.Properties.Status.OutputResources[0]["LocalID"]) - require.Equal(t, "kubernetes", versioned.Properties.Status.OutputResources[0]["Provider"]) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, "secretname", *versioned.Properties.TLS.CertificateFrom) require.Equal(t, TLSMinVersionOne2, *versioned.Properties.TLS.MinimumProtocolVersion) } @@ -258,7 +255,7 @@ func TestGatewayConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go index 24162324e0..924d34792c 100644 --- a/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go @@ -24,6 +24,7 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -74,8 +75,7 @@ func TestHTTPRouteConvertDataModelToVersioned(t *testing.T) { require.Equal(t, int32(8080), r.Properties.Port) require.Equal(t, "http", r.Properties.Scheme) require.Equal(t, "http://testapplications.com/httproute/", r.Properties.URL) - require.Equal(t, "Deployment", versioned.Properties.Status.OutputResources[0]["LocalID"]) - require.Equal(t, "kubernetes", versioned.Properties.Status.OutputResources[0]["Provider"]) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) } func TestHTTPRouteConvertFromValidation(t *testing.T) { @@ -83,7 +83,7 @@ func TestHTTPRouteConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go index 61617e04d8..19e24e604e 100644 --- a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go @@ -22,10 +22,10 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -107,8 +107,7 @@ func TestSecretStoreConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "Applications.Core/secretStores", r.Type) require.Equal(t, "dev", r.Tags["env"]) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", r.Properties.Application) - identity := versioned.Properties.Status.OutputResources[0]["Identity"].(resourcemodel.KubernetesIdentity) - require.Equal(t, "Secret", identity.Kind) + require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, "certificate", string(*versioned.Properties.Type)) require.Nil(t, versioned.Properties.Data["tls.crt"].Encoding) require.Equal(t, "", to.String(versioned.Properties.Data["tls.crt"].Value)) @@ -150,7 +149,7 @@ func TestSecretStoreConvertFromValidation(t *testing.T) { src v1.ResourceDataModel err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresource.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresource.json index 308d92c379..c53d5aa869 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresource.json @@ -6,11 +6,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "containers", - "Provider": "aks" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel.json index 996f62bade..57bb303c92 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel.json @@ -18,11 +18,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "containers", - "Provider": "aks" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodelemptyext.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodelemptyext.json index 0b272ae4ea..285068e132 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodelemptyext.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodelemptyext.json @@ -1,89 +1,85 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "source": "inventory_route_id", + "iam": { + "kind": "azure", + "roles": [ + "read" + ] + } + } }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "containers", - "Provider": "aks" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "source": "inventory_route_id", - "iam": { - "kind": "azure", - "roles": [ - "read" - ] - } + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcuri/id", + "resource": "resourceid" + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "tcp": { + "healthProbeBase": { + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5 + }, + "containerPort": 8080 } }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcuri/id", - "resource": "resourceid" - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "livenessProbe": { - "kind": "tcp", - "tcp": { - "healthProbeBase": { - "failureThreshold": 5, - "initialDelaySeconds": 5, - "periodSeconds": 5 - }, - "containerPort": 8080 - } - }, - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "extensions": [ + { + "kind": "manualScaling", + "manualScaling": { + "replicas": 2 + } }, - "extensions": [ - { - "kind": "manualScaling", - "manualScaling": { - "replicas": 2 - } - }, - { - "kind": "daprSidecar", - "daprSidecar": { - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http" - } - }, - { - "kind": "kubernetesMetadata" + { + "kind": "daprSidecar", + "daprSidecar": { + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" } - ] - } - } \ No newline at end of file + }, + { + "kind": "kubernetesMetadata" + } + ] + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext.json index 05c38645bb..2a2f48e5c3 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext.json @@ -1,74 +1,70 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "containers", - "Provider": "aks" - } - } - ] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "source": "inventory_route_id", - "disableDefaultEnvVars": true, - "iam": { - "kind": "azure", - "roles": [ - "read" - ] - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "source": "inventory_route_id", + "disableDefaultEnvVars": true, + "iam": { + "kind": "azure", + "roles": [ + "read" + ] + } + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5, + "timeoutSeconds": 5, + "containerPort": 8080 }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "livenessProbe": { - "kind": "tcp", - "failureThreshold": 5, - "initialDelaySeconds": 5, - "periodSeconds": 5, - "timeoutSeconds": 5, - "containerPort": 8080 - }, - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcuri/id", + "resource": "resourceid" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcuri/id", - "resource": "resourceid" + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" }, - "extensions": [ - { - "kind": "manualScaling", - "replicas": 2 - }, - { - "kind": "daprSidecar", - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http" - }, - { - "kind": "kubernetesMetadata", - "annotations": {}, - "labels": {} - } - ] - } - } \ No newline at end of file + { + "kind": "kubernetesMetadata", + "annotations": {}, + "labels": {} + } + ] + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext2.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext2.json index a5c0117707..a177501577 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext2.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourceemptyext2.json @@ -1,72 +1,68 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "containers", - "Provider": "aks" - } - } - ] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "source": "inventory_route_id", - "disableDefaultEnvVars": true, - "iam": { - "kind": "azure", - "roles": [ - "read" - ] - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "source": "inventory_route_id", + "disableDefaultEnvVars": true, + "iam": { + "kind": "azure", + "roles": [ + "read" + ] + } + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5, + "timeoutSeconds": 5, + "containerPort": 8080 }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "livenessProbe": { - "kind": "tcp", - "failureThreshold": 5, - "initialDelaySeconds": 5, - "periodSeconds": 5, - "timeoutSeconds": 5, - "containerPort": 8080 - }, - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcuri/id", + "resource": "resourceid" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcuri/id", - "resource": "resourceid" + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" }, - "extensions": [ - { - "kind": "manualScaling", - "replicas": 2 - }, - { - "kind": "daprSidecar", - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http" - }, - { - "kind": "kubernetesMetadata" - } - ] - } - } \ No newline at end of file + { + "kind": "kubernetesMetadata" + } + ] + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcenegativetest.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcenegativetest.json index 7f594a9147..532694b031 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcenegativetest.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcenegativetest.json @@ -6,11 +6,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "containers", - "Provider": "aks" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/extender_manual.json b/pkg/corerp/api/v20220315privatepreview/testdata/extender_manual.json index 7ffc98b6e7..d3ebe2bd3c 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/extender_manual.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/extender_manual.json @@ -1,24 +1,22 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken": "token" - }, - "resourceProvisioning": "manual" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken": "token" + }, + "resourceProvisioning": "manual" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/extender_recipe.json b/pkg/corerp/api/v20220315privatepreview/testdata/extender_recipe.json index 0e15799e71..d90eb5898d 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/extender_recipe.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/extender_recipe.json @@ -1,21 +1,19 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "test-recipe" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "recipe": { + "name": "test-recipe" } + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json b/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json index 42c4ac0300..f557f855c1 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json @@ -1,37 +1,35 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "additionalProperties": { + "fromNumber": "222-222-2222" }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties":{ - "fromNumber": "222-222-2222" - }, - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } -} + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json b/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json index efc983aba4..dd931d5e5e 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json @@ -1,32 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "test-recipe" - } + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "recipe": { + "name": "test-recipe" } -} + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json index e9e10ddb4b..8ac29c54b0 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json @@ -1,33 +1,31 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "additionalProperties": { + "fromNumber": "222-222-2222" }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties":{ - "fromNumber": "222-222-2222" - }, - "resourceProvisioning": "manual" - } -} + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-sslpassthrough.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-sslpassthrough.json index 5ea604fba3..8af0e3ac85 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-sslpassthrough.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-sslpassthrough.json @@ -1,34 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls": { - "sslPassthrough": true - }, - "url": "http://myprefix.myapp.mydomain.com" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" + }, + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "sslPassthrough": true + }, + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination-nominprotocolversion.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination-nominprotocolversion.json index d02b2dbc45..86032cb2b3 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination-nominprotocolversion.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination-nominprotocolversion.json @@ -1,34 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls": { - "certificateFrom": "secretname" - }, - "url": "http://myprefix.myapp.mydomain.com" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" + }, + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "certificateFrom": "secretname" + }, + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination.json index 21d404e567..cf14076331 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource-with-tlstermination.json @@ -1,35 +1,31 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls": { - "certificateFrom": "secretname", - "minimumProtocolVersion": "1.3" - }, - "url": "http://myprefix.myapp.mydomain.com" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" + }, + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "certificateFrom": "secretname", + "minimumProtocolVersion": "1.3" + }, + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource.json index 5ca8254efe..a0df3dfb35 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresource.json @@ -1,31 +1,27 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "url": "http://myprefix.myapp.mydomain.com" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" + }, + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-sslpassthrough.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-sslpassthrough.json index a3877e7afc..92249ee132 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-sslpassthrough.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-sslpassthrough.json @@ -1,45 +1,41 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" }, - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls": { - "sslPassthrough": true - }, - "url": "http://myprefix.myapp.mydomain.com" - } + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "sslPassthrough": true + }, + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination-nominprotocolversion.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination-nominprotocolversion.json index cc611a6ad2..93f1a34d0b 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination-nominprotocolversion.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination-nominprotocolversion.json @@ -1,45 +1,41 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" }, - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls": { - "certificateFrom": "secretname" - }, - "url": "http://myprefix.myapp.mydomain.com" - } + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "certificateFrom": "secretname" + }, + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination.json index f7c8b5d431..b0d1aedfc3 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel-with-tlstermination.json @@ -1,46 +1,42 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" }, - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls": { - "certificateFrom": "secretname", - "minimumProtocolVersion": "1.3" - }, - "url": "http://myprefix.myapp.mydomain.com" - } + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "certificateFrom": "secretname", + "minimumProtocolVersion": "1.3" + }, + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel.json index 38853ca0ba..255a6366f6 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/gatewayresourcedatamodel.json @@ -1,42 +1,38 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" }, - "properties": { - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix": "myprefix" - }, - "routes": [ - { - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "url": "http://myprefix.myapp.mydomain.com" - } + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "url": "http://myprefix.myapp.mydomain.com" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresource.json b/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresource.json index a52810c5e7..039861adc5 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresource.json @@ -1,21 +1,19 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "HttpRoute", - "Provider": "kubernetes" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "localhost", - "port":8080, - "scheme": "http", - "url": "http://testapplications.com/httproute/" - } -} + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": "localhost", + "port": 8080, + "scheme": "http", + "url": "http://testapplications.com/httproute/" + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresourcedatamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresourcedatamodel.json index 802c1433ea..b2b3eb364c 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresourcedatamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/httprouteresourcedatamodel.json @@ -1,32 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "HttpRoute", - "Provider": "kubernetes" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "localhost", - "port":8080, - "scheme": "http", - "url": "http://testapplications.com/httproute/" - } -} + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": "localhost", + "port": 8080, + "scheme": "http", + "url": "http://testapplications.com/httproute/" + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel-resource.json b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel-resource.json index 02bd47d720..d0dc865d13 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel-resource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel-resource.json @@ -1,54 +1,43 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", - "name": "secret0", - "type": "Applications.Core/secretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "type": "certificate", - "data": { - "tls.crt": { - "valueFrom": { - "name": "secret/tls_cert", - "version": "1" - } - }, - "tls.key": { - "valueFrom": { - "name": "secret/tls_key", - "version": "1" - } - } - }, - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", - "status": { - "outputResources": [ - { - "identity": { - "resourceType": { - "type": "Secret", - "provider": "kubernetes" - }, - "data": { - "kind": "Secret", - "apiVersion": "v1", - "namespace": "app0-default", - "name": "secret0" - } - } - } - ] + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", + "name": "secret0", + "type": "Applications.Core/secretStores", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/tls_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/tls_key", + "version": "1" } + } }, - "tags": { - "env": "dev" + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] } + }, + "tags": { + "env": "dev" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel.json index 24e97b5c4d..549ea8ab32 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-datamodel.json @@ -1,49 +1,38 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", - "name": "secret0", - "type": "Applications.Core/secretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", + "name": "secret0", + "type": "Applications.Core/secretStores", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "value": "-----BEGIN CERT---- ..." + }, + "tls.key": { + "encoding": "base64", + "value": "-----BEGIN KEY---- ..." + } }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "type": "certificate", - "data": { - "tls.crt": { - "value": "-----BEGIN CERT---- ..." - }, - "tls.key": { - "encoding": "base64", - "value": "-----BEGIN KEY---- ..." - } - }, - "resource": "default/letsencrypt-prod", - "status": { - "outputResources": [ - { - "identity": { - "resourceType": { - "type": "Secret", - "provider": "kubernetes" - }, - "data": { - "kind": "Secret", - "apiVersion": "v1", - "namespace": "default", - "name": "letsencrypt-prod" - } - } - } - ] + "resource": "default/letsencrypt-prod", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } - }, - "tags": { - "env": "dev" + ] } + }, + "tags": { + "env": "dev" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned-resource.json b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned-resource.json index 7d57e90096..c1a99b3eb5 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned-resource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned-resource.json @@ -1,46 +1,35 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", - "name": "secret0", - "type": "Applications.Core/secretStores", - "location": "global", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "type": "certificate", - "data": { - "tls.crt": { - "valueFrom": { - "name": "secret/tls_cert", - "version": "1" - } - }, - "tls.key": { - "valueFrom": { - "name": "secret/tls_key", - "version": "1" - } - } - }, - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", - "status": { - "outputResources": [ - { - "identity": { - "resourceType": { - "type": "Secret", - "provider": "kubernetes" - }, - "data": { - "kind": "Secret", - "apiVersion": "v1", - "namespace": "app0-default", - "name": "secret0" - } - } - } - ] + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", + "name": "secret0", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/tls_cert", + "version": "1" } + }, + "tls.key": { + "valueFrom": { + "name": "secret/tls_key", + "version": "1" + } + } }, - "tags": { - "env": "dev" + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] } + }, + "tags": { + "env": "dev" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned.json b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned.json index 44ffdcea9a..563a4c203f 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/secretstore-versioned.json @@ -1,40 +1,29 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", - "name": "secret0", - "type": "Applications.Core/secretStores", - "location": "global", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "type": "certificate", - "data": { - "tls.crt": { - "encoding": "base64", - "value": "-----BEGIN CERT---- ..." - }, - "tls.key": { - "value": "-----BEGIN KEY---- ..." - } - }, - "status": { - "outputResources": [ - { - "identity": { - "resourceType": { - "type": "Secret", - "provider": "kubernetes" - }, - "data": { - "kind": "Secret", - "apiVersion": "v1", - "namespace": "default", - "name": "letsencrypt-prod" - } - } - } - ] - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/secretStores/secret0", + "name": "secret0", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "encoding": "base64", + "value": "-----BEGIN CERT---- ..." + }, + "tls.key": { + "value": "-----BEGIN KEY---- ..." + } }, - "tags": { - "env": "dev" + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] } + }, + "tags": { + "env": "dev" + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv-datamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv-datamodel.json index b6cb739a8f..5c68dbf9c3 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv-datamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv-datamodel.json @@ -1,70 +1,68 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/volumes/azkeyvault0", - "name": "azkeyvault0", - "type": "Applications.Core/volumes", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/volumes/azkeyvault0", + "name": "azkeyvault0", + "type": "Applications.Core/volumes", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Volume", - "Provider": "kubernetes" - } - }] + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "azureKeyVault": { + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "alias": "aliassecret-1", + "version": "1", + "encoding": "utf-8" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "alias": "aliaskey1-1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "alias": "aliascert1-1", + "certType": "certificate", + "encoding": "utf-8" }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "kind": "azure.com.keyvault", - "azureKeyVault": { - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", - "secrets": { - "mysecret-1": { - "name": "mysecret-1", - "alias": "aliassecret-1", - "version": "1", - "encoding": "utf-8" - }, - "mysecret-2": { - "name": "mysecret-2", - "encoding": "base64" - } - }, - "keys": { - "mykey-1": { - "name": "key1", - "alias": "aliaskey1-1", - "version": "1" - }, - "mykey-2": { - "name": "key2" - } - }, - "certificates": { - "mycert-1": { - "name": "cert1", - "alias": "aliascert1-1", - "certType": "certificate", - "encoding": "utf-8" - }, - "mycert-2": { - "name": "cert2", - "certType": "privatekey", - "format": "pfx", - "encoding": "hex" - } - } + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" } + } } + } } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv.json b/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv.json index 3dddfefefa..e8e09a8651 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/volume-az-kv.json @@ -16,10 +16,11 @@ }, "properties": { "status": { - "outputResources": [{ - "LocalID": "Deployment", - "Provider": "kubernetes" - }] + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, "provisioningState": "Succeeded", "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", diff --git a/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go index 459a610b7a..41e41f8e84 100644 --- a/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go @@ -24,6 +24,7 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -62,7 +63,6 @@ func TestVolumeConvertDataModelToVersioned(t *testing.T) { expected := &VolumeResource{} err = json.Unmarshal(testutil.ReadFixture("volume-az-kv.json"), expected) require.NoError(t, err) - expected.Properties.GetVolumeProperties().Status.OutputResources[0]["Identity"] = nil // act versioned := &VolumeResource{} @@ -82,7 +82,7 @@ func TestVolumeConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index 12cf223f5e..0d5e0188f5 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -25,7 +25,6 @@ import ( "strings" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/resourcemodel" rp_util "github.com/project-radius/radius/pkg/rp/util" rpv1 "github.com/project-radius/radius/pkg/rp/v1" @@ -41,6 +40,7 @@ import ( msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" "github.com/project-radius/radius/pkg/ucp/dataprovider" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" "github.com/project-radius/radius/pkg/ucp/store" "github.com/project-radius/radius/pkg/ucp/ucplog" @@ -149,11 +149,12 @@ func (dp *deploymentProcessor) Render(ctx context.Context, resourceID resources. // Check if the output resources have the corresponding provider supported in Radius for _, or := range rendererOutput.Resources { - if or.ResourceType.Provider == "" { + resourceType := or.GetResourceType() + if resourceType.Provider == "" { return renderers.RendererOutput{}, fmt.Errorf("output resource %q does not have a provider specified", or.LocalID) } - if !dp.appmodel.IsProviderSupported(or.ResourceType.Provider) { - return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("provider %s is not configured. Cannot support resource type %s", or.ResourceType.Provider, or.ResourceType.Type)) + if !dp.appmodel.IsProviderSupported(resourceType.Provider) { + return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("provider %s is not configured. Cannot support resource type %s", resourceType.Provider, resourceType.Type)) } } @@ -176,9 +177,10 @@ func (dp *deploymentProcessor) deployOutputResource(ctx context.Context, id reso logger := ucplog.FromContextOrDiscard(ctx) or := putOptions.Resource - logger.Info(fmt.Sprintf("Deploying output resource: LocalID: %s, resource type: %q\n", or.LocalID, or.ResourceType)) + resourceType := or.GetResourceType() + logger.Info(fmt.Sprintf("Deploying output resource: LocalID: %s, resource type: %q\n", or.LocalID, resourceType)) - outputResourceModel, err := dp.appmodel.LookupOutputResourceModel(or.ResourceType) + outputResourceModel, err := dp.appmodel.LookupOutputResourceModel(resourceType) if err != nil { return err } @@ -194,8 +196,8 @@ func (dp *deploymentProcessor) deployOutputResource(ctx context.Context, id reso return err } - if or.Identity.ResourceType == nil { - err = fmt.Errorf("output resource %q does not have an identity. This is a bug in the handler", or.LocalID) + if or.ID.IsEmpty() { + err = fmt.Errorf("output resource %q does not have an id. This is a bug in the handler", or.LocalID) return err } @@ -216,7 +218,7 @@ func (dp *deploymentProcessor) deployOutputResource(ctx context.Context, id reso return fmt.Errorf("failed to process JSON Pointer %q for resource: %w", v.JSONPointer, err) } - value, _, err := pointer.Get(or.Resource) + value, _, err := pointer.Get(or.CreateResource) if err != nil { return fmt.Errorf("failed to process JSON Pointer %q for resource: %w", v.JSONPointer, err) } @@ -250,26 +252,22 @@ func (dp *deploymentProcessor) Deploy(ctx context.Context, id resources.ID, rend deployedOutputResourceProperties := map[string]map[string]string{} for _, outputResource := range orderedOutputResources { - logger.Info(fmt.Sprintf("Deploying output resource: LocalID: %s, resource type: %q\n", outputResource.LocalID, outputResource.ResourceType)) + resourceType := outputResource.GetResourceType() + logger.Info(fmt.Sprintf("Deploying output resource: LocalID: %s, resource type: %q\n", outputResource.LocalID, resourceType)) err := dp.deployOutputResource(ctx, id, rendererOutput, computedValues, &handlers.PutOptions{Resource: &outputResource, DependencyProperties: deployedOutputResourceProperties}) if err != nil { return rpv1.DeploymentOutput{}, err } - if outputResource.Identity.ResourceType == nil { - return rpv1.DeploymentOutput{}, fmt.Errorf("output resource %q does not have an identity. This is a bug in the handler", outputResource.LocalID) + if outputResource.ID.IsEmpty() { + return rpv1.DeploymentOutput{}, fmt.Errorf("output resource %q does not have an id. This is a bug in the handler", outputResource.LocalID) } // Build database resource - copy updated properties to Resource field outputResource := rpv1.OutputResource{ - LocalID: outputResource.LocalID, - ResourceType: outputResource.ResourceType, - Identity: outputResource.Identity, - Status: rpv1.OutputResourceStatus{ - ProvisioningState: string(v1.ProvisioningStateProvisioned), - ProvisioningErrorDetails: "", - }, + LocalID: outputResource.LocalID, + ID: outputResource.ID, } deployedOutputResources = append(deployedOutputResources, outputResource) } @@ -304,12 +302,13 @@ func (dp *deploymentProcessor) Delete(ctx context.Context, id resources.ID, depl // Loop over each output resource and delete in reverse dependency order - resource deployed last should be deleted first for i := len(deployedOutputResources) - 1; i >= 0; i-- { outputResource := deployedOutputResources[i] - outputResourceModel, err := dp.appmodel.LookupOutputResourceModel(outputResource.ResourceType) + resourceType := outputResource.GetResourceType() + outputResourceModel, err := dp.appmodel.LookupOutputResourceModel(resourceType) if err != nil { return err } - logger.Info(fmt.Sprintf("Deleting output resource: LocalID: %s, resource type: %q\n", outputResource.LocalID, outputResource.ResourceType)) + logger.Info(fmt.Sprintf("Deleting output resource: LocalID: %s, resource type: %q\n", outputResource.LocalID, resourceType)) err = outputResourceModel.ResourceHandler.Delete(ctx, &handlers.DeleteOptions{Resource: &outputResource}) if err != nil { return err @@ -601,7 +600,7 @@ func (dp *deploymentProcessor) buildResourceDependency(resourceID resources.ID, return ResourceData{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("application ID %q for the resource %q is not a valid id. Error: %s", applicationID, resourceID.String(), err.Error())) } appID = &parsedID - } else if strings.EqualFold(resourceID.ProviderNamespace(), resources.LinkRPNamespace) { + } else if strings.EqualFold(resourceID.ProviderNamespace(), resources_radius.NamespaceApplicationsLink) { // Application id is optional for link resource types appID = nil } else { @@ -621,9 +620,9 @@ func (dp *deploymentProcessor) buildResourceDependency(resourceID resources.ID, func (dp *deploymentProcessor) getRendererDependency(ctx context.Context, dependency ResourceData) (renderers.RendererDependency, error) { // Get dependent resource identity - outputResourceIdentity := map[string]resourcemodel.ResourceIdentity{} + outputResourceIDs := map[string]resources.ID{} for _, outputResource := range dependency.OutputResources { - outputResourceIdentity[outputResource.LocalID] = outputResource.Identity + outputResourceIDs[outputResource.LocalID] = outputResource.ID } // Get dependent resource computedValues @@ -648,7 +647,7 @@ func (dp *deploymentProcessor) getRendererDependency(ctx context.Context, depend ResourceID: dependency.ID, Resource: dependency.Resource, ComputedValues: computedValues, - OutputResources: outputResourceIdentity, + OutputResources: outputResourceIDs, } return rendererDependency, nil diff --git a/pkg/corerp/backend/deployment/deploymentprocessor_test.go b/pkg/corerp/backend/deployment/deploymentprocessor_test.go index db29ee605a..95516ca087 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor_test.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor_test.go @@ -24,7 +24,6 @@ import ( "testing" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/azure/azresources" "github.com/project-radius/radius/pkg/azure/clientv2" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/handlers" @@ -34,12 +33,13 @@ import ( "github.com/project-radius/radius/pkg/linkrp" linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" linkrp_renderers "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/resourcekinds" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/dataprovider" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/pkg/ucp/store" "github.com/project-radius/radius/test/testcontext" "github.com/project-radius/radius/test/testutil" @@ -73,28 +73,21 @@ func setup(t *testing.T) SharedMocks { []model.OutputResourceModel{ { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Deployment, + Type: model.AnyResourceType, Provider: resourcemodel.ProviderKubernetes, }, ResourceHandler: resourceHandler, }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Secret, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: resourceHandler, - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, Provider: resourcemodel.ProviderAzure, }, }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Service, - Provider: resourcemodel.ProviderKubernetes, + Type: "Test.Namespace/testResources", + Provider: "test", }, ResourceHandler: resourceHandler, }, @@ -139,9 +132,11 @@ func getTestRendererOutput() renderers.RendererOutput { testOutputResources := []rpv1.OutputResource{ { LocalID: rpv1.LocalIDService, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Service, - Provider: resourcemodel.ProviderKubernetes, + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_kubernetes.ResourceTypeService, + Provider: resourcemodel.ProviderKubernetes, + }, }, }, } @@ -214,48 +209,31 @@ func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData { testResource.ComputedValues = computedValues testResource.SecretValues = secretValues - accountResourceType := resourcemodel.ResourceType{ - Type: resourcekinds.AzureCosmosAccount, - Provider: resourcemodel.ProviderAzure, - } dbResourceType := resourcemodel.ResourceType{ - Type: resourcekinds.AzureCosmosDBMongo, + Type: "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases", Provider: resourcemodel.ProviderAzure, } outputResources := []rpv1.OutputResource{ { - LocalID: rpv1.LocalIDAzureCosmosAccount, - ResourceType: accountResourceType, - ProviderResourceType: azresources.DocumentDBDatabaseAccounts, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &accountResourceType, - Data: resourcemodel.ARMIdentity{ - ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account", - APIVersion: clientv2.DocumentDBManagementClientAPIVersion, - }, - }, + LocalID: rpv1.LocalIDAzureCosmosAccount, + ID: resources.MustParse("/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account"), RadiusManaged: to.Ptr(true), }, { - LocalID: rpv1.LocalIDAzureCosmosDBMongo, - ResourceType: dbResourceType, - ProviderResourceType: azresources.DocumentDBDatabaseAccounts + "/" + azresources.DocumentDBDatabaseAccountsMongoDBDatabases, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &dbResourceType, - Data: resourcemodel.ARMIdentity{ - ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database", - APIVersion: clientv2.DocumentDBManagementClientAPIVersion, - }, - }, - Resource: map[string]any{ - "properties": map[string]any{ - "resource": map[string]string{ - "id": "test-database", + LocalID: rpv1.LocalIDAzureCosmosDBMongo, + ID: resources.MustParse("/subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database"), + CreateResource: &rpv1.Resource{ + ResourceType: dbResourceType, + Data: map[string]any{ + "properties": map[string]any{ + "resource": map[string]string{ + "id": "test-database", + }, }, }, + Dependencies: []string{rpv1.LocalIDAzureCosmosAccount}, }, RadiusManaged: to.Ptr(true), - Dependencies: []rpv1.Dependency{{LocalID: rpv1.LocalIDAzureCosmosAccount}}, }, } @@ -704,7 +682,7 @@ func Test_Render(t *testing.T) { testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - testRendererOutput.Resources[0].ResourceType.Provider = "" + testRendererOutput.Resources[0].CreateResource.ResourceType.Provider = "" depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") requiredResources := []resources.ID{depId1} @@ -774,7 +752,7 @@ func Test_Render(t *testing.T) { testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - testRendererOutput.Resources[0].ResourceType.Provider = "unknown" + testRendererOutput.Resources[0].CreateResource.ResourceType.Provider = "unknown" depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") requiredResources := []resources.ID{depId1} @@ -841,39 +819,33 @@ func Test_Render(t *testing.T) { } func Test_Deploy(t *testing.T) { - ctx := testcontext.New(t) - mocks := setup(t) - dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} - t.Run("Verify deploy success", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) kubeProp := map[string]string{ - handlers.KubernetesKindKey: resourcekinds.Service, + handlers.KubernetesKindKey: "Service", handlers.KubernetesAPIVersionKey: "v1", handlers.KubernetesNamespaceKey: "test-namespace", handlers.ResourceName: "test-deployment", } - expectedIdentity := resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.Service, - Provider: resourcemodel.ProviderKubernetes, - }, - Data: resourcemodel.KubernetesIdentity{ - Name: kubeProp[handlers.ResourceName], - Namespace: kubeProp[handlers.KubernetesNamespaceKey], - Kind: kubeProp[handlers.KubernetesKindKey], - APIVersion: kubeProp[handlers.ResourceName], - }, - } + expectedID := resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + kubeProp[handlers.KubernetesKindKey], + kubeProp[handlers.KubernetesNamespaceKey], + kubeProp[handlers.ResourceName]) mocks.resourceHandler. EXPECT(). Put(gomock.Any(), gomock.Any()).Times(1). DoAndReturn(func(ctx context.Context, options *handlers.PutOptions) (map[string]string, error) { - options.Resource.Identity = expectedIdentity + options.Resource.ID = expectedID return kubeProp, nil }) @@ -881,11 +853,15 @@ func Test_Deploy(t *testing.T) { require.NoError(t, err) require.Equal(t, len(testRendererOutput.Resources), len(deploymentOutput.DeployedOutputResources)) - require.NotEqual(t, resourcemodel.ResourceIdentity{}, deploymentOutput.DeployedOutputResources[0].Identity) + require.NotEqual(t, resources.ID{}, deploymentOutput.DeployedOutputResources[0].ID) require.Equal(t, map[string]any{"url": testRendererOutput.ComputedValues["url"].Value}, deploymentOutput.ComputedValues) }) t.Run("Verify deploy failure", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) @@ -897,13 +873,15 @@ func Test_Deploy(t *testing.T) { }) t.Run("Output resource dependency missing local ID", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - testRendererOutput.Resources[0].Dependencies = []rpv1.Dependency{ - {LocalID: ""}, - } + testRendererOutput.Resources[0].CreateResource.Dependencies = []string{""} _, err := dp.Deploy(ctx, resourceID, testRendererOutput) @@ -911,18 +889,26 @@ func Test_Deploy(t *testing.T) { }) t.Run("Invalid output resource type", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) - testRendererOutput.Resources[0].ResourceType.Type = "foo" + testRendererOutput.Resources[0].CreateResource.ResourceType = resourcemodel.ResourceType{Provider: resourcemodel.ProviderAzure, Type: "foo"} _, err := dp.Deploy(ctx, resourceID, testRendererOutput) - require.ErrorContains(t, err, "output resource kind 'Provider: kubernetes, Type: foo' is unsupported") + require.ErrorContains(t, err, "output resource kind 'Provider: azure, Type: foo' is unsupported") }) t.Run("Missing output resource identity", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() testRendererOutput := getTestRendererOutput() resourceID := getTestResourceID(testResource.ID) @@ -931,23 +917,23 @@ func Test_Deploy(t *testing.T) { EXPECT(). Put(gomock.Any(), gomock.Any()).Times(1). DoAndReturn(func(ctx context.Context, options *handlers.PutOptions) (map[string]string, error) { - options.Resource.Identity = resourcemodel.ResourceIdentity{} + options.Resource.ID = resources.ID{} return map[string]string{}, nil }) _, err := dp.Deploy(ctx, resourceID, testRendererOutput) - require.ErrorContains(t, err, `output resource "Service" does not have an identity. This is a bug in the handler`) + require.ErrorContains(t, err, `output resource "Service" does not have an id. This is a bug in the handler`) }) } func Test_Delete(t *testing.T) { - ctx := testcontext.New(t) - - mocks := setup(t) - dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} t.Run("Verify delete success", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) @@ -958,6 +944,10 @@ func Test_Delete(t *testing.T) { }) t.Run("Verify delete failure", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) @@ -968,6 +958,10 @@ func Test_Delete(t *testing.T) { }) t.Run("Verify delete with no output resources", func(t *testing.T) { + ctx := testcontext.New(t) + mocks := setup(t) + dp := deploymentProcessor{mocks.model, mocks.dbProvider, nil, nil} + testResource := getTestResource() resourceID := getTestResourceID(testResource.ID) testResource.Properties.Status.OutputResources = []rpv1.OutputResource{} diff --git a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json index 5e299411e6..1d96b85b8e 100644 --- a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json +++ b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodel.json @@ -17,11 +17,7 @@ "status": { "outputResources": [ { - "LocalID": "Service", - "ResourceType": { - "Type": "Service", - "Provider": "kubernetes" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json index 98276b35b0..b2f9911782 100644 --- a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json +++ b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodellowercase.json @@ -1,60 +1,58 @@ { - "id": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/containers/test-resource", - "name": "test-resource", - "type": "applications.core/containers", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/containers/test-resource", + "name": "test-resource", + "type": "applications.core/containers", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "provisioningState": "Succeeded", + "application": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", + "connections": { + "inventory": { + "source": "inventory_route_id", + "iam": { + "kind": "Http", + "roles": [ + "administrator" + ] + } + } }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Service", - "ResourceType": { - "Type": "Service", - "Provider": "kubernetes" - } - }] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - "connections": { - "inventory": { - "source": "inventory_route_id", - "iam": { - "kind": "Http", - "roles": [ - "administrator" - ] - } - } + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "tcp": { + "healthProbeBase": { + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5 }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "livenessProbe": { - "kind": "tcp", - "tcp": { - "healthProbeBase": { - "failureThreshold": 5, - "initialDelaySeconds": 5, - "periodSeconds": 5 - }, - "containerPort": 8080 - } - }, - "ports": { - "web":{ - "containerPort": 5000, - "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" - } - } + "containerPort": 8080 + } + }, + "ports": { + "web": { + "containerPort": 5000, + "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" } + } } -} + } +} \ No newline at end of file diff --git a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json index 0b9ed597f8..cb012548cb 100644 --- a/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json +++ b/pkg/corerp/backend/deployment/testdata/containerresourcedatamodeluppercase.json @@ -1,60 +1,58 @@ { - "id": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/containers/test-resource", - "name": "test-resource", - "type": "APPLICATIONS.CORE/CONTAINERS", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/containers/test-resource", + "name": "test-resource", + "type": "APPLICATIONS.CORE/CONTAINERS", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "provisioningState": "Succeeded", + "application": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", + "connections": { + "inventory": { + "source": "inventory_route_id", + "iam": { + "kind": "Http", + "roles": [ + "administrator" + ] + } + } }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Service", - "ResourceType": { - "Type": "Service", - "Provider": "kubernetes" - } - }] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application", - "connections": { - "inventory": { - "source": "inventory_route_id", - "iam": { - "kind": "Http", - "roles": [ - "administrator" - ] - } - } + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "tcp": { + "healthProbeBase": { + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5 }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "livenessProbe": { - "kind": "tcp", - "tcp": { - "healthProbeBase": { - "failureThreshold": 5, - "initialDelaySeconds": 5, - "periodSeconds": 5 - }, - "containerPort": 8080 - } - }, - "ports": { - "web":{ - "containerPort": 5000, - "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" - } - } + "containerPort": 8080 + } + }, + "ports": { + "web": { + "containerPort": 5000, + "provides": "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/applications/test-application/HttpRoute/B" } + } } -} + } +} \ No newline at end of file diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go index df466eba62..4c03a83f5f 100644 --- a/pkg/corerp/backend/service.go +++ b/pkg/corerp/backend/service.go @@ -30,7 +30,6 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/model" "github.com/project-radius/radius/pkg/corerp/processors/extenders" - "github.com/project-radius/radius/pkg/kubeutil" "github.com/project-radius/radius/pkg/linkrp" linkrp_backend_ctrl "github.com/project-radius/radius/pkg/linkrp/backend/controller" "github.com/project-radius/radius/pkg/linkrp/processors" @@ -41,7 +40,6 @@ import ( "github.com/project-radius/radius/pkg/sdk" "github.com/project-radius/radius/pkg/sdk/clients" "github.com/project-radius/radius/pkg/ucp/secret/provider" - "k8s.io/client-go/discovery" ) const ( @@ -86,7 +84,7 @@ func (w *Service) Run(ctx context.Context) error { return err } - coreAppModel, err := model.NewApplicationModel(w.Options.Arm, w.KubeClient, w.KubeClientSet) + coreAppModel, err := model.NewApplicationModel(w.Options.Arm, w.KubeClient, w.KubeClientSet, w.KubeDiscoveryClient) if err != nil { return fmt.Errorf("failed to initialize application model: %w", err) } @@ -115,22 +113,7 @@ func (w *Service) Run(ctx context.Context) error { } } - // Setup to run backend controller for extenders. - runtimeClient, err := kubeutil.NewRuntimeClient(w.Options.K8sConfig) - if err != nil { - return err - } - - discoveryClient, err := discovery.NewDiscoveryClientForConfig(w.Options.K8sConfig) - if err != nil { - return err - } - - // Use legacy discovery client to avoid the issue of the staled GroupVersion discovery(api.ucp.dev/v1alpha3). - // TODO: Disable UseLegacyDiscovery once https://github.com/project-radius/radius/issues/5974 is resolved. - discoveryClient.UseLegacyDiscovery = true - - client := processors.NewResourceClient(w.Options.Arm, w.Options.UCPConnection, runtimeClient, discoveryClient) + client := processors.NewResourceClient(w.Options.Arm, w.Options.UCPConnection, w.KubeClient, w.KubeDiscoveryClient) clientOptions := sdk.NewClientOptions(w.Options.UCPConnection) deploymentEngineClient, err := clients.NewResourceDeploymentsClient(&clients.Options{ diff --git a/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_datamodel.json index fee530dfc2..ee20dc9fd2 100644 --- a/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_datamodel.json @@ -1,74 +1,63 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/containers/test-container-0", - "name": "test-container-0", - "type": "applications.core/containers", - "location": "West US", - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "test@microsoft.com", - "createdByType": "Test", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "test@microsoft.com", - "lastModifiedByType": "Test" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/containers/test-container-0", + "name": "test-container-0", + "type": "applications.core/containers", + "location": "West US", + "tenantId": "00000000-0000-0000-0000-000000000000", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroup": "radius-test-rg", + "createdApiVersion": "2022-03-15-privatepreview", + "updatedApiVersion": "2022-03-15-privatepreview", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "test@microsoft.com", + "createdByType": "Test", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "test@microsoft.com", + "lastModifiedByType": "Test" + }, + "provisioningState": "Updating", + "properties": { + "application": "test-application", + "connections": { + "test-connection": { + "source": "test", + "disableDefaultEnvVars": false, + "iam": { + "kind": "azure", + "roles": [ + "admin" + ] + } + } + }, + "container": { + "image": "test-image", + "env": { + "env-variable-0": "test-env-variable-0", + "env-variable-1": "test-env-variable-1" + }, + "livenessProbe": { + "kind": "tcp", + "tcp": { + "containerPort": 8080, + "initialDelaySeconds": 5 + } + }, + "ports": { + "default": { + "containerPort": 80, + "protocol": "http", + "provides": "/" + } + } }, - "provisioningState": "Updating", - "properties": { - "application": "test-application", - "connections": { - "test-connection": { - "source": "test", - "disableDefaultEnvVars": false, - "iam": { - "kind": "azure", - "roles": [ - "admin" - ] - } - } - }, - "container": { - "image": "test-image", - "env": { - "env-variable-0": "test-env-variable-0", - "env-variable-1": "test-env-variable-1" - }, - "livenessProbe": { - "kind": "tcp", - "tcp": { - "containerPort": 8080, - "initialDelaySeconds": 5 - } - }, - "ports": { - "default": { - "containerPort": 80, - "protocol": "http", - "provides": "/" - } - } - }, - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Provider": "azure", - "Type": "aks" - }, - "Identity": { - "data": null, - "resourceType": { - "Type": "aks", - "Provider": "azure" - } - } - } - ] + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] } + } } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_output.json b/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_output.json index c3ac91f02e..bc90e95068 100644 --- a/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_output.json +++ b/pkg/corerp/frontend/controller/containers/testdata/container20220315privatepreview_output.json @@ -1,64 +1,59 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/containers/test-container-0", - "name": "test-container-0", - "type": "applications.core/containers", - "location": "West US", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "test@microsoft.com", - "createdByType": "Test", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "test@microsoft.com", - "lastModifiedByType": "Test" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/containers/test-container-0", + "name": "test-container-0", + "type": "applications.core/containers", + "location": "West US", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroup": "radius-test-rg", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "test@microsoft.com", + "createdByType": "Test", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "test@microsoft.com", + "lastModifiedByType": "Test" + }, + "tags": {}, + "properties": { + "application": "test-application", + "connections": { + "test-connection": { + "source": "test", + "disableDefaultEnvVars": false, + "iam": { + "kind": "azure", + "roles": [ + "admin" + ] + } + } + }, + "container": { + "image": "test-image", + "env": { + "env-variable-0": "test-env-variable-0", + "env-variable-1": "test-env-variable-1" + }, + "ports": { + "default": { + "containerPort": 80, + "protocol": "http", + "provides": "/" + } + }, + "livenessProbe": { + "containerPort": 8080, + "initialDelaySeconds": 5, + "kind": "tcp" + } }, - "tags": {}, - "properties": { - "application": "test-application", - "connections": { - "test-connection": { - "source": "test", - "disableDefaultEnvVars": false, - "iam": { - "kind": "azure", - "roles": [ - "admin" - ] - } - } - }, - "container": { - "image": "test-image", - "env": { - "env-variable-0": "test-env-variable-0", - "env-variable-1": "test-env-variable-1" - }, - "ports": { - "default": { - "containerPort": 80, - "protocol": "http", - "provides": "/" - } - }, - "livenessProbe": { - "containerPort": 8080, - "initialDelaySeconds": 5, - "kind": "tcp" - } - }, - "provisioningState": "Updating", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "Provider": "azure", - "Identity": { - "apiVersion": "", - "id": "" - } - } - ] + "provisioningState": "Updating", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] } + } } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreview_output.json b/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreview_output.json index d863564809..40b1996539 100644 --- a/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreview_output.json +++ b/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreview_output.json @@ -1,29 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/extenders/extender0", - "location": "West US", - "name": "extender0", - "properties": { - "status": { - "outputResources": null - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual", - "provisioningState": "Succeeded" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/extenders/extender0", + "location": "West US", + "name": "extender0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" }, - "tags": {}, - "type": "applications.core/extenders" + "resourceProvisioning": "manual", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.core/extenders" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json b/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json index b3b88bba73..d52141f508 100644 --- a/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json +++ b/pkg/corerp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json @@ -1,25 +1,29 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/extenders/extender0", - "location": "West US", - "name": "extender0", - "properties": { - "status": { - "outputResources": null - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "resourceProvisioning": "manual", - "provisioningState": "Succeeded" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/extenders/extender0", + "location": "West US", + "name": "extender0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/extenders" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "resourceProvisioning": "manual", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.core/extenders" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_datamodel.json index e3a2369390..33732108df 100644 --- a/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_datamodel.json @@ -1,51 +1,43 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "location": "West US", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": { + "env": "dev" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Gateway", - "Provider": "kubernetes" - }, - "Identity": { - "data": null, - "resourceType": { - "Type": "httproutes", - "Provider": "aks" - } - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix":"myprefix" - }, - "routes": [{ - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls":{ - "sslPassthrough": false - }, - "url": "myprefix.myapp.mydomain.com" - } -} + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "sslPassthrough": false + }, + "url": "myprefix.myapp.mydomain.com" + } +} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_output.json b/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_output.json index f8cbab5e60..c7331f640c 100644 --- a/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_output.json +++ b/pkg/corerp/frontend/controller/gateways/testdata/gateway20220315privatepreview_output.json @@ -1,46 +1,43 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "location": "West US", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": { + "fullyQualifiedHostname": "myapp.mydomain.com", + "prefix": "myprefix" }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "Provider": "kubernetes", - "Identity": { - "aksClusterName": "", - "name": "", - "namespace": "" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": { - "fullyQualifiedHostname": "myapp.mydomain.com", - "prefix":"myprefix" - }, - "routes": [{ - "destination": "mydestination", - "path": "mypath", - "replacePrefix": "myreplaceprefix" - } - ], - "tls":{ - "sslPassthrough": false - }, - "url": "myprefix.myapp.mydomain.com", - "provisioningState": "Succeeded" - } + "routes": [ + { + "destination": "mydestination", + "path": "mypath", + "replacePrefix": "myreplaceprefix" + } + ], + "tls": { + "sslPassthrough": false + }, + "url": "myprefix.myapp.mydomain.com", + "provisioningState": "Succeeded" + } } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_datamodel.json index 2f35c05da0..a561056795 100644 --- a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_datamodel.json @@ -1,44 +1,34 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", - "name": "hrt0", - "type": "applications.core/httproutes", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", + "name": "hrt0", + "type": "applications.core/httproutes", + "location": "West US", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "httproutes", - "Provider": "aks" - }, - "Resource": null, - "Identity": { - "data": null, - "resourceType": { - "Type": "httproutes", - "Provider": "aks" - } - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "foo.example.com", - "port": 8080, - "scheme": "https", - "url": "https://foo.example.com" - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": "foo.example.com", + "port": 8080, + "scheme": "https", + "url": "https://foo.example.com" + }, + "tenantId": "00000000-0000-0000-0000-000000000000", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroup": "radius-test-rg", + "createdApiVersion": "2022-03-15-privatepreview", + "updatedApiVersion": "2022-03-15-privatepreview" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_output.json b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_output.json index 33a7fb6ea0..3c6c0f4d96 100644 --- a/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_output.json +++ b/pkg/corerp/frontend/controller/httproutes/testdata/httproute20220315privatepreview_output.json @@ -1,34 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", - "location": "West US", - "name": "hrt0", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "Provider": "aks", - "Identity": { - "aksClusterName": "", - "name": "", - "namespace": "" - } - }] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "hostname": "foo.example.com", - "port": 8080, - "scheme": "https", - "url": "https://foo.example.com" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.core/httproutes/hrt0", + "location": "West US", + "name": "hrt0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.core/httproutes" + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "hostname": "foo.example.com", + "port": 8080, + "scheme": "https", + "url": "https://foo.example.com" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.core/httproutes" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/secretstores/kubernetes.go b/pkg/corerp/frontend/controller/secretstores/kubernetes.go index 5acde7887b..e53b196125 100644 --- a/pkg/corerp/frontend/controller/secretstores/kubernetes.go +++ b/pkg/corerp/frontend/controller/secretstores/kubernetes.go @@ -27,11 +27,10 @@ import ( "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/pkg/ucp/store" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -267,18 +266,12 @@ func UpsertSecret(ctx context.Context, newResource, old *datamodel.SecretStore, newResource.Properties.Status.OutputResources = []rpv1.OutputResource{ { LocalID: rpv1.LocalIDSecret, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.Secret, - Provider: resourcemodel.ProviderKubernetes, - }, - Data: resourcemodel.KubernetesIdentity{ - Kind: resourcekinds.Secret, - APIVersion: "v1", - Name: name, - Namespace: ns, - }, - }, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + resources_kubernetes.KindSecret, + ns, + name), }, } @@ -305,33 +298,17 @@ func DeleteRadiusSecret(ctx context.Context, oldResource *datamodel.SecretStore, return nil, nil } -func getIdentityFromOutputResources(resources []rpv1.OutputResource) (*resourcemodel.KubernetesIdentity, error) { - for _, r := range resources { - ri := r.Identity - if ri.ResourceType.Provider == resourcemodel.ProviderKubernetes && ri.ResourceType.Type == resourcekinds.Secret { - ki := &resourcemodel.KubernetesIdentity{} - if err := store.DecodeMap(ri.Data, ki); err != nil { - return nil, err - } - return ki, nil - } - } - - return nil, nil -} - func getSecretFromOutputResources(resources []rpv1.OutputResource, options *controller.Options) (*corev1.Secret, error) { - ki, err := getIdentityFromOutputResources(resources) - if err != nil { - return nil, err - } - - if ki == nil { - return nil, nil + name, ns := "", "" + for _, resource := range resources { + if strings.EqualFold(resource.ID.Type(), "core/Secret") { + _, _, ns, name = resources_kubernetes.ToParts(resource.ID) + break + } } ksecret := &corev1.Secret{} - err = options.KubeClient.Get(context.Background(), runtimeclient.ObjectKey{Namespace: ki.Namespace, Name: ki.Name}, ksecret) + err := options.KubeClient.Get(context.Background(), runtimeclient.ObjectKey{Namespace: ns, Name: name}, ksecret) if apierrors.IsNotFound(err) { return nil, nil } else if err != nil { diff --git a/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go b/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go index 27d12f4ff5..e1176ec9fc 100644 --- a/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go +++ b/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go @@ -27,9 +27,8 @@ import ( "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/pkg/ucp/store" "github.com/project-radius/radius/test/k8sutil" "github.com/project-radius/radius/test/testutil" @@ -399,18 +398,12 @@ func TestUpsertSecret(t *testing.T) { require.Equal(t, "MTAwMDAwMDAtMTAwMC0xMDAwLTAwMDAtMDAwMDAwMDAwMDAw", string(ksecret.Data["servicePrincipalPassword"])) require.Equal(t, rpv1.OutputResource{ LocalID: "Secret", - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.Secret, - Provider: resourcemodel.ProviderKubernetes, - }, - Data: resourcemodel.KubernetesIdentity{ - Kind: resourcekinds.Secret, - APIVersion: "v1", - Name: "secret0", - Namespace: "app0-ns", - }, - }, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + resources_kubernetes.KindSecret, + "app0-ns", + "secret0"), }, newResource.Properties.Status.OutputResources[0]) }) diff --git a/pkg/corerp/frontend/controller/secretstores/testdata/secretstores_datamodel_cert_valuefrom.json b/pkg/corerp/frontend/controller/secretstores/testdata/secretstores_datamodel_cert_valuefrom.json index cda623d0d1..c1ee1af09b 100644 --- a/pkg/corerp/frontend/controller/secretstores/testdata/secretstores_datamodel_cert_valuefrom.json +++ b/pkg/corerp/frontend/controller/secretstores/testdata/secretstores_datamodel_cert_valuefrom.json @@ -23,18 +23,7 @@ "status": { "outputResources": [ { - "identity": { - "resourceType": { - "type": "Secret", - "provider": "kubernetes" - }, - "data": { - "kind": "Secret", - "apiVersion": "v1", - "namespace": "default", - "name": "letsencrypt-prod" - } - } + "id": "/planes/kubernetes/local/namespaces/default/providers/core/Secret/letsencrypt-prod" } ] } diff --git a/pkg/corerp/handlers/arm_handler.go b/pkg/corerp/handlers/arm_handler.go index 1be04b5f1f..e7e6d21ad3 100644 --- a/pkg/corerp/handlers/arm_handler.go +++ b/pkg/corerp/handlers/arm_handler.go @@ -18,15 +18,14 @@ package handlers import ( "context" - "encoding/json" - "errors" "fmt" + "strings" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/project-radius/radius/pkg/azure/armauth" "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/resourcemodel" - ucpresources "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" ) // NewARMHandler creates a new ARMHandler instance with the given ARM configuration, for 'generic' ARM resources. @@ -38,22 +37,14 @@ type armHandler struct { arm *armauth.ArmConfig } -// Put validates that the resource exists and returns the resource so renderers can use it for computed values. It -// returns an error if the resource does not exist. +// Put validates that the resource exists. It returns an error if the resource does not exist. func (handler *armHandler) Put(ctx context.Context, options *PutOptions) (map[string]string, error) { // Do a GET just to validate that the resource exists. - resource, err := getByID(ctx, &handler.arm.ClientOptions, options.Resource.Identity) + _, err := handler.getByID(ctx, options.Resource.ID) if err != nil { return nil, err } - // Return the resource so renderers can use it for computed values. - serialized, err := handler.serializeResource(resource) - if err != nil { - return nil, err - } - options.Resource.Resource = serialized - return map[string]string{}, nil } @@ -62,43 +53,53 @@ func (handler *armHandler) Delete(ctx context.Context, options *DeleteOptions) e return nil } -func (handler *armHandler) serializeResource(resource *armresources.GenericResource) (map[string]interface{}, error) { - // We turn the resource into a weakly-typed representation. This is needed because JSON Pointer - // will have trouble with the autorest embdedded types. - b, err := json.Marshal(&resource) +func (handler *armHandler) getByID(ctx context.Context, id resources.ID) (*armresources.GenericResource, error) { + client, err := clientv2.NewGenericResourceClient(id.FindScope(resources_azure.ScopeSubscriptions), &handler.arm.ClientOptions, nil) if err != nil { - return nil, fmt.Errorf("failed to marshal %T", resource) + return nil, err } - data := map[string]any{} - err = json.Unmarshal(b, &data) + apiVersion, err := handler.lookupARMAPIVersion(ctx, id) if err != nil { - return nil, errors.New("failed to umarshal resource data") + return nil, fmt.Errorf("failed to access resource %q", id) } - return data, nil -} - -func getByID(ctx context.Context, options *clientv2.Options, identity resourcemodel.ResourceIdentity) (*armresources.GenericResource, error) { - id, apiVersion, err := identity.RequireARM() + resp, err := client.GetByID(ctx, id.String(), apiVersion, &armresources.ClientGetByIDOptions{}) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to access resource %q", id) } - parsed, err := ucpresources.ParseResource(id) + return &resp.GenericResource, nil +} + +func (handler *armHandler) lookupARMAPIVersion(ctx context.Context, id resources.ID) (string, error) { + client, err := clientv2.NewProvidersClient(id.FindScope(resources_azure.ScopeSubscriptions), &handler.arm.ClientOptions, nil) if err != nil { - return nil, err + return "", err } - client, err := clientv2.NewGenericResourceClient(parsed.FindScope(ucpresources.SubscriptionsSegment), options, nil) + resp, err := client.Get(ctx, id.ProviderNamespace(), nil) if err != nil { - return nil, err + return "", err } - resp, err := client.GetByID(ctx, id, apiVersion, &armresources.ClientGetByIDOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to access resource %q", id) + // We need to match on the resource type name without the provider namespace. + shortType := strings.TrimPrefix(id.TypeSegments()[0].Type, id.ProviderNamespace()+"/") + for _, rt := range resp.ResourceTypes { + if !strings.EqualFold(shortType, *rt.ResourceType) { + continue + } + if rt.DefaultAPIVersion != nil { + return *rt.DefaultAPIVersion, nil + } + + if len(rt.APIVersions) > 0 { + return *rt.APIVersions[0], nil + } + + return "", fmt.Errorf("could not find API version for type %q, no supported API versions", id.Type()) + } - return &resp.GenericResource, nil + return "", fmt.Errorf("could not find API version for type %q, type was not found", id.Type()) } diff --git a/pkg/corerp/handlers/azure_federatedidentity.go b/pkg/corerp/handlers/azure_federatedidentity.go index 5ed8934622..7f688d2200 100644 --- a/pkg/corerp/handlers/azure_federatedidentity.go +++ b/pkg/corerp/handlers/azure_federatedidentity.go @@ -27,12 +27,10 @@ import ( "github.com/project-radius/radius/pkg/azure/armauth" "github.com/project-radius/radius/pkg/azure/clientv2" "github.com/project-radius/radius/pkg/logging" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/ucplog" ) @@ -109,7 +107,7 @@ func (handler *azureFederatedIdentityHandler) Put(ctx context.Context, options * return nil, errors.New("fails to get identity resource id") } - rs := options.Resource.Resource + rs := options.Resource.CreateResource.Data federatedName, err := GetMapValue[string](rs, FederatedIdentityNameKey) if err != nil { return nil, err @@ -141,8 +139,8 @@ func (handler *azureFederatedIdentityHandler) Put(ctx context.Context, options * return nil, err } - subID := rID.FindScope(resources.SubscriptionsSegment) - rgName := rID.FindScope(resources.ResourceGroupsSegment) + subID := rID.FindScope(resources_azure.ScopeSubscriptions) + rgName := rID.FindScope(resources_azure.ScopeResourceGroups) client, err := clientv2.NewFederatedIdentityClient(subID, &handler.arm.ClientOptions) if err != nil { @@ -156,25 +154,17 @@ func (handler *azureFederatedIdentityHandler) Put(ctx context.Context, options * } // WORKAROUND: Ensure that federal identity credential is populated. (Why not they provide async api?) - _, err = client.Get(ctx, rgName, rID.Name(), federatedName, nil) + response, err := client.Get(ctx, rgName, rID.Name(), federatedName, nil) if err != nil { return nil, err } - options.Resource.Identity = resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - Data: resourcemodel.AzureFederatedIdentity{ - Resource: identityID, - OIDCIssuer: issuer, - Subject: subject, - Audience: AzureFederatedIdentityAudience, - Name: federatedName, - }, + id, err := resources.ParseResource(*response.ID) + if err != nil { + return nil, err } + options.Resource.ID = id logger.Info("Created federated identity for Azure AD identity.", logging.LogFieldLocalID, rpv1.LocalIDFederatedIdentity) return map[string]string{}, nil @@ -186,23 +176,32 @@ func (handler *azureFederatedIdentityHandler) Put(ctx context.Context, options * // azureFederatedIdentityHandler.Delete deletes an Azure Federated Identity resource from the Azure cloud given the // resource's data and subscription ID. func (handler *azureFederatedIdentityHandler) Delete(ctx context.Context, options *DeleteOptions) error { - fi := &resourcemodel.AzureFederatedIdentity{} - if err := store.DecodeMap(options.Resource.Identity.Data, fi); err != nil { - return err - } + subscriptionID := options.Resource.ID.FindScope(resources_azure.ScopeSubscriptions) - rID, err := resources.ParseResource(fi.Resource) + client, err := clientv2.NewFederatedIdentityClient(subscriptionID, &handler.arm.ClientOptions) if err != nil { return err } - subscriptionID := rID.FindScope(resources.SubscriptionsSegment) - - client, err := clientv2.NewFederatedIdentityClient(subscriptionID, &handler.arm.ClientOptions) + // Validate the ID matches the expected type before we start taking it apart to get the names. + expected := resources.KnownType{ + Types: []resources.TypeSegment{ + { + Type: "Microsoft.ManagedIdentity/userAssignedIdentities", + Name: "*", + }, + { + Type: "federatedIdentityCredentials", + Name: "*", + }, + }, + } + err = options.Resource.ID.ValidateResourceType(expected) if err != nil { return err } - _, err = client.Delete(ctx, rID.FindScope(resources.ResourceGroupsSegment), rID.Name(), fi.Name, nil) + typeSegments := options.Resource.ID.TypeSegments() + _, err = client.Delete(ctx, options.Resource.ID.FindScope(resources_azure.ScopeResourceGroups), typeSegments[0].Name, typeSegments[1].Name, nil) return err } diff --git a/pkg/corerp/handlers/azure_fileshare.go b/pkg/corerp/handlers/azure_fileshare.go deleted file mode 100644 index 84678fa980..0000000000 --- a/pkg/corerp/handlers/azure_fileshare.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handlers - -import ( - "context" - "fmt" - - "github.com/project-radius/radius/pkg/azure/armauth" -) - -const ( - FileShareNameKey = "fileshare" - FileShareIDKey = "fileshareid" -) - -// NewAzureFileShareHandler creates a new instance of azureFileShareHandler with the given arm config. -func NewAzureFileShareHandler(arm *armauth.ArmConfig) ResourceHandler { - return &azureFileShareHandler{arm: arm} -} - -type azureFileShareHandler struct { - arm *armauth.ArmConfig -} - -// Put validates the required properties for the resource and creates/modifies the resource using the ARMHandler. -func (handler *azureFileShareHandler) Put(ctx context.Context, options *PutOptions) (map[string]string, error) { - properties, ok := options.Resource.Resource.(map[string]string) - if !ok { - return properties, fmt.Errorf("invalid required properties for resource") - } - - // This assertion is important so we don't start creating/modifying a resource - err := ValidateResourceIDsForResource(properties, FileShareStorageAccountIDKey, FileShareIDKey, FileShareNameKey) - if err != nil { - return nil, err - } - - armhandler := NewARMHandler(handler.arm) - properties, err = armhandler.Put(ctx, options) - if err != nil { - return nil, err - } - return properties, nil -} - -// No-op. Just returns nil. -func (handler *azureFileShareHandler) Delete(ctx context.Context, options *DeleteOptions) error { - return nil -} diff --git a/pkg/corerp/handlers/azure_fileshare_storageaccount.go b/pkg/corerp/handlers/azure_fileshare_storageaccount.go deleted file mode 100644 index 62c8e52065..0000000000 --- a/pkg/corerp/handlers/azure_fileshare_storageaccount.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handlers - -import ( - "context" - "fmt" - - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/ucp/resources" -) - -const ( - FileShareStorageAccountNameKey = "filesharestorageaccount" - FileShareStorageAccountIDKey = "filesharestorageaccountid" - AzureFileShareStorageAccountBaseName = "storageaccountbase" -) - -// NewAzureFileShareStorageAccountHandler creates a new instance of the azureFileShareStorageAccountHandler object. -func NewAzureFileShareStorageAccountHandler(arm *armauth.ArmConfig) ResourceHandler { - return &azureFileShareStorageAccountHandler{arm: arm} -} - -type azureFileShareStorageAccountHandler struct { - arm *armauth.ArmConfig -} - -// Put validates the required properties for the resource and checks if the storage account exists. -func (handler *azureFileShareStorageAccountHandler) Put(ctx context.Context, options *PutOptions) (map[string]string, error) { - properties, ok := options.Resource.Resource.(map[string]string) - if !ok { - return nil, fmt.Errorf("invalid required properties for resource") - } - - // This assertion is important so we don't start creating/modifying a resource - err := ValidateResourceIDsForResource(properties, FileShareStorageAccountIDKey, FileShareStorageAccountNameKey) - if err != nil { - return nil, err - } - - _, err = getStorageAccountByID(ctx, *handler.arm, properties[FileShareStorageAccountIDKey]) - if err != nil { - return nil, err - } - - options.Resource.Identity = resourcemodel.NewARMIdentity(&options.Resource.ResourceType, properties[FileShareStorageAccountIDKey], clientv2.StateStoreClientAPIVersion) - - return nil, nil -} - -// No-op. Just returns nil. -func (handler *azureFileShareStorageAccountHandler) Delete(ctx context.Context, options *DeleteOptions) error { - return nil -} - -func getStorageAccountByID(ctx context.Context, arm armauth.ArmConfig, accountID string) (*armstorage.Account, error) { - parsed, err := resources.ParseResource(accountID) - if err != nil { - return nil, fmt.Errorf("failed to parse Storage Account resource id: %w", err) - } - - client, err := clientv2.NewAccountsClient(parsed.FindScope(resources.SubscriptionsSegment), &arm.ClientOptions) - if err != nil { - return nil, fmt.Errorf("failed to create Storage Account client: %w", err) - } - - resp, err := client.GetProperties(ctx, parsed.FindScope(resources.ResourceGroupsSegment), - parsed.TypeSegments()[0].Name, &armstorage.AccountsClientGetPropertiesOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to get Storage Account: %w", err) - } - - return &resp.Account, nil -} diff --git a/pkg/corerp/handlers/azure_roleassignment.go b/pkg/corerp/handlers/azure_roleassignment.go index 1ffa831059..4a0b55b587 100644 --- a/pkg/corerp/handlers/azure_roleassignment.go +++ b/pkg/corerp/handlers/azure_roleassignment.go @@ -22,12 +22,11 @@ import ( "fmt" "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" "github.com/project-radius/radius/pkg/azure/roleassignment" "github.com/project-radius/radius/pkg/logging" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/ucplog" ) @@ -52,7 +51,7 @@ type azureRoleAssignmentHandler struct { func (handler *azureRoleAssignmentHandler) Put(ctx context.Context, options *PutOptions) (map[string]string, error) { logger := ucplog.FromContextOrDiscard(ctx) - properties, ok := options.Resource.Resource.(map[string]string) + properties, ok := options.Resource.CreateResource.Data.(map[string]string) if !ok { return properties, fmt.Errorf("invalid required properties for resource") } @@ -79,7 +78,7 @@ func (handler *azureRoleAssignmentHandler) Put(ctx context.Context, options *Put // Assign Key Vault Secrets User role to grant managed identity read-only access to the keyvault for secrets. // Assign Key Vault Crypto User role to grant managed identity permissions to perform operations using encryption keys. - roleAssignment, err := roleassignment.Create(ctx, handler.arm, parsedScope.FindScope(resources.SubscriptionsSegment), principalID, scope, roleName) + roleAssignment, err := roleassignment.Create(ctx, handler.arm, parsedScope.FindScope(resources_azure.ScopeSubscriptions), principalID, scope, roleName) if err != nil { return nil, fmt.Errorf( "failed to assign '%s' role to the managed identity '%s' within resource '%s' scope : %w", @@ -87,16 +86,17 @@ func (handler *azureRoleAssignmentHandler) Put(ctx context.Context, options *Put } logger.Info(fmt.Sprintf("Created %s role assignment for %s to access %s", roleName, principalID, scope), logging.LogFieldLocalID, rpv1.LocalIDRoleAssignmentKVKeys) - options.Resource.Identity = resourcemodel.NewARMIdentity(&options.Resource.ResourceType, *roleAssignment.ID, clientv2.RoleAssignmentClientAPIVersion) + id, err := resources.ParseResource(*roleAssignment.ID) + if err != nil { + return nil, err + } + + options.Resource.ID = id return properties, nil } // Delete deletes an Azure role assignment using the provided DeleteOptions. It returns an error if the role assignment // cannot be deleted. func (handler *azureRoleAssignmentHandler) Delete(ctx context.Context, options *DeleteOptions) error { - roleID, _, err := options.Resource.Identity.RequireARM() - if err != nil { - return err - } - return roleassignment.Delete(ctx, handler.arm, roleID) + return roleassignment.Delete(ctx, handler.arm, options.Resource.ID.String()) } diff --git a/pkg/corerp/handlers/azure_userassigned_managedidentity.go b/pkg/corerp/handlers/azure_userassigned_managedidentity.go index 85fad6bf55..88241c7d4d 100644 --- a/pkg/corerp/handlers/azure_userassigned_managedidentity.go +++ b/pkg/corerp/handlers/azure_userassigned_managedidentity.go @@ -24,10 +24,10 @@ import ( "github.com/project-radius/radius/pkg/azure/armauth" "github.com/project-radius/radius/pkg/azure/clientv2" "github.com/project-radius/radius/pkg/logging" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/ucplog" ) @@ -56,7 +56,7 @@ type azureUserAssignedManagedIdentityHandler struct { func (handler *azureUserAssignedManagedIdentityHandler) Put(ctx context.Context, options *PutOptions) (map[string]string, error) { logger := ucplog.FromContextOrDiscard(ctx) - properties, ok := options.Resource.Resource.(map[string]string) + properties, ok := options.Resource.CreateResource.Data.(map[string]string) if !ok { return properties, fmt.Errorf("invalid required properties for resource") } @@ -105,7 +105,12 @@ func (handler *azureUserAssignedManagedIdentityHandler) Put(ctx context.Context, properties[UserAssignedIdentityClientIDKey] = to.String(identity.Properties.ClientID) properties[UserAssignedIdentityTenantIDKey] = to.String(identity.Properties.TenantID) - options.Resource.Identity = resourcemodel.NewARMIdentity(&options.Resource.ResourceType, properties[UserAssignedIdentityIDKey], clientv2.MSIClientAPIVersion) + id, err := resources.ParseResource(properties[UserAssignedIdentityIDKey]) + if err != nil { + return nil, err + } + + options.Resource.ID = id logger.Info("Created managed identity for KeyVault access", logging.LogFieldLocalID, rpv1.LocalIDUserAssignedManagedIdentity) return properties, nil @@ -113,24 +118,14 @@ func (handler *azureUserAssignedManagedIdentityHandler) Put(ctx context.Context, // Delete deletes a user assigned managed identity from Azure using the provided DeleteOptions. func (handler *azureUserAssignedManagedIdentityHandler) Delete(ctx context.Context, options *DeleteOptions) error { - msiResourceID, _, err := options.Resource.Identity.RequireARM() - if err != nil { - return err - } - - parsed, err := resources.ParseResource(msiResourceID) - if err != nil { - return err - } - - subscriptionID := parsed.FindScope(resources.SubscriptionsSegment) + subscriptionID := options.Resource.ID.FindScope(resources_azure.ScopeSubscriptions) msiClient, err := clientv2.NewUserAssignedIdentityClient(subscriptionID, &handler.arm.ClientOptions) if err != nil { return err } - _, err = msiClient.Delete(ctx, parsed.FindScope(resources.ResourceGroupsSegment), parsed.Name(), nil) + _, err = msiClient.Delete(ctx, options.Resource.ID.FindScope(resources_azure.ScopeResourceGroups), options.Resource.ID.Name(), nil) if err != nil { return fmt.Errorf("failed to delete user assigned managed identity: %w", err) diff --git a/pkg/corerp/handlers/kubernetes.go b/pkg/corerp/handlers/kubernetes.go index a870419d78..e319df2827 100644 --- a/pkg/corerp/handlers/kubernetes.go +++ b/pkg/corerp/handlers/kubernetes.go @@ -27,7 +27,8 @@ import ( "github.com/project-radius/radius/pkg/kubeutil" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/pkg/ucp/ucplog" v1 "k8s.io/api/apps/v1" @@ -36,6 +37,8 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/discovery" "k8s.io/client-go/informers" k8s "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" @@ -51,10 +54,11 @@ const ( ) // NewKubernetesHandler creates a new KubernetesHandler which is used to handle Kubernetes resources. -func NewKubernetesHandler(client client.Client, clientSet k8s.Interface) ResourceHandler { +func NewKubernetesHandler(client client.Client, clientSet k8s.Interface, discoveryClient discovery.ServerResourcesInterface) ResourceHandler { return &kubernetesHandler{ client: client, clientSet: clientSet, + k8sDiscoveryClient: discoveryClient, deploymentTimeOut: MaxDeploymentTimeout, cacheResyncInterval: DefaultCacheResyncInterval, } @@ -63,6 +67,8 @@ func NewKubernetesHandler(client client.Client, clientSet k8s.Interface) Resourc type kubernetesHandler struct { client client.Client clientSet k8s.Interface + // k8sDiscoveryClient is the Kubernetes client to used for API version lookups on Kubernetes resources. Override this for testing. + k8sDiscoveryClient discovery.ServerResourcesInterface deploymentTimeOut time.Duration cacheResyncInterval time.Duration @@ -90,28 +96,24 @@ func (handler *kubernetesHandler) Put(ctx context.Context, options *PutOptions) return nil, err } - if options.Resource.Deployed { - return properties, nil - } - err = handler.client.Patch(ctx, &item, client.Apply, &client.PatchOptions{FieldManager: kubernetes.FieldManager}) if err != nil { return nil, err } - options.Resource.Identity = resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: options.Resource.ResourceType.Type, - Provider: resourcemodel.ProviderKubernetes, - }, - Data: resourcemodel.KubernetesIdentity{ - Name: item.GetName(), - Namespace: item.GetNamespace(), - Kind: item.GetKind(), - APIVersion: item.GetAPIVersion(), - }, + groupVersion, err := schema.ParseGroupVersion(item.GetAPIVersion()) + if err != nil { + return nil, err } + id := resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + groupVersion.Group, + item.GetKind(), + item.GetNamespace(), + item.GetName()) + options.Resource.ID = id + // Monitor the created or updated resource until it is ready. switch strings.ToLower(item.GetKind()) { case "deployment": @@ -410,18 +412,19 @@ func (handler *kubernetesHandler) checkPodStatus(ctx context.Context, pod *corev // Delete decodes the identity data from the DeleteOptions, creates an unstructured object from the identity data, // and then attempts to delete the object from the Kubernetes cluster, returning an error if one occurs. func (handler *kubernetesHandler) Delete(ctx context.Context, options *DeleteOptions) error { - identity := &resourcemodel.KubernetesIdentity{} - if err := store.DecodeMap(options.Resource.Identity.Data, identity); err != nil { + apiVersion, err := handler.lookupKubernetesAPIVersion(ctx, options.Resource.ID) + if err != nil { return err } + group, kind, namespace, name := resources_kubernetes.ToParts(options.Resource.ID) item := unstructured.Unstructured{ Object: map[string]any{ - "apiVersion": identity.APIVersion, - "kind": identity.Kind, + "apiVersion": schema.GroupVersion{Group: group, Version: apiVersion}.String(), + "kind": kind, "metadata": map[string]any{ - "namespace": identity.Namespace, - "name": identity.Name, + "namespace": namespace, + "name": name, }, }, } @@ -429,17 +432,55 @@ func (handler *kubernetesHandler) Delete(ctx context.Context, options *DeleteOpt return client.IgnoreNotFound(handler.client.Delete(ctx, &item)) } -func convertToUnstructured(resource rpv1.OutputResource) (unstructured.Unstructured, error) { - if resource.ResourceType.Provider != resourcemodel.ProviderKubernetes { - return unstructured.Unstructured{}, fmt.Errorf("invalid resource type provider: %s", resource.ResourceType.Provider) +func (handler *kubernetesHandler) lookupKubernetesAPIVersion(ctx context.Context, id resources.ID) (string, error) { + group, kind, namespace, _ := resources_kubernetes.ToParts(id) + var resourceLists []*metav1.APIResourceList + var err error + if namespace == "" { + resourceLists, err = handler.k8sDiscoveryClient.ServerPreferredResources() + if err != nil { + return "", fmt.Errorf("could not find API version for type %q: %w", id.Type(), err) + } + } else { + resourceLists, err = handler.k8sDiscoveryClient.ServerPreferredNamespacedResources() + if err != nil { + return "", fmt.Errorf("could not find API version for type %q: %w", id.Type(), err) + } } - obj, ok := resource.Resource.(runtime.Object) + for _, resourceList := range resourceLists { + // We know the group but not the version. This will give us the the list of resources and their preferred versions. + gv, err := schema.ParseGroupVersion(resourceList.GroupVersion) + if err != nil { + return "", err + } + + if group != gv.Group { + continue + } + + for _, resource := range resourceList.APIResources { + if resource.Kind == kind { + return gv.Version, nil + } + } + } + + return "", fmt.Errorf("could not find API version for type %q, type was not found", id.Type()) +} + +func convertToUnstructured(resource rpv1.OutputResource) (unstructured.Unstructured, error) { + obj, ok := resource.CreateResource.Data.(runtime.Object) if !ok { return unstructured.Unstructured{}, errors.New("inner type was not a runtime.Object") } - c, err := runtime.DefaultUnstructuredConverter.ToUnstructured(resource.Resource) + resourceType := resource.GetResourceType() + if resourceType.Provider != resourcemodel.ProviderKubernetes { + return unstructured.Unstructured{}, fmt.Errorf("invalid resource type provider: %s", resourceType.Provider) + } + + c, err := runtime.DefaultUnstructuredConverter.ToUnstructured(resource.CreateResource.Data) if err != nil { return unstructured.Unstructured{}, fmt.Errorf("could not convert object %v to unstructured: %w", obj.GetObjectKind(), err) } diff --git a/pkg/corerp/handlers/kubernetes_test.go b/pkg/corerp/handlers/kubernetes_test.go index ca116f8711..46915ff432 100644 --- a/pkg/corerp/handlers/kubernetes_test.go +++ b/pkg/corerp/handlers/kubernetes_test.go @@ -26,6 +26,7 @@ import ( "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -119,17 +120,20 @@ func TestPut(t *testing.T) { name: "secret resource", in: &PutOptions{ Resource: &rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Provider: resourcemodel.ProviderKubernetes, - }, - Resource: &corev1.Secret{ - TypeMeta: metav1.TypeMeta{ - Kind: "Secret", - APIVersion: "core/v1", + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderKubernetes, + Type: "core/Secret", }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test-secret", - Namespace: "test-namespace", + Data: &corev1.Secret{ + TypeMeta: metav1.TypeMeta{ + Kind: "Secret", + APIVersion: "core/v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-secret", + Namespace: "test-namespace", + }, }, }, }, @@ -145,10 +149,13 @@ func TestPut(t *testing.T) { name: "deploment resource", in: &PutOptions{ Resource: &rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Provider: resourcemodel.ProviderKubernetes, + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderKubernetes, + Type: "apps/Deployment", + }, + Data: testDeployment, }, - Resource: testDeployment, }, }, out: map[string]string{ @@ -171,11 +178,11 @@ func TestPut(t *testing.T) { cacheResyncInterval: time.Duration(1) * time.Second, } - clientSet := fake.NewSimpleClientset(tc.in.Resource.Resource.(runtime.Object)) + clientSet := fake.NewSimpleClientset(tc.in.Resource.CreateResource.Data.(runtime.Object)) handler.clientSet = clientSet // If the resource is a deployment, we need to add a replica set to it - if tc.in.Resource.Resource.(runtime.Object).GetObjectKind().GroupVersionKind().Kind == "Deployment" { + if tc.in.Resource.CreateResource.Data.(runtime.Object).GetObjectKind().GroupVersionKind().Kind == "Deployment" { // The deployment is not marked as ready till we find a replica set. Therefore, we need to create one. addReplicaSetToDeployment(t, ctx, clientSet, testDeployment) } @@ -202,8 +209,24 @@ func TestDelete(t *testing.T) { }, } + dc := &k8sutil.DiscoveryClient{ + Resources: []*metav1.APIResourceList{ + { + GroupVersion: "apps/v1", + APIResources: []metav1.APIResource{ + { + Name: "deployments", + Version: "v1", + Kind: "Deployment", + }, + }, + }, + }, + } + handler := kubernetesHandler{ client: k8sutil.NewFakeKubeClient(nil), + k8sDiscoveryClient: dc, deploymentTimeOut: time.Duration(1) * time.Second, cacheResyncInterval: time.Duration(10) * time.Second, } @@ -214,35 +237,12 @@ func TestDelete(t *testing.T) { t.Run("existing resource", func(t *testing.T) { err := handler.Delete(ctx, &DeleteOptions{ Resource: &rpv1.OutputResource{ - Identity: resourcemodel.ResourceIdentity{ - Data: map[string]any{ - "apiVersion": "apps/v1", - "kind": "Deployment", - "metadata": map[string]any{ - "name": "test-deployment", - "namespace": "test-namespace", - }, - }, - }, - }, - }) - - require.NoError(t, err) - }) - - t.Run("existing resource", func(t *testing.T) { - err := handler.Delete(ctx, &DeleteOptions{ - Resource: &rpv1.OutputResource{ - Identity: resourcemodel.ResourceIdentity{ - Data: map[string]any{ - "apiVersion": "apps/v1", - "kind": "Deployment", - "metadata": map[string]any{ - "name": "test-deployment1", - "namespace": "test-namespace", - }, - }, - }, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "apps", + "Deployment", + "test-namespace", + "test-deployment"), }, }) @@ -260,13 +260,16 @@ func TestConvertToUnstructured(t *testing.T) { { name: "valid resource", in: rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Provider: resourcemodel.ProviderKubernetes, - }, - Resource: &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderKubernetes, + Type: "apps/Deployment", + }, + Data: &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + }, }, }, }, @@ -296,13 +299,16 @@ func TestConvertToUnstructured(t *testing.T) { { name: "invalid provider", in: rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Provider: resourcemodel.ProviderAzure, - }, - Resource: &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderAzure, + Type: "apps/Deployment", + }, + Data: &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + }, }, }, }, @@ -311,10 +317,13 @@ func TestConvertToUnstructured(t *testing.T) { { name: "invalid resource", in: rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Provider: resourcemodel.ProviderKubernetes, + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderAzure, + Type: "apps/Deployment", + }, + Data: map[string]any{"invalid": "type"}, }, - Resource: map[string]any{"invalid": "type"}, }, err: errors.New("inner type was not a runtime.Object"), }, diff --git a/pkg/corerp/handlers/util.go b/pkg/corerp/handlers/util.go index 79df4b0b6e..d0f7005a8b 100644 --- a/pkg/corerp/handlers/util.go +++ b/pkg/corerp/handlers/util.go @@ -17,7 +17,6 @@ limitations under the License. package handlers import ( - "errors" "fmt" "strings" ) @@ -63,6 +62,7 @@ func GetMapValue[T any](collection any, key string) (T, error) { return defaultValue, fmt.Errorf("value is not %T type", *new(T)) } return s, nil + default: + return defaultValue, fmt.Errorf("unsupported type: %T", c) } - return defaultValue, errors.New("unsupported type") } diff --git a/pkg/corerp/model/application_model.go b/pkg/corerp/model/application_model.go index 205f5c6634..eff9a4054c 100644 --- a/pkg/corerp/model/application_model.go +++ b/pkg/corerp/model/application_model.go @@ -32,15 +32,23 @@ import ( "github.com/project-radius/radius/pkg/corerp/renderers/volume" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" + "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" "sigs.k8s.io/controller-runtime/pkg/client" ) +const ( + // AnyResourceType is used to designate a resource handler that can handle any type that belongs to a provider. AnyResourceType + // should only be used to register handlers, and not as part of an output resource. + AnyResourceType = "*" +) + // NewApplicationModel configures RBAC support on connections based on connection kind, configures the providers supported by the appmodel, // registers the renderers and handlers for various resources, and checks for duplicate registrations. -func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sClientSet kubernetes.Interface) (ApplicationModel, error) { +func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sClientSet kubernetes.Interface, discoveryClient discovery.ServerResourcesInterface) (ApplicationModel, error) { // Configure RBAC support on connections based connection kind. // Role names can be user input or default roles assigned by Radius. // Leave RoleNames field empty if no default roles are supported for a connection kind. @@ -105,118 +113,47 @@ func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sCli outputResourceModel := []OutputResourceModel{ { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Kubernetes, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Deployment, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Service, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Secret, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Gateway, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Volume, + Type: AnyResourceType, Provider: resourcemodel.ProviderKubernetes, }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), + ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient), }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.KubernetesHTTPRoute, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.SecretProviderClass, + Type: resources_kubernetes.ResourceTypeSecretProviderClass, Provider: resourcemodel.ProviderKubernetes, }, ResourceTransformer: azcontainer.TransformSecretProviderClass, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), + ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient), }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.ServiceAccount, + Type: resources_kubernetes.ResourceTypeServiceAccount, Provider: resourcemodel.ProviderKubernetes, }, ResourceTransformer: azcontainer.TransformFederatedIdentitySA, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.KubernetesRole, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.KubernetesRoleBinding, - Provider: resourcemodel.ProviderKubernetes, - }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet), + ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient), }, } azureOutputResourceModel := []OutputResourceModel{ - // Azure CosmosDB and Azure Redis models are consumed by deployment processor to fetch secrets for container dependencies. - // Any new SecretValueTransformer for a link should be added here to support connections from container. - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureCosmosDBMongo, - Provider: resourcemodel.ProviderAzure, - }, - }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentity, Provider: resourcemodel.ProviderAzure, }, ResourceHandler: handlers.NewAzureUserAssignedManagedIdentityHandler(arm), }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential, Provider: resourcemodel.ProviderAzure, }, ResourceHandler: handlers.NewAzureFederatedIdentity(arm), }, { ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - ResourceHandler: handlers.NewAzureRoleAssignmentHandler(arm), - }, - { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, Provider: resourcemodel.ProviderAzure, }, ResourceHandler: handlers.NewAzureRoleAssignmentHandler(arm), diff --git a/pkg/corerp/model/types.go b/pkg/corerp/model/types.go index 8feff80aa1..6193f1cc86 100644 --- a/pkg/corerp/model/types.go +++ b/pkg/corerp/model/types.go @@ -63,11 +63,17 @@ func (m ApplicationModel) LookupRadiusResourceModel(resourceType string) (*Radiu // or an error if the resourceType is unsupported. func (m ApplicationModel) LookupOutputResourceModel(resourceType resourcemodel.ResourceType) (*OutputResourceModel, error) { resource, ok := m.outputResourceLookup[resourceType] - if !ok { - return nil, fmt.Errorf("output resource kind '%s' is unsupported", resourceType) + if ok { + return &resource, nil } - return &resource, nil + // As a fallback, see if there is a handler for any resource type that belongs to the provider. + resource, ok = m.outputResourceLookup[resourcemodel.ResourceType{Provider: resourceType.Provider, Type: AnyResourceType}] + if ok { + return &resource, nil + } + + return nil, fmt.Errorf("output resource kind '%s' is unsupported", resourceType) } // IsProviderSupported checks if the given provider is supported by the application model. diff --git a/pkg/corerp/renderers/container/azure/identity.go b/pkg/corerp/renderers/container/azure/identity.go index 0943c12a6f..dda00ff60f 100644 --- a/pkg/corerp/renderers/container/azure/identity.go +++ b/pkg/corerp/renderers/container/azure/identity.go @@ -25,10 +25,10 @@ import ( "github.com/project-radius/radius/pkg/corerp/handlers" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,7 +50,7 @@ func MakeManagedIdentity(name string, cloudProvider *datamodel.Providers) (*rpv1 var err error if cloudProvider != nil && cloudProvider.Azure.Scope != "" { rID, err = resources.Parse(cloudProvider.Azure.Scope) - if err != nil || rID.FindScope(resources.SubscriptionsSegment) == "" || rID.FindScope(resources.ResourceGroupsSegment) == "" { + if err != nil || rID.FindScope(resources_azure.ScopeSubscriptions) == "" || rID.FindScope(resources_azure.ScopeResourceGroups) == "" { return nil, fmt.Errorf("invalid environment Azure Provider scope: %s", cloudProvider.Azure.Scope) } } else { @@ -58,44 +58,42 @@ func MakeManagedIdentity(name string, cloudProvider *datamodel.Providers) (*rpv1 } return &rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, - Deployed: false, - Resource: map[string]string{ - handlers.UserAssignedIdentityNameKey: name, - handlers.UserAssignedIdentitySubscriptionID: rID.FindScope(resources.SubscriptionsSegment), - handlers.UserAssignedIdentityResourceGroup: rID.FindScope(resources.ResourceGroupsSegment), + LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + CreateResource: &rpv1.Resource{ + Data: map[string]string{ + handlers.UserAssignedIdentityNameKey: name, + handlers.UserAssignedIdentitySubscriptionID: rID.FindScope(resources_azure.ScopeSubscriptions), + handlers.UserAssignedIdentityResourceGroup: rID.FindScope(resources_azure.ScopeResourceGroups), + }, + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentity, + Provider: resourcemodel.ProviderAzure, + }, }, }, nil } // MakeRoleAssignments creates OutputResources and Dependencies for each roleName in the roleNames slice, and adds them to // the outputResources and deps slices respectively. -func MakeRoleAssignments(azResourceID string, roleNames []string) ([]rpv1.OutputResource, []rpv1.Dependency) { - deps := []rpv1.Dependency{} +func MakeRoleAssignments(azResourceID string, roleNames []string) ([]rpv1.OutputResource, []string) { + deps := []string{} outputResources := []rpv1.OutputResource{} for _, roleName := range roleNames { roleAssignment := rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.GenerateLocalIDForRoleAssignment(azResourceID, roleName), - Deployed: false, - Resource: map[string]string{ - handlers.RoleNameKey: roleName, - handlers.RoleAssignmentScope: azResourceID, - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + LocalID: rpv1.GenerateLocalIDForRoleAssignment(azResourceID, roleName), + CreateResource: &rpv1.Resource{ + Data: map[string]string{ + handlers.RoleNameKey: roleName, + handlers.RoleAssignmentScope: azResourceID, }, + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, + Provider: resourcemodel.ProviderAzure, + }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, } - deps = append(deps, rpv1.Dependency{LocalID: roleAssignment.LocalID}) + deps = append(deps, roleAssignment.LocalID) outputResources = append(outputResources, roleAssignment) } @@ -115,28 +113,25 @@ func MakeFederatedIdentity(name string, envOpt *renderers.EnvironmentOptions) (* subject := handlers.GetKubeAzureSubject(envOpt.Namespace, name) return &rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.LocalIDFederatedIdentity, - Deployed: false, - Resource: map[string]string{ - handlers.FederatedIdentityNameKey: name, - handlers.FederatedIdentitySubjectKey: subject, - handlers.FederatedIdentityIssuerKey: envOpt.Identity.OIDCIssuer, - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + LocalID: rpv1.LocalIDFederatedIdentity, + CreateResource: &rpv1.Resource{ + Data: map[string]string{ + handlers.FederatedIdentityNameKey: name, + handlers.FederatedIdentitySubjectKey: subject, + handlers.FederatedIdentityIssuerKey: envOpt.Identity.OIDCIssuer, }, + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential, + Provider: resourcemodel.ProviderAzure, + }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, }, nil } // TransformFederatedIdentitySA extracts the identity info from the request and adds it to the ServiceAccount annotations. func TransformFederatedIdentitySA(ctx context.Context, options *handlers.PutOptions) error { - sa, ok := options.Resource.Resource.(*corev1.ServiceAccount) + sa, ok := options.Resource.CreateResource.Data.(*corev1.ServiceAccount) if !ok { return errors.New("invalid output resource type") } @@ -196,17 +191,8 @@ func MakeFederatedIdentitySA(appName, name, namespace string, resource *datamode }, } - or := rpv1.NewKubernetesOutputResource( - resourcekinds.ServiceAccount, - rpv1.LocalIDServiceAccount, - sa, - sa.ObjectMeta) - - or.Dependencies = []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDFederatedIdentity, - }, - } + or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDServiceAccount, sa, sa.ObjectMeta) + or.CreateResource.Dependencies = []string{rpv1.LocalIDFederatedIdentity} return &or } diff --git a/pkg/corerp/renderers/container/azure/identity_test.go b/pkg/corerp/renderers/container/azure/identity_test.go index 0ff45f7153..ca2a38dd3f 100644 --- a/pkg/corerp/renderers/container/azure/identity_test.go +++ b/pkg/corerp/renderers/container/azure/identity_test.go @@ -25,9 +25,9 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/handlers" "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcekinds" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" @@ -63,16 +63,17 @@ func TestMakeManagedIdentity(t *testing.T) { or, err := MakeManagedIdentity("mi", provider) require.NoError(t, err) require.Equal(t, &rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, - Deployed: false, - Resource: map[string]string{ - handlers.UserAssignedIdentityNameKey: "mi", - handlers.UserAssignedIdentitySubscriptionID: "test-sub-id", - handlers.UserAssignedIdentityResourceGroup: "test-group", + LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentity, + Provider: resourcemodel.ProviderAzure, + }, + Data: map[string]string{ + handlers.UserAssignedIdentityNameKey: "mi", + handlers.UserAssignedIdentitySubscriptionID: "test-sub-id", + handlers.UserAssignedIdentityResourceGroup: "test-group", + }, }, }, or) }) @@ -89,17 +90,17 @@ func TestMakeRoleAssignments(t *testing.T) { require.Len(t, or, 2) require.Len(t, ra, 2) - require.Equal(t, rpv1.LocalIDUserAssignedManagedIdentity, or[0].Dependencies[0].LocalID) - require.Equal(t, rpv1.LocalIDUserAssignedManagedIdentity, or[1].Dependencies[0].LocalID) + require.Equal(t, rpv1.LocalIDUserAssignedManagedIdentity, or[0].CreateResource.Dependencies[0]) + require.Equal(t, rpv1.LocalIDUserAssignedManagedIdentity, or[1].CreateResource.Dependencies[0]) require.NotEqual(t, or[0].LocalID, or[1].LocalID) require.Equal(t, map[string]string{ handlers.RoleNameKey: "Role1", handlers.RoleAssignmentScope: miTestResource, - }, or[0].Resource) + }, or[0].CreateResource.Data) require.Equal(t, map[string]string{ handlers.RoleNameKey: "Role2", handlers.RoleAssignmentScope: miTestResource, - }, or[1].Resource) + }, or[1].CreateResource.Data) } func TestMakeFederatedIdentitySA(t *testing.T) { @@ -126,11 +127,11 @@ func TestMakeFederatedIdentitySA(t *testing.T) { // Transform outputresource err := TransformFederatedIdentitySA(context.Background(), putOptions) require.NoError(t, err) - sa := fi.Resource.(*corev1.ServiceAccount) + sa := fi.CreateResource.Data.(*corev1.ServiceAccount) require.Equal(t, sa.Annotations[azureWorkloadIdentityClientID], "newClientID") require.Equal(t, sa.Annotations[azureWorkloadIdentityTenantID], "newTenantID") - require.Equal(t, rpv1.LocalIDFederatedIdentity, fi.Dependencies[0].LocalID) + require.Equal(t, rpv1.LocalIDFederatedIdentity, fi.CreateResource.Dependencies[0]) } func TestTransformFederatedIdentitySA_Validation(t *testing.T) { @@ -175,7 +176,7 @@ func TestTransformFederatedIdentitySA_Validation(t *testing.T) { for _, tc := range tests { t.Run(tc.desc, func(t *testing.T) { err := TransformFederatedIdentitySA(context.Background(), &handlers.PutOptions{ - Resource: &rpv1.OutputResource{Resource: tc.resource}, + Resource: &rpv1.OutputResource{CreateResource: &rpv1.Resource{Data: tc.resource}}, DependencyProperties: tc.dep, }) @@ -209,11 +210,11 @@ func TestMakeFederatedIdentity(t *testing.T) { require.NoError(t, err) require.Equal(t, rpv1.LocalIDFederatedIdentity, or.LocalID) - require.Equal(t, rpv1.LocalIDUserAssignedManagedIdentity, or.Dependencies[0].LocalID) + require.Equal(t, rpv1.LocalIDUserAssignedManagedIdentity, or.CreateResource.Dependencies[0]) require.Equal(t, map[string]string{ handlers.FederatedIdentityNameKey: "fi", handlers.FederatedIdentitySubjectKey: "system:serviceaccount:default:fi", handlers.FederatedIdentityIssuerKey: "https://radiusoidc/00000000-0000-0000-0000-000000000000", - }, or.Resource) + }, or.CreateResource.Data) }) } diff --git a/pkg/corerp/renderers/container/azure/keyvaultvolume.go b/pkg/corerp/renderers/container/azure/keyvaultvolume.go index bf360ff712..cdaf7ebfe9 100644 --- a/pkg/corerp/renderers/container/azure/keyvaultvolume.go +++ b/pkg/corerp/renderers/container/azure/keyvaultvolume.go @@ -24,7 +24,6 @@ import ( "github.com/project-radius/radius/pkg/corerp/handlers" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -70,7 +69,7 @@ func MakeKeyVaultVolumeSpec(volumeName string, mountPath, spcName string) (corev // TransformSecretProviderClass updates the clientID and tenantID for azure workload identity. func TransformSecretProviderClass(ctx context.Context, options *handlers.PutOptions) error { - spc, ok := options.Resource.Resource.(*csiv1.SecretProviderClass) + spc, ok := options.Resource.CreateResource.Data.(*csiv1.SecretProviderClass) if !ok { return errors.New("cannot transform service account") } @@ -132,17 +131,8 @@ func MakeKeyVaultSecretProviderClass(appName, name string, res *datamodel.Volume }, } - or := rpv1.NewKubernetesOutputResource( - resourcekinds.SecretProviderClass, - rpv1.LocalIDSecretProviderClass, - secretProvider, - secretProvider.ObjectMeta) - - or.Dependencies = []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDServiceAccount, - }, - } + or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDSecretProviderClass, secretProvider, secretProvider.ObjectMeta) + or.CreateResource.Dependencies = []string{rpv1.LocalIDServiceAccount} return &or, nil diff --git a/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go b/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go index 9503a22353..4d11bce717 100644 --- a/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go +++ b/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go @@ -120,7 +120,7 @@ func TestMakeKeyVaultSecretProviderClass(t *testing.T) { if tc.err != nil { require.ErrorIs(t, tc.err, err) } else { - r := or.Resource.(*csiv1.SecretProviderClass) + r := or.CreateResource.Data.(*csiv1.SecretProviderClass) require.Equal(t, string(tc.identityKind), r.Annotations[kubernetes.AnnotationIdentityType]) require.Equal(t, tc.beforeParams, r.Spec.Parameters) diff --git a/pkg/corerp/renderers/container/rbac.go b/pkg/corerp/renderers/container/rbac.go index 3a29d95cfd..e23dbe06d6 100644 --- a/pkg/corerp/renderers/container/rbac.go +++ b/pkg/corerp/renderers/container/rbac.go @@ -22,7 +22,6 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -49,11 +48,7 @@ func makeRBACRole(appName, name, namespace string, resource *datamodel.Container }, } - or := rpv1.NewKubernetesOutputResource( - resourcekinds.KubernetesRole, - rpv1.LocalIDKubernetesRole, - role, - role.ObjectMeta) + or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDKubernetesRole, role, role.ObjectMeta) return &or } @@ -84,16 +79,8 @@ func makeRBACRoleBinding(appName, name, saName, namespace string, resource *data }, } - or := rpv1.NewKubernetesOutputResource( - resourcekinds.KubernetesRoleBinding, - rpv1.LocalIDKubernetesRoleBinding, - bindings, - bindings.ObjectMeta) + or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDKubernetesRoleBinding, bindings, bindings.ObjectMeta) - or.Dependencies = []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDKubernetesRole, - }, - } + or.CreateResource.Dependencies = []string{rpv1.LocalIDKubernetesRole} return &or } diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index fb7b18be1c..607119de6e 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -40,11 +40,12 @@ import ( azrenderer "github.com/project-radius/radius/pkg/corerp/renderers/container/azure" azvolrenderer "github.com/project-radius/radius/pkg/corerp/renderers/volume/azure" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" ) const ( @@ -111,7 +112,7 @@ func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface continue } - if resourceID.IsRadiusRPResource() { + if resources_radius.IsRadiusResource(resourceID) { radiusResourceIDs = append(radiusResourceIDs, resourceID) continue } @@ -130,7 +131,7 @@ func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface return nil, nil, v1.NewClientErrInvalidRequest(err.Error()) } - if resourceID.IsRadiusRPResource() { + if resources_radius.IsRadiusResource(resourceID) { radiusResourceIDs = append(radiusResourceIDs, resourceID) continue } @@ -144,7 +145,7 @@ func (r Renderer) GetDependencyIDs(ctx context.Context, dm v1.DataModelInterface return nil, nil, v1.NewClientErrInvalidRequest(err.Error()) } - if resourceID.IsRadiusRPResource() { + if resources_radius.IsRadiusResource(resourceID) { radiusResourceIDs = append(radiusResourceIDs, resourceID) continue } @@ -305,7 +306,7 @@ func (r Renderer) makeService(resource *datamodel.ContainerResource, options ren }, } - return rpv1.NewKubernetesOutputResource(resourcekinds.Service, rpv1.LocalIDService, service, service.ObjectMeta), nil + return rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta), nil } func (r Renderer) makeDeployment(ctx context.Context, applicationName string, options renderers.RenderOptions, computedValues map[string]rpv1.ComputedValueReference, resource *datamodel.ContainerResource, roles []rpv1.OutputResource) ([]rpv1.OutputResource, map[string][]byte, error) { @@ -397,7 +398,7 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op outputResources := []rpv1.OutputResource{} - deps := []rpv1.Dependency{} + deps := []string{} podLabels := kubernetes.MakeDescriptiveLabels(applicationName, resource.Name, resource.ResourceTypeName()) @@ -474,7 +475,7 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op return []rpv1.OutputResource{}, nil, err } outputResources = append(outputResources, *secretProvider) - deps = append(deps, rpv1.Dependency{LocalID: rpv1.LocalIDSecretProviderClass}) + deps = append(deps, rpv1.LocalIDSecretProviderClass) // Create volume spec which associated with secretProviderClass. volumeSpec, volumeMountSpec, err = azrenderer.MakeKeyVaultVolumeSpec(volumeName, volumeProperties.Persistent.MountPath, spcName) @@ -497,12 +498,8 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op if value.(string) == rpv1.LocalIDAzureFileShareStorageAccount { // The storage account was not created when the computed value was rendered // Lookup the actual storage account name from the local id - id := properties.OutputResources[value.(string)].Data.(resourcemodel.ARMIdentity).ID - r, err := resources.ParseResource(id) - if err != nil { - return []rpv1.OutputResource{}, nil, v1.NewClientErrInvalidRequest(err.Error()) - } - value = r.Name() + id := properties.OutputResources[value.(string)] + value = id.Name() } secretData[key] = []byte(value.(string)) } @@ -542,11 +539,11 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op // This is required to enable workload identity. podLabels[azrenderer.AzureWorkloadIdentityUseKey] = "true" - deps = append(deps, rpv1.Dependency{LocalID: rpv1.LocalIDServiceAccount}) + deps = append(deps, rpv1.LocalIDServiceAccount) // 4. Add RBAC resources to the dependencies. for _, role := range roles { - deps = append(deps, rpv1.Dependency{LocalID: role.LocalID}) + deps = append(deps, role.LocalID) } computedValues[handlers.IdentityProperties] = rpv1.ComputedValueReference{ @@ -593,11 +590,11 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op // Create the role and role bindings for SA. role := makeRBACRole(applicationName, kubeIdentityName, options.Environment.Namespace, resource) outputResources = append(outputResources, *role) - deps = append(deps, rpv1.Dependency{LocalID: rpv1.LocalIDKubernetesRole}) + deps = append(deps, rpv1.LocalIDKubernetesRole) roleBinding := makeRBACRoleBinding(applicationName, kubeIdentityName, serviceAccountName, options.Environment.Namespace, resource) outputResources = append(outputResources, *roleBinding) - deps = append(deps, rpv1.Dependency{LocalID: rpv1.LocalIDKubernetesRoleBinding}) + deps = append(deps, rpv1.LocalIDKubernetesRoleBinding) deployment := appsv1.Deployment{ TypeMeta: metav1.TypeMeta{ @@ -646,13 +643,11 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op if len(secretData) > 0 { hash := r.hashSecretData(secretData) deployment.Spec.Template.ObjectMeta.Annotations[kubernetes.AnnotationSecretHash] = hash - deps = append(deps, rpv1.Dependency{ - LocalID: rpv1.LocalIDSecret, - }) + deps = append(deps, rpv1.LocalIDSecret) } - deploymentOutput := rpv1.NewKubernetesOutputResource(resourcekinds.Deployment, rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta) - deploymentOutput.Dependencies = deps + deploymentOutput := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta) + deploymentOutput.CreateResource.Dependencies = deps outputResources = append(outputResources, deploymentOutput) return outputResources, secretData, nil @@ -818,8 +813,7 @@ func (r Renderer) makeSecret(ctx context.Context, resource datamodel.ContainerRe Data: secrets, } - // Skip registration of the secret resource with the HealthService since health as a concept is not quite applicable to it - output := rpv1.NewKubernetesOutputResource(resourcekinds.Secret, rpv1.LocalIDSecret, &secret, secret.ObjectMeta) + output := rpv1.NewKubernetesOutputResource(rpv1.LocalIDSecret, &secret, secret.ObjectMeta) return output } @@ -880,12 +874,10 @@ func (r Renderer) makeRoleAssignmentsForResource(ctx context.Context, connection return nil, v1.NewClientErrInvalidRequest(fmt.Sprintf("output resource %q was not found in the outputs of dependency %q", roleAssignmentData.LocalID, connection.Source)) } - // Now we know the resource ID to assign roles against. - arm, ok := target.Data.(resourcemodel.ARMIdentity) - if !ok { + if !resources_azure.IsAzureResource(target) { return nil, v1.NewClientErrInvalidRequest(fmt.Sprintf("output resource %q must be an ARM resource to support role assignments. Was: %+v", roleAssignmentData.LocalID, target)) } - armResourceIdentifier = arm.ID + armResourceIdentifier = target.String() roleNames = roleAssignmentData.RoleNames } @@ -894,20 +886,18 @@ func (r Renderer) makeRoleAssignmentsForResource(ctx context.Context, connection for _, roleName := range roleNames { localID := rpv1.GenerateLocalIDForRoleAssignment(armResourceIdentifier, roleName) roleAssignment := rpv1.OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: localID, - Deployed: false, - Resource: map[string]string{ - handlers.RoleNameKey: roleName, - handlers.RoleAssignmentScope: armResourceIdentifier, - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + + LocalID: localID, + CreateResource: &rpv1.Resource{ + Data: map[string]string{ + handlers.RoleNameKey: roleName, + handlers.RoleAssignmentScope: armResourceIdentifier, + }, + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, + Provider: resourcemodel.ProviderAzure, }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, } diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index b4920e6c34..4200a2fb21 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -27,18 +27,18 @@ import ( azrenderer "github.com/project-radius/radius/pkg/corerp/renderers/container/azure" azvolrenderer "github.com/project-radius/radius/pkg/corerp/renderers/volume/azure" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/test/testcontext" "github.com/google/uuid" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" ) @@ -103,7 +103,7 @@ func makeResource(t *testing.T, properties datamodel.ContainerProperties) *datam return &resource } -func makeResourceID(t *testing.T, resourceType string, resourceName string) resources.ID { +func makeAzureResourceID(t *testing.T, resourceType string, resourceName string) resources.ID { id, err := resources.ParseResource(resources.MakeRelativeID( []resources.ScopeSegment{ {Type: "subscriptions", Name: "test-subscription"}, @@ -117,19 +117,37 @@ func makeResourceID(t *testing.T, resourceType string, resourceName string) reso return id } +func makeRadiusResourceID(t *testing.T, resourceType string, resourceName string) resources.ID { + id, err := resources.ParseResource(resources.MakeRelativeID( + []resources.ScopeSegment{ + {Type: "radius", Name: "local"}, + {Type: "resourceGroups", Name: "test-resourcegroup"}, + }, + []resources.TypeSegment{ + { + Type: resourceType, + Name: resourceName, + }, + }, + nil)) + require.NoError(t, err) + + return id +} + func Test_GetDependencyIDs_Success(t *testing.T) { testStorageResourceID := "/subscriptions/test-sub-id/resourceGroups/test-rg/providers/Microsoft.Storage/storageaccounts/testaccount/fileservices/default/shares/testShareName" - testAzureResourceID := makeResourceID(t, "Microsoft.ServiceBus/namespaces", "testAzureResource") + testAzureResourceID := makeAzureResourceID(t, "Microsoft.ServiceBus/namespaces", "testAzureResource") properties := datamodel.ContainerProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ Application: applicationResourceID, }, Connections: map[string]datamodel.ConnectionProperties{ "A": { - Source: makeResourceID(t, "Applications.Core/httpRoutes", "A").String(), + Source: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A").String(), }, "B": { - Source: makeResourceID(t, "Applications.Core/httpRoutes", "B").String(), + Source: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "B").String(), IAM: datamodel.IAMProperties{ Kind: datamodel.KindHTTP, Roles: []string{"administrator"}, @@ -151,7 +169,7 @@ func Test_GetDependencyIDs_Success(t *testing.T) { Ports: map[string]datamodel.ContainerPort{ "web": { ContainerPort: 5000, - Provides: makeResourceID(t, "Applications.Core/httpRoutes", "C").String(), + Provides: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "C").String(), }, }, Volumes: map[string]datamodel.VolumeProperties{ @@ -178,9 +196,9 @@ func Test_GetDependencyIDs_Success(t *testing.T) { require.Len(t, azureResourceIDs, 1) expectedRadiusResourceIDs := []resources.ID{ - makeResourceID(t, "Applications.Core/httpRoutes", "A"), - makeResourceID(t, "Applications.Core/httpRoutes", "B"), - makeResourceID(t, "Applications.Core/httpRoutes", "C"), + makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A"), + makeRadiusResourceID(t, "Applications.Core/httpRoutes", "B"), + makeRadiusResourceID(t, "Applications.Core/httpRoutes", "C"), } require.ElementsMatch(t, expectedRadiusResourceIDs, radiusResourceIDs) @@ -277,15 +295,8 @@ func Test_Render_Basic(t *testing.T) { deployment, outputResource := kubernetes.FindDeployment(output.Resources) require.NotNil(t, deployment) - expected := rpv1.NewKubernetesOutputResource(resourcekinds.Deployment, rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) - expected.Dependencies = []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDKubernetesRole, - }, - { - LocalID: rpv1.LocalIDKubernetesRoleBinding, - }, - } + expected := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) + expected.CreateResource.Dependencies = []string{rpv1.LocalIDKubernetesRole, rpv1.LocalIDKubernetesRoleBinding} require.Equal(t, outputResource, expected) // Only real thing to verify here is the image and the labels @@ -312,7 +323,7 @@ func Test_Render_Basic(t *testing.T) { require.Equal(t, args, container.Args) require.Equal(t, "", container.WorkingDir) - expectedEnv := []v1.EnvVar{ + expectedEnv := []corev1.EnvVar{ {Name: envVarName1, Value: envVarValue1}, {Name: envVarName2, Value: envVarValue2}, } @@ -355,15 +366,8 @@ func Test_Render_WithCommandArgsWorkingDir(t *testing.T) { deployment, outputResource := kubernetes.FindDeployment(output.Resources) require.NotNil(t, deployment) - expected := rpv1.NewKubernetesOutputResource(resourcekinds.Deployment, rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) - expected.Dependencies = []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDKubernetesRole, - }, - { - LocalID: rpv1.LocalIDKubernetesRoleBinding, - }, - } + expected := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) + expected.CreateResource.Dependencies = []string{rpv1.LocalIDKubernetesRole, rpv1.LocalIDKubernetesRoleBinding} require.Equal(t, outputResource, expected) // Only real thing to verify here is the image and the labels @@ -381,7 +385,7 @@ func Test_Render_WithCommandArgsWorkingDir(t *testing.T) { require.Equal(t, []string{"arg1", "arg2"}, container.Args) require.Equal(t, "/some/path", container.WorkingDir) - expectedEnv := []v1.EnvVar{ + expectedEnv := []corev1.EnvVar{ {Name: envVarName1, Value: envVarValue1}, {Name: envVarName2, Value: envVarValue2}, } @@ -426,9 +430,9 @@ func Test_Render_PortWithoutRoute(t *testing.T) { require.Len(t, container.Ports, 1) port := container.Ports[0] - expected := v1.ContainerPort{ + expected := corev1.ContainerPort{ ContainerPort: 5000, - Protocol: v1.ProtocolTCP, + Protocol: corev1.ProtocolTCP, } require.Equal(t, expected, port) @@ -447,7 +451,7 @@ func Test_Render_PortConnectedToRoute(t *testing.T) { "web": { ContainerPort: 5000, Protocol: datamodel.ProtocolTCP, - Provides: makeResourceID(t, "Applications.Core/httpRoutes", "A").String(), + Provides: makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A").String(), }, }, }, @@ -480,12 +484,12 @@ func Test_Render_PortConnectedToRoute(t *testing.T) { require.Len(t, container.Ports, 1) port := container.Ports[0] - routeID := makeResourceID(t, "Applications.Core/httpRoutes", "A") + routeID := makeRadiusResourceID(t, "Applications.Core/httpRoutes", "A") - expected := v1.ContainerPort{ + expected := corev1.ContainerPort{ Name: kubernetes.GetShortenedTargetPortName("httpRoutes" + routeID.Name()), ContainerPort: 5000, - Protocol: v1.ProtocolTCP, + Protocol: corev1.ProtocolTCP, } require.Equal(t, expected, port) }) @@ -499,7 +503,7 @@ func Test_Render_Connections(t *testing.T) { }, Connections: map[string]datamodel.ConnectionProperties{ "A": { - Source: makeResourceID(t, "SomeProvider/ResourceType", "A").String(), + Source: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String(), IAM: datamodel.IAMProperties{ Kind: datamodel.KindHTTP, }, @@ -515,8 +519,8 @@ func Test_Render_Connections(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -544,12 +548,12 @@ func Test_Render_Connections(t *testing.T) { require.Equal(t, properties.Container.Image, container.Image) require.Empty(t, container.ImagePullPolicy) - expectedEnv := []v1.EnvVar{ + expectedEnv := []corev1.EnvVar{ { Name: "CONNECTION_A_COMPUTEDKEY1", - ValueFrom: &v1.EnvVarSource{ - SecretKeyRef: &v1.SecretKeySelector{ - LocalObjectReference: v1.LocalObjectReference{ + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ Name: secretName, }, Key: "CONNECTION_A_COMPUTEDKEY1", @@ -558,9 +562,9 @@ func Test_Render_Connections(t *testing.T) { }, { Name: "CONNECTION_A_COMPUTEDKEY2", - ValueFrom: &v1.EnvVarSource{ - SecretKeyRef: &v1.SecretKeySelector{ - LocalObjectReference: v1.LocalObjectReference{ + ValueFrom: &corev1.EnvVarSource{ + SecretKeyRef: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{ Name: secretName, }, Key: "CONNECTION_A_COMPUTEDKEY2", @@ -577,7 +581,7 @@ func Test_Render_Connections(t *testing.T) { secret, outputResource := kubernetes.FindSecret(output.Resources) require.NotNil(t, secret) - expectedOutputResource := rpv1.NewKubernetesOutputResource(resourcekinds.Secret, rpv1.LocalIDSecret, secret, secret.ObjectMeta) + expectedOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDSecret, secret, secret.ObjectMeta) require.Equal(t, outputResource, expectedOutputResource) require.Equal(t, secretName, secret.Name) @@ -600,7 +604,7 @@ func Test_RenderConnections_DisableDefaultEnvVars(t *testing.T) { }, Connections: map[string]datamodel.ConnectionProperties{ "A": { - Source: makeResourceID(t, "SomeProvider/ResourceType", "A").String(), + Source: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String(), DisableDefaultEnvVars: to.Ptr(true), IAM: datamodel.IAMProperties{ Kind: datamodel.KindHTTP, @@ -613,8 +617,8 @@ func Test_RenderConnections_DisableDefaultEnvVars(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -637,7 +641,7 @@ func Test_RenderConnections_DisableDefaultEnvVars(t *testing.T) { require.Equal(t, properties.Container.Image, container.Image) require.Empty(t, container.ImagePullPolicy) - expectedEnv := []v1.EnvVar{} + expectedEnv := []corev1.EnvVar{} require.Equal(t, expectedEnv, container.Env) } @@ -650,7 +654,7 @@ func Test_Render_Connections_SecretsGetHashed(t *testing.T) { }, Connections: map[string]datamodel.ConnectionProperties{ "A": { - Source: makeResourceID(t, "SomeProvider/ResourceType", "A").String(), + Source: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String(), IAM: datamodel.IAMProperties{ Kind: datamodel.KindHTTP, }, @@ -666,8 +670,8 @@ func Test_Render_Connections_SecretsGetHashed(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -689,7 +693,7 @@ func Test_Render_Connections_SecretsGetHashed(t *testing.T) { hash1 := deployment.Spec.Template.Annotations[kubernetes.AnnotationSecretHash] // Update and render again - dependencies[makeResourceID(t, "SomeProvider/ResourceType", "A").String()].ComputedValues["ComputedKey1"] = "new value" + dependencies[makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String()].ComputedValues["ComputedKey1"] = "new value" output, err = renderer.Render(ctx, resource, renderers.RenderOptions{Dependencies: dependencies, Environment: renderers.EnvironmentOptions{Namespace: "default"}}) require.NoError(t, err) @@ -709,7 +713,7 @@ func Test_Render_ConnectionWithRoleAssignment(t *testing.T) { }, Connections: map[string]datamodel.ConnectionProperties{ "A": { - Source: makeResourceID(t, "SomeProvider/ResourceType", "A").String(), + Source: makeAzureResourceID(t, "SomeProvider/ResourceType", "A").String(), IAM: datamodel.IAMProperties{ Kind: datamodel.KindHTTP, }, @@ -721,21 +725,15 @@ func Test_Render_ConnectionWithRoleAssignment(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeAzureResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeAzureResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, }, - OutputResources: map[string]resourcemodel.ResourceIdentity{ + OutputResources: map[string]resources.ID{ // This is the resource that the role assignments target! - "TargetLocalID": resourcemodel.NewARMIdentity( - &resourcemodel.ResourceType{ - Type: "dummy", - Provider: resourcemodel.ProviderAzure, - }, - makeResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), - "2020-01-01"), + "TargetLocalID": makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource"), }, }, } @@ -757,105 +755,98 @@ func Test_Render_ConnectionWithRoleAssignment(t *testing.T) { require.Empty(t, output.SecretValues) require.Len(t, output.Resources, 9) - resourceMap := outputResourcesToKindMap(output.Resources) + resourceMap := outputResourcesToResourceTypeMap(output.Resources) // We're just verifying the role assignments and related things, we'll ignore kubernetes types. - matches := resourceMap[resourcekinds.Deployment] + matches := resourceMap[resources_kubernetes.ResourceTypeDeployment] require.Equal(t, 1, len(matches)) - matches = resourceMap[resourcekinds.Secret] + matches = resourceMap[resources_kubernetes.ResourceTypeSecret] require.Equal(t, 1, len(matches)) - matches = resourceMap[resourcekinds.AzureRoleAssignment] + matches = resourceMap[resources_azure.ResourceTypeAuthorizationRoleAssignment] require.Equal(t, 2, len(matches)) expected := []rpv1.OutputResource{ { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.GenerateLocalIDForRoleAssignment(makeResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole1"), - Deployed: false, - Resource: map[string]string{ - handlers.RoleNameKey: "TestRole1", - handlers.RoleAssignmentScope: makeResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + LocalID: rpv1.GenerateLocalIDForRoleAssignment(makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole1"), + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, + Provider: resourcemodel.ProviderAzure, + }, + Data: map[string]string{ + handlers.RoleNameKey: "TestRole1", + handlers.RoleAssignmentScope: makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, }, { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.GenerateLocalIDForRoleAssignment(makeResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole2"), - Deployed: false, - Resource: map[string]string{ - handlers.RoleNameKey: "TestRole2", - handlers.RoleAssignmentScope: makeResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + LocalID: rpv1.GenerateLocalIDForRoleAssignment(makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole2"), + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, + Provider: resourcemodel.ProviderAzure, + }, + Data: map[string]string{ + handlers.RoleNameKey: "TestRole2", + handlers.RoleAssignmentScope: makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, }, } require.ElementsMatch(t, expected, matches) - matches = resourceMap[resourcekinds.AzureUserAssignedManagedIdentity] + matches = resourceMap[resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentity] require.Equal(t, 1, len(matches)) expected = []rpv1.OutputResource{ { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, - Deployed: false, - Resource: map[string]string{ - "userassignedidentityname": "test-app-test-container", - "userassignedidentitysubscriptionid": "00000000-0000-0000-0000-000000000000", - "userassignedidentityresourcegroup": "testGroup", + + LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentity, + Provider: resourcemodel.ProviderAzure, + }, + Data: map[string]string{ + "userassignedidentityname": "test-app-test-container", + "userassignedidentitysubscriptionid": "00000000-0000-0000-0000-000000000000", + "userassignedidentityresourcegroup": "testGroup", + }, }, }, } require.ElementsMatch(t, expected, matches) - matches = resourceMap[resourcekinds.AzureFederatedIdentity] + matches = resourceMap[resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential] require.Equal(t, 1, len(matches)) expected = []rpv1.OutputResource{ { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.LocalIDFederatedIdentity, - Deployed: false, - Resource: map[string]string{ - "federatedidentityname": "test-container", - "federatedidentitysubject": "system:serviceaccount:default:test-container", - "federatedidentityissuer": "https://radiusoidc/00000000-0000-0000-0000-000000000000", - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + LocalID: rpv1.LocalIDFederatedIdentity, + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential, + Provider: resourcemodel.ProviderAzure, }, + Data: map[string]string{ + "federatedidentityname": "test-container", + "federatedidentitysubject": "system:serviceaccount:default:test-container", + "federatedidentityissuer": "https://radiusoidc/00000000-0000-0000-0000-000000000000", + }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, }} require.ElementsMatch(t, expected, matches) - matches = resourceMap[resourcekinds.ServiceAccount] + matches = resourceMap[resources_kubernetes.ResourceTypeServiceAccount] require.Equal(t, 1, len(matches)) } func Test_Render_AzureConnection(t *testing.T) { - testARMID := makeResourceID(t, "SomeProvider/ResourceType", "test-azure-resource").String() + testARMID := makeAzureResourceID(t, "SomeProvider/ResourceType", "test-azure-resource").String() expectedRole := "administrator" properties := datamodel.ContainerProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ @@ -894,42 +885,40 @@ func Test_Render_AzureConnection(t *testing.T) { require.Empty(t, output.SecretValues) require.Len(t, output.Resources, 7) - kindResourceMap := outputResourcesToKindMap(output.Resources) + resourceMap := outputResourcesToResourceTypeMap(output.Resources) - _, ok := kindResourceMap[resourcekinds.Deployment] + _, ok := resourceMap[resources_kubernetes.ResourceTypeDeployment] require.Equal(t, true, ok) - roleOutputResource, ok := kindResourceMap[resourcekinds.AzureRoleAssignment] + roleOutputResource, ok := resourceMap[resources_azure.ResourceTypeAuthorizationRoleAssignment] require.Equal(t, true, ok) require.Len(t, roleOutputResource, 1) expected := []rpv1.OutputResource{ { - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - LocalID: rpv1.GenerateLocalIDForRoleAssignment(testARMID, expectedRole), - Deployed: false, - Resource: map[string]string{ - handlers.RoleNameKey: expectedRole, - handlers.RoleAssignmentScope: testARMID, - }, - Dependencies: []rpv1.Dependency{ - { - LocalID: rpv1.LocalIDUserAssignedManagedIdentity, + + LocalID: rpv1.GenerateLocalIDForRoleAssignment(testARMID, expectedRole), + CreateResource: &rpv1.Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, + Provider: resourcemodel.ProviderAzure, + }, + Data: map[string]string{ + handlers.RoleNameKey: expectedRole, + handlers.RoleAssignmentScope: testARMID, }, + Dependencies: []string{rpv1.LocalIDUserAssignedManagedIdentity}, }, }, } require.ElementsMatch(t, expected, roleOutputResource) - require.Len(t, kindResourceMap[resourcekinds.AzureUserAssignedManagedIdentity], 1) - require.Len(t, kindResourceMap[resourcekinds.AzureFederatedIdentity], 1) - require.Len(t, kindResourceMap[resourcekinds.ServiceAccount], 1) + require.Len(t, resourceMap[resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentity], 1) + require.Len(t, resourceMap[resources_azure.ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential], 1) + require.Len(t, resourceMap[resources_kubernetes.ResourceTypeServiceAccount], 1) } func Test_Render_AzureConnectionEmptyRoleAllowed(t *testing.T) { - testARMID := makeResourceID(t, "SomeProvider/ResourceType", "test-azure-resource").String() + testARMID := makeAzureResourceID(t, "SomeProvider/ResourceType", "test-azure-resource").String() properties := datamodel.ContainerProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ Application: applicationResourceID, @@ -987,8 +976,8 @@ func Test_Render_EphemeralVolumes(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeRadiusResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeRadiusResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{}, }, } @@ -1010,19 +999,19 @@ func Test_Render_EphemeralVolumes(t *testing.T) { volumes := deployment.Spec.Template.Spec.Volumes - expectedVolumeMounts := []v1.VolumeMount{ + expectedVolumeMounts := []corev1.VolumeMount{ { Name: tempVolName, MountPath: tempVolMountPath, }, } - expectedVolumes := []v1.Volume{ + expectedVolumes := []corev1.Volume{ { Name: tempVolName, - VolumeSource: v1.VolumeSource{ - EmptyDir: &v1.EmptyDirVolumeSource{ - Medium: v1.StorageMediumMemory, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{ + Medium: corev1.StorageMediumMemory, }, }, }, @@ -1093,7 +1082,7 @@ func Test_Render_PersistentAzureFileShareVolumes(t *testing.T) { require.NotEmpty(t, secretResource) // Verify deployment - volumes := deploymentResource.Resource.(*appsv1.Deployment).Spec.Template.Spec.Volumes + volumes := deploymentResource.CreateResource.Data.(*appsv1.Deployment).Spec.Template.Spec.Volumes require.Lenf(t, volumes, 1, "expected 1 volume, instead got %+v", len(volumes)) require.Equal(t, tempVolName, volumes[0].Name) require.NotNil(t, volumes[0].VolumeSource.AzureFile, "expected volumesource azurefile to be not nil") @@ -1101,7 +1090,7 @@ func Test_Render_PersistentAzureFileShareVolumes(t *testing.T) { require.Equal(t, volumes[0].VolumeSource.AzureFile.ShareName, testShareName) // Verify Kubernetes secret - secret := secretResource.Resource.(*v1.Secret) + secret := secretResource.CreateResource.Data.(*corev1.Secret) require.Lenf(t, secret.Data, 2, "expected 2 secret key-value pairs, instead got %+v", len(secret.Data)) require.NoError(t, err) } @@ -1159,19 +1148,13 @@ func Test_Render_PersistentAzureKeyVaultVolumes(t *testing.T) { ComputedValues: map[string]any{ azvolrenderer.SPCVolumeObjectSpecKey: "objectspecs", }, - OutputResources: map[string]resourcemodel.ResourceIdentity{ - rpv1.LocalIDSecretProviderClass: { - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.SecretProviderClass, - Provider: resourcemodel.ProviderKubernetes, - }, - Data: resourcemodel.KubernetesIdentity{ - Kind: "SecretProviderClass", - APIVersion: "secrets-store.csi.x-k8s.io/v1alpha1", - Name: testVolName, - Namespace: "test-ns", - }, - }, + OutputResources: map[string]resources.ID{ + rpv1.LocalIDSecretProviderClass: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "secrets-store.csi.x-k8s.io", + "SecretProviderClass", + "test-ns", + testVolName), }, }, } @@ -1186,19 +1169,19 @@ func Test_Render_PersistentAzureKeyVaultVolumes(t *testing.T) { // Verify deployment deploymentSpec := renderOutput.Resources[7] require.Equal(t, rpv1.LocalIDDeployment, deploymentSpec.LocalID, "expected output resource of kind deployment instead got :%v", renderOutput.Resources[0].LocalID) - require.Contains(t, deploymentSpec.Dependencies[0].LocalID, "RoleAssignment") - require.Equal(t, deploymentSpec.Dependencies[1].LocalID, "SecretProviderClass") - require.Equal(t, deploymentSpec.Dependencies[2].LocalID, "ServiceAccount") - require.Equal(t, deploymentSpec.Dependencies[3].LocalID, "KubernetesRole") - require.Equal(t, deploymentSpec.Dependencies[4].LocalID, "KubernetesRoleBinding") - require.Equal(t, deploymentSpec.Dependencies[5].LocalID, "Secret") + require.Contains(t, deploymentSpec.CreateResource.Dependencies[0], "RoleAssignment") + require.Equal(t, deploymentSpec.CreateResource.Dependencies[1], "SecretProviderClass") + require.Equal(t, deploymentSpec.CreateResource.Dependencies[2], "ServiceAccount") + require.Equal(t, deploymentSpec.CreateResource.Dependencies[3], "KubernetesRole") + require.Equal(t, deploymentSpec.CreateResource.Dependencies[4], "KubernetesRoleBinding") + require.Equal(t, deploymentSpec.CreateResource.Dependencies[5], "Secret") // Verify pod template - podTemplate := deploymentSpec.Resource.(*appsv1.Deployment).Spec.Template + podTemplate := deploymentSpec.CreateResource.Data.(*appsv1.Deployment).Spec.Template require.Equal(t, "true", podTemplate.ObjectMeta.Labels[azrenderer.AzureWorkloadIdentityUseKey]) // Verify volume spec - volumes := deploymentSpec.Resource.(*appsv1.Deployment).Spec.Template.Spec.Volumes + volumes := deploymentSpec.CreateResource.Data.(*appsv1.Deployment).Spec.Template.Spec.Volumes require.Lenf(t, volumes, 1, "expected 1 volume, instead got %+v", len(volumes)) require.Equal(t, tempVolName, volumes[0].Name) require.Equal(t, "secrets-store.csi.k8s.io", volumes[0].VolumeSource.CSI.Driver, "expected volumesource azurefile to be not nil") @@ -1206,19 +1189,20 @@ func Test_Render_PersistentAzureKeyVaultVolumes(t *testing.T) { require.Equal(t, true, *volumes[0].VolumeSource.CSI.ReadOnly, "expected readonly attribute to be true") // Verify volume mount spec - volumeMounts := deploymentSpec.Resource.(*appsv1.Deployment).Spec.Template.Spec.Containers[0].VolumeMounts + volumeMounts := deploymentSpec.CreateResource.Data.(*appsv1.Deployment).Spec.Template.Spec.Containers[0].VolumeMounts require.Lenf(t, volumeMounts, 1, "expected 1 volume mount, instead got %+v", len(volumeMounts)) require.Equal(t, tempVolMountPath, volumeMounts[0].MountPath) require.Equal(t, tempVolName, volumeMounts[0].Name) require.Equal(t, true, volumeMounts[0].ReadOnly) } -func outputResourcesToKindMap(resources []rpv1.OutputResource) map[string][]rpv1.OutputResource { +func outputResourcesToResourceTypeMap(resources []rpv1.OutputResource) map[string][]rpv1.OutputResource { results := map[string][]rpv1.OutputResource{} for _, resource := range resources { - matches := results[resource.ResourceType.Type] + resourceType := resource.GetResourceType() + matches := results[resourceType.Type] matches = append(matches, resource) - results[resource.ResourceType.Type] = matches + results[resourceType.Type] = matches } return results @@ -1253,8 +1237,8 @@ func Test_Render_ReadinessProbeHttpGet(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeAzureResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeAzureResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -1278,16 +1262,16 @@ func Test_Render_ReadinessProbeHttpGet(t *testing.T) { container := deployment.Spec.Template.Spec.Containers[0] require.Equal(t, resourceName, container.Name) - expectedReadinessProbe := &v1.Probe{ + expectedReadinessProbe := &corev1.Probe{ InitialDelaySeconds: 30, FailureThreshold: 10, PeriodSeconds: 2, TimeoutSeconds: 5, - ProbeHandler: v1.ProbeHandler{ - HTTPGet: &v1.HTTPGetAction{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ Path: "/healthz", Port: intstr.FromInt(8080), - HTTPHeaders: []v1.HTTPHeader{ + HTTPHeaders: []corev1.HTTPHeader{ { Name: "header1", Value: "value1", @@ -1330,8 +1314,8 @@ func Test_Render_ReadinessProbeTcp(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeAzureResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeAzureResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -1355,14 +1339,14 @@ func Test_Render_ReadinessProbeTcp(t *testing.T) { container := deployment.Spec.Template.Spec.Containers[0] require.Equal(t, resourceName, container.Name) - expectedReadinessProbe := &v1.Probe{ + expectedReadinessProbe := &corev1.Probe{ InitialDelaySeconds: 30, FailureThreshold: 10, PeriodSeconds: 2, TimeoutSeconds: 5, - ProbeHandler: v1.ProbeHandler{ + ProbeHandler: corev1.ProbeHandler{ HTTPGet: nil, - TCPSocket: &v1.TCPSocketAction{ + TCPSocket: &corev1.TCPSocketAction{ Port: intstr.FromInt(8080), }, Exec: nil, @@ -1400,8 +1384,8 @@ func Test_Render_LivenessProbeExec(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeAzureResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeAzureResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -1425,15 +1409,15 @@ func Test_Render_LivenessProbeExec(t *testing.T) { container := deployment.Spec.Template.Spec.Containers[0] require.Equal(t, resourceName, container.Name) - expectedLivenessProbe := &v1.Probe{ + expectedLivenessProbe := &corev1.Probe{ InitialDelaySeconds: 30, FailureThreshold: 10, PeriodSeconds: 2, TimeoutSeconds: 5, - ProbeHandler: v1.ProbeHandler{ + ProbeHandler: corev1.ProbeHandler{ HTTPGet: nil, TCPSocket: nil, - Exec: &v1.ExecAction{ + Exec: &corev1.ExecAction{ Command: []string{"a", "b", "c"}, }, }, @@ -1460,8 +1444,8 @@ func Test_Render_LivenessProbeWithDefaults(t *testing.T) { } resource := makeResource(t, properties) dependencies := map[string]renderers.RendererDependency{ - (makeResourceID(t, "SomeProvider/ResourceType", "A").String()): { - ResourceID: makeResourceID(t, "SomeProvider/ResourceType", "A"), + (makeAzureResourceID(t, "SomeProvider/ResourceType", "A").String()): { + ResourceID: makeAzureResourceID(t, "SomeProvider/ResourceType", "A"), ComputedValues: map[string]any{ "ComputedKey1": "ComputedValue1", "ComputedKey2": 82, @@ -1485,16 +1469,16 @@ func Test_Render_LivenessProbeWithDefaults(t *testing.T) { container := deployment.Spec.Template.Spec.Containers[0] require.Equal(t, resourceName, container.Name) - expectedLivenessProbe := &v1.Probe{ + expectedLivenessProbe := &corev1.Probe{ // Aligining with Kubernetes defaults InitialDelaySeconds: DefaultInitialDelaySeconds, FailureThreshold: DefaultFailureThreshold, PeriodSeconds: DefaultPeriodSeconds, TimeoutSeconds: DefaultTimeoutSeconds, - ProbeHandler: v1.ProbeHandler{ + ProbeHandler: corev1.ProbeHandler{ HTTPGet: nil, TCPSocket: nil, - Exec: &v1.ExecAction{ + Exec: &corev1.ExecAction{ Command: []string{"a", "b", "c"}, }, }, @@ -1571,7 +1555,7 @@ func Test_DNS_Service_Generation(t *testing.T) { require.Len(t, output.ComputedValues, 0) service, outputResource := kubernetes.FindService(output.Resources) - expectedOutputResource := rpv1.NewKubernetesOutputResource(resourcekinds.Service, rpv1.LocalIDService, service, service.ObjectMeta) + expectedOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta) require.Equal(t, expectedOutputResource, outputResource) require.Equal(t, kubernetes.NormalizeResourceName(resource.Name), service.Name) diff --git a/pkg/corerp/renderers/daprextension/renderer.go b/pkg/corerp/renderers/daprextension/renderer.go index fb6a32638f..165618fd30 100644 --- a/pkg/corerp/renderers/daprextension/renderer.go +++ b/pkg/corerp/renderers/daprextension/renderer.go @@ -72,12 +72,13 @@ func (r *Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options // the desired annotations. for i := range output.Resources { - if output.Resources[i].ResourceType.Provider != resourcemodel.ProviderKubernetes { + resourceType := output.Resources[i].GetResourceType() + if resourceType.Provider != resourcemodel.ProviderKubernetes { // Not a Kubernetes resource continue } - o, ok := output.Resources[i].Resource.(runtime.Object) + o, ok := output.Resources[i].CreateResource.Data.(runtime.Object) if !ok { return renderers.RendererOutput{}, errors.New("found Kubernetes resource with non-Kubernetes payload") } diff --git a/pkg/corerp/renderers/daprextension/renderer_test.go b/pkg/corerp/renderers/daprextension/renderer_test.go index 387fb3a256..f330f910dd 100644 --- a/pkg/corerp/renderers/daprextension/renderer_test.go +++ b/pkg/corerp/renderers/daprextension/renderer_test.go @@ -25,10 +25,10 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" ) @@ -45,12 +45,14 @@ func (r *noop) Render(ctx context.Context, dm v1.DataModelInterface, options ren deployment := appsv1.Deployment{} deploymentResource := rpv1.OutputResource{ - Resource: &deployment, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Deployment, - Provider: resourcemodel.ProviderKubernetes, - }, LocalID: rpv1.LocalIDDeployment, + CreateResource: &rpv1.Resource{ + Data: &deployment, + ResourceType: resourcemodel.ResourceType{ + Type: resources_kubernetes.ResourceTypeDeployment, + Provider: resourcemodel.ProviderKubernetes, + }, + }, } output := renderers.RendererOutput{ diff --git a/pkg/corerp/renderers/gateway/render.go b/pkg/corerp/renderers/gateway/render.go index 1acc2c1d72..b9464696cb 100644 --- a/pkg/corerp/renderers/gateway/render.go +++ b/pkg/corerp/renderers/gateway/render.go @@ -32,9 +32,9 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" ) type Renderer struct { @@ -180,19 +180,14 @@ func MakeGateway(ctx context.Context, options renderers.RenderOptions, gateway * return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("secretStore resource %s not found", secretStoreResourceId)) } - secretResource := secretStoreResource.OutputResources[rpv1.LocalIDSecret].Data - secretResourceData, ok := secretResource.(map[string]any) + secretResourceID, ok := secretStoreResource.OutputResources[rpv1.LocalIDSecret] if !ok { return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("secretStore resource %s not found", secretStoreResourceId)) } - secretName, ok := secretResourceData["name"] - if !ok { - return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("secretStore resource %s not found", secretStoreResourceId)) - } - - secretNamespace, ok := secretResourceData["namespace"] - if !ok { + secretName := secretResourceID.Name() + secretNamespace := secretResourceID.FindScope(resources_kubernetes.ScopeNamespaces) + if secretNamespace == "" { return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("secretStore resource %s not found", secretStoreResourceId)) } @@ -294,7 +289,7 @@ func MakeGateway(ctx context.Context, options renderers.RenderOptions, gateway * rootHTTPProxy.Spec.TCPProxy = tcpProxy } - return rpv1.NewKubernetesOutputResource(resourcekinds.Gateway, rpv1.LocalIDGateway, rootHTTPProxy, rootHTTPProxy.ObjectMeta), nil + return rpv1.NewKubernetesOutputResource(rpv1.LocalIDGateway, rootHTTPProxy, rootHTTPProxy.ObjectMeta), nil } // MakeHttpRoutes creates HTTPProxy objects for each route in the gateway and returns them as OutputResources. It returns @@ -396,7 +391,7 @@ func MakeHttpRoutes(ctx context.Context, options renderers.RenderOptions, resour var outputResources []rpv1.OutputResource for localID, object := range objects { - outputResources = append(outputResources, rpv1.NewKubernetesOutputResource(resourcekinds.KubernetesHTTPRoute, localID, object, object.ObjectMeta)) + outputResources = append(outputResources, rpv1.NewKubernetesOutputResource(localID, object, object.ObjectMeta)) } return outputResources, nil diff --git a/pkg/corerp/renderers/gateway/render_test.go b/pkg/corerp/renderers/gateway/render_test.go index 5da0fea925..62d28e2622 100644 --- a/pkg/corerp/renderers/gateway/render_test.go +++ b/pkg/corerp/renderers/gateway/render_test.go @@ -26,11 +26,10 @@ import ( "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/corerp/renderers/httproute" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/test/testcontext" contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" "github.com/stretchr/testify/require" @@ -150,7 +149,7 @@ func Test_Render_WithIPAndNoHostname(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithIPAndPrefix(t *testing.T) { @@ -185,7 +184,7 @@ func Test_Render_WithIPAndPrefix(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithIPAndFQHostname(t *testing.T) { @@ -218,7 +217,7 @@ func Test_Render_WithIPAndFQHostname(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithFQHostname_OverridesPrefix(t *testing.T) { @@ -253,7 +252,7 @@ func Test_Render_WithFQHostname_OverridesPrefix(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_PublicEndpointOverride(t *testing.T) { @@ -281,7 +280,7 @@ func Test_Render_PublicEndpointOverride(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_PublicEndpointOverride_OverridesAll(t *testing.T) { @@ -314,7 +313,7 @@ func Test_Render_PublicEndpointOverride_OverridesAll(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_PublicEndpointOverride_WithEmptyIP(t *testing.T) { @@ -344,7 +343,7 @@ func Test_Render_PublicEndpointOverride_WithEmptyIP(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_LocalhostPublicEndpointOverride(t *testing.T) { @@ -374,7 +373,7 @@ func Test_Render_LocalhostPublicEndpointOverride(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname(t *testing.T) { @@ -403,7 +402,7 @@ func Test_Render_Hostname(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname_WithPort(t *testing.T) { @@ -433,7 +432,7 @@ func Test_Render_Hostname_WithPort(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname_WithPrefix(t *testing.T) { @@ -467,7 +466,7 @@ func Test_Render_Hostname_WithPrefix(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Hostname_WithPrefixAndPort(t *testing.T) { @@ -501,7 +500,7 @@ func Test_Render_Hostname_WithPrefixAndPort(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_WithMissingPublicIP(t *testing.T) { @@ -532,7 +531,7 @@ func Test_Render_WithMissingPublicIP(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Fails_SSLPassthroughWithRoutePath(t *testing.T) { @@ -659,7 +658,7 @@ func Test_Render_FQDNOverride(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_Render_Fails_WithoutFQHostnameOrPrefix(t *testing.T) { @@ -731,7 +730,7 @@ func Test_Render_Single_Route(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") validateHttpRoute(t, output.Resources, routeName, 80, nil, "") } @@ -804,7 +803,7 @@ func Test_Render_SSLPassthrough(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") validateHttpRoute(t, output.Resources, routeName, 80, nil, "") } @@ -872,7 +871,7 @@ func Test_Render_Multiple_Routes(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") validateHttpRoute(t, output.Resources, routeAName, 80, nil, "") validateHttpRoute(t, output.Resources, routeBName, 80, nil, "") } @@ -927,7 +926,7 @@ func Test_Render_Route_WithPrefixRewrite(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") expectedPathRewritePolicy := &contourv1.PathRewritePolicy{ ReplacePrefix: []contourv1.ReplacePrefix{ @@ -1036,7 +1035,7 @@ func Test_Render_Route_WithMultiplePrefixRewrite(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") expectedPathRewritePolicy := &contourv1.PathRewritePolicy{ ReplacePrefix: []contourv1.ReplacePrefix{ @@ -1115,7 +1114,7 @@ func Test_Render_WithDependencies(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") validateHttpRoute(t, output.Resources, routeName, httpRoutePort, nil, "") } @@ -1167,7 +1166,7 @@ func Test_Render_WithEnvironment_KubernetesMetadata(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, envKubeMetadata) + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envKubeMetadata) validateHttpRoute(t, output.Resources, routeName, 80, nil, envKubeMetadata) } @@ -1220,7 +1219,7 @@ func Test_Render_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) validateHttpRoute(t, output.Resources, routeName, 80, nil, envAppKubeMetadata) } @@ -1275,7 +1274,7 @@ func Test_RenderDNS_WithEnvironmentApplication_KubernetesMetadata(t *testing.T) Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envAppKubeMetadata) } func Test_RenderDNS_WithEnvironment_KubernetesMetadata(t *testing.T) { @@ -1328,7 +1327,7 @@ func Test_RenderDNS_WithEnvironment_KubernetesMetadata(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, envKubeMetadata) + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, envKubeMetadata) } func Test_Render_With_TLSTermination(t *testing.T) { @@ -1365,19 +1364,13 @@ func Test_Render_With_TLSTermination(t *testing.T) { }, }, }, - OutputResources: map[string]resourcemodel.ResourceIdentity{ - "Secret": { - ResourceType: &resourcemodel.ResourceType{ - Type: "Secret", - Provider: "kubernetes", - }, - Data: map[string]any{ - "kind": "Secret", - "apiVersion": "v1", - "name": secretName, - "namespace": environmentOptions.Namespace, - }, - }, + OutputResources: map[string]resources.ID{ + "Secret": resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + "Secret", + environmentOptions.Namespace, + secretName), }, }, } @@ -1403,7 +1396,7 @@ func Test_Render_With_TLSTermination(t *testing.T) { Includes: expectedIncludes, } - validateGateway(t, output.Resources, expectedGatewaySpec, "") + validateHTTPProxy(t, output.Resources, expectedGatewaySpec, "") } func Test_ParseURL(t *testing.T) { @@ -1469,27 +1462,27 @@ func Test_IsURL(t *testing.T) { require.True(t, isURL(valid_default_https_url)) } -func validateGateway(t *testing.T, outputResources []rpv1.OutputResource, expectedGatewaySpec *contourv1.HTTPProxySpec, kmeOption string) { - gateway, gatewayOutputResource := kubernetes.FindGateway(outputResources) +func validateHTTPProxy(t *testing.T, outputResources []rpv1.OutputResource, expectedHTTPProxySpec *contourv1.HTTPProxySpec, kmeOption string) { + httpProxy, httpProxyOutputResource := kubernetes.FindContourHTTPProxy(outputResources) - expectedGatewayOutputResource := rpv1.NewKubernetesOutputResource(resourcekinds.Gateway, rpv1.LocalIDGateway, gateway, gateway.ObjectMeta) - require.Equal(t, expectedGatewayOutputResource, gatewayOutputResource) - require.Equal(t, kubernetes.NormalizeResourceName(resourceName), gateway.Name) - require.Equal(t, applicationName, gateway.Namespace) + expectedHTTPProxyOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDGateway, httpProxy, httpProxy.ObjectMeta) + require.Equal(t, expectedHTTPProxyOutputResource, httpProxyOutputResource) + require.Equal(t, kubernetes.NormalizeResourceName(resourceName), httpProxy.Name) + require.Equal(t, applicationName, httpProxy.Namespace) if !(kmeOption == envKubeMetadata || kmeOption == envAppKubeMetadata) { - require.Equal(t, kubernetes.MakeDescriptiveLabels(applicationName, resourceName, ResourceType), gateway.Labels) + require.Equal(t, kubernetes.MakeDescriptiveLabels(applicationName, resourceName, ResourceType), httpProxy.Labels) } else { - require.Equal(t, getExpectedMaps(true, kmeOption).metaAnn, gateway.Annotations) - require.Equal(t, getExpectedMaps(true, kmeOption).metaLbl, gateway.Labels) + require.Equal(t, getExpectedMaps(true, kmeOption).metaAnn, httpProxy.Annotations) + require.Equal(t, getExpectedMaps(true, kmeOption).metaLbl, httpProxy.Labels) } - require.Equal(t, expectedGatewaySpec, &gateway.Spec) + require.Equal(t, expectedHTTPProxySpec, &httpProxy.Spec) } func validateHttpRoute(t *testing.T, outputResources []rpv1.OutputResource, expectedRouteName string, expectedPort int32, expectedRewrite *contourv1.PathRewritePolicy, kmeOption string) { expectedLocalID := fmt.Sprintf("%s-%s", rpv1.LocalIDHttpRoute, expectedRouteName) - httpRoute, httpRouteOutputResource := kubernetes.FindHttpRouteByLocalID(outputResources, expectedLocalID) - expectedHttpRouteOutputResource := rpv1.NewKubernetesOutputResource(resourcekinds.KubernetesHTTPRoute, expectedLocalID, httpRoute, httpRoute.ObjectMeta) + httpRoute, httpRouteOutputResource := kubernetes.FindContourHTTPProxyByLocalID(outputResources, expectedLocalID) + expectedHttpRouteOutputResource := rpv1.NewKubernetesOutputResource(expectedLocalID, httpRoute, httpRoute.ObjectMeta) require.Equal(t, expectedHttpRouteOutputResource, httpRouteOutputResource) require.Equal(t, kubernetes.NormalizeResourceName(expectedRouteName), httpRoute.Name) require.Equal(t, applicationName, httpRoute.Namespace) diff --git a/pkg/corerp/renderers/httproute/render.go b/pkg/corerp/renderers/httproute/render.go index c4924d8e63..41fb9315f8 100644 --- a/pkg/corerp/renderers/httproute/render.go +++ b/pkg/corerp/renderers/httproute/render.go @@ -29,7 +29,6 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" ) @@ -117,5 +116,5 @@ func (r *Renderer) makeService(ctx context.Context, route *datamodel.HTTPRoute, }, } - return rpv1.NewKubernetesOutputResource(resourcekinds.Service, rpv1.LocalIDService, service, service.ObjectMeta), nil + return rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta), nil } diff --git a/pkg/corerp/renderers/httproute/render_test.go b/pkg/corerp/renderers/httproute/render_test.go index aed461b8ec..635a7bd1f1 100644 --- a/pkg/corerp/renderers/httproute/render_test.go +++ b/pkg/corerp/renderers/httproute/render_test.go @@ -25,7 +25,6 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/test/testcontext" @@ -155,7 +154,7 @@ func TestHTTPRouteRenderer(t *testing.T) { require.Equal(t, expectedValues, output.ComputedValues) service, outputResource := kubernetes.FindService(output.Resources) - expectedOutputResource := rpv1.NewKubernetesOutputResource(resourcekinds.Service, rpv1.LocalIDService, service, service.ObjectMeta) + expectedOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta) require.Equal(t, expectedOutputResource, outputResource) require.Equal(t, kubernetes.NormalizeResourceName(resource.Name), service.Name) diff --git a/pkg/corerp/renderers/kubernetesmetadata/render.go b/pkg/corerp/renderers/kubernetesmetadata/render.go index 31ac749542..f773bc53c7 100644 --- a/pkg/corerp/renderers/kubernetesmetadata/render.go +++ b/pkg/corerp/renderers/kubernetesmetadata/render.go @@ -66,12 +66,13 @@ func (r *Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options } for _, ores := range output.Resources { - if ores.ResourceType.Provider != resourcemodel.ProviderKubernetes { + resourceType := ores.GetResourceType() + if resourceType.Provider != resourcemodel.ProviderKubernetes { // Not a Kubernetes resource continue } - dep, ok := ores.Resource.(*appsv1.Deployment) + dep, ok := ores.CreateResource.Data.(*appsv1.Deployment) if !ok { continue } diff --git a/pkg/corerp/renderers/kubernetesmetadata/render_test.go b/pkg/corerp/renderers/kubernetesmetadata/render_test.go index 82ce341b4a..19ee99fb57 100644 --- a/pkg/corerp/renderers/kubernetesmetadata/render_test.go +++ b/pkg/corerp/renderers/kubernetesmetadata/render_test.go @@ -9,9 +9,9 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" @@ -33,13 +33,22 @@ func (r *noop) GetDependencyIDs(ctx context.Context, resource v1.DataModelInterf func (r *noop) Render(ctx context.Context, dm v1.DataModelInterface, options renderers.RenderOptions) (renderers.RendererOutput, error) { // Return a deployment so the kubernetes metadata extension renderer can modify it - deployment := appsv1.Deployment{} + deployment := appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + }, + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + } // Populate Meta labels with existing values deployment.Annotations = map[string]string{"prior.MetaAnnotation1": "prior.MetaAnnotationVal1", "prior.MetaAnnotation2": "prior.MetaAnnotationVal2"} deployment.Labels = map[string]string{"prior.MetaLabel1": "prior.MetaLabelVal1", "prior.MetaLabel2": "prior.MetaLabelVal2"} - resources := []rpv1.OutputResource{rpv1.NewKubernetesOutputResource(resourcekinds.Deployment, rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta)} + resources := []rpv1.OutputResource{rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta)} return renderers.RendererOutput{Resources: resources}, nil } diff --git a/pkg/corerp/renderers/manualscale/render.go b/pkg/corerp/renderers/manualscale/render.go index ff2b985aae..fae681c9b7 100644 --- a/pkg/corerp/renderers/manualscale/render.go +++ b/pkg/corerp/renderers/manualscale/render.go @@ -59,11 +59,12 @@ func (r *Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options switch e.Kind { case datamodel.ManualScaling: for _, ores := range output.Resources { - if ores.ResourceType.Provider != resourcemodel.ProviderKubernetes { + resourceType := ores.GetResourceType() + if resourceType.Provider != resourcemodel.ProviderKubernetes { // Not a Kubernetes resource continue } - o, ok := ores.Resource.(runtime.Object) + o, ok := ores.CreateResource.Data.(runtime.Object) if !ok { return renderers.RendererOutput{}, errors.New("found Kubernetes resource with non-Kubernetes payload") } diff --git a/pkg/corerp/renderers/manualscale/render_test.go b/pkg/corerp/renderers/manualscale/render_test.go index 4811715f03..28e256201e 100644 --- a/pkg/corerp/renderers/manualscale/render_test.go +++ b/pkg/corerp/renderers/manualscale/render_test.go @@ -24,9 +24,9 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" @@ -43,8 +43,17 @@ func (r *noop) GetDependencyIDs(ctx context.Context, resource v1.DataModelInterf func (r *noop) Render(ctx context.Context, dm v1.DataModelInterface, options renderers.RenderOptions) (renderers.RendererOutput, error) { // Return a deployment so the manualscale extension can modify it - deployment := appsv1.Deployment{} - resources := []rpv1.OutputResource{rpv1.NewKubernetesOutputResource(resourcekinds.Deployment, rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta)} + deployment := appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + }, + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + } + resources := []rpv1.OutputResource{rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta)} return renderers.RendererOutput{Resources: resources}, nil } diff --git a/pkg/corerp/renderers/types.go b/pkg/corerp/renderers/types.go index a1ef23c001..3e375dba2c 100644 --- a/pkg/corerp/renderers/types.go +++ b/pkg/corerp/renderers/types.go @@ -21,7 +21,6 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" ) @@ -57,8 +56,8 @@ type RendererDependency struct { // ComputedValues is a map of the computed values and secrets of the dependency. ComputedValues map[string]any - // OutputResources is a map of the output resource identities of the dependency. The map is keyed on the LocalID of the output resource. - OutputResources map[string]resourcemodel.ResourceIdentity + // OutputResources is a map of the output resource IDs of the dependency. The map is keyed on the LocalID of the output resource. + OutputResources map[string]resources.ID } // EnvironmentOptions represents the options for the linked environment resource. diff --git a/pkg/corerp/renderers/volume/azure/testdata/volume-az-kv-systemassigned.json b/pkg/corerp/renderers/volume/azure/testdata/volume-az-kv-systemassigned.json index 9f8b198115..8bf9f974e1 100644 --- a/pkg/corerp/renderers/volume/azure/testdata/volume-az-kv-systemassigned.json +++ b/pkg/corerp/renderers/volume/azure/testdata/volume-az-kv-systemassigned.json @@ -1,57 +1,55 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/volumes/azkeyvault0", - "name": "azkeyvault0", - "type": "Applications.Core/volumes", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/volumes/azkeyvault0", + "name": "azkeyvault0", + "type": "Applications.Core/volumes", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "provisioningState": "Succeeded", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Volume", - "Provider": "kubernetes" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "kind": "azure.com.keyvault", - "azureKeyVault": { - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcIssuer/URL" - }, - "secrets": { - "mysecret": { - "name": "mysecret", - "encoding": "base64" - } - }, - "keys": { - "mykey": { - "name": "mykey" - } - }, - "certificates": { - "mycert": { - "name": "mycert", - "alias": "myalias", - "certType": "certificate", - "encoding": "utf-8" - } - } + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "azureKeyVault": { + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcIssuer/URL" + }, + "secrets": { + "mysecret": { + "name": "mysecret", + "encoding": "base64" + } + }, + "keys": { + "mykey": { + "name": "mykey" + } + }, + "certificates": { + "mycert": { + "name": "mycert", + "alias": "myalias", + "certType": "certificate", + "encoding": "utf-8" } + } } + } } \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go index 5842f36ffd..73c4baced5 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go @@ -23,9 +23,10 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -113,10 +114,9 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &DaprPubSubBrokerResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -151,10 +151,9 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel_Invalid(t *testing.T) { for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &DaprStateStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -193,15 +192,7 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -225,15 +216,7 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -247,10 +230,9 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.DaprPubSubBroker{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &DaprPubSubBrokerResource{} @@ -270,7 +252,7 @@ func TestDaprPubSubBroker_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go index 4385af9bfd..80b258ee10 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go @@ -23,9 +23,10 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -110,10 +111,9 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &DaprSecretStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -150,15 +150,7 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dss"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -188,15 +180,7 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { Metadata: map[string]any{"foo": "bar"}, ComponentName: to.Ptr("test-dss"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -209,10 +193,9 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.DaprSecretStore{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &DaprSecretStoreResource{} @@ -247,10 +230,9 @@ func TestDaprSecretStore_ConvertVersionedToDataModel_InvalidRequest(t *testing.T } for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &DaprSecretStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -267,7 +249,7 @@ func TestDaprSecretStore_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go index a1249d29f2..5a061aa5c8 100644 --- a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go @@ -23,9 +23,10 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -37,10 +38,9 @@ func TestDaprStateStore_ConvertVersionedToDataModel(t *testing.T) { for _, payload := range testset { t.Run(payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload) versionedResource := &DaprStateStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -107,10 +107,9 @@ func TestDaprStateStore_ConvertVersionedToDataModel_Invalid(t *testing.T) { for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &DaprStateStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -130,10 +129,9 @@ func TestDaprStateStore_ConvertDataModelToVersioned(t *testing.T) { for _, payload := range testset { t.Run(payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload) resource := &datamodel.DaprStateStore{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &DaprStateStoreResource{} @@ -156,15 +154,7 @@ func TestDaprStateStore_ConvertDataModelToVersioned(t *testing.T) { Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), ComponentName: to.Ptr("stateStore0"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, } @@ -197,7 +187,7 @@ func TestDaprStateStore_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_datamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_datamodel.json index 09f61d2067..74714f0903 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_datamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_datamodel.json @@ -1,44 +1,40 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Dapr/pubSubBrokers", - "location": "global", - "tags": { - "env": "dev" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", + "name": "test-dpsb", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "tags": { + "env": "dev" + }, + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "properties": { + "componentName": "test-dpsb", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "resourceProvisioning": "manual", + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "daprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async" - } - ] - } + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async" + } + ] + } } \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_generic_datamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_generic_datamodel.json index a5c114c947..bbd2688472 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_generic_datamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_manual_generic_datamodel.json @@ -1,40 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Dapr/pubSubBrokers", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "kind": "generic", - "resourceProvisioning": "manual", - "type": "pubsub.kafka", - "version": "v1", - "metadata": { - "foo": "bar" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", + "name": "test-dpsb", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "componentName": "test-dpsb", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "kind": "generic", + "resourceProvisioning": "manual", + "type": "pubsub.kafka", + "version": "v1", + "metadata": { + "foo": "bar" } + } } \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_recipe_datamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_recipe_datamodel.json index 603efe0943..8292bc3900 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_recipe_datamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/pubsubbroker_recipe_datamodel.json @@ -1,37 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Dapr/pubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "recipe", - "recipe": { - "name": "dpsb-recipe" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", + "name": "test-dpsb", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "tags": { + "env": "dev" + }, + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "properties": { + "componentName": "test-dpsb", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "resourceProvisioning": "recipe", + "recipe": { + "name": "dpsb-recipe" } + } } \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_manual_resourcedatamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_manual_resourcedatamodel.json index f97421ee1d..69db9f7141 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_manual_resourcedatamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_manual_resourcedatamodel.json @@ -1,40 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", - "name": "test-dss", - "type": "Applications.Dapr/secretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", + "name": "test-dss", + "type": "Applications.Dapr/secretStores", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "componentName": "test-dss", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "kind": "generic", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" }, - "properties": { - "componentName": "test-dss", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprSecretStoreProvider", - "Provider": "kubernetes" - } - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "kind": "generic", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning":"manual" - } -} + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resource.json b/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resource.json index eae37b44bd..d478d4161b 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resource.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resource.json @@ -1,28 +1,26 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", - "name": "test-dss", - "type": "Applications.Dapr/secretStores", - "location": "global", - "tags": { - "env": "dev" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", + "name": "test-dss", + "type": "Applications.Dapr/secretStores", + "location": "global", + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Secret", - "Provider": "kubernetes" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "recipe": { - "name": "daprSecretStore", - "parameters":{ - "foo":"bar" - } + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "recipe": { + "name": "daprSecretStore", + "parameters": { + "foo": "bar" } } -} + } +} \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resourcedatamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resourcedatamodel.json index fef3759f91..1758924778 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resourcedatamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/secretstore_recipe_resourcedatamodel.json @@ -1,44 +1,40 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", - "name": "test-dss", - "type": "Applications.Dapr/secretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", + "name": "test-dss", + "type": "Applications.Dapr/secretStores", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "componentName": "test-dss", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" }, - "properties": { - "componentName": "test-dss", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprSecretStoreProvider", - "Provider": "kubernetes" - } - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "recipe": { - "name": "daprSecretStore", - "parameters":{ - "foo":"bar" - } - } + "recipe": { + "name": "daprSecretStore", + "parameters": { + "foo": "bar" + } } -} + } +} \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_recipe_resourcedatamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_recipe_resourcedatamodel.json index 47b74ae613..98889019fa 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_recipe_resourcedatamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_recipe_resourcedatamodel.json @@ -19,11 +19,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprStateStoreProvider", - "Provider": "kubernetes" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_values_resourcedatamodel.json b/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_values_resourcedatamodel.json index 4e25353eff..fb6009836e 100644 --- a/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_values_resourcedatamodel.json +++ b/pkg/daprrp/api/v20220315privatepreview/testdata/statestore_values_resourcedatamodel.json @@ -19,11 +19,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprStateStoreProvider", - "Provider": "kubernetes" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go b/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go index 95de84f28e..397cbfaee8 100644 --- a/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go +++ b/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go @@ -24,8 +24,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/daprrp/datamodel" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -67,15 +68,7 @@ func TestPubSubBrokerDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(v20220315privatepreview.ProvisioningStateAccepted), - Status: &v20220315privatepreview.ResourceStatus{ - OutputResources: []map[string]any{ - { - "LocalID": "Deployment", - "Provider": "kubernetes", - "Identity": nil, - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&v20220315privatepreview.ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -113,15 +106,7 @@ func TestPubSubBrokerDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(v20220315privatepreview.ProvisioningStateAccepted), - Status: &v20220315privatepreview.ResourceStatus{ - OutputResources: []map[string]any{ - { - "LocalID": "Deployment", - "Provider": "kubernetes", - "Identity": nil, - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&v20220315privatepreview.ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -151,10 +136,10 @@ func TestPubSubBrokerDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.DaprPubSubBroker{} - _ = json.Unmarshal(c, dm) + err = json.Unmarshal(c, dm) + require.NoError(t, err) am, err := PubSubBrokerDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { @@ -209,8 +194,7 @@ func TestDaprPubSubBrokerDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := PubSubBrokerDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.Equal(t, tc.err, err) diff --git a/pkg/daprrp/datamodel/converter/secretstore_converter_test.go b/pkg/daprrp/datamodel/converter/secretstore_converter_test.go index 55c8661acc..91315b5ac8 100644 --- a/pkg/daprrp/datamodel/converter/secretstore_converter_test.go +++ b/pkg/daprrp/datamodel/converter/secretstore_converter_test.go @@ -24,7 +24,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/daprrp/datamodel" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/test/testutil" "github.com/stretchr/testify/require" ) @@ -52,10 +52,10 @@ func TestDaprSecretStoreDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.DaprSecretStore{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := SecretStoreDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -97,8 +97,7 @@ func TestDaprSecretStoreDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := SecretStoreDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) diff --git a/pkg/daprrp/datamodel/converter/statestore_converter_test.go b/pkg/daprrp/datamodel/converter/statestore_converter_test.go index a3d7c08bff..7a9bbc95da 100644 --- a/pkg/daprrp/datamodel/converter/statestore_converter_test.go +++ b/pkg/daprrp/datamodel/converter/statestore_converter_test.go @@ -23,7 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/daprrp/datamodel" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/test/testutil" "github.com/stretchr/testify/require" ) @@ -57,10 +57,10 @@ func TestDaprStateStoreDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.DaprStateStore{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := StateStoreDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -107,8 +107,7 @@ func TestDaprStateStoreDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := StateStoreDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.Equal(t, tc.err, err) diff --git a/pkg/daprrp/datamodel/daprstatestore_test.go b/pkg/daprrp/datamodel/daprstatestore_test.go index 9f39803ca1..fb32529d22 100644 --- a/pkg/daprrp/datamodel/daprstatestore_test.go +++ b/pkg/daprrp/datamodel/daprstatestore_test.go @@ -20,8 +20,6 @@ import ( "testing" "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" @@ -40,24 +38,8 @@ func TestDaprStateStore_ApplyDeploymentOutput(t *testing.T) { do: &rpv1.DeploymentOutput{ DeployedOutputResources: []rpv1.OutputResource{ { - LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Data: resourcemodel.ARMIdentity{}, - }, + LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, RadiusManaged: to.Ptr(true), - Dependencies: []rpv1.Dependency{ - { - LocalID: "", - }, - }, }, }, ComputedValues: map[string]any{ @@ -72,24 +54,8 @@ func TestDaprStateStore_ApplyDeploymentOutput(t *testing.T) { do: &rpv1.DeploymentOutput{ DeployedOutputResources: []rpv1.OutputResource{ { - LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Data: resourcemodel.ARMIdentity{}, - }, + LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, RadiusManaged: to.Ptr(true), - Dependencies: []rpv1.Dependency{ - { - LocalID: "", - }, - }, }, }, ComputedValues: map[string]any{}, diff --git a/pkg/daprrp/processors/pubsubbrokers/processor.go b/pkg/daprrp/processors/pubsubbrokers/processor.go index aec3307224..c341619723 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor.go @@ -26,7 +26,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/handlers" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -96,7 +95,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubB return &processors.ResourceError{Inner: err} } - deployed := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) + deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) deployed.RadiusManaged = to.Ptr(true) resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) diff --git a/pkg/daprrp/processors/pubsubbrokers/processor_test.go b/pkg/daprrp/processors/pubsubbrokers/processor_test.go index bf33587aed..022598e9a0 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor_test.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor_test.go @@ -27,7 +27,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/k8sutil" @@ -188,9 +187,8 @@ func Test_Process(t *testing.T) { }, } - component := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) + component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) component.RadiusManaged = to.Ptr(true) - component.Resource = generated expectedOutputResources = append(expectedOutputResources, component) require.NoError(t, err) diff --git a/pkg/daprrp/processors/secretstores/processor.go b/pkg/daprrp/processors/secretstores/processor.go index 1eff1a6a28..c9c9937ec3 100644 --- a/pkg/daprrp/processors/secretstores/processor.go +++ b/pkg/daprrp/processors/secretstores/processor.go @@ -26,7 +26,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/handlers" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -93,7 +92,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretS return &processors.ResourceError{Inner: err} } - deployed := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) + deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) deployed.RadiusManaged = to.Ptr(true) resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) diff --git a/pkg/daprrp/processors/secretstores/processor_test.go b/pkg/daprrp/processors/secretstores/processor_test.go index 3842ca4f93..fe5770e2e2 100644 --- a/pkg/daprrp/processors/secretstores/processor_test.go +++ b/pkg/daprrp/processors/secretstores/processor_test.go @@ -27,7 +27,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/k8sutil" @@ -172,9 +171,8 @@ func Test_Process(t *testing.T) { }, } - component := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) + component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) component.RadiusManaged = to.Ptr(true) - component.Resource = generated expectedOutputResources := []rpv1.OutputResource{component} require.NoError(t, err) diff --git a/pkg/daprrp/processors/statestores/processor.go b/pkg/daprrp/processors/statestores/processor.go index 38646fb3e5..826daa9000 100644 --- a/pkg/daprrp/processors/statestores/processor.go +++ b/pkg/daprrp/processors/statestores/processor.go @@ -26,7 +26,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/handlers" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -96,7 +95,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateSt return &processors.ResourceError{Inner: err} } - deployed := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) + deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) deployed.RadiusManaged = to.Ptr(true) resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) diff --git a/pkg/daprrp/processors/statestores/processor_test.go b/pkg/daprrp/processors/statestores/processor_test.go index 571fa9d0a9..966529ab28 100644 --- a/pkg/daprrp/processors/statestores/processor_test.go +++ b/pkg/daprrp/processors/statestores/processor_test.go @@ -27,7 +27,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/k8sutil" @@ -180,9 +179,8 @@ func Test_Process(t *testing.T) { }, } - component := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) + component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) component.RadiusManaged = to.Ptr(true) - component.Resource = generated expectedOutputResources = append(expectedOutputResources, component) require.NoError(t, err) diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go index aab3478dcf..effc19ab08 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go @@ -26,6 +26,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -167,10 +169,9 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testset { // arrange t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &MongoDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -204,10 +205,9 @@ func TestMongoDatabase_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) } for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &MongoDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -240,15 +240,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr("testUser"), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "AzureCosmosAccount", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -317,10 +309,9 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testset { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.MongoDatabase{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &MongoDatabaseResource{} @@ -340,7 +331,7 @@ func TestMongoDatabase_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -353,10 +344,9 @@ func TestMongoDatabase_ConvertFromValidation(t *testing.T) { func TestMongoDatabaseSecrets_ConvertVersionedToDataModel(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/mongodatabasesecrets.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("mongodatabasesecrets.json") versioned := &MongoDatabaseSecrets{} - err = json.Unmarshal(rawPayload, versioned) + err := json.Unmarshal(rawPayload, versioned) require.NoError(t, err) // act @@ -371,10 +361,9 @@ func TestMongoDatabaseSecrets_ConvertVersionedToDataModel(t *testing.T) { func TestMongoDatabaseSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/mongodatabasesecretsdatamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("mongodatabasesecretsdatamodel.json") secrets := &datamodel.MongoDatabaseSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -392,7 +381,7 @@ func TestMongoDatabaseSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go index a70f7272cd..b6e4454d15 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go @@ -23,10 +23,11 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -132,10 +133,9 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testset { // arrange t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &RedisCacheResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -171,15 +171,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr(""), TLS: to.Ptr(false), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -204,15 +196,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr(""), TLS: to.Ptr(false), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -237,15 +221,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr("redis-test"), Parameters: map[string]any{"port": float64(6081)}}, Username: to.Ptr(""), TLS: to.Ptr(false), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -290,10 +266,9 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { for _, tc := range testset1 { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.RedisCache{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &RedisCacheResource{} @@ -312,10 +287,9 @@ func TestRedisCache_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { testset := []string{"rediscacheresource-invalid.json", "rediscacheresource-invalid2.json"} for _, payload := range testset { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload) versionedResource := &RedisCacheResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) if payload == "rediscacheresource-invalid.json" { expectedErr := v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} @@ -335,7 +309,7 @@ func TestRedisCache_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -348,10 +322,9 @@ func TestRedisCache_ConvertFromValidation(t *testing.T) { func TestRedisCacheSecrets_ConvertVersionedToDataModel(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/rediscachesecrets.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("/rediscachesecrets.json") versioned := &RedisCacheSecrets{} - err = json.Unmarshal(rawPayload, versioned) + err := json.Unmarshal(rawPayload, versioned) require.NoError(t, err) // act @@ -367,10 +340,9 @@ func TestRedisCacheSecrets_ConvertVersionedToDataModel(t *testing.T) { func TestRedisCacheSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/rediscachesecretsdatamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("rediscachesecretsdatamodel.json") secrets := &datamodel.RedisCacheSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -389,7 +361,7 @@ func TestRedisCacheSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go index 1ccf9582a9..aa6fbcad36 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go @@ -23,9 +23,10 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" "github.com/project-radius/radius/pkg/linkrp" - linkrp_shared "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -118,10 +119,9 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := linkrp_shared.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &SQLDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -161,15 +161,7 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { Port: to.Ptr(int32(1433)), Username: to.Ptr("testUser"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -199,15 +191,7 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { }, }, ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -220,10 +204,9 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := linkrp_shared.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.SqlDatabase{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &SQLDatabaseResource{} @@ -258,10 +241,9 @@ func TestSqlDatabase_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := linkrp_shared.LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &SQLDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -278,7 +260,7 @@ func TestSqlDatabase_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&linkrp_shared.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -291,10 +273,9 @@ func TestSqlDatabase_ConvertFromValidation(t *testing.T) { func TestSqlDatabaseSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := linkrp_shared.LoadTestData("./testdata/sqldatabase_secrets_datamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("sqldatabase_secrets_datamodel.json") secrets := &datamodel.SqlDatabaseSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -312,7 +293,7 @@ func TestSqlDatabaseSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&linkrp_shared.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json index f2e83b6793..3a4c0fc9b6 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json @@ -1,27 +1,25 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Datastores/mongoDatabases", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.cosmosdb.mongo", - "Provider": "azure" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database", - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount.mongo.cosmos.azure.com", + "port": 10255, + "database": "test-database", + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" } -} + } +} \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json index 6bfa17a4c6..c62c159bee 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json @@ -1,38 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Datastores/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "AzureCosmosAccount", - "ResourceType": { - "Type": "azure.cosmosdb.mongo", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database", - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "test-database", + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" } -} + } +} \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json index 31b4baa9f9..dbb371cddd 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json @@ -1,33 +1,31 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" - } - ], - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "username": "admin", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string", - "url": "test-url" - }, - "tls": true, - "resourceProvisioning": "manual" - } -} + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 10255, + "username": "admin", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string", + "url": "test-url" + }, + "tls": true, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json index 9db7b6f062..4fa666fab3 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json @@ -1,32 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "resourceProvisioning": "manual" - } -} + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "host": "myrediscache.redis.cache.windows.net", + "port": 10255, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json index 3ecacb6114..9eaa162121 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json @@ -1,29 +1,27 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication" - } -} + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication" + } +} \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json index 31bfe7573a..3028bfe106 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json @@ -1,35 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "recipe": { - "name": "redis-test", - "parameters": { - "port": 6081 - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "recipe": { + "name": "redis-test", + "parameters": { + "port": 6081 + } } -} + } +} \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json index bba0676b7a..d1789e2177 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json @@ -1,36 +1,34 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Datastores/sqlDatabases", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.sql.database", - "Provider": "azure" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning":"manual", - "resources": [ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server":"testAccount1.sql.cosmos.azure.com", - "port":1433, - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "port": 1433, + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" } + } } \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json index 25d6535630..a74ffd9733 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json @@ -1,40 +1,38 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Datastores/sqlDatabases", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.sql.database", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resources":[ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning":"manual", - "username": "testUser", - "port":1433 - } + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual", + "username": "testUser", + "port": 1433 + } } \ No newline at end of file diff --git a/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json b/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json index 0fbd273d06..e9a341e8ef 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json +++ b/pkg/datastoresrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json @@ -1,41 +1,39 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Datastores/sqlDatabases", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "recipe": { + "name": "sql-test", + "parameters": { + "foo": "bar" + } }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.sql.database", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "recipe": { - "name": "sql-test", - "parameters":{ - "foo":"bar" - } - }, - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning":"recipe", - "username":"testUser", - "port":1433 - } + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "recipe", + "username": "testUser", + "port": 1433 + } } \ No newline at end of file diff --git a/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go b/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go index 2145261f7e..77565a2c24 100644 --- a/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go +++ b/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go @@ -24,7 +24,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/test/testutil" "github.com/stretchr/testify/require" ) @@ -52,10 +52,10 @@ func TestMongoDatabaseDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.MongoDatabase{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := MongoDatabaseDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -96,8 +96,7 @@ func TestMongoDatabaseDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := MongoDatabaseDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -132,10 +131,10 @@ func TestMongoDatabaseSecretsDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.MongoDatabaseSecrets{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := MongoDatabaseSecretsDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) diff --git a/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go b/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go index 04f1ae5e26..73d8b09918 100644 --- a/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go +++ b/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go @@ -24,7 +24,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/test/testutil" "github.com/stretchr/testify/require" ) @@ -52,10 +52,10 @@ func TestRedisCacheDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.RedisCache{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := RedisCacheDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -97,8 +97,7 @@ func TestRedisCacheDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := RedisCacheDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -133,10 +132,10 @@ func TestRedisCacheSecretsDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.RedisCacheSecrets{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := RedisCacheSecretsDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) diff --git a/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go b/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go index 5af1583337..f5b01c76ba 100644 --- a/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go +++ b/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go @@ -24,7 +24,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/test/testutil" "github.com/stretchr/testify/require" ) @@ -52,10 +52,10 @@ func TestSqlDatabaseDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.SqlDatabase{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := SqlDatabaseDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -102,8 +102,7 @@ func TestSqlDatabaseDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := SqlDatabaseDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -144,10 +143,10 @@ func TestSqlDatabaseSecretsDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.SqlDatabaseSecrets{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := SqlDatabaseSecretsDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json b/pkg/datastoresrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json index 2976a38d65..7e20688f62 100644 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json +++ b/pkg/datastoresrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json @@ -15,12 +15,7 @@ "status": { "outputResources": [ { - "LocalID": "AzureCosmosAccount", - "Dependencies": null, - "ResourceType": { - "type": "azure.cosmosdb.account", - "provider": "azure" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json b/pkg/datastoresrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json index 33574645b7..4e2949b3cb 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json +++ b/pkg/datastoresrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json @@ -15,12 +15,7 @@ "status": { "outputResources": [ { - "LocalID": "AzureRedis", - "Dependencies": null, - "ResourceType": { - "type": "azure.redis", - "provider": "azure" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json b/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json index 267af46be9..c2bb9d2355 100644 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json +++ b/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json @@ -15,12 +15,7 @@ "status": { "outputResources": [ { - "LocalID": "AzureSqlServer", - "Dependencies": null, - "ResourceType": { - "type": "azure.sql", - "provider": "azure" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json b/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json index 37067d5bad..acc7a87520 100644 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json +++ b/pkg/datastoresrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json @@ -1,37 +1,37 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.datastores/sqldatabases/sql0", - "location": "West US", - "name": "sql0", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "AzureSqlServer", - "Provider": "azure", - "Identity": null - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "provisioningState": "Succeeded", - "resourceProvisioning": "manual", - "port": 1433, - "username": "testUser" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.datastores/sqldatabases/sql0", + "location": "West US", + "name": "sql0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.datastores/sqldatabases" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "provisioningState": "Succeeded", + "resourceProvisioning": "manual", + "port": 1433, + "username": "testUser" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.datastores/sqldatabases" } \ No newline at end of file diff --git a/pkg/kubernetes/object.go b/pkg/kubernetes/object.go index 462927d3e2..b14bac0844 100644 --- a/pkg/kubernetes/object.go +++ b/pkg/kubernetes/object.go @@ -21,8 +21,8 @@ import ( "hash/fnv" "strings" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" appsv1 "k8s.io/api/apps/v1" @@ -34,11 +34,11 @@ import ( // associated OutputResource object. func FindDeployment(resources []rpv1.OutputResource) (*appsv1.Deployment, rpv1.OutputResource) { for _, r := range resources { - if r.ResourceType.Type != resourcekinds.Deployment { + if r.GetResourceType().Type != resources_kubernetes.ResourceTypeDeployment { continue } - deployment, ok := r.Resource.(*appsv1.Deployment) + deployment, ok := r.CreateResource.Data.(*appsv1.Deployment) if !ok { continue } @@ -53,11 +53,11 @@ func FindDeployment(resources []rpv1.OutputResource) (*appsv1.Deployment, rpv1.O // OutputResource object it was found in. func FindService(resources []rpv1.OutputResource) (*corev1.Service, rpv1.OutputResource) { for _, r := range resources { - if r.ResourceType.Type != resourcekinds.Service { + if r.GetResourceType().Type != resources_kubernetes.ResourceTypeService { continue } - service, ok := r.Resource.(*corev1.Service) + service, ok := r.CreateResource.Data.(*corev1.Service) if !ok { continue } @@ -72,11 +72,12 @@ func FindService(resources []rpv1.OutputResource) (*corev1.Service, rpv1.OutputR // corresponding OutputResource object. func FindSecret(resources []rpv1.OutputResource) (*corev1.Secret, rpv1.OutputResource) { for _, r := range resources { - if r.ResourceType.Type != resourcekinds.Secret { + resourceType := r.GetResourceType() + if resourceType.Type != resources_kubernetes.ResourceTypeSecret { continue } - secret, ok := r.Resource.(*corev1.Secret) + secret, ok := r.CreateResource.Data.(*corev1.Secret) if !ok { continue } @@ -87,49 +88,48 @@ func FindSecret(resources []rpv1.OutputResource) (*corev1.Secret, rpv1.OutputRes return nil, rpv1.OutputResource{} } -// FindHttpRouteByLocalID searches through a slice of OutputResources to find a HTTPProxy resource -// with the given localID. -func FindHttpRouteByLocalID(resources []rpv1.OutputResource, localID string) (*contourv1.HTTPProxy, rpv1.OutputResource) { +// FindContourHTTPProxyByLocalID searches through a slice of OutputResources to find a HTTPProxy resource. +func FindContourHTTPProxy(resources []rpv1.OutputResource) (*contourv1.HTTPProxy, rpv1.OutputResource) { for _, r := range resources { - if r.ResourceType.Type != resourcekinds.KubernetesHTTPRoute || r.LocalID != localID { + if r.GetResourceType().Type != resources_kubernetes.ResourceTypeContourHTTPProxy { continue } - httpRoute, ok := r.Resource.(*contourv1.HTTPProxy) + httpProxy, ok := r.CreateResource.Data.(*contourv1.HTTPProxy) if !ok { continue } // If VirtualHost exists, then this is a root HTTPProxy (gateway) - if httpRoute.Spec.VirtualHost != nil { + if httpProxy.Spec.VirtualHost == nil { continue } - return httpRoute, r + return httpProxy, r } return nil, rpv1.OutputResource{} } -// FindGateway iterates through a slice of OutputResources and returns the first HTTPProxy resource found with a -// VirtualHost set. -func FindGateway(resources []rpv1.OutputResource) (*contourv1.HTTPProxy, rpv1.OutputResource) { +// FindContourHTTPProxyByLocalID searches through a slice of OutputResources to find a HTTPProxy resource +// with the given localID. +func FindContourHTTPProxyByLocalID(resources []rpv1.OutputResource, localID string) (*contourv1.HTTPProxy, rpv1.OutputResource) { for _, r := range resources { - if r.ResourceType.Type != resourcekinds.Gateway { + if r.GetResourceType().Type != resources_kubernetes.ResourceTypeContourHTTPProxy || r.LocalID != localID { continue } - gateway, ok := r.Resource.(*contourv1.HTTPProxy) + httpRoute, ok := r.CreateResource.Data.(*contourv1.HTTPProxy) if !ok { continue } // If VirtualHost exists, then this is a root HTTPProxy (gateway) - if gateway.Spec.VirtualHost == nil { + if httpRoute.Spec.VirtualHost != nil { continue } - return gateway, r + return httpRoute, r } return nil, rpv1.OutputResource{} diff --git a/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go index 56a5fc83ae..860e18c241 100644 --- a/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -112,10 +114,9 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &DaprPubSubBrokerResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -150,10 +151,9 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel_Invalid(t *testing.T) { for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &DaprStateStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -192,15 +192,7 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -224,15 +216,7 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -246,10 +230,9 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.DaprPubSubBroker{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &DaprPubSubBrokerResource{} @@ -269,7 +252,7 @@ func TestDaprPubSubBroker_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go index 85f44d36a0..5d35213ac2 100644 --- a/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -110,10 +112,9 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &DaprSecretStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -150,15 +151,7 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dss"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -188,15 +181,7 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { Metadata: map[string]any{"foo": "bar"}, ComponentName: to.Ptr("test-dss"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -209,10 +194,9 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.DaprSecretStore{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &DaprSecretStoreResource{} @@ -247,10 +231,9 @@ func TestDaprSecretStore_ConvertVersionedToDataModel_InvalidRequest(t *testing.T } for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &DaprSecretStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -267,7 +250,7 @@ func TestDaprSecretStore_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go index d545baca3e..50ee76f619 100644 --- a/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -36,10 +38,9 @@ func TestDaprStateStore_ConvertVersionedToDataModel(t *testing.T) { for _, payload := range testset { t.Run(payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload) versionedResource := &DaprStateStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -106,10 +107,9 @@ func TestDaprStateStore_ConvertVersionedToDataModel_Invalid(t *testing.T) { for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &DaprStateStoreResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -129,10 +129,9 @@ func TestDaprStateStore_ConvertDataModelToVersioned(t *testing.T) { for _, payload := range testset { t.Run(payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload) resource := &datamodel.DaprStateStore{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &DaprStateStoreResource{} @@ -155,15 +154,7 @@ func TestDaprStateStore_ConvertDataModelToVersioned(t *testing.T) { Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), ComponentName: to.Ptr("daprStateStore0"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "kubernetes", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, } @@ -196,7 +187,7 @@ func TestDaprStateStore_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go index da64004d16..d0fa6c1fd1 100644 --- a/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -125,10 +127,9 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { for _, payload := range testset { // arrange - rawPayload, err := LoadTestData("./testdata/" + payload.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload.file) versionedResource := &ExtenderResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -160,15 +161,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "ExtenderProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -190,7 +183,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - Status: &ResourceStatus{}, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -211,15 +204,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &Recipe{Name: to.Ptr("test-recipe"), Parameters: nil}, - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "ExtenderProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -233,10 +218,9 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.Extender{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &ExtenderResource{} @@ -256,7 +240,7 @@ func TestExtender_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go index 434d02eaf8..8ac4aa1c40 100644 --- a/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -165,10 +167,9 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testset { // arrange t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &MongoDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -202,10 +203,9 @@ func TestMongoDatabase_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) } for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &MongoDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -238,15 +238,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr("testUser"), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "AzureCosmosAccount", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -272,9 +264,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Resources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db")}}, Username: to.Ptr(""), - Status: &ResourceStatus{ - OutputResources: nil, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -300,9 +290,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { ProvisioningState: to.Ptr(ProvisioningStateAccepted), Recipe: &Recipe{Name: to.Ptr("cosmosdb"), Parameters: map[string]interface{}{"foo": "bar"}}, Username: to.Ptr(""), - Status: &ResourceStatus{ - OutputResources: nil, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -315,10 +303,9 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testset { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.MongoDatabase{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &MongoDatabaseResource{} @@ -338,7 +325,7 @@ func TestMongoDatabase_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -351,10 +338,9 @@ func TestMongoDatabase_ConvertFromValidation(t *testing.T) { func TestMongoDatabaseSecrets_ConvertVersionedToDataModel(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/mongodatabasesecrets.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("mongodatabasesecrets.json") versioned := &MongoDatabaseSecrets{} - err = json.Unmarshal(rawPayload, versioned) + err := json.Unmarshal(rawPayload, versioned) require.NoError(t, err) // act @@ -369,10 +355,9 @@ func TestMongoDatabaseSecrets_ConvertVersionedToDataModel(t *testing.T) { func TestMongoDatabaseSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/mongodatabasesecretsdatamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("mongodatabasesecretsdatamodel.json") secrets := &datamodel.MongoDatabaseSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -390,7 +375,7 @@ func TestMongoDatabaseSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go index 58f7c485cb..8f339628b4 100644 --- a/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -115,10 +117,9 @@ func TestRabbitMQMessageQueue_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &RabbitMQMessageQueueResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -155,15 +156,7 @@ func TestRabbitMQMessageQueue_ConvertDataModelToVersioned(t *testing.T) { Port: to.Ptr(int32(5672)), Username: to.Ptr("test-user"), TLS: to.Ptr(true), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "rabbitmqProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -195,15 +188,7 @@ func TestRabbitMQMessageQueue_ConvertDataModelToVersioned(t *testing.T) { "foo": "bar", }, }, - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "rabbitmqProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -216,10 +201,9 @@ func TestRabbitMQMessageQueue_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.RabbitMQMessageQueue{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &RabbitMQMessageQueueResource{} @@ -254,10 +238,9 @@ func TestRabbitMQMessageQueue_ConvertVersionedToDataModel_InvalidRequest(t *test for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &RabbitMQMessageQueueResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -274,7 +257,7 @@ func TestRabbitMQMessageQueue_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -287,10 +270,9 @@ func TestRabbitMQMessageQueue_ConvertFromValidation(t *testing.T) { func TestRabbitMQSecrets_ConvertVersionedToDataModel(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/rabbitmqsecrets.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("rabbitmqsecrets.json") versioned := &RabbitMQSecrets{} - err = json.Unmarshal(rawPayload, versioned) + err := json.Unmarshal(rawPayload, versioned) require.NoError(t, err) // act @@ -304,10 +286,9 @@ func TestRabbitMQSecrets_ConvertVersionedToDataModel(t *testing.T) { func TestRabbitMQSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/rabbitmqsecretsdatamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("./rabbitmqsecretsdatamodel.json") secrets := &datamodel.RabbitMQSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -324,7 +305,7 @@ func TestRabbitMQSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go index db75261dab..960ca52387 100644 --- a/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go @@ -23,6 +23,8 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/linkrp/datamodel" @@ -132,10 +134,9 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testset { // arrange t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &RedisCacheResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -171,15 +172,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr(""), TLS: to.Ptr(false), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -204,15 +197,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr(""), TLS: to.Ptr(false), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -237,15 +222,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr("redis-test"), Parameters: map[string]any{"port": float64(6081)}}, Username: to.Ptr(""), TLS: to.Ptr(false), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -270,9 +247,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, Username: to.Ptr(""), TLS: to.Ptr(true), - Status: &ResourceStatus{ - OutputResources: nil, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), Resources: []*ResourceReference{ {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}, @@ -290,10 +265,9 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { for _, tc := range testset1 { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.RedisCache{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &RedisCacheResource{} @@ -312,10 +286,9 @@ func TestRedisCache_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { testset := []string{"rediscacheresource-invalid.json", "rediscacheresource-invalid2.json"} for _, payload := range testset { // arrange - rawPayload, err := LoadTestData("./testdata/" + payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(payload) versionedResource := &RedisCacheResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) if payload == "rediscacheresource-invalid.json" { expectedErr := v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} @@ -335,7 +308,7 @@ func TestRedisCache_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -348,10 +321,9 @@ func TestRedisCache_ConvertFromValidation(t *testing.T) { func TestRedisCacheSecrets_ConvertVersionedToDataModel(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/rediscachesecrets.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("rediscachesecrets.json") versioned := &RedisCacheSecrets{} - err = json.Unmarshal(rawPayload, versioned) + err := json.Unmarshal(rawPayload, versioned) require.NoError(t, err) // act @@ -367,10 +339,9 @@ func TestRedisCacheSecrets_ConvertVersionedToDataModel(t *testing.T) { func TestRedisCacheSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/rediscachesecretsdatamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("rediscachesecretsdatamodel.json") secrets := &datamodel.RedisCacheSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -389,7 +360,7 @@ func TestRedisCacheSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go index 2e593834d6..980c7e6597 100644 --- a/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go +++ b/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go @@ -25,6 +25,8 @@ import ( "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -117,10 +119,9 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &SQLDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -160,15 +161,7 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { Port: to.Ptr(int32(1433)), Username: to.Ptr("testUser"), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -198,15 +191,7 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { }, }, ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "azure", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -219,10 +204,9 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.SqlDatabase{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &SQLDatabaseResource{} @@ -257,10 +241,9 @@ func TestSqlDatabase_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &SQLDatabaseResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -277,7 +260,7 @@ func TestSqlDatabase_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -290,10 +273,9 @@ func TestSqlDatabase_ConvertFromValidation(t *testing.T) { func TestSqlDatabaseSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := LoadTestData("./testdata/sqldatabase_secrets_datamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("sqldatabase_secrets_datamodel.json") secrets := &datamodel.SqlDatabaseSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -311,7 +293,7 @@ func TestSqlDatabaseSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json index 1a323b317b..151c32b983 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json @@ -1,44 +1,40 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", + "name": "test-dpsb", + "type": "Applications.Link/daprPubSubBrokers", + "location": "global", + "tags": { + "env": "dev" + }, + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "properties": { + "componentName": "test-dpsb", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "resourceProvisioning": "manual", + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async" - } - ] - } + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async" + } + ] + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json index 2978133059..bb7d556381 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json @@ -1,40 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "kind": "generic", - "resourceProvisioning": "manual", - "type": "pubsub.kafka", - "version": "v1", - "metadata": { - "foo": "bar" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", + "name": "test-dpsb", + "type": "Applications.Link/daprPubSubBrokers", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "componentName": "test-dpsb", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "kind": "generic", + "resourceProvisioning": "manual", + "type": "pubsub.kafka", + "version": "v1", + "metadata": { + "foo": "bar" } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json index 2254a6a86d..35a55a8f41 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json @@ -1,37 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "recipe", - "recipe": { - "name": "dpsb-recipe" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", + "name": "test-dpsb", + "type": "Applications.Link/daprPubSubBrokers", + "location": "global", + "tags": { + "env": "dev" + }, + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "properties": { + "componentName": "test-dpsb", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "resourceProvisioning": "recipe", + "recipe": { + "name": "dpsb-recipe" } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json index de98137fb2..94d974dcfd 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json @@ -1,40 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", + "name": "test-dss", + "type": "Applications.Link/daprSecretStores", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "componentName": "test-dss", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "kind": "generic", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" }, - "properties": { - "componentName": "test-dss", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "kind": "generic", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning":"manual" - } -} + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json index 6984ffbbc9..d6ed2298b0 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json @@ -1,28 +1,26 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "tags": { - "env": "dev" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", + "name": "test-dss", + "type": "Applications.Link/daprSecretStores", + "location": "global", + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Secret", - "Provider": "kubernetes" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "recipe": { - "name": "daprSecretStore", - "parameters":{ - "foo":"bar" - } + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "recipe": { + "name": "daprSecretStore", + "parameters": { + "foo": "bar" } } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json index 948f02d645..7eacd3a1b2 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json @@ -1,44 +1,40 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", + "name": "test-dss", + "type": "Applications.Link/daprSecretStores", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "componentName": "test-dss", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" }, - "properties": { - "componentName": "test-dss", - "status": { - "outputResources": [ - { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprPubSubProvider", - "Provider": "kubernetes" - } - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "recipe": { - "name": "daprSecretStore", - "parameters":{ - "foo":"bar" - } - } + "recipe": { + "name": "daprSecretStore", + "parameters": { + "foo": "bar" + } } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json index c0b4717e6a..cccd4c79bd 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json @@ -19,11 +19,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprStateStoreProvider", - "Provider": "kubernetes" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json index 9ea4f01971..8ae41dec9a 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json @@ -19,11 +19,7 @@ "status": { "outputResources": [ { - "LocalID": "Deployment", - "ResourceType": { - "Type": "DaprStateStoreProvider", - "Provider": "kubernetes" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json index e32698c8b1..577f161531 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json @@ -1,24 +1,22 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken": "token" - }, - "resourceProvisioning": "manual" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", + "name": "extender0", + "type": "Applications.Link/extenders", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken": "token" + }, + "resourceProvisioning": "manual" + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json index a155d3247d..620ea2acad 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json @@ -1,21 +1,19 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "test-recipe" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", + "name": "extender0", + "type": "Applications.Link/extenders", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "recipe": { + "name": "test-recipe" } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json index eaa1cbc080..0fecbdce28 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json @@ -1,37 +1,35 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", + "name": "extender0", + "type": "Applications.Link/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "additionalProperties": { + "fromNumber": "222-222-2222" }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties":{ - "fromNumber": "222-222-2222" - }, - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } -} + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json index cadcd2af02..5404711dff 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json @@ -1,24 +1,31 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", + "name": "extender0", + "type": "Applications.Link/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "additionalProperties": { + "fromNumber": "222-222-2222" }, - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties":{ - "fromNumber": "222-222-2222" - }, - "resourceProvisioning": "manual" + "resourceProvisioning": "manual", + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json index e4dcb85310..5c2142a0a8 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json @@ -1,32 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", + "name": "extender0", + "type": "Applications.Link/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "test-recipe" - } + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "recipe": { + "name": "test-recipe" } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json index f793246445..2a1d36084d 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json @@ -1,33 +1,31 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", + "name": "extender0", + "type": "Applications.Link/extenders", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "additionalProperties": { + "fromNumber": "222-222-2222" }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "Extender", - "Provider": "ExtenderProvider" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties":{ - "fromNumber": "222-222-2222" - }, - "resourceProvisioning": "manual" - } -} + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json index 8c7e3204f6..72a82c84d1 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json @@ -1,27 +1,25 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.cosmosdb.mongo", - "Provider": "azure" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database", - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Link/mongoDatabases", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount.mongo.cosmos.azure.com", + "port": 10255, + "database": "test-database", + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json index 7651bf8740..fe8b44806a 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json @@ -1,38 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "AzureCosmosAccount", - "ResourceType": { - "Type": "azure.cosmosdb.mongo", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database", - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Link/mongoDatabases", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "test-database", + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json index 03ef5a6209..5302bd302f 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json @@ -1,25 +1,36 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Link/mongoDatabases", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}], - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database" - } -} + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" + } + ], + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "test-database" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json index be6c334ad1..864321a177 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json @@ -1,28 +1,35 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Link/mongoDatabases", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } }, - "properties": { - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - }, - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255 - } -} + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255 + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json index 9227c3f226..015ff8bdd3 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json @@ -1,41 +1,39 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "location": "global", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "rabbitmq", - "Provider": "rabbitmqProvider" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning":"manual", - "queue": "testQueue", - "host": "test-host", - "vHost": "test-vhost", - "port": 5672, - "username": "test-user", - "tls":true, - "secrets": { - "uri": "connection://string", - "password": "password" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Link/rabbitMQMessageQueues", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "location": "global", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "resourceProvisioning": "manual", + "queue": "testQueue", + "host": "test-host", + "vHost": "test-vhost", + "port": 5672, + "username": "test-user", + "tls": true, + "secrets": { + "uri": "connection://string", + "password": "password" } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json index 40a736d12c..24f7ef1471 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json @@ -1,43 +1,41 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "location": "global", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "rabbitmq", - "Provider": "rabbitmqProvider" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning":"recipe", - "queue": "testQueue", - "host": "test-host", - "port": 5672, - "vHost": "test-vhost", - "username": "test-user", - "tls":false, - "recipe": { - "name": "rabbitmq", - "parameters":{ - "foo":"bar" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Link/rabbitMQMessageQueues", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "location": "global", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "resourceProvisioning": "recipe", + "queue": "testQueue", + "host": "test-host", + "port": 5672, + "vHost": "test-vhost", + "username": "test-user", + "tls": false, + "recipe": { + "name": "rabbitmq", + "parameters": { + "foo": "bar" + } } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json index 7cb117fece..87da40bd42 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json @@ -1,29 +1,27 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "rabbitmq", - "Provider": "rabbitmqProvider" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "tls": false, - "recipe": { - "name": "rabbitmq", - "parameters":{ - "foo":"bar" - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Link/rabbitMQMessageQueues", + "location": "global", + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "tls": false, + "recipe": { + "name": "rabbitmq", + "parameters": { + "foo": "bar" + } } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json index 9b09e08079..0b7f52ed43 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json @@ -1,33 +1,31 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" - } - ], - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "username": "admin", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string", - "url": "test-url" - }, - "tls": true, - "resourceProvisioning": "manual" - } -} + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Link/redisCaches", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 10255, + "username": "admin", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string", + "url": "test-url" + }, + "tls": true, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json index fad5ed84ff..801d1add95 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json @@ -1,32 +1,30 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Link/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "resourceProvisioning": "manual" - } -} + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "host": "myrediscache.redis.cache.windows.net", + "port": 10255, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json index e2720809eb..f4dd2097bd 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json @@ -1,30 +1,39 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Link/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resources": [{ - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" - }, - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1" - }], - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "tls": true, - "resourceProvisioning": "manual" - } -} + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 10255, + "tls": true, + "resourceProvisioning": "manual" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json index 9858b43ed1..7db319736a 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json @@ -1,29 +1,27 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Link/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication" - } -} + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication" + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json index f87553fd7c..35a494cea1 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json @@ -1,35 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.redis", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "recipe": { - "name": "redis-test", - "parameters": { - "port": 6081 - } + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Link/redisCaches", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "recipe": { + "name": "redis-test", + "parameters": { + "port": 6081 + } } -} + } +} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json index 71fc788985..68591724a9 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json @@ -1,36 +1,34 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.sql.database", - "Provider": "azure" - } - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning":"manual", - "resources": [ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server":"testAccount1.sql.cosmos.azure.com", - "port":1433, - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Link/sqlDatabases", + "location": "global", + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "port": 1433, + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" } + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json index 263b80599b..0ed6b7efec 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json @@ -1,40 +1,38 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Link/sqlDatabases", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.sql.database", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resources":[ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning":"manual", - "username": "testUser", - "port":1433 - } + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual", + "username": "testUser", + "port": 1433 + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json index f8b5a28c0c..fc1c1695b5 100644 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json +++ b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json @@ -1,41 +1,39 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Link/sqlDatabases", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "tags": { - "env": "dev" + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "recipe": { + "name": "sql-test", + "parameters": { + "foo": "bar" + } }, - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "azure.sql.database", - "Provider": "azure" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "recipe": { - "name": "sql-test", - "parameters":{ - "foo":"bar" - } - }, - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning":"recipe", - "username":"testUser", - "port":1433 - } + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "recipe", + "username": "testUser", + "port": 1433 + } } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/test_util.go b/pkg/linkrp/api/v20220315privatepreview/util.go similarity index 60% rename from pkg/linkrp/api/v20220315privatepreview/test_util.go rename to pkg/linkrp/api/v20220315privatepreview/util.go index 673fa925e9..880eb0cf42 100644 --- a/pkg/linkrp/api/v20220315privatepreview/test_util.go +++ b/pkg/linkrp/api/v20220315privatepreview/util.go @@ -17,29 +17,9 @@ limitations under the License. package v20220315privatepreview import ( - "os" "time" ) -// FakeResource is a fake resource type. -type FakeResource struct{} - -// Always returns "FakeResource" as the name. -func (f *FakeResource) ResourceTypeName() string { - return "FakeResource" -} - -// LoadTestData reads the contents of a file and returns it as a byte slice. -// It takes a single argument, testfile, which is the path to the file to be read. -// If the file cannot be read, an error is returned. -func LoadTestData(testfile string) ([]byte, error) { - d, err := os.ReadFile(testfile) - if err != nil { - return nil, err - } - return d, nil -} - // UnmarshalTimeString unmarshals a string representation of a time in RFC3339 format into a time.Time object. func UnmarshalTimeString(ts string) *time.Time { var tt timeRFC3339 diff --git a/pkg/linkrp/backend/controller/createorupdateresource.go b/pkg/linkrp/backend/controller/createorupdateresource.go index fd947e572c..b96b008a4e 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource.go +++ b/pkg/linkrp/backend/controller/createorupdateresource.go @@ -27,7 +27,6 @@ import ( "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" "github.com/project-radius/radius/pkg/recipes/engine" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/store" "github.com/project-radius/radius/pkg/ucp/ucplog" @@ -95,7 +94,7 @@ func (c *CreateOrUpdateResource[P, T]) Run(ctx context.Context, req *ctrl.Reques // Now we need to clean up any obsolete output resources. diff := rpv1.GetGCOutputResources(data.OutputResources(), previousOutputResources) - err = c.garbageCollectResources(ctx, req.ResourceID, diff) + err = c.garbageCollectResources(ctx, diff) if err != nil { return ctrl.Result{}, err } @@ -152,16 +151,15 @@ func (c *CreateOrUpdateResource[P, T]) loadRuntimeConfiguration(ctx context.Cont return &config.Runtime, nil } -func (c *CreateOrUpdateResource[P, T]) garbageCollectResources(ctx context.Context, id string, diff []rpv1.OutputResource) error { +func (c *CreateOrUpdateResource[P, T]) garbageCollectResources(ctx context.Context, diff []rpv1.OutputResource) error { logger := ucplog.FromContextOrDiscard(ctx) for _, resource := range diff { - id := resource.Identity.GetID() - logger.Info(fmt.Sprintf("Deleting output resource: %q", id), ucplog.LogFieldTargetResourceID, id) - err := c.client.Delete(ctx, id, resourcemodel.APIVersionUnknown) + logger.Info(fmt.Sprintf("Deleting output resource: %q", resource.ID), ucplog.LogFieldTargetResourceID, resource.ID) + err := c.client.Delete(ctx, resource.ID.String()) if err != nil { return err } - logger.Info(fmt.Sprintf("Deleted output resource: %q", id), ucplog.LogFieldTargetResourceID, id) + logger.Info(fmt.Sprintf("Deleted output resource: %q", resource.ID), ucplog.LogFieldTargetResourceID, resource.ID) } return nil diff --git a/pkg/linkrp/backend/controller/createorupdateresource_test.go b/pkg/linkrp/backend/controller/createorupdateresource_test.go index 8e28e536df..e456abc04d 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource_test.go +++ b/pkg/linkrp/backend/controller/createorupdateresource_test.go @@ -18,7 +18,6 @@ package controller import ( "context" - "encoding/json" "errors" "testing" @@ -35,8 +34,8 @@ import ( "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" "github.com/project-radius/radius/pkg/recipes/engine" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/pkg/ucp/store" ) @@ -115,20 +114,9 @@ var processorErr = errors.New("processor error") var configurationErr = errors.New("configuration error") var oldOutputResourceResourceID = "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1" -var oldOutputResource = rpv1.OutputResource{ - Identity: resourcemodel.NewARMIdentity(&resourcemodel.ResourceType{ - Type: "System.Test/testResources", - Provider: resourcemodel.ProviderAzure, - }, oldOutputResourceResourceID, "2022-01-01"), -} var newOutputResourceResourceID = "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test2" -var newOutputResource = rpv1.OutputResource{ - Identity: resourcemodel.NewARMIdentity(&resourcemodel.ResourceType{ - Type: "System.Test/testResources", - Provider: resourcemodel.ProviderAzure, - }, newOutputResourceResourceID, "2022-01-01"), -} +var newOutputResource = rpv1.OutputResource{ID: resources.MustParse(newOutputResourceResourceID)} func TestCreateOrUpdateResource_Run(t *testing.T) { setupTest := func(tb testing.TB) (*store.MockStorageClient, *engine.MockEngine, *processors.MockResourceClient, *configloader.MockConfigurationLoader) { @@ -293,19 +281,6 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { OperationTimeout: &ctrl.DefaultAsyncOperationTimeout, } - // Set up an output resource so we can cover resource deletion. - status := rpv1.ResourceStatus{ - OutputResources: []rpv1.OutputResource{ - oldOutputResource, - }, - } - sb, err := json.Marshal(&status) - require.NoError(t, err) - - sm := map[string]interface{}{} - err = json.Unmarshal(sb, &sm) - require.NoError(t, err) - data := map[string]any{ "name": "tr", "type": "Applications.Test/testResources", @@ -315,7 +290,13 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { "application": TestApplicationID, "environment": TestEnvironmentID, "provisioningState": "Accepted", - "status": sm, + "status": map[string]any{ + "outputResources": []map[string]any{ + { + "id": oldOutputResourceResourceID, + }, + }, + }, "recipe": map[string]any{ "name": "test-recipe", "parameters": map[string]any{ @@ -411,12 +392,12 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { if stillPassing && tt.resourceClientErr != nil { stillPassing = false client.EXPECT(). - Delete(gomock.Any(), oldOutputResourceResourceID, resourcemodel.APIVersionUnknown). + Delete(gomock.Any(), oldOutputResourceResourceID). Return(tt.resourceClientErr). Times(1) } else if stillPassing { client.EXPECT(). - Delete(gomock.Any(), oldOutputResourceResourceID, resourcemodel.APIVersionUnknown). + Delete(gomock.Any(), oldOutputResourceResourceID). Return(nil). Times(1) } diff --git a/pkg/linkrp/backend/controller/deleteresource_test.go b/pkg/linkrp/backend/controller/deleteresource_test.go index 3631e9b7c5..1169286441 100644 --- a/pkg/linkrp/backend/controller/deleteresource_test.go +++ b/pkg/linkrp/backend/controller/deleteresource_test.go @@ -28,25 +28,16 @@ import ( ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/engine" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) var outputResourceResourceID = "/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.DocumentDB/databaseAccounts/mongoDatabases" var outputResource = rpv1.OutputResource{ - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: "Microsoft.DocumentDB/databaseAccounts/mongoDatabases", - Provider: resourcemodel.ProviderAzure, - }, - Data: map[string]any{ - "id": outputResourceResourceID, - "apiVersion": "2022-01-01", - }, - }, + ID: resources.MustParse(outputResourceResourceID), RadiusManaged: to.Ptr(true), } diff --git a/pkg/linkrp/backend/service.go b/pkg/linkrp/backend/service.go index 5a938fbc80..899bc6e009 100644 --- a/pkg/linkrp/backend/service.go +++ b/pkg/linkrp/backend/service.go @@ -32,7 +32,6 @@ import ( mongo_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/mongodatabases" redis_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/rediscaches" sql_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/sqldatabases" - "github.com/project-radius/radius/pkg/kubeutil" "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/linkrp/datamodel" "github.com/project-radius/radius/pkg/linkrp/frontend/handler" @@ -54,7 +53,6 @@ import ( "github.com/project-radius/radius/pkg/recipes/engine" "github.com/project-radius/radius/pkg/sdk" "github.com/project-radius/radius/pkg/sdk/clients" - "k8s.io/client-go/discovery" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" backend_ctrl "github.com/project-radius/radius/pkg/linkrp/backend/controller" @@ -87,21 +85,7 @@ func (s *Service) Run(ctx context.Context) error { return err } - runtimeClient, err := kubeutil.NewRuntimeClient(s.Options.K8sConfig) - if err != nil { - return err - } - - discoveryClient, err := discovery.NewDiscoveryClientForConfig(s.Options.K8sConfig) - if err != nil { - return err - } - - // Use legacy discovery client to avoid the issue of the staled GroupVersion discovery(api.ucp.dev/v1alpha3). - // TODO: Disable UseLegacyDiscovery once https://github.com/project-radius/radius/issues/5974 is resolved. - discoveryClient.UseLegacyDiscovery = true - - client := processors.NewResourceClient(s.Options.Arm, s.Options.UCPConnection, runtimeClient, discoveryClient) + client := processors.NewResourceClient(s.Options.Arm, s.Options.UCPConnection, s.KubeClient, s.KubeDiscoveryClient) clientOptions := sdk.NewClientOptions(s.Options.UCPConnection) deploymentEngineClient, err := clients.NewResourceDeploymentsClient(&clients.Options{ @@ -148,15 +132,15 @@ func (s *Service) Run(ctx context.Context) error { return backend_ctrl.NewCreateOrUpdateResource[*datamodel.RabbitMQMessageQueue, datamodel.RabbitMQMessageQueue](processor, engine, client, configLoader, options) }}, {linkrp.DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &daprstatestores.Processor{Client: runtimeClient} + processor := &daprstatestores.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*datamodel.DaprStateStore, datamodel.DaprStateStore](processor, engine, client, configLoader, options) }}, {linkrp.DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &daprsecretstores.Processor{Client: runtimeClient} + processor := &daprsecretstores.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*datamodel.DaprSecretStore, datamodel.DaprSecretStore](processor, engine, client, configLoader, options) }}, {linkrp.DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &daprpubsubbrokers.Processor{Client: runtimeClient} + processor := &daprpubsubbrokers.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*datamodel.DaprPubSubBroker, datamodel.DaprPubSubBroker](processor, engine, client, configLoader, options) }}, {linkrp.ExtendersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { @@ -170,15 +154,15 @@ func (s *Service) Run(ctx context.Context) error { return backend_ctrl.NewCreateOrUpdateResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, client, configLoader, options) }}, {linkrp.N_DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &statestores.Processor{Client: runtimeClient} + processor := &statestores.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, client, configLoader, options) }}, {linkrp.N_DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &secretstores.Processor{Client: runtimeClient} + processor := &secretstores.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, client, configLoader, options) }}, {linkrp.N_DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &pubsubbrokers.Processor{Client: runtimeClient} + processor := &pubsubbrokers.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, client, configLoader, options) }}, {linkrp.N_MongoDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { diff --git a/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go b/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go index f862d08536..0cb58be2ee 100644 --- a/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go +++ b/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go @@ -25,6 +25,7 @@ import ( "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/linkrp/datamodel" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -66,15 +67,7 @@ func TestDaprPubSubBrokerDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(v20220315privatepreview.ProvisioningStateAccepted), - Status: &v20220315privatepreview.ResourceStatus{ - OutputResources: []map[string]any{ - { - "LocalID": "Deployment", - "Provider": "kubernetes", - "Identity": nil, - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&v20220315privatepreview.ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -112,15 +105,7 @@ func TestDaprPubSubBrokerDataModelToVersioned(t *testing.T) { Version: to.Ptr("v1"), ComponentName: to.Ptr("test-dpsb"), ProvisioningState: to.Ptr(v20220315privatepreview.ProvisioningStateAccepted), - Status: &v20220315privatepreview.ResourceStatus{ - OutputResources: []map[string]any{ - { - "LocalID": "Deployment", - "Provider": "kubernetes", - "Identity": nil, - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&v20220315privatepreview.ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), diff --git a/pkg/linkrp/datamodel/daprstatestore_test.go b/pkg/linkrp/datamodel/daprstatestore_test.go index 9f39803ca1..c4f3c21f66 100644 --- a/pkg/linkrp/datamodel/daprstatestore_test.go +++ b/pkg/linkrp/datamodel/daprstatestore_test.go @@ -20,10 +20,8 @@ import ( "testing" "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) @@ -41,23 +39,7 @@ func TestDaprStateStore_ApplyDeploymentOutput(t *testing.T) { DeployedOutputResources: []rpv1.OutputResource{ { LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Data: resourcemodel.ARMIdentity{}, - }, - RadiusManaged: to.Ptr(true), - Dependencies: []rpv1.Dependency{ - { - LocalID: "", - }, - }, + ID: resources.MustParse("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/test-sa"), }, }, ComputedValues: map[string]any{ @@ -73,23 +55,7 @@ func TestDaprStateStore_ApplyDeploymentOutput(t *testing.T) { DeployedOutputResources: []rpv1.OutputResource{ { LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.DaprStateStoreAzureStorage, - Provider: resourcemodel.ProviderAzure, - }, - Data: resourcemodel.ARMIdentity{}, - }, - RadiusManaged: to.Ptr(true), - Dependencies: []rpv1.Dependency{ - { - LocalID: "", - }, - }, + ID: resources.MustParse("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/test-sa"), }, }, ComputedValues: map[string]any{}, diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json index b703b37f04..3c460ec960 100644 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json +++ b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json @@ -1,29 +1,33 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", - "location": "West US", - "name": "extender0", - "properties": { - "status": { - "outputResources": null - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual", - "provisioningState": "Succeeded" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", + "location": "West US", + "name": "extender0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" }, - "tags": {}, - "type": "applications.link/extenders" + "resourceProvisioning": "manual", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.link/extenders" } \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json index 0a36cafbd2..ffd9386a6a 100644 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json +++ b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json @@ -1,25 +1,29 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", - "location": "West US", - "name": "extender0", - "properties": { - "status": { - "outputResources": null - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "resourceProvisioning": "manual", - "provisioningState": "Succeeded" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", + "location": "West US", + "name": "extender0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.link/extenders" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "resourceProvisioning": "manual", + "provisioningState": "Succeeded" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.link/extenders" } \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json index 431090ce3d..29c85e0176 100644 --- a/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json +++ b/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json @@ -15,12 +15,7 @@ "status": { "outputResources": [ { - "LocalID": "AzureCosmosAccount", - "Dependencies": null, - "ResourceType": { - "type": "azure.cosmosdb.account", - "provider": "azure" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json index 8c08b15a02..af82e27f5f 100644 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json +++ b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json @@ -1,44 +1,48 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/rabbitmqmessagequeues/rabbitmq0", - "name": "rabbitmq0", - "type": "applications.link/rabbitmqmessagequeues", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "status": { - "outputResources": null - }, - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "queue": "testQueue", - "secrets": { - "uri": "connection://string", - "password": "password" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/rabbitmqmessagequeues/rabbitmq0", + "name": "rabbitmq0", + "type": "applications.link/rabbitmqmessagequeues", + "location": "West US", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] }, - "computedValues": { - "queue": "testQueue" - }, - "secretValues": { - "uri": { - "value": "connection://string" - }, - "password": { - "value": "password" - } + "provisioningState": "Succeeded", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "resourceProvisioning": "manual", + "queue": "testQueue", + "secrets": { + "uri": "connection://string", + "password": "password" + } + }, + "computedValues": { + "queue": "testQueue" + }, + "secretValues": { + "uri": { + "value": "connection://string" }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" + "password": { + "value": "password" + } + }, + "tenantId": "00000000-0000-0000-0000-000000000000", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroup": "radius-test-rg", + "createdApiVersion": "2022-03-15-privatepreview", + "updatedApiVersion": "2022-03-15-privatepreview" } \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json index f2d1f2b5b3..968bea1612 100644 --- a/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json +++ b/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json @@ -15,12 +15,7 @@ "status": { "outputResources": [ { - "LocalID": "AzureRedis", - "Dependencies": null, - "ResourceType": { - "type": "azure.redis", - "provider": "azure" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json index abbe084a5d..10d92b06a7 100644 --- a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json +++ b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json @@ -15,12 +15,7 @@ "status": { "outputResources": [ { - "LocalID": "AzureSqlServer", - "Dependencies": null, - "ResourceType": { - "type": "azure.sql", - "provider": "azure" - } + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } ] }, diff --git a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json index e5fe62dbf6..53c9d4359e 100644 --- a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json +++ b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json @@ -1,37 +1,37 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/sqldatabases/sql0", - "location": "West US", - "name": "sql0", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "AzureSqlServer", - "Provider": "azure", - "Identity": null - }] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "provisioningState": "Succeeded", - "resourceProvisioning": "manual", - "port": 1433, - "username": "testUser" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/sqldatabases/sql0", + "location": "West US", + "name": "sql0", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.link/sqldatabases" + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "provisioningState": "Succeeded", + "resourceProvisioning": "manual", + "port": 1433, + "username": "testUser" + }, + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "tags": {}, + "type": "applications.link/sqldatabases" } \ No newline at end of file diff --git a/pkg/linkrp/processors/daprpubsubbrokers/processor.go b/pkg/linkrp/processors/daprpubsubbrokers/processor.go index dc2d41ac75..26263a462b 100644 --- a/pkg/linkrp/processors/daprpubsubbrokers/processor.go +++ b/pkg/linkrp/processors/daprpubsubbrokers/processor.go @@ -26,7 +26,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/handlers" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -96,7 +95,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubB return &processors.ResourceError{Inner: err} } - deployed := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) + deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) deployed.RadiusManaged = to.Ptr(true) resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) diff --git a/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go b/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go index 59313d12b4..cfe0023178 100644 --- a/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go +++ b/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go @@ -27,7 +27,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/k8sutil" @@ -188,9 +187,8 @@ func Test_Process(t *testing.T) { }, } - component := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) + component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) component.RadiusManaged = to.Ptr(true) - component.Resource = generated expectedOutputResources = append(expectedOutputResources, component) require.NoError(t, err) diff --git a/pkg/linkrp/processors/daprsecretstores/processor.go b/pkg/linkrp/processors/daprsecretstores/processor.go index 61fe9c8a26..1990cbf970 100644 --- a/pkg/linkrp/processors/daprsecretstores/processor.go +++ b/pkg/linkrp/processors/daprsecretstores/processor.go @@ -26,7 +26,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/handlers" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -93,7 +92,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretS return &processors.ResourceError{Inner: err} } - deployed := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) + deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) deployed.RadiusManaged = to.Ptr(true) resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) diff --git a/pkg/linkrp/processors/daprsecretstores/processor_test.go b/pkg/linkrp/processors/daprsecretstores/processor_test.go index d1894614aa..dbcdeba80a 100644 --- a/pkg/linkrp/processors/daprsecretstores/processor_test.go +++ b/pkg/linkrp/processors/daprsecretstores/processor_test.go @@ -27,7 +27,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/k8sutil" @@ -172,9 +171,8 @@ func Test_Process(t *testing.T) { }, } - component := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) + component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) component.RadiusManaged = to.Ptr(true) - component.Resource = generated expectedOutputResources := []rpv1.OutputResource{component} require.NoError(t, err) diff --git a/pkg/linkrp/processors/daprstatestores/processor.go b/pkg/linkrp/processors/daprstatestores/processor.go index 47cbdaee5a..dc7f64bc51 100644 --- a/pkg/linkrp/processors/daprstatestores/processor.go +++ b/pkg/linkrp/processors/daprstatestores/processor.go @@ -26,7 +26,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp/handlers" "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/resourcekinds" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -96,7 +95,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateSt return &processors.ResourceError{Inner: err} } - deployed := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) + deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) deployed.RadiusManaged = to.Ptr(true) resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) diff --git a/pkg/linkrp/processors/daprstatestores/processor_test.go b/pkg/linkrp/processors/daprstatestores/processor_test.go index 038249bc48..b98afdaa0a 100644 --- a/pkg/linkrp/processors/daprstatestores/processor_test.go +++ b/pkg/linkrp/processors/daprstatestores/processor_test.go @@ -27,9 +27,10 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcekinds" + "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -180,9 +181,15 @@ func Test_Process(t *testing.T) { }, } - component := rpv1.NewKubernetesOutputResource(resourcekinds.DaprComponent, "Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) + component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) component.RadiusManaged = to.Ptr(true) - component.Resource = generated + component.CreateResource = &rpv1.Resource{ + Data: generated, + ResourceType: resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderKubernetes, + Type: resources_kubernetes.ResourceTypeDaprComponent, + }, + } expectedOutputResources = append(expectedOutputResources, component) require.NoError(t, err) diff --git a/pkg/linkrp/processors/mock_resourceclient.go b/pkg/linkrp/processors/mock_resourceclient.go index 036dd52ce5..c32279b625 100644 --- a/pkg/linkrp/processors/mock_resourceclient.go +++ b/pkg/linkrp/processors/mock_resourceclient.go @@ -35,15 +35,15 @@ func (m *MockResourceClient) EXPECT() *MockResourceClientMockRecorder { } // Delete mocks base method. -func (m *MockResourceClient) Delete(arg0 context.Context, arg1, arg2 string) error { +func (m *MockResourceClient) Delete(arg0 context.Context, arg1 string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Delete", arg0, arg1) ret0, _ := ret[0].(error) return ret0 } // Delete indicates an expected call of Delete. -func (mr *MockResourceClientMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.Call { +func (mr *MockResourceClientMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockResourceClient)(nil).Delete), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockResourceClient)(nil).Delete), arg0, arg1) } diff --git a/pkg/linkrp/processors/resourceclient.go b/pkg/linkrp/processors/resourceclient.go index b04afbca5b..a840cfe476 100644 --- a/pkg/linkrp/processors/resourceclient.go +++ b/pkg/linkrp/processors/resourceclient.go @@ -27,10 +27,11 @@ import ( "github.com/project-radius/radius/pkg/azure/clientv2" aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/pkg/sdk" "github.com/project-radius/radius/pkg/trace" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/pkg/ucp/ucplog" "go.opentelemetry.io/otel/attribute" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -62,7 +63,7 @@ func NewResourceClient(arm *armauth.ArmConfig, connection sdk.Connection, k8sCli } // Delete attempts to delete a resource, either through UCP, Azure, or Kubernetes, depending on the resource type. -func (c *resourceClient) Delete(ctx context.Context, id string, apiVersion string) error { +func (c *resourceClient) Delete(ctx context.Context, id string) error { parsed, err := resources.ParseResource(id) if err != nil { return err @@ -79,11 +80,11 @@ func (c *resourceClient) Delete(ctx context.Context, id string, apiVersion strin ns := strings.ToLower(parsed.PlaneNamespace()) if !parsed.IsUCPQualfied() || strings.HasPrefix(ns, "azure/") { - return c.wrapError(parsed, c.deleteAzureResource(ctx, parsed, apiVersion)) + return c.wrapError(parsed, c.deleteAzureResource(ctx, parsed)) } else if strings.HasPrefix(ns, "kubernetes/") { - return c.wrapError(parsed, c.deleteKubernetesResource(ctx, parsed, apiVersion)) + return c.wrapError(parsed, c.deleteKubernetesResource(ctx, parsed)) } else { - return c.wrapError(parsed, c.deleteUCPResource(ctx, parsed, apiVersion)) + return c.wrapError(parsed, c.deleteUCPResource(ctx, parsed)) } } @@ -95,7 +96,7 @@ func (c *resourceClient) wrapError(id resources.ID, err error) error { return nil } -func (c *resourceClient) deleteAzureResource(ctx context.Context, id resources.ID, apiVersion string) error { +func (c *resourceClient) deleteAzureResource(ctx context.Context, id resources.ID) error { var err error if id.IsUCPQualfied() { id, err = resources.ParseResource(resources.MakeRelativeID(id.ScopeSegments()[1:], id.TypeSegments(), id.ExtensionSegments())) @@ -104,14 +105,12 @@ func (c *resourceClient) deleteAzureResource(ctx context.Context, id resources.I } } - if apiVersion == "" || apiVersion == resourcemodel.APIVersionUnknown { - apiVersion, err = c.lookupARMAPIVersion(ctx, id) - if err != nil { - return err - } + apiVersion, err := c.lookupARMAPIVersion(ctx, id) + if err != nil { + return err } - client, err := clientv2.NewGenericResourceClient(id.FindScope(resources.SubscriptionsSegment), &c.arm.ClientOptions, c.armClientOptions) + client, err := clientv2.NewGenericResourceClient(id.FindScope(resources_azure.ScopeSubscriptions), &c.arm.ClientOptions, c.armClientOptions) if err != nil { return err } @@ -130,7 +129,7 @@ func (c *resourceClient) deleteAzureResource(ctx context.Context, id resources.I } func (c *resourceClient) lookupARMAPIVersion(ctx context.Context, id resources.ID) (string, error) { - client, err := clientv2.NewProvidersClient(id.FindScope(resources.SubscriptionsSegment), &c.arm.ClientOptions, c.armClientOptions) + client, err := clientv2.NewProvidersClient(id.FindScope(resources_azure.ScopeSubscriptions), &c.arm.ClientOptions, c.armClientOptions) if err != nil { return "", err } @@ -161,7 +160,7 @@ func (c *resourceClient) lookupARMAPIVersion(ctx context.Context, id resources.I return "", fmt.Errorf("could not find API version for type %q, type was not found", id.Type()) } -func (c *resourceClient) deleteUCPResource(ctx context.Context, id resources.ID, apiVersion string) error { +func (c *resourceClient) deleteUCPResource(ctx context.Context, id resources.ID) error { // NOTE: the API version passed in here is ignored. // // We're using a generated client that understands Radius' currently supported API version. @@ -187,33 +186,29 @@ func (c *resourceClient) deleteUCPResource(ctx context.Context, id resources.ID, return nil } -func (c *resourceClient) deleteKubernetesResource(ctx context.Context, id resources.ID, apiVersion string) error { - if apiVersion == "" || apiVersion == resourcemodel.APIVersionUnknown { - var err error - apiVersion, err = c.lookupKubernetesAPIVersion(ctx, id) - if err != nil { - return err - } - } - - identity := resourcemodel.FromUCPID(id, apiVersion) - gvk, ns, name, err := identity.RequireKubernetes() +func (c *resourceClient) deleteKubernetesResource(ctx context.Context, id resources.ID) error { + apiVersion, err := c.lookupKubernetesAPIVersion(ctx, id) if err != nil { - // We don't expect this to fail, but just in case.... - return fmt.Errorf("could not understand kubernetes resource id %q: %w", id.String(), err) + return err } + group, kind, namespace, name := resources_kubernetes.ToParts(id) + metadata := map[string]any{ "name": name, } - if ns != "" { - metadata["namespace"] = ns + if namespace != "" { + metadata["namespace"] = namespace + } + + if group != "" { + apiVersion = fmt.Sprintf("%s/%s", group, apiVersion) } obj := unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": gvk.GroupVersion().String(), - "kind": gvk.Kind, + "apiVersion": apiVersion, + "kind": kind, "metadata": metadata, }, } @@ -227,14 +222,9 @@ func (c *resourceClient) deleteKubernetesResource(ctx context.Context, id resour } func (c *resourceClient) lookupKubernetesAPIVersion(ctx context.Context, id resources.ID) (string, error) { - identity := resourcemodel.FromUCPID(id, resourcemodel.APIVersionUnknown) - gvk, namespace, _, err := identity.RequireKubernetes() - if err != nil { - // We don't expect this to fail, but just in case.... - return "", fmt.Errorf("could not find API version for type %q: %w", id.Type(), err) - } - + group, kind, namespace, _ := resources_kubernetes.ToParts(id) var resourceLists []*v1.APIResourceList + var err error if namespace == "" { resourceLists, err = c.k8sDiscoveryClient.ServerPreferredResources() if err != nil { @@ -254,12 +244,12 @@ func (c *resourceClient) lookupKubernetesAPIVersion(ctx context.Context, id reso return "", err } - if gvk.Group != gv.Group { + if group != gv.Group { continue } for _, resource := range resourceList.APIResources { - if resource.Kind == gvk.Kind { + if resource.Kind == kind { return gv.Version, nil } } diff --git a/pkg/linkrp/processors/resourceclient_test.go b/pkg/linkrp/processors/resourceclient_test.go index b093d12826..8a65dd62da 100644 --- a/pkg/linkrp/processors/resourceclient_test.go +++ b/pkg/linkrp/processors/resourceclient_test.go @@ -33,8 +33,8 @@ import ( aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" "github.com/project-radius/radius/pkg/sdk" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/require" - appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -52,39 +52,11 @@ const ( func Test_Delete_InvalidResourceID(t *testing.T) { c := NewResourceClient(nil, nil, nil, nil) - err := c.Delete(context.Background(), "invalid", "") + err := c.Delete(context.Background(), "invalid") require.Error(t, err) } func Test_Delete_ARM(t *testing.T) { - t.Run("success", func(t *testing.T) { - mux := http.NewServeMux() - mux.HandleFunc(ARMResourceID, handleDeleteSuccess(t)) - - server := httptest.NewServer(mux) - defer server.Close() - - c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) - c.armClientOptions = newClientOptions(server.Client(), server.URL) - - err := c.Delete(context.Background(), ARMResourceID, ARMAPIVersion) - require.NoError(t, err) - }) - - t.Run("success (ucp absolute ID)", func(t *testing.T) { - mux := http.NewServeMux() - mux.HandleFunc(ARMResourceID, handleDeleteSuccess(t)) // Note, the /planes... prefix is not part of the request. - - server := httptest.NewServer(mux) - defer server.Close() - - c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) - c.armClientOptions = newClientOptions(server.Client(), server.URL) - - err := c.Delete(context.Background(), AzureUCPResourceID, ARMAPIVersion) - require.NoError(t, err) - }) - t.Run("failure - delete fails", func(t *testing.T) { mux := http.NewServeMux() mux.HandleFunc(ARMResourceID, handleJSONResponse(t, v1.ErrorResponse{ @@ -99,7 +71,7 @@ func Test_Delete_ARM(t *testing.T) { c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) c.armClientOptions = newClientOptions(server.Client(), server.URL) - err := c.Delete(context.Background(), ARMResourceID, ARMAPIVersion) + err := c.Delete(context.Background(), ARMResourceID) require.Error(t, err) require.IsType(t, &ResourceError{}, err) }) @@ -127,7 +99,7 @@ func Test_Delete_ARM(t *testing.T) { c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) c.armClientOptions = newClientOptions(server.Client(), server.URL) - err := c.Delete(context.Background(), ARMResourceID, "") + err := c.Delete(context.Background(), ARMResourceID) require.NoError(t, err) }) @@ -150,7 +122,7 @@ func Test_Delete_ARM(t *testing.T) { c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) c.armClientOptions = newClientOptions(server.Client(), server.URL) - err := c.Delete(context.Background(), ARMResourceID, "") + err := c.Delete(context.Background(), ARMResourceID) require.NoError(t, err) }) @@ -164,7 +136,7 @@ func Test_Delete_ARM(t *testing.T) { c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) c.armClientOptions = newClientOptions(server.Client(), server.URL) - err := c.Delete(context.Background(), ARMResourceID, "") + err := c.Delete(context.Background(), ARMResourceID) require.Error(t, err) require.IsType(t, &ResourceError{}, err) }) @@ -182,7 +154,7 @@ func Test_Delete_ARM(t *testing.T) { c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) c.armClientOptions = newClientOptions(server.Client(), server.URL) - err := c.Delete(context.Background(), ARMResourceID, "") + err := c.Delete(context.Background(), ARMResourceID) require.Error(t, err) require.IsType(t, &ResourceError{}, err) require.Contains(t, err.Error(), "could not find API version for type \"Microsoft.Compute/virtualMachines\", type was not found") @@ -206,7 +178,7 @@ func Test_Delete_ARM(t *testing.T) { c := NewResourceClient(newArmOptions(server.URL), nil, nil, nil) c.armClientOptions = newClientOptions(server.Client(), server.URL) - err := c.Delete(context.Background(), ARMResourceID, "") + err := c.Delete(context.Background(), ARMResourceID) require.Error(t, err) require.IsType(t, &ResourceError{}, err) require.Contains(t, err.Error(), "could not find API version for type \"Microsoft.Compute/virtualMachines\", no supported API versions") @@ -214,34 +186,6 @@ func Test_Delete_ARM(t *testing.T) { } func Test_Delete_Kubernetes(t *testing.T) { - t.Run("success", func(t *testing.T) { - client := fake.NewClientBuilder().WithObjects(&corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-name", - Namespace: "test-namespace", - }, - }).Build() - - c := NewResourceClient(nil, nil, client, nil) - - err := c.Delete(context.Background(), KubernetesCoreGroupResourceID, "v1") - require.NoError(t, err) - }) - - t.Run("success (non-core)", func(t *testing.T) { - client := fake.NewClientBuilder().WithObjects(&appsv1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-name", - Namespace: "test-namespace", - }, - }).Build() - - c := NewResourceClient(nil, nil, client, nil) - - err := c.Delete(context.Background(), KubernetesNonCoreGroupResourceID, "v1") - require.NoError(t, err) - }) - // Note: unfortunately there isn't a great way to test a deletion failure with the runtime client. t.Run("success - lookup API Version (preferred namespaced resources)", func(t *testing.T) { @@ -252,7 +196,7 @@ func Test_Delete_Kubernetes(t *testing.T) { }, }).Build() - dc := &discoveryClient{ + dc := &k8sutil.DiscoveryClient{ Resources: []*metav1.APIResourceList{ { GroupVersion: "v1", @@ -269,7 +213,7 @@ func Test_Delete_Kubernetes(t *testing.T) { c := NewResourceClient(nil, nil, client, dc) - err := c.Delete(context.Background(), KubernetesCoreGroupResourceID, "") + err := c.Delete(context.Background(), KubernetesCoreGroupResourceID) require.NoError(t, err) }) @@ -280,7 +224,7 @@ func Test_Delete_Kubernetes(t *testing.T) { }, }).Build() - dc := &discoveryClient{ + dc := &k8sutil.DiscoveryClient{ Resources: []*metav1.APIResourceList{ { GroupVersion: "v1", @@ -297,7 +241,7 @@ func Test_Delete_Kubernetes(t *testing.T) { c := NewResourceClient(nil, nil, client, dc) - err := c.Delete(context.Background(), KubernetesCoreGroupResourceID, "") + err := c.Delete(context.Background(), KubernetesCoreGroupResourceID) require.NoError(t, err) }) @@ -309,13 +253,13 @@ func Test_Delete_Kubernetes(t *testing.T) { }, }).Build() - dc := &discoveryClient{ + dc := &k8sutil.DiscoveryClient{ Resources: []*metav1.APIResourceList{}, } c := NewResourceClient(nil, nil, client, dc) - err := c.Delete(context.Background(), KubernetesCoreGroupResourceID, "") + err := c.Delete(context.Background(), KubernetesCoreGroupResourceID) require.Error(t, err) require.Contains(t, err.Error(), "could not find API version for type \"core/Secret\", type was not found") }) @@ -334,7 +278,7 @@ func Test_Delete_UCP(t *testing.T) { c := NewResourceClient(nil, connection, nil, nil) - err = c.Delete(context.Background(), AWSResourceID, "") + err = c.Delete(context.Background(), AWSResourceID) require.NoError(t, err) }) @@ -354,7 +298,7 @@ func Test_Delete_UCP(t *testing.T) { c := NewResourceClient(nil, connection, nil, nil) - err = c.Delete(context.Background(), AWSResourceID, "") + err = c.Delete(context.Background(), AWSResourceID) require.Error(t, err) require.IsType(t, &ResourceError{}, err) }) @@ -422,34 +366,3 @@ type wrapper struct { func (w *wrapper) Do(req *http.Request) (*http.Response, error) { return w.Client.Do(req) } - -type discoveryClient struct { - Groups *metav1.APIGroupList - Resources []*metav1.APIResourceList - APIGroup []*metav1.APIGroup -} - -// ServerGroups returns a list of API groups supported by the server. -func (d *discoveryClient) ServerGroups() (*metav1.APIGroupList, error) { - return d.Groups, nil -} - -// This function returns a slice of API resource lists. -func (d *discoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { - return d.Resources, nil -} - -// This function returns a slice of API resource lists. -func (d *discoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { - return d.Resources, nil -} - -// ServerGroupsAndResources returns a list of API groups and resources associated with the discovery client. -func (d *discoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { - return d.APIGroup, d.Resources, nil -} - -// ServerResourcesForGroupVersion returns nil for the API resource list. -func (d *discoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { - return nil, nil -} diff --git a/pkg/linkrp/processors/types.go b/pkg/linkrp/processors/types.go index af2258d4ea..8a21eef0dd 100644 --- a/pkg/linkrp/processors/types.go +++ b/pkg/linkrp/processors/types.go @@ -62,7 +62,7 @@ type ResourceClient interface { // Delete deletes a resource by id. // // If the API version is omitted, then an attempt will be made to look up the API version. - Delete(ctx context.Context, id string, apiVersion string) error + Delete(ctx context.Context, id string) error } // ResourceError represents an error that occured while processing a resource. diff --git a/pkg/linkrp/processors/util.go b/pkg/linkrp/processors/util.go index 8b93deedbe..3ea2bac722 100644 --- a/pkg/linkrp/processors/util.go +++ b/pkg/linkrp/processors/util.go @@ -21,7 +21,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -32,21 +31,14 @@ import ( // processing the '.properties.resources' field of a resource. func GetOutputResourcesFromResourcesField(field []*linkrp.ResourceReference) ([]rpv1.OutputResource, error) { results := []rpv1.OutputResource{} - for i, resource := range field { + for _, resource := range field { id, err := resources.ParseResource(resource.ID) if err != nil { return nil, &ValidationError{Message: fmt.Sprintf("resource id %q is invalid", resource.ID)} } - identity := resourcemodel.FromUCPID(id, "") - if (identity == resourcemodel.ResourceIdentity{}) { - return nil, &ValidationError{Message: fmt.Sprintf("resource id %q is invalid", resource)} - } - result := rpv1.OutputResource{ - LocalID: fmt.Sprintf("Resource%d", i), // The dependency sorting code requires unique LocalIDs - Identity: identity, - ResourceType: *identity.ResourceType, + ID: id, RadiusManaged: to.Ptr(false), // Generally when we parse a resource ID from a resource field, it's externally managed. } results = append(results, result) @@ -59,21 +51,14 @@ func GetOutputResourcesFromResourcesField(field []*linkrp.ResourceReference) ([] // returning an error if any of the resources are invalid. func GetOutputResourcesFromRecipe(output *recipes.RecipeOutput) ([]rpv1.OutputResource, error) { results := []rpv1.OutputResource{} - for i, resource := range output.Resources { + for _, resource := range output.Resources { id, err := resources.ParseResource(resource) if err != nil { return nil, &ValidationError{Message: fmt.Sprintf("resource id %q returned by recipe is invalid", resource)} } - identity := resourcemodel.FromUCPID(id, "") - if (identity == resourcemodel.ResourceIdentity{}) { - return nil, &ValidationError{Message: fmt.Sprintf("resource id %q returned by recipe is invalid", resource)} - } - result := rpv1.OutputResource{ - LocalID: fmt.Sprintf("RecipeResource%d", i), // The dependency sorting code requires unique LocalIDs - Identity: identity, - ResourceType: *identity.ResourceType, + ID: id, RadiusManaged: to.Ptr(true), } diff --git a/pkg/linkrp/processors/util_test.go b/pkg/linkrp/processors/util_test.go index 1f76830ea0..65be5d935a 100644 --- a/pkg/linkrp/processors/util_test.go +++ b/pkg/linkrp/processors/util_test.go @@ -21,9 +21,9 @@ import ( "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) @@ -33,22 +33,15 @@ func Test_GetOutputResourcesFromResourcesField(t *testing.T) { {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Cache/redis/test-resource2"}, } - redisType := resourcemodel.ResourceType{ - Type: "Microsoft.Cache/redis", - Provider: resourcemodel.ProviderAzure, - } - expected := []rpv1.OutputResource{ { - LocalID: "Resource0", - ResourceType: redisType, - Identity: resourcemodel.NewARMIdentity(&redisType, resourcesField[0].ID, "unknown"), + LocalID: "", + ID: resources.MustParse(resourcesField[0].ID), RadiusManaged: to.Ptr(false), }, { - LocalID: "Resource1", - ResourceType: redisType, - Identity: resourcemodel.NewARMIdentity(&redisType, resourcesField[1].ID, "unknown"), + LocalID: "", + ID: resources.MustParse(resourcesField[1].ID), RadiusManaged: to.Ptr(false), }, } @@ -78,22 +71,15 @@ func Test_GetOutputResourcesFromRecipe(t *testing.T) { }, } - redisType := resourcemodel.ResourceType{ - Type: "Microsoft.Cache/redis", - Provider: resourcemodel.ProviderAzure, - } - expected := []rpv1.OutputResource{ { - LocalID: "RecipeResource0", - ResourceType: redisType, - Identity: resourcemodel.NewARMIdentity(&redisType, output.Resources[0], "unknown"), + LocalID: "", + ID: resources.MustParse(output.Resources[0]), RadiusManaged: to.Ptr(true), }, { - LocalID: "RecipeResource1", - ResourceType: redisType, - Identity: resourcemodel.NewARMIdentity(&redisType, output.Resources[1], "unknown"), + LocalID: "", + ID: resources.MustParse(output.Resources[1]), RadiusManaged: to.Ptr(true), }, } diff --git a/pkg/linkrp/processors/validator_test.go b/pkg/linkrp/processors/validator_test.go index 3a7203641f..52224eae08 100644 --- a/pkg/linkrp/processors/validator_test.go +++ b/pkg/linkrp/processors/validator_test.go @@ -21,7 +21,6 @@ import ( "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -178,12 +177,6 @@ func Test_Validator_SetAndValidate_OutputResources(t *testing.T) { Resources: []string{"/planes/aws/aws/accounts/1234/regions/us-west-1/providers/AWS.Kinesis/Stream/my-stream2"}, } - mustparse := func(id string) resources.ID { - parsed, err := resources.ParseResource(id) - require.NoError(t, err) - return parsed - } - v := NewValidator(&values, &secrets, &outputResources) v.AddResourcesField(&resourcesField) @@ -192,15 +185,11 @@ func Test_Validator_SetAndValidate_OutputResources(t *testing.T) { expected := []rpv1.OutputResource{ { - LocalID: "RecipeResource0", - Identity: resourcemodel.FromUCPID(mustparse(output.Resources[0]), ""), - ResourceType: *resourcemodel.FromUCPID(mustparse(output.Resources[0]), "").ResourceType, + ID: resources.MustParse(output.Resources[0]), RadiusManaged: to.Ptr(true), }, { - LocalID: "Resource0", - Identity: resourcemodel.FromUCPID(mustparse(resourcesField[0].ID), ""), - ResourceType: *resourcemodel.FromUCPID(mustparse(resourcesField[0].ID), "").ResourceType, + ID: resources.MustParse(resourcesField[0].ID), RadiusManaged: to.Ptr(false), }, } diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go index aac0372abf..bc3c69d677 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go @@ -22,10 +22,11 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/messagingrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" + "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -116,10 +117,9 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel(t *testing.T) { for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) versionedResource := &RabbitMQQueueResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) // act @@ -156,15 +156,7 @@ func TestRabbitMQQueue_ConvertDataModelToVersioned(t *testing.T) { Port: to.Ptr(int32(5672)), Username: to.Ptr("test-user"), TLS: to.Ptr(true), - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "rabbitmqProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -196,15 +188,7 @@ func TestRabbitMQQueue_ConvertDataModelToVersioned(t *testing.T) { "foo": "bar", }, }, - Status: &ResourceStatus{ - OutputResources: []map[string]any{ - { - "Identity": nil, - "LocalID": "Deployment", - "Provider": "rabbitmqProvider", - }, - }, - }, + Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ "env": to.Ptr("dev"), @@ -217,10 +201,9 @@ func TestRabbitMQQueue_ConvertDataModelToVersioned(t *testing.T) { } for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + tc.file) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(tc.file) resource := &datamodel.RabbitMQQueue{} - err = json.Unmarshal(rawPayload, resource) + err := json.Unmarshal(rawPayload, resource) require.NoError(t, err) versionedResource := &RabbitMQQueueResource{} @@ -255,10 +238,9 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) for _, test := range testset { t.Run(test.payload, func(t *testing.T) { - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/" + test.payload) - require.NoError(t, err) + rawPayload := testutil.ReadFixture(test.payload) versionedResource := &RabbitMQQueueResource{} - err = json.Unmarshal(rawPayload, versionedResource) + err := json.Unmarshal(rawPayload, versionedResource) require.NoError(t, err) dm, err := versionedResource.ConvertTo() @@ -275,7 +257,7 @@ func TestRabbitMQQueue_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } @@ -288,10 +270,9 @@ func TestRabbitMQQueue_ConvertFromValidation(t *testing.T) { func TestRabbitMQSecrets_ConvertVersionedToDataModel(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/rabbitmqsecrets.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("rabbitmqsecrets.json") versioned := &RabbitMQSecrets{} - err = json.Unmarshal(rawPayload, versioned) + err := json.Unmarshal(rawPayload, versioned) require.NoError(t, err) // act @@ -305,10 +286,9 @@ func TestRabbitMQSecrets_ConvertVersionedToDataModel(t *testing.T) { func TestRabbitMQSecrets_ConvertDataModelToVersioned(t *testing.T) { // arrange - rawPayload, err := v20220315privatepreview.LoadTestData("./testdata/rabbitmqsecretsdatamodel.json") - require.NoError(t, err) + rawPayload := testutil.ReadFixture("rabbitmqsecretsdatamodel.json") secrets := &datamodel.RabbitMQSecrets{} - err = json.Unmarshal(rawPayload, secrets) + err := json.Unmarshal(rawPayload, secrets) require.NoError(t, err) // act @@ -325,7 +305,7 @@ func TestRabbitMQSecrets_ConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&v20220315privatepreview.FakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json b/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json index dc7d2b9705..2f686b7856 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json +++ b/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json @@ -1,41 +1,39 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Messaging/rabbitMQQueues", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "location": "global", - "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "rabbitmq", - "Provider": "rabbitmqProvider" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning":"manual", - "queue": "testQueue", - "host": "test-host", - "vHost": "test-vhost", - "port": 5672, - "username": "test-user", - "tls":true, - "secrets": { - "uri": "connection://string", - "password": "password" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "location": "global", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "resourceProvisioning": "manual", + "queue": "testQueue", + "host": "test-host", + "vHost": "test-vhost", + "port": 5672, + "username": "test-user", + "tls": true, + "secrets": { + "uri": "connection://string", + "password": "password" } + } } \ No newline at end of file diff --git a/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json b/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json index f330bc499d..4b0e169796 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json +++ b/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json @@ -3,41 +3,39 @@ "name": "rabbitmq0", "type": "Applications.Messaging/rabbitMQQueues", "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" }, "tags": { - "env": "dev" + "env": "dev" }, "location": "global", "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "rabbitmq", - "Provider": "rabbitmqProvider" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning":"recipe", - "queue": "testQueue", - "host": "test-host", - "port": 5672, - "vHost": "test-vhost", - "username": "test-user", - "tls":false, - "recipe": { - "name": "rabbitmq", - "parameters":{ - "foo":"bar" - } + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "resourceProvisioning": "recipe", + "queue": "testQueue", + "host": "test-host", + "port": 5672, + "vHost": "test-vhost", + "username": "test-user", + "tls": false, + "recipe": { + "name": "rabbitmq", + "parameters": { + "foo": "bar" } + } } } \ No newline at end of file diff --git a/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json b/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json index 2433cbbb07..0e33a9e71d 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json +++ b/pkg/messagingrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json @@ -4,26 +4,24 @@ "type": "Applications.Messaging/rabbitMQQueues", "location": "global", "tags": { - "env": "dev" + "env": "dev" }, "properties": { - "status": { - "outputResources": [{ - "LocalID": "Deployment", - "ResourceType": { - "Type": "rabbitmq", - "Provider": "rabbitmqProvider" - } - }] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "tls": false, - "recipe": { - "name": "rabbitmq", - "parameters":{ - "foo":"bar" - } + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", + "tls": false, + "recipe": { + "name": "rabbitmq", + "parameters": { + "foo": "bar" } + } } } \ No newline at end of file diff --git a/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go b/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go index b5c6a970d8..2abf098af5 100644 --- a/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go +++ b/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go @@ -22,9 +22,9 @@ import ( "testing" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - linkrp_util "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/messagingrp/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/test/testutil" "github.com/stretchr/testify/require" ) @@ -52,10 +52,10 @@ func TestRabbitMQQueueDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.RabbitMQQueue{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := RabbitMQQueueDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -92,8 +92,7 @@ func TestRabbitMQQueueDataModelFromVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.versionedModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.versionedModelFile) dm, err := RabbitMQQueueDataModelFromVersioned(c, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) @@ -128,10 +127,10 @@ func TestRabbitMQSecretsDataModelToVersioned(t *testing.T) { for _, tc := range testset { t.Run(tc.apiVersion, func(t *testing.T) { - c, err := linkrp_util.LoadTestData(tc.dataModelFile) - require.NoError(t, err) + c := testutil.ReadFixture("../" + tc.dataModelFile) dm := &datamodel.RabbitMQSecrets{} - _ = json.Unmarshal(c, dm) + err := json.Unmarshal(c, dm) + require.NoError(t, err) am, err := RabbitMQSecretsDataModelToVersioned(dm, tc.apiVersion) if tc.err != nil { require.ErrorAs(t, tc.err, &err) diff --git a/pkg/messagingrp/frontend/controller/rabbitmqqueues/testdata/20220315privatepreview_datamodel.json b/pkg/messagingrp/frontend/controller/rabbitmqqueues/testdata/20220315privatepreview_datamodel.json index 64fde9a2e3..dd945fcb96 100644 --- a/pkg/messagingrp/frontend/controller/rabbitmqqueues/testdata/20220315privatepreview_datamodel.json +++ b/pkg/messagingrp/frontend/controller/rabbitmqqueues/testdata/20220315privatepreview_datamodel.json @@ -1,44 +1,48 @@ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.messaging/rabbitmqqueues/rabbitmq0", - "name": "rabbitmq0", - "type": "applications.messaging/rabbitmqqueues", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "status": { - "outputResources": null - }, - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "queue": "testQueue", - "secrets": { - "uri": "connection://string", - "password": "password" + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.messaging/rabbitmqqueues/rabbitmq0", + "name": "rabbitmq0", + "type": "applications.messaging/rabbitmqqueues", + "location": "West US", + "systemData": { + "createdAt": "2022-03-22T18:54:52.6857175Z", + "createdBy": "fake@hotmail.com", + "createdByType": "User", + "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", + "lastModifiedBy": "fake@hotmail.com", + "lastModifiedByType": "User" + }, + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" } + ] }, - "computedValues": { - "queue": "testQueue" - }, - "secretValues": { - "uri": { - "value": "connection://string" - }, - "password": { - "value": "password" - } + "provisioningState": "Succeeded", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", + "resourceProvisioning": "manual", + "queue": "testQueue", + "secrets": { + "uri": "connection://string", + "password": "password" + } + }, + "computedValues": { + "queue": "testQueue" + }, + "secretValues": { + "uri": { + "value": "connection://string" }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" + "password": { + "value": "password" + } + }, + "tenantId": "00000000-0000-0000-0000-000000000000", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroup": "radius-test-rg", + "createdApiVersion": "2022-03-15-privatepreview", + "updatedApiVersion": "2022-03-15-privatepreview" } \ No newline at end of file diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index 75930d195c..b41262035f 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -32,11 +32,11 @@ import ( "github.com/project-radius/radius/pkg/metrics" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/recipecontext" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/pkg/rp/util" rpv1 "github.com/project-radius/radius/pkg/rp/v1" clients "github.com/project-radius/radius/pkg/sdk/clients" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" "github.com/project-radius/radius/pkg/ucp/ucplog" coredm "github.com/project-radius/radius/pkg/corerp/datamodel" @@ -98,7 +98,7 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu } // Provider config will specify the Azure and AWS scopes (if provided). - providerConfig := newProviderConfig(deploymentID.FindScope(resources.ResourceGroupsSegment), configuration.Providers) + providerConfig := newProviderConfig(deploymentID.FindScope(resources_radius.ScopeResourceGroups), configuration.Providers) logger.Info("deploying bicep template for recipe", "deploymentID", deploymentID) if providerConfig.AWS != nil { @@ -151,20 +151,18 @@ func (d *bicepDriver) Delete(ctx context.Context, outputResources []rpv1.OutputR // Loop over each output resource and delete in reverse dependency order for i := len(orderedOutputResources) - 1; i >= 0; i-- { outputResource := orderedOutputResources[i] - id := outputResource.Identity.GetID() - if err != nil { - return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) - } - logger.Info(fmt.Sprintf("Deleting output resource: %v, LocalID: %s, resource type: %s\n", outputResource.Identity, outputResource.LocalID, outputResource.ResourceType.Type)) + + resourceType := outputResource.GetResourceType() + logger.Info(fmt.Sprintf("Deleting output resource: %v, LocalID: %s, resource type: %s\n", outputResource.ID.String(), outputResource.LocalID, resourceType.Type)) if outputResource.RadiusManaged == nil || !*outputResource.RadiusManaged { continue } - err = d.ResourceClient.Delete(ctx, id, resourcemodel.APIVersionUnknown) + err = d.ResourceClient.Delete(ctx, outputResource.ID.String()) if err != nil { return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } - logger.Info(fmt.Sprintf("Deleted output resource: %q", id), ucplog.LogFieldTargetResourceID, id) + logger.Info(fmt.Sprintf("Deleted output resource: %q", outputResource.ID.String()), ucplog.LogFieldTargetResourceID, outputResource.ID.String()) } @@ -214,7 +212,7 @@ func createDeploymentID(resourceID string, deploymentName string) (resources.ID, return resources.ID{}, err } - resourceGroup := parsed.FindScope(resources.ResourceGroupsSegment) + resourceGroup := parsed.FindScope(resources_radius.ScopeResourceGroups) return resources.ParseResource(fmt.Sprintf("/planes/radius/local/resourceGroups/%s/providers/Microsoft.Resources/deployments/%s", resourceGroup, deploymentName)) } diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index a49846f7e0..f04c87dcb9 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -27,11 +27,11 @@ import ( "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/recipecontext" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" clients "github.com/project-radius/radius/pkg/sdk/clients" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/project-radius/radius/test/testcontext" "github.com/stretchr/testify/require" ) @@ -369,39 +369,27 @@ func Test_Bicep_Delete_Success(t *testing.T) { outputResources := []rpv1.OutputResource{ { LocalID: "RecipeResource0", - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: "Service", - Provider: "kubernetes", - }, - Data: map[string]any{ - "apiVersion": "apps/unknown", - "kind": "Deployment", - "name": "redis", - "namespace": "recipe-app", - }, - }, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "apps", + "Deployment", + "recipe-app", + "redis"), RadiusManaged: to.Ptr(true), }, { LocalID: "RecipeResource1", - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: "Service", - Provider: "kubernetes", - }, - Data: map[string]any{ - "apiVersion": "apps/unknown", - "kind": "Deployment", - "name": "redis", - "namespace": "recipe-app", - }, - }, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + "Service", + "recipe-app", + "redis"), // We don't expect a call to delete to be made when RadiusManaged is false. RadiusManaged: to.Ptr(false), }, } - client.EXPECT().Delete(ctx, "/planes/kubernetes/local/namespaces/recipe-app/providers/apps/Deployment/redis", resourcemodel.APIVersionUnknown).Times(1).Return(nil) + client.EXPECT().Delete(ctx, "/planes/kubernetes/local/namespaces/recipe-app/providers/apps/Deployment/redis").Times(1).Return(nil) err := driver.Delete(ctx, outputResources) require.NoError(t, err) @@ -412,29 +400,25 @@ func Test_Bicep_Delete_Error(t *testing.T) { driver, client := setupDeleteInputs(t) outputResources := []rpv1.OutputResource{ { - LocalID: "RecipeResource0", - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: "KubernetesService", - Provider: "kubernetes", - }, - Data: map[string]any{ - "apiVersion": "invalid api versionn", - "kind": "Deployment", - "name": "redis", - "namespace": "recipe-app", - }, - }, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "core", + "Deployment", + "recipe-app", + "redis"), RadiusManaged: to.Ptr(true), }, } recipeError := recipes.RecipeError{ ErrorDetails: v1.ErrorDetails{ Code: recipes.RecipeDeletionFailed, - Message: fmt.Sprintf("could not find API version for type %q, no supported API versions", outputResources[0].Identity.ResourceType.Type), + Message: fmt.Sprintf("could not find API version for type %q, no supported API versions", outputResources[0].GetResourceType().Type), }, } - client.EXPECT().Delete(ctx, "/planes/kubernetes/local/namespaces/recipe-app/providers/core/Deployment/redis", resourcemodel.APIVersionUnknown).Times(1).Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].Identity.ResourceType.Type)) + client.EXPECT(). + Delete(ctx, "/planes/kubernetes/local/namespaces/recipe-app/providers/core/Deployment/redis"). + Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].GetResourceType().Type)). + Times(1) err := driver.Delete(ctx, outputResources) require.Error(t, err) diff --git a/pkg/recipes/engine/engine_test.go b/pkg/recipes/engine/engine_test.go index 781e0c5b77..ff896f4edf 100644 --- a/pkg/recipes/engine/engine_test.go +++ b/pkg/recipes/engine/engine_test.go @@ -26,8 +26,8 @@ import ( "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" "github.com/project-radius/radius/pkg/recipes/driver" - "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/test/testcontext" "github.com/stretchr/testify/require" ) @@ -274,7 +274,7 @@ func Test_Engine_Delete_Error(t *testing.T) { engine, configLoader, driver := setup(t) configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(&recipeDefinition, nil) - driver.EXPECT().Delete(ctx, outputResources).Times(1).Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].Identity.ResourceType.Type)) + driver.EXPECT().Delete(ctx, outputResources).Times(1).Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].ID)) err := engine.Delete(ctx, recipeMetadata, outputResources) require.Error(t, err) @@ -308,7 +308,7 @@ func getDeleteInputs() (recipes.ResourceMetadata, recipes.EnvironmentDefinition, Name: "mongo-azure", ApplicationID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/applications/app1", EnvironmentID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/environments/env1", - ResourceID: "/planes/deployments/local/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/recipe", + ResourceID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/test-db", Parameters: map[string]any{ "resourceName": "resource1", }, @@ -322,13 +322,7 @@ func getDeleteInputs() (recipes.ResourceMetadata, recipes.EnvironmentDefinition, outputResources := []rpv1.OutputResource{ { - LocalID: "/planes/deployments/local/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/recipe", - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: "Microsoft.Resources/deployments", - Provider: "azure", - }, - }, + ID: resources.MustParse("/subscriptions/test-sub/resourcegroups/test-rg/providers/Microsoft.DocumentDB/accounts/test-account"), }, } return recipeMetadata, recipeDefinition, outputResources diff --git a/pkg/recipes/recipecontext/context.go b/pkg/recipes/recipecontext/context.go index 3ae3d42c84..3330e67197 100644 --- a/pkg/recipes/recipecontext/context.go +++ b/pkg/recipes/recipecontext/context.go @@ -22,6 +22,8 @@ import ( coredm "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/ucp/resources" + resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" ) var ( @@ -78,8 +80,8 @@ func New(metadata *recipes.ResourceMetadata, config *recipes.Configuration) (*Co return nil, fmt.Errorf(ErrParseFormat, "Azure scope", providers.Azure.Scope, err) } - subID := p.FindScope(resources.SubscriptionsSegment) - rgName := p.FindScope(resources.ResourceGroupsSegment) + subID := p.FindScope(resources_azure.ScopeSubscriptions) + rgName := p.FindScope(resources_azure.ScopeResourceGroups) recipeContext.Azure = &ProviderAzure{ ResourceGroup: AzureResourceGroup{ Name: rgName, @@ -98,8 +100,8 @@ func New(metadata *recipes.ResourceMetadata, config *recipes.Configuration) (*Co return nil, fmt.Errorf(ErrParseFormat, "AWS scope", providers.AWS.Scope, err) } recipeContext.AWS = &ProviderAWS{ - Region: p.FindScope(resources.RegionsSegment), - Account: p.FindScope(resources.AccountsSegment), + Region: p.FindScope(resources_aws.ScopeRegions), + Account: p.FindScope(resources_aws.ScopeAccounts), } } diff --git a/pkg/recipes/terraform/config/providers/aws.go b/pkg/recipes/terraform/config/providers/aws.go index d67c7d8684..129940e1e9 100644 --- a/pkg/recipes/terraform/config/providers/aws.go +++ b/pkg/recipes/terraform/config/providers/aws.go @@ -27,6 +27,7 @@ import ( "github.com/project-radius/radius/pkg/sdk" "github.com/project-radius/radius/pkg/ucp/credentials" "github.com/project-radius/radius/pkg/ucp/resources" + resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" "github.com/project-radius/radius/pkg/ucp/secret" ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" "github.com/project-radius/radius/pkg/ucp/ucplog" @@ -92,7 +93,7 @@ func (p *awsProvider) parseScope(ctx context.Context, envConfig *recipes.Configu return "", fmt.Errorf("invalid AWS provider scope %q is configured on the Environment, error parsing: %s", scope, err.Error()) } - region := parsedScope.FindScope(resources.RegionsSegment) + region := parsedScope.FindScope(resources_aws.ScopeRegions) if region == "" { return "", fmt.Errorf("invalid AWS provider scope %q is configured on the Environment, region is required in the scope", scope) } diff --git a/pkg/recipes/terraform/config/providers/azure.go b/pkg/recipes/terraform/config/providers/azure.go index ab83e63c9c..6431f06527 100644 --- a/pkg/recipes/terraform/config/providers/azure.go +++ b/pkg/recipes/terraform/config/providers/azure.go @@ -27,6 +27,7 @@ import ( "github.com/project-radius/radius/pkg/sdk" "github.com/project-radius/radius/pkg/ucp/credentials" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/secret" ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" "github.com/project-radius/radius/pkg/ucp/ucplog" @@ -100,7 +101,7 @@ func (p *azureProvider) parseScope(ctx context.Context, envConfig *recipes.Confi return "", fmt.Errorf("invalid Azure provider scope %q is configured on the Environment, error parsing: %s", scope, err.Error()) } - subscription := parsedScope.FindScope(resources.SubscriptionsSegment) + subscription := parsedScope.FindScope(resources_azure.ScopeSubscriptions) if subscription == "" { return "", fmt.Errorf("invalid Azure provider scope %q is configured on the Environment, subscription is required in the scope", scope) } diff --git a/pkg/resourcekinds/resource_kinds.go b/pkg/resourcekinds/resource_kinds.go deleted file mode 100644 index e90f027395..0000000000 --- a/pkg/resourcekinds/resource_kinds.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resourcekinds - -// ResourceKinds supported. The RP determines how these are created/deleted and the HealthService determines how -// health checks are handled for these -const ( - Azure = "azure" - Kubernetes = "kubernetes" - Deployment = "Deployment" - Service = "Service" - ServiceAccount = "ServiceAccount" - Secret = "Secret" - Gateway = "Gateway" - Volume = "Volume" - KubernetesRole = "KubernetesRole" - KubernetesRoleBinding = "KubernetesRoleBinding" - KubernetesHTTPRoute = "HTTPRoute" // For httproutes.networking.x-k8s.io - RadiusHttpRoute = "HttpRoute" // For httproutes.radius.dev - StatefulSet = "StatefulSet" - SecretProviderClass = "SecretProviderClass" - DaprStateStoreAzureStorage = "dapr.statestore.azurestorage" - DaprStateStoreAzureTableService = "dapr.statestore.azuretableservice" - DaprStateStoreAzureTable = "dapr.statestore.azuretable" - DaprStateStoreAzureTableStorage = "state.azure.tablestorage" - DaprGeneric = "generic" - DaprComponent = "dapr.io.component" - DaprPubSubTopicAzureServiceBus = "pubsub.azure.servicebus" - AzureCosmosAccount = "azure.cosmosdb.account" - AzureCosmosDBMongo = "azure.cosmosdb.mongo" - AzureCosmosDBSQL = "azure.cosmosdb.sql" - AzureSqlServer = "azure.sql" - AzureSqlServerDatabase = "azure.sql.database" - AzureUserAssignedManagedIdentity = "azure.userassignedmanagedidentity" - AzureFederatedIdentity = "azure.federatedidentity" - AzureRoleAssignment = "azure.roleassignment" - AzureRedis = "azure.redis" - AzureFileShare = "azure.fileshare" - AzureFileShareStorageAccount = "azure.fileshare.account" - - // AnyResourceType is used to designate a resource handler that can handle any type that belongs to a provider. AnyResourceType - // should only be used to register handlers, and not as part of an output resource. - AnyResourceType = "*" -) diff --git a/pkg/resourcemodel/identity.go b/pkg/resourcemodel/identity.go index ee7600e144..9306c18cf0 100644 --- a/pkg/resourcemodel/identity.go +++ b/pkg/resourcemodel/identity.go @@ -17,19 +17,7 @@ limitations under the License. package resourcemodel import ( - "encoding/json" "fmt" - "strings" - - "github.com/project-radius/radius/pkg/logging" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "go.mongodb.org/mongo-driver/bson" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" ) // Providers supported by Radius @@ -39,11 +27,6 @@ const ( ProviderAWS = "aws" ProviderRadius = "radius" ProviderKubernetes = "kubernetes" - - // APIVersionUnknown encodes an "unknown" API version. Including API version in resource identity is - // a design mistake because an API version is not part of the identity of a resource. We use this - // value as a sentinel for the cases where we don't have a preferred API version. - APIVersionUnknown = "unknown" ) // ResourceType determines the type of the resource and the provider domain for the resource @@ -56,485 +39,3 @@ type ResourceType struct { func (r ResourceType) String() string { return fmt.Sprintf("Provider: %s, Type: %s", r.Provider, r.Type) } - -// ResourceIdentity represents the identity of a resource in the underlying system. -// - eg: For ARM this a Resource ID + API Version -// - eg: For Kubernetes this a GroupVersionKind + Namespace + Name -// -// This type supports safe serialization to/from JSON & BSON. -type ResourceIdentity struct { - ResourceType *ResourceType `json:"resourceType"` - // A polymorphic payload. The fields in this data structure are determined by the provider field in the ResourceType - Data any `json:"data"` -} - -// We just need custom Unmarshaling, default Marshaling is fine. -var _ json.Unmarshaler = (*ResourceIdentity)(nil) - -// ARMIdentity uniquely identifies an ARM resource -type ARMIdentity struct { - ID string `json:"id"` - APIVersion string `json:"apiVersion"` -} - -// UCPIdentity uniquely identifies a UCP resource -type UCPIdentity struct { - ID string `json:"id"` -} - -// KubernetesIdentity uniquely identifies a Kubernetes resource -type KubernetesIdentity struct { - Kind string `json:"kind"` - APIVersion string `json:"apiVersion"` - Name string `json:"name"` - Namespace string `json:"namespace"` -} - -// AzureFederatedIdentity represents the federated identity for OIDC issuer. -type AzureFederatedIdentity struct { - // Name represents the name of federeated identity. - Name string `json:"name"` - // Resource represents the associated identity resource. - Resource string `json:"resource"` - // OIDCIssuer represents the OIDC issuer. - OIDCIssuer string `json:"oidcIssuer"` - // Audience represents the client ID of Resource - Audience string `json:"audience"` - // Subejct represents the subject of Identity - Subject string `json:"subject"` -} - -// NewARMIdentity creates a new ResourceIdentity object from a ResourceType, an ID and an API version. -func NewARMIdentity(resourceType *ResourceType, id string, apiVersion string) ResourceIdentity { - return ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourceType.Type, - Provider: resourceType.Provider, - }, - Data: ARMIdentity{ - ID: id, - APIVersion: apiVersion, - }, - } -} - -// NewUCPIdentity creates a new ResourceIdentity with the given ResourceType and ID. -func NewUCPIdentity(resourceType *ResourceType, id string) ResourceIdentity { - return ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourceType.Type, - Provider: resourceType.Provider, - }, - Data: UCPIdentity{ - ID: id, - }, - } -} - -// NewKubernetesIdentity creates a ResourceIdentity object from a ResourceType, runtime.Object and metav1.ObjectMeta. -func NewKubernetesIdentity(resourceType *ResourceType, obj runtime.Object, objectMeta metav1.ObjectMeta) ResourceIdentity { - return ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourceType.Type, - Provider: resourceType.Provider, - }, - Data: KubernetesIdentity{ - Kind: obj.GetObjectKind().GroupVersionKind().Kind, - APIVersion: obj.GetObjectKind().GroupVersionKind().GroupVersion().String(), - Name: objectMeta.Name, - Namespace: objectMeta.Namespace, - }, - } -} - -// GetID constructs a UCP resource ID from the ResourceIdentity. -func (r ResourceIdentity) GetID() string { - if r.ResourceType == nil { - return "" // For a default-initialized identity we can't do anything smart. - } - - switch r.ResourceType.Provider { - case ProviderAzure: - id, _, _ := r.RequireARM() - return id - case ProviderAWS: - id, _ := r.RequireAWS() - return id - case ProviderRadius: - id, _ := r.RequireRadius() - return id - case ProviderKubernetes: - gvk, namespace, name, _ := r.RequireKubernetes() - group := gvk.Group - if group == "" { - group = "core" - } - if namespace == "" { - return fmt.Sprintf("/planes/kubernetes/local/providers/%s/%s/%s", group, gvk.Kind, name) - } else { - return fmt.Sprintf("/planes/kubernetes/local/namespaces/%s/providers/%s/%s/%s", namespace, group, gvk.Kind, name) - } - default: - return "" - } -} - -// RequireARM checks if the ResourceType provider is Azure and returns the ID and API version of the ARMIdentity, or an -// error if the provider is not Azure. -func (r ResourceIdentity) RequireARM() (string, string, error) { - if r.ResourceType.Provider == ProviderAzure { - data, ok := r.Data.(ARMIdentity) - if !ok { - data = ARMIdentity{} - if err := store.DecodeMap(r.Data, &data); err != nil { - return "", "", err - } - } - return data.ID, data.APIVersion, nil - } - - return "", "", fmt.Errorf("expected an %q provider, was %q", ProviderAzure, r.ResourceType.Provider) -} - -// RequireAWS checks if the ResourceIdentity is an AWS provider and returns the ID or an error if not. -func (r ResourceIdentity) RequireAWS() (string, error) { - if r.ResourceType.Provider == ProviderAWS { - data, ok := r.Data.(UCPIdentity) - if !ok { - data = UCPIdentity{} - if err := store.DecodeMap(r.Data, &data); err != nil { - return "", err - } - } - return data.ID, nil - } - - return "", fmt.Errorf("expected an %q provider, was %q", ProviderAWS, r.ResourceType.Provider) -} - -// RequireRadius checks if the ResourceIdentity is an Radius ID and returns the ID or an error if not. -func (r ResourceIdentity) RequireRadius() (string, error) { - if r.ResourceType.Provider == ProviderRadius { - data, ok := r.Data.(UCPIdentity) - if !ok { - data = UCPIdentity{} - if err := store.DecodeMap(r.Data, &data); err != nil { - return "", err - } - } - return data.ID, nil - } - - return "", fmt.Errorf("expected an %q provider, was %q", ProviderRadius, r.ResourceType.Provider) -} - -// RequireKubernetes checks if the ResourceType.Provider is Kubernetes and returns the GroupVersionKind, Namespace, Name -// and an error if the Provider is not Kubernetes. -func (r ResourceIdentity) RequireKubernetes() (schema.GroupVersionKind, string, string, error) { - if r.ResourceType.Provider == ProviderKubernetes { - data, ok := r.Data.(KubernetesIdentity) - if !ok { - data = KubernetesIdentity{} - if err := store.DecodeMap(r.Data, &data); err != nil { - return schema.GroupVersionKind{}, "", "", err - } - } - return schema.FromAPIVersionAndKind(data.APIVersion, data.Kind), data.Namespace, data.Name, nil - } - - return schema.GroupVersionKind{}, "", "", fmt.Errorf("expected an %q provider, was %q", ProviderKubernetes, r.ResourceType.Provider) -} - -// IsSameResource compares two ResourceIdentity objects and returns a boolean indicating whether they are the same resource or not. -func (r ResourceIdentity) IsSameResource(other ResourceIdentity) bool { - if r.ResourceType.Provider != other.ResourceType.Provider { - return false - } - - switch r.ResourceType.Provider { - case ProviderAzure: - a, _ := r.Data.(ARMIdentity) - b, _ := other.Data.(ARMIdentity) - return a == b - - case ProviderAWS: - a, _ := r.Data.(UCPIdentity) - b, _ := other.Data.(UCPIdentity) - return a == b - - case ProviderRadius: - a, _ := r.Data.(UCPIdentity) - b, _ := other.Data.(UCPIdentity) - return a == b - - case ProviderKubernetes: - a, _ := r.Data.(KubernetesIdentity) - b, _ := other.Data.(KubernetesIdentity) - return a == b - - } - // An identity without a valid kind is not the same as any resource. - return false -} - -// AsLogValues returns a slice of any type based on the provider type of the ResourceIdentity struct. If the provider is -// Azure, it returns the ResourceID, SubscriptionID, ResourceGroup, ResourceType and ResourceName. If the provider is AWS, -// it returns the ResourceID, ResourceType and ResourceName. If the provider is Kubernetes, it returns the ResourceName, -// Namespace, Kind and ResourceKind. If the provider is none of the above, it returns nil. -func (r ResourceIdentity) AsLogValues() []any { - if r.ResourceType == nil { - return nil - } - switch r.ResourceType.Provider { - case ProviderAzure: - // We can't report an error here so this is best-effort. - data := r.Data.(ARMIdentity) - id, err := resources.ParseResource(data.ID) - if err != nil { - return []any{ucplog.LogFieldResourceID, data.ID} - } - - return []any{ - logging.LogFieldResourceID, data.ID, - logging.LogFieldSubscriptionID, id.FindScope(resources.SubscriptionsSegment), - logging.LogFieldResourceGroup, id.FindScope(resources.ResourceGroupsSegment), - logging.LogFieldResourceType, id.Type(), - logging.LogFieldResourceName, id.QualifiedName(), - } - - case ProviderAWS: - // We can't report an error here so this is best-effort. - data := r.Data.(UCPIdentity) - id, err := resources.ParseResource(data.ID) - if err != nil { - return []any{ucplog.LogFieldResourceID, data.ID} - } - - return []any{ - logging.LogFieldResourceID, data.ID, - logging.LogFieldResourceType, id.Type(), - logging.LogFieldResourceName, id.QualifiedName(), - } - - case ProviderRadius: - // We can't report an error here so this is best-effort. - data := r.Data.(UCPIdentity) - id, err := resources.ParseResource(data.ID) - if err != nil { - return []any{ucplog.LogFieldResourceID, data.ID} - } - - return []any{ - logging.LogFieldResourceID, data.ID, - logging.LogFieldResourceType, id.Type(), - logging.LogFieldResourceName, id.QualifiedName(), - } - - case ProviderKubernetes: - data := r.Data.(KubernetesIdentity) - return []any{ - logging.LogFieldResourceName, data.Name, - logging.LogFieldNamespace, data.Namespace, - logging.LogFieldKind, data.Kind, - logging.LogFieldResourceKind, resourcekinds.Kubernetes, - } - - default: - return nil - } -} - -// UnmarshalJSON unmarshals a JSON byte slice into a ResourceIdentity struct based on the provider type. -func (r *ResourceIdentity) UnmarshalJSON(b []byte) error { - type intermediate struct { - ResourceType *ResourceType `json:"resourceType"` - Data json.RawMessage `json:"data"` - } - - data := intermediate{} - err := json.Unmarshal(b, &data) - if err != nil { - return err - } - - r.ResourceType = data.ResourceType - - // Make sure not to crash for a default-initialized identity. - if r.ResourceType == nil { - return nil - } - - switch r.ResourceType.Provider { - case ProviderAzure: - identity := ARMIdentity{} - err = json.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - case ProviderAWS: - identity := UCPIdentity{} - err = json.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - case ProviderRadius: - identity := UCPIdentity{} - err = json.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - case ProviderKubernetes: - identity := KubernetesIdentity{} - err = json.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - } - - err = json.Unmarshal(data.Data, &r.Data) - if err != nil { - return err - } - - return nil -} - -// UnmarshalBSON unmarshals a BSON byte slice into a ResourceIdentity, depending on the provider type. It returns an error -// if the provider type is unknown or if the BSON unmarshalling fails. -func (r *ResourceIdentity) UnmarshalBSON(b []byte) error { - type intermediate struct { - ResourceType *ResourceType `json:"resourceType"` - Data bson.Raw `bson:"data"` - } - - data := intermediate{} - err := bson.Unmarshal(b, &data) - if err != nil { - return err - } - - r.ResourceType = data.ResourceType - - // Make sure not to crash for a default-initialized identity. - if r.ResourceType == nil { - return nil - } - - switch r.ResourceType.Provider { - case ProviderAzure: - identity := ARMIdentity{} - err = bson.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - case ProviderAWS: - identity := UCPIdentity{} - err = bson.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - case ProviderRadius: - identity := UCPIdentity{} - err = bson.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - case ProviderKubernetes: - identity := KubernetesIdentity{} - err = bson.Unmarshal(data.Data, &identity) - if err != nil { - return err - } - r.Data = identity - return nil - - default: - return fmt.Errorf("unknown provider: %q", r.ResourceType.Provider) - } -} - -// FromUCPID translates a UCP resource ID into a ResourceIdentity. -// -// TODO: This is transitional while we're refactoring to get rid of ResourceIdentity. UCP resource IDs are a more -// complete and flexible way of identitying resources. -func FromUCPID(id resources.ID, preferredAPIVersion string) ResourceIdentity { - // Blank resource id => blank identity - if len(id.ScopeSegments()) == 0 { - return ResourceIdentity{} - } - - firstScope := id.ScopeSegments()[0].Type - if preferredAPIVersion == "" { - preferredAPIVersion = APIVersionUnknown - } - - // If this starts with a subscription ID then it's an Azure resource - // - // case: /subscriptions/.../resourceGroups/.../...... - if strings.EqualFold(resources.SubscriptionsSegment, firstScope) { - return NewARMIdentity(&ResourceType{Type: id.Type(), Provider: ProviderAzure}, id.String(), preferredAPIVersion) - } - - // case: /planes/azure/azurecloud/subscriptions/.../resourceGroups/.../...... - if strings.EqualFold("azure", firstScope) { - return NewARMIdentity(&ResourceType{Type: id.Type(), Provider: ProviderAzure}, id.String(), preferredAPIVersion) - } - - // case: /planes/aws/aws/accounts/.../regions/.../...... - if strings.EqualFold("aws", firstScope) { - return NewUCPIdentity(&ResourceType{Type: id.Type(), Provider: ProviderAWS}, id.String()) - } - - // case: /planes/radius/local/... - if strings.EqualFold("radius", firstScope) { - return NewUCPIdentity(&ResourceType{Type: id.Type(), Provider: ProviderRadius}, id.String()) - } - - // case: /planes/kubernetes/local/namespaces/.../...... - if strings.EqualFold("kubernetes", firstScope) { - // Kubernetes has some quirks because API groups were added after the initial release. - // We encode the "unnamed" group as "core". - group, kind, _ := strings.Cut(id.Type(), "/") - resourceType := id.Type() - apiVersion := group + "/" + preferredAPIVersion - if strings.EqualFold(group, "core") { - resourceType = kind - apiVersion = preferredAPIVersion - } - - return ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourceType, - Provider: ProviderKubernetes, - }, - Data: KubernetesIdentity{ - Kind: kind, - APIVersion: apiVersion, - Namespace: id.FindScope("namespaces"), - Name: id.Name(), - }, - } - } - - return ResourceIdentity{} -} diff --git a/pkg/resourcemodel/identity_test.go b/pkg/resourcemodel/identity_test.go deleted file mode 100644 index c76feceb9a..0000000000 --- a/pkg/resourcemodel/identity_test.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resourcemodel - -import ( - "encoding/json" - "testing" - - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/stretchr/testify/require" - "go.mongodb.org/mongo-driver/bson" -) - -var values = []struct { - Description string - ExpectedID string - Identity ResourceIdentity -}{ - { - // Ensure that default-initialized identity does not panic. - Description: "empty", - ExpectedID: "", - Identity: ResourceIdentity{}, - }, - { - Description: "Azure", - ExpectedID: "/subscriptions/0000/resourceGroups/mygroup/providers/Microsoft.DocumentDB/accounts/someaccount", - Identity: ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourcekinds.AzureCosmosAccount, - Provider: ProviderAzure, - }, - Data: ARMIdentity{ - ID: "/subscriptions/0000/resourceGroups/mygroup/providers/Microsoft.DocumentDB/accounts/someaccount", - APIVersion: "2020-01-01", - }, - }, - }, - { - // "core" group - Description: "Kubernetes (core)", - ExpectedID: "/planes/kubernetes/local/namespaces/test-namespace/providers/core/Secret/test-name", - Identity: ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourcekinds.Secret, - Provider: ProviderKubernetes, - }, - Data: KubernetesIdentity{ - Kind: "Secret", - APIVersion: "v1", - Name: "test-name", - Namespace: "test-namespace", - }, - }, - }, - { - // Cluster-scoped resource - Description: "Kubernetes (cluster-scoped)", - ExpectedID: "/planes/kubernetes/local/providers/secrets/SecretProviderClass/test-name", - Identity: ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourcekinds.SecretProviderClass, - Provider: ProviderKubernetes, - }, - Data: KubernetesIdentity{ - Kind: "SecretProviderClass", - APIVersion: "secrets/v1", - Name: "test-name", - }, - }, - }, - { - // Namespaced non-core group - Description: "Kubernetes (non-core)", - ExpectedID: "/planes/kubernetes/local/namespaces/test-namespace/providers/apps/Deployment/test-name", - Identity: ResourceIdentity{ - ResourceType: &ResourceType{ - Type: resourcekinds.Deployment, - Provider: ProviderKubernetes, - }, - Data: KubernetesIdentity{ - Kind: "Deployment", - APIVersion: "apps/v1", - Name: "test-name", - Namespace: "test-namespace", - }, - }, - }, - { - Description: "AWS", - ExpectedID: "/planes/aws/aws/accounts/0000/regions/us-west-2/providers/AWS.Kinesis/Stream/mystream", - Identity: ResourceIdentity{ - ResourceType: &ResourceType{ - Type: "AWS.Kinesis/Stream", - Provider: ProviderAWS, - }, - Data: UCPIdentity{ - ID: "/planes/aws/aws/accounts/0000/regions/us-west-2/providers/AWS.Kinesis/Stream/mystream", - }, - }, - }, - { - Description: "Radius", - ExpectedID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/myapp", - Identity: ResourceIdentity{ - ResourceType: &ResourceType{ - Type: "Applications.Core/applications", - Provider: ProviderRadius, - }, - Data: UCPIdentity{ - ID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/myapp", - }, - }, - }, -} - -// Test that all formats of ResourceIdentifier round-trip with BSON -func Test_ResourceIdentifier_BSONRoundTrip(t *testing.T) { - for _, input := range values { - t.Run(input.Description, func(t *testing.T) { - b, err := bson.Marshal(&input.Identity) - require.NoError(t, err) - - output := ResourceIdentity{} - err = bson.Unmarshal(b, &output) - require.NoError(t, err) - - require.Equal(t, input.Identity, output) - }) - } -} - -// Test that all formats of ResourceIdentifier round-trip with JSON -func Test_ResourceIdentifier_JSONRoundTrip(t *testing.T) { - for _, input := range values { - t.Run(input.Description, func(t *testing.T) { - b, err := json.Marshal(&input.Identity) - require.NoError(t, err) - - output := ResourceIdentity{} - err = json.Unmarshal(b, &output) - require.NoError(t, err) - - require.Equal(t, input.Identity, output) - }) - } -} - -func Test_GetID(t *testing.T) { - for _, input := range values { - t.Run(input.Description, func(t *testing.T) { - id := input.Identity.GetID() - require.Equal(t, input.ExpectedID, id) - }) - } -} diff --git a/pkg/rp/v1/outputresource.go b/pkg/rp/v1/outputresource.go index 82a51bdc36..7fdf238966 100644 --- a/pkg/rp/v1/outputresource.go +++ b/pkg/rp/v1/outputresource.go @@ -21,40 +21,63 @@ import ( "github.com/project-radius/radius/pkg/algorithm/graph" "github.com/project-radius/radius/pkg/resourcemodel" + "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) // OutputResource represents the output of rendering a resource type OutputResource struct { - // LocalID is a logical identifier scoped to the owning Radius resource. + // LocalID is a logical identifier scoped to the owning Radius resource. This is only needed or used + // when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning + // beyond being compared to determine dependency relationships. LocalID string `json:"localID"` - // Identity uniquely identifies the underlying resource within its platform.. - Identity resourcemodel.ResourceIdentity `json:"identity"` + // ID is the UCP resource ID of the underlying resource. + ID resources.ID `json:"id"` - // Resource type specifies the 'provider' and 'kind' used to look up the resource handler for processing - ResourceType resourcemodel.ResourceType `json:"resourceType"` + // RadiusManaged determines whether Radius manages the lifecycle of the underlying resource. + RadiusManaged *bool `json:"radiusManaged"` - // Resource type defined by the provider for this resource. Example for Azure, a resource type is of the format: Microsoft.DocumentDB/databaseAccounts - ProviderResourceType string `json:"providerResourceType"` - - RadiusManaged *bool `json:"radiusManaged"` - Deployed bool `json:"deployed"` - Resource any `json:"resource,omitempty"` - Dependencies []Dependency // resources that are required to be deployed before this resource can be deployed - used for parent/child resources. - Status OutputResourceStatus `json:"status,omitempty"` + // CreateResource describes data that will be used to create a resource. This is never saved to the database. + CreateResource *Resource `json:"-"` } -type Dependency struct { - // LocalID is the LocalID of the dependency. - LocalID string +// Resource describes data that will be used to create a resource. This data is not saved to the database. +type Resource struct { + // Data is the arbitrary data that will be passed to the handler. + Data any + // ResourceType is the type of resource that will be created. This is used for dispatching to the correct handler. + ResourceType resourcemodel.ResourceType + // Dependencies is the set of LocalIDs of the resources that are required to be deployed before this resource can be deployed. + Dependencies []string } -// OutputResourceStatus represents the status of the Output Resource -type OutputResourceStatus struct { - ProvisioningState string `json:"provisioningState"` - ProvisioningErrorDetails string `json:"provisioningErrorDetails"` +// GetResourceType returns the ResourceType of the OutputResource. +func (or OutputResource) GetResourceType() resourcemodel.ResourceType { + // There are two possible states: + // + // 1) The resource already exists in which case we have a resource ID. + // 2) The resource will be created, in which case we know the resource type, but don't have an ID. + if or.CreateResource != nil { + return or.CreateResource.ResourceType + } + + if or.ID.IsUCPQualfied() && len(or.ID.ScopeSegments()) > 0 { + return resourcemodel.ResourceType{ + Provider: or.ID.ScopeSegments()[0].Type, + Type: or.ID.Type(), + } + } else if len(or.ID.ScopeSegments()) > 0 { + // Legacy ARM case + return resourcemodel.ResourceType{ + Provider: resourcemodel.ProviderAzure, + Type: or.ID.Type(), + } + } + + return resourcemodel.ResourceType{} } // Key localID of the output resource is used as the key in DependencyItem for output resources. @@ -65,12 +88,16 @@ func (resource OutputResource) Key() string { // GetDependencies returns a slice of strings containing the LocalIDs of the OutputResource's dependencies, or an error if // any of the dependencies are missing a LocalID. func (resource OutputResource) GetDependencies() ([]string, error) { + if resource.CreateResource == nil { + return nil, nil + } + dependencies := []string{} - for _, dependency := range resource.Dependencies { - if dependency.LocalID == "" { + for _, dependency := range resource.CreateResource.Dependencies { + if dependency == "" { return dependencies, errors.New("missing localID for outputresource") } - dependencies = append(dependencies, dependency.LocalID) + dependencies = append(dependencies, dependency) } return dependencies, nil } @@ -111,66 +138,38 @@ func OrderOutputResources(outputResources []OutputResource) ([]OutputResource, e } // NewKubernetesOutputResource creates an OutputResource object with the given resourceType, localID, obj and objectMeta. -func NewKubernetesOutputResource(resourceType string, localID string, obj runtime.Object, objectMeta metav1.ObjectMeta) OutputResource { - rt := resourcemodel.ResourceType{ - Type: resourceType, - Provider: resourcemodel.ProviderKubernetes, - } +func NewKubernetesOutputResource(localID string, obj runtime.Object, objectMeta metav1.ObjectMeta) OutputResource { + gvk := obj.GetObjectKind().GroupVersionKind() return OutputResource{ - LocalID: localID, - Deployed: false, - ResourceType: rt, - Identity: resourcemodel.NewKubernetesIdentity(&rt, obj, objectMeta), - Resource: obj, - Dependencies: []Dependency{}, + LocalID: localID, + ID: resources_kubernetes.IDFromMeta(resources_kubernetes.PlaneNameTODO, gvk, objectMeta), + CreateResource: &Resource{ + ResourceType: resourcemodel.ResourceType{ + Type: resources_kubernetes.ResourceTypeFromGVK(gvk), + Provider: resourcemodel.ProviderKubernetes, + }, + Data: obj, + }, } } // GetGCOutputResources [GC stands for Garbage Collection] compares two slices of OutputResource and // returns a slice of OutputResource that contains the elements that are in the "before" slice but not in the "after". func GetGCOutputResources(after []OutputResource, before []OutputResource) []OutputResource { - afterMap := map[string][]OutputResource{} - - for _, outputResource := range after { - id := outputResource.LocalID - orArr := []OutputResource{} - - if arr, ok := afterMap[id]; ok { - orArr = arr - } - - orArr = append(orArr, outputResource) - afterMap[id] = orArr - } - + // We can easily determine which resources have changed via a brute-force search comparing IDs. + // The lists of resources we work with are small, so this is fine. diff := []OutputResource{} - for _, outputResource := range before { - id := outputResource.LocalID - - // If there is a resource or a group of resources in before(old) outputResources - // array with a LocalID that is not in the after(new) outputResources array, then - // we have to to delete those resources. - if _, found := afterMap[id]; !found { - diff = append(diff, outputResource) - continue - } - - // Otherwise we have to check each resource for their equivalence on the type and ID. - // - // If there is no match, we have to delete that resource. Meaning that new outputResources - // doesn't have that resource in the old array. + for _, beforeResource := range before { found := false - for _, innerOutputResource := range afterMap[id] { - if outputResource.ResourceType.Type == innerOutputResource.ResourceType.Type && - outputResource.ResourceType.Provider == innerOutputResource.ResourceType.Provider && - outputResource.Identity.GetID() == innerOutputResource.Identity.GetID() { + for _, afterResource := range after { + if resources.IDEquals(beforeResource.ID, afterResource.ID) { found = true break } } if !found { - diff = append(diff, outputResource) + diff = append(diff, beforeResource) } } diff --git a/pkg/rp/v1/outputresource_test.go b/pkg/rp/v1/outputresource_test.go index 52cfeb5a7f..99c67275ea 100644 --- a/pkg/rp/v1/outputresource_test.go +++ b/pkg/rp/v1/outputresource_test.go @@ -19,8 +19,8 @@ package v1 import ( "testing" - "github.com/project-radius/radius/pkg/resourcekinds" - "github.com/project-radius/radius/pkg/resourcemodel" + "github.com/project-radius/radius/pkg/ucp/resources" + resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" "github.com/stretchr/testify/require" ) @@ -29,25 +29,17 @@ func TestGetDependencies(t *testing.T) { dependencies, err := outputResource.GetDependencies() require.NoError(t, err) - require.Equal(t, []string{LocalIDUserAssignedManagedIdentity, LocalIDRoleAssignmentKVKeys}, - dependencies) + require.Equal(t, []string{LocalIDUserAssignedManagedIdentity, LocalIDRoleAssignmentKVKeys}, dependencies) } func TestGetDependencies_MissingLocalID(t *testing.T) { - testResource1 := OutputResource{ - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - } + testResource1 := OutputResource{} testResource2 := OutputResource{ LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, + CreateResource: &Resource{ + Dependencies: []string{testResource1.LocalID}, }, - Dependencies: []Dependency{{LocalID: testResource1.LocalID}}, } _, err := testResource2.GetDependencies() @@ -58,10 +50,6 @@ func TestGetDependencies_MissingLocalID(t *testing.T) { func TestGetDependencies_Empty(t *testing.T) { testOutputResource := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, } dependencies, err := testOutputResource.GetDependencies() @@ -87,30 +75,19 @@ func TestOrderOutputResources(t *testing.T) { func getTestOutputResourceWithDependencies() (OutputResource, map[string]OutputResource) { managedIdentity := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, } roleAssignmentKeys := OutputResource{ LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, + CreateResource: &Resource{ + Dependencies: []string{managedIdentity.LocalID}, }, - Dependencies: []Dependency{{LocalID: managedIdentity.LocalID}}, } federatedIdentity := OutputResource{ LocalID: LocalIDFederatedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{ - {LocalID: managedIdentity.LocalID}, - {LocalID: roleAssignmentKeys.LocalID}, + CreateResource: &Resource{ + Dependencies: []string{managedIdentity.LocalID, roleAssignmentKeys.LocalID}, }, } @@ -129,36 +106,19 @@ func TestGetGCOutputResources_Same(t *testing.T) { managedIdentity := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi"), } roleAssignmentKeys := OutputResource{ LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.NewARMIdentity(&resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, "/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi", "2020-01-01"), - Dependencies: []Dependency{{LocalID: managedIdentity.LocalID}}, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.Authorization/roleAssignments/test-ra"), } federatedIdentity := OutputResource{ LocalID: LocalIDFederatedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{ - {LocalID: managedIdentity.LocalID}, - {LocalID: roleAssignmentKeys.LocalID}, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi/federatedIdentities/test-fi"), } + after = append(after, managedIdentity) after = append(after, roleAssignmentKeys) after = append(after, federatedIdentity) @@ -176,27 +136,13 @@ func TestGetGCOutputResources_ResourceDiffersByID(t *testing.T) { after := []OutputResource{ { LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.NewARMIdentity(&resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, "/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/after", "2020-01-01"), + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/after"), }, } before := []OutputResource{ { LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - Identity: resourcemodel.NewARMIdentity(&resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, "/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/before", "2020-01-01"), + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/before"), }, } @@ -210,31 +156,17 @@ func TestGetGCOutputResources_SameWithAdditionalOutputResource(t *testing.T) { managedIdentity := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi"), } roleAssignmentKeys := OutputResource{ LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{{LocalID: managedIdentity.LocalID}}, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.Authorization/roleAssignments/test-ra"), } federatedIdentity := OutputResource{ LocalID: LocalIDFederatedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{ - {LocalID: managedIdentity.LocalID}, - {LocalID: roleAssignmentKeys.LocalID}, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi/federatedIdentities/test-fi"), } after = append(after, managedIdentity) @@ -255,31 +187,17 @@ func TestGetGCOutputResources_ManagedIdentityShouldBeDeleted(t *testing.T) { managedIdentity := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi"), } roleAssignmentKeys := OutputResource{ LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{{LocalID: managedIdentity.LocalID}}, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.Authorization/roleAssignments/test-ra"), } federatedIdentity := OutputResource{ LocalID: LocalIDFederatedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{ - {LocalID: managedIdentity.LocalID}, - {LocalID: roleAssignmentKeys.LocalID}, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi/federatedIdentities/test-fi"), } after = append(after, roleAssignmentKeys) @@ -300,40 +218,22 @@ func TestGetGCOutputResources_ALotOfResources(t *testing.T) { managedIdentity1 := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - Provider: resourcemodel.ProviderAzure, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi1"), } managedIdentity2 := OutputResource{ LocalID: LocalIDUserAssignedManagedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureUserAssignedManagedIdentity, - // Fixme: Kubernetes is not possible? - Provider: resourcemodel.ProviderKubernetes, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi2"), } roleAssignmentKeys := OutputResource{ LocalID: LocalIDRoleAssignmentKVKeys, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureRoleAssignment, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{{LocalID: managedIdentity1.LocalID}}, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.Authorization/roleAssignments/test-ra"), } federatedIdentity := OutputResource{ LocalID: LocalIDFederatedIdentity, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.AzureFederatedIdentity, - Provider: resourcemodel.ProviderAzure, - }, - Dependencies: []Dependency{ - {LocalID: managedIdentity1.LocalID}, - {LocalID: roleAssignmentKeys.LocalID}, - }, + ID: resources.MustParse("/subscriptions/test-subscription/resourceGroups/test-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-mi/federatedIdentities/test-fi"), } after = append(after, managedIdentity1) @@ -350,38 +250,28 @@ func TestGetGCOutputResources_ALotOfResources(t *testing.T) { require.Equal(t, []OutputResource{managedIdentity2}, diff) } -func TestGetGCOutputResources_Secret(t *testing.T) { +func TestGetGCOutputResources_ResourceRemoved(t *testing.T) { after := []OutputResource{} before := []OutputResource{} deployment := OutputResource{ LocalID: LocalIDDeployment, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.Deployment, - Provider: resourcemodel.ProviderKubernetes, - }, - }, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Deployment, - Provider: resourcemodel.ProviderKubernetes, - }, - Dependencies: nil, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + resources_kubernetes.KindDeployment, + "test-namespace", + "test-deployment"), } secret := OutputResource{ LocalID: LocalIDSecret, - Identity: resourcemodel.ResourceIdentity{ - ResourceType: &resourcemodel.ResourceType{ - Type: resourcekinds.Secret, - Provider: resourcemodel.ProviderKubernetes, - }, - }, - ResourceType: resourcemodel.ResourceType{ - Type: resourcekinds.Secret, - Provider: resourcemodel.ProviderKubernetes, - }, - Dependencies: nil, + ID: resources_kubernetes.IDFromParts( + resources_kubernetes.PlaneNameTODO, + "", + resources_kubernetes.KindSecret, + "test-namespace", + "test-secret"), } after = append(after, deployment) diff --git a/pkg/rp/v1/types.go b/pkg/rp/v1/types.go index d384a7c45b..c9f8efa161 100644 --- a/pkg/rp/v1/types.go +++ b/pkg/rp/v1/types.go @@ -123,10 +123,13 @@ func BuildExternalOutputResources(outputResources []OutputResource) []map[string var externalOutputResources []map[string]any for _, or := range outputResources { externalOutput := map[string]any{ - "LocalID": or.LocalID, - "Provider": or.ResourceType.Provider, - "Identity": or.Identity.Data, + "id": or.ID.String(), } + + if or.LocalID != "" { + externalOutput["LocalID"] = or.LocalID + } + externalOutputResources = append(externalOutputResources, externalOutput) } diff --git a/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go index 4e208186ac..001d6b1e96 100644 --- a/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go @@ -25,6 +25,7 @@ import ( "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/datamodel" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -112,19 +113,12 @@ func TestPlaneConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "https://applications.core.radius.azure.com", *r.Properties.ResourceProviders["Applications.Core"]) } -type fakeResource struct{} - -// FakeResource's ResourceTypeName function returns a string "FakeResource" when called. -func (f *fakeResource) ResourceTypeName() string { - return "FakeResource" -} - func TestPlaneConvertFromValidation(t *testing.T) { validationTests := []struct { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go index 8334fc4b2d..87f377a983 100644 --- a/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go @@ -24,6 +24,7 @@ import ( "github.com/project-radius/radius/pkg/ucp/datamodel" "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/test/testutil" + "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) @@ -95,7 +96,7 @@ func TestResourceGroupConvertFromValidation(t *testing.T) { src v1.DataModelInterface err error }{ - {&fakeResource{}, v1.ErrInvalidModelConversion}, + {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, {nil, v1.ErrInvalidModelConversion}, } diff --git a/pkg/ucp/aws/servicecontext/awsrequestcontext.go b/pkg/ucp/aws/servicecontext/awsrequestcontext.go index e345b8e6db..850b5d4c18 100644 --- a/pkg/ucp/aws/servicecontext/awsrequestcontext.go +++ b/pkg/ucp/aws/servicecontext/awsrequestcontext.go @@ -20,7 +20,7 @@ import ( "context" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" ) // AWSRequestContext is the context for AWS request. @@ -36,5 +36,5 @@ func AWSRequestContextFromContext(ctx context.Context) *AWSRequestContext { // ResourceTypeInAWSFormat returns the AWS resource type. func (c *AWSRequestContext) ResourceTypeInAWSFormat() string { - return resources.ToAWSResourceType(c.ResourceID) + return resources_aws.ToAWSResourceType(c.ResourceID) } diff --git a/pkg/ucp/frontend/controller/awsproxy/awsparsing.go b/pkg/ucp/frontend/controller/awsproxy/awsparsing.go index e949237591..0fdce60576 100644 --- a/pkg/ucp/frontend/controller/awsproxy/awsparsing.go +++ b/pkg/ucp/frontend/controller/awsproxy/awsparsing.go @@ -28,6 +28,7 @@ import ( awsoperations "github.com/project-radius/radius/pkg/aws/operations" awsclient "github.com/project-radius/radius/pkg/ucp/aws" "github.com/project-radius/radius/pkg/ucp/resources" + resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" ) // getPrimaryIdentifiersFromSchema returns the primaryIdentifier field from the @@ -128,7 +129,7 @@ func readRegionFromRequest(path string, pathBase string) (string, armrpc_rest.Re response := armrpc_rest.NewBadRequestARMResponse(errResponse) return "", response } - region := resourceID.FindScope(resources.RegionsSegment) + region := resourceID.FindScope(resources_aws.ScopeRegions) if region == "" { errResponse := v1.ErrorResponse{ Error: v1.ErrorDetails{ diff --git a/pkg/ucp/resources/aws.go b/pkg/ucp/resources/aws/aws.go similarity index 69% rename from pkg/ucp/resources/aws.go rename to pkg/ucp/resources/aws/aws.go index 3695972f91..c1ecfdddd1 100644 --- a/pkg/ucp/resources/aws.go +++ b/pkg/ucp/resources/aws/aws.go @@ -14,12 +14,27 @@ See the License for the specific language governing permissions and limitations under the License. */ -package resources +package aws -import "strings" +import ( + "strings" + + "github.com/project-radius/radius/pkg/ucp/resources" +) + +const ( + // PlaneTypeAWS defines the type name of the AWS plane. + PlaneTypeAWS = "aws" + + // ScopeAccounts defines the account scope for AWS resources. + ScopeAccounts = "accounts" + + // ScopeRegions defines the region scope for AWS resources. + ScopeRegions = "regions" +) // ToAWSResourceType takes an ID and returns a string representing the AWS resource type. -func ToAWSResourceType(id ID) string { +func ToAWSResourceType(id resources.ID) string { parts := []string{} // AWS ARNs use :: as separator. for _, segment := range id.TypeSegments() { diff --git a/pkg/ucp/resources/aws_test.go b/pkg/ucp/resources/aws/aws_test.go similarity index 89% rename from pkg/ucp/resources/aws_test.go rename to pkg/ucp/resources/aws/aws_test.go index 519d081472..8a5aec6a69 100644 --- a/pkg/ucp/resources/aws_test.go +++ b/pkg/ucp/resources/aws/aws_test.go @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -package resources +package aws import ( "testing" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) @@ -26,7 +27,7 @@ func Test_ToAWSResourceType(t *testing.T) { expected := "AWS::S3::Bucket" resourceId := "/planes/aws/aws/accounts/123341234/regions/us-west-2/providers/AWS.S3/Bucket" - id, err := Parse(resourceId) + id, err := resources.Parse(resourceId) require.NoError(t, err) actual := ToAWSResourceType(id) diff --git a/pkg/ucp/resources/aws/doc.go b/pkg/ucp/resources/aws/doc.go new file mode 100644 index 0000000000..fa7b5f4ad6 --- /dev/null +++ b/pkg/ucp/resources/aws/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package aws defines utility functions and constants for working with AWS types and UCP resource IDs. +package aws diff --git a/pkg/ucp/resources/azure/azure.go b/pkg/ucp/resources/azure/azure.go new file mode 100644 index 0000000000..ae422719b6 --- /dev/null +++ b/pkg/ucp/resources/azure/azure.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import "github.com/project-radius/radius/pkg/ucp/resources" + +const ( + // PlaneTypeAzure defines the type name of the Azure plane. + PlaneTypeAzure = "azure" + + // ScopeSubscriptions is the scope for an Azure subscription ID. + ScopeSubscriptions = "subscriptions" + // ScopeResourceGroups is the scope for an Azure Resource Group. + ScopeResourceGroups = "resourcegroups" +) + +// IsAzureResource returns true if the given resource ID is an Azure resource. +func IsAzureResource(id resources.ID) bool { + return (id.FindScope(ScopeSubscriptions) != "" || id.FindScope(PlaneTypeAzure) != "") && id.IsResource() +} diff --git a/pkg/ucp/resources/azure/doc.go b/pkg/ucp/resources/azure/doc.go new file mode 100644 index 0000000000..9dbc99d15f --- /dev/null +++ b/pkg/ucp/resources/azure/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package azure defines utility functions and constants for working with Azure types and UCP resource IDs. +package azure diff --git a/pkg/ucp/resources/azure/resource_types.go b/pkg/ucp/resources/azure/resource_types.go new file mode 100644 index 0000000000..a770af17fe --- /dev/null +++ b/pkg/ucp/resources/azure/resource_types.go @@ -0,0 +1,26 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +const ( + // ResourceTypeManagedIdentityUserAssignedManagedIdentity is the resource type of a user-assigned managed identity. + ResourceTypeManagedIdentityUserAssignedManagedIdentity = "Microsoft.ManagedIdentity/userAssignedIdentities" + // ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential is the resource type of a federated identity credential for a user-assigned managed identity. + ResourceTypeManagedIdentityUserAssignedManagedIdentityFederatedIdentityCredential = "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials" + // ResourceTypeAuthorizationRoleAssignment is the resource type of a role assignment. + ResourceTypeAuthorizationRoleAssignment = "Microsoft.Authorization/roleAssignments" +) diff --git a/pkg/ucp/resources/id.go b/pkg/ucp/resources/id.go index d43eb1de4c..00abdf92f1 100644 --- a/pkg/ucp/resources/id.go +++ b/pkg/ucp/resources/id.go @@ -17,41 +17,26 @@ limitations under the License. package resources import ( + "encoding/json" "fmt" "net/http" "strings" - - "golang.org/x/exp/slices" ) const ( - SegmentSeparator = "/" - PlanesSegment = "planes" - ProvidersSegment = "providers" - ResourceGroupsSegment = "resourcegroups" - SubscriptionsSegment = "subscriptions" - LocationsSegment = "locations" - AccountsSegment = "accounts" - RegionsSegment = "regions" - - CoreRPNamespace = "Applications.Core" - LinkRPNamespace = "Applications.Link" - DatastoresRPNamespace = "Applications.Datastores" - DaprRPNamespace = "Applications.Dapr" - MessagingRPNamespace = "Applications.Messaging" + // SegmentSeparator is the separator between segments in a resource ID. + SegmentSeparator = "/" + + // ProvidersSegment is the segment that separates the scope from the resource type. + ProvidersSegment = "providers" + + // PlanesSegment is the segment the planes delimiter that distinguishes between UCP and ARM resource IDs. + PlanesSegment = "planes" PlaneTypePrefix = "System.Planes" ResourceGroupType = "System.Resources/resourceGroups" ) -var supportedNamespaces = []string{ - CoreRPNamespace, - LinkRPNamespace, - DatastoresRPNamespace, - DaprRPNamespace, - MessagingRPNamespace, -} - // ID represents an ARM or UCP resource id. ID is immutable once created. Use Parse() or ParseXyz() // to create IDs and use String() to convert back to strings. type ID struct { @@ -90,10 +75,18 @@ type TypeSegment struct { Name string } +// KnownType represents a known resource type. Since resource types can have child types, this +// includes multiple segments. type KnownType struct { + // Types is the set of TypeSegments that make up the type. Types []TypeSegment } +// IDEquals compares two IDs for equality. +func IDEquals(x ID, y ID) bool { + return strings.EqualFold(x.String(), y.String()) +} + // IsEmpty checks if the ID is empty. func (ri ID) IsEmpty() bool { return ri.id == "" @@ -252,7 +245,7 @@ func (ri ID) RootScope() string { func (ri ID) PlaneScope() string { segments := []string{} for _, t := range ri.scopeSegments { - if !strings.EqualFold(t.Type, ResourceGroupsSegment) { + if !strings.EqualFold(t.Type, "resourcegroups") { segments = append(segments, t.Type) if t.Name != "" { segments = append(segments, t.Name) @@ -289,11 +282,6 @@ func (ri ID) ProviderNamespace() string { return "" } -// IsRadiusRPResource checks if the given ID is a supported Radius resource. -func (ri ID) IsRadiusRPResource() bool { - return slices.Contains(supportedNamespaces, ri.ProviderNamespace()) -} - // PlaneNamespace returns the plane part of the UCP ID, or an empty string if the ID is not UCP qualified. // // Examples: @@ -530,6 +518,46 @@ func (ri ID) Truncate() ID { } } +// MarshalText implements text marshalling support for Resource IDs. +func (id ID) MarshalText() ([]byte, error) { + return []byte(id.String()), nil +} + +// UnmarshalText implements text unmarshalling support for Resource IDs. +func (id *ID) UnmarshalText(data []byte) error { + parsed, err := Parse(string(data)) + if err != nil { + return fmt.Errorf("failed to unmarshal text, value was not a valid resource ID: %w", err) + } + + // Assign fields into self. + *id = parsed + return nil +} + +// MarshalJSON implements JSON marshalling support for Resource IDs. +func (id ID) MarshalJSON() ([]byte, error) { + return json.Marshal(id.String()) +} + +// UnmarshalJSON implements JSON unmarshalling support for Resource IDs. +func (id *ID) UnmarshalJSON(data []byte) error { + str := "" + err := json.Unmarshal(data, &str) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON, value was not a string: %w", err) + } + + parsed, err := Parse(str) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON, value was not a valid resource ID: %w", err) + } + + // Assign fields into self. + *id = parsed + return nil +} + // ParseByMethod is a helper function to extract the custom actions from the id. // If there is a custom action in the request, then the method will be POST. To be able // to get the proper type, we need to remove the custom action from the id. @@ -804,6 +832,16 @@ func invalid(id string) error { return fmt.Errorf("'%s' is not a valid resource id", id) } +// MustParse parses a resource ID. MustParse will panic if the ID is not valid. This should only +// be used in tests and other circumstances where the ID is known to be valid. +func MustParse(id string) ID { + parsed, err := Parse(id) + if err != nil { + panic(err) + } + return parsed +} + // MakeUCPID creates a fully-qualified UCP resource ID, from the given scopes and resource types. func MakeUCPID(scopes []ScopeSegment, resourceTypes []TypeSegment, extensionTypes []TypeSegment) string { relative := MakeRelativeID(scopes, resourceTypes, extensionTypes) diff --git a/pkg/ucp/resources/id_test.go b/pkg/ucp/resources/id_test.go index 20a538af24..a4d016fd51 100644 --- a/pkg/ucp/resources/id_test.go +++ b/pkg/ucp/resources/id_test.go @@ -619,17 +619,17 @@ func Test_FindScope(t *testing.T) { cases := []testcase{ { ID: "/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app", - Segment: SubscriptionsSegment, + Segment: "subscriptions", Expected: "s1", }, { ID: "/subscriPtions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app", - Segment: SubscriptionsSegment, + Segment: "Subscriptions", Expected: "s1", }, { ID: "/subscriptions/s1/resourceGroups/r1/providers/Microsoft.CustomProviders/resourceProviders/radius/Applications/test-app", - Segment: ResourceGroupsSegment, + Segment: "resourcegroups", Expected: "r1", }, { @@ -639,7 +639,7 @@ func Test_FindScope(t *testing.T) { }, { ID: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", - Segment: ResourceGroupsSegment, + Segment: "resourcegroups", Expected: "r1", }, } @@ -1112,60 +1112,6 @@ func Test_ParseByMethod(t *testing.T) { } } -func Test_RadiusRPResource(t *testing.T) { - values := []struct { - testID ID - expected bool - }{ - { - testID: ID{ - id: "/subscriptions/s1/resourceGroups/r1/providers/Applications.Core/containers/test-container", - scopeSegments: []ScopeSegment{ - {Type: "subscriptions", Name: "s1"}, - {Type: "resourceGroups", Name: "r1"}, - }, - typeSegments: []TypeSegment{ - {Type: "Applications.Core/containers", Name: "test-container"}, - }, - }, - expected: true, - }, - { - testID: ID{ - id: "/subscriptions/s1/resourceGroups/r1/providers/Applications.Link/mongoDatabases/test-mongo", - scopeSegments: []ScopeSegment{ - {Type: "subscriptions", Name: "s1"}, - {Type: "resourceGroups", Name: "r1"}, - }, - typeSegments: []TypeSegment{ - {Type: linkrp.MongoDatabasesResourceType, Name: "test-mongo"}, - }, - }, - expected: true, - }, - { - testID: ID{ - id: "/subscriptions/s1/resourceGroups/r1/providers/Applications.foo/containers/test-container", - scopeSegments: []ScopeSegment{ - {Type: "subscriptions", Name: "s1"}, - {Type: "resourceGroups", Name: "r1"}, - }, - typeSegments: []TypeSegment{ - {Type: "Applications.foo/containers", Name: "test-container"}, - }, - }, - expected: false, - }, - } - - for i, v := range values { - t.Run(fmt.Sprintf("%d: %v", i, v.testID.id), func(t *testing.T) { - radiusResource := v.testID.IsRadiusRPResource() - require.Equal(t, v.expected, radiusResource) - }) - } -} - func Test_Type(t *testing.T) { values := []struct { desc string @@ -1227,8 +1173,8 @@ func Test_ParseProviderScope(t *testing.T) { desc: "Azure provider resource group", scope: "/subscriptions/test-sub/resourcegroups/test-rg", expectedScopeSegments: []ScopeSegment{ - {Type: SubscriptionsSegment, Name: "test-sub"}, - {Type: ResourceGroupsSegment, Name: "test-rg"}, + {Type: "subscriptions", Name: "test-sub"}, + {Type: "resourcegroups", Name: "test-rg"}, }, }, { @@ -1236,8 +1182,8 @@ func Test_ParseProviderScope(t *testing.T) { scope: "/planes/aws/aws/accounts/000/regions/us-east-1", expectedScopeSegments: []ScopeSegment{ {Type: "aws", Name: "aws"}, - {Type: AccountsSegment, Name: "000"}, - {Type: RegionsSegment, Name: "us-east-1"}, + {Type: "accounts", Name: "000"}, + {Type: "regions", Name: "us-east-1"}, }, }, } diff --git a/pkg/ucp/resources/kubernetes/doc.go b/pkg/ucp/resources/kubernetes/doc.go new file mode 100644 index 0000000000..732aab6736 --- /dev/null +++ b/pkg/ucp/resources/kubernetes/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package kubernetes defines utility functions and constants for working with Kubernetes types and UCP resource IDs. +package kubernetes diff --git a/pkg/ucp/resources/kubernetes/kubernetes.go b/pkg/ucp/resources/kubernetes/kubernetes.go new file mode 100644 index 0000000000..de687744b1 --- /dev/null +++ b/pkg/ucp/resources/kubernetes/kubernetes.go @@ -0,0 +1,86 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubernetes + +import ( + "strings" + + "github.com/project-radius/radius/pkg/ucp/resources" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + // PlaneTypeKubernetes defines the type name of the Kubernetes plane. + PlaneTypeKubernetes = "kubernetes" + + // PlaneNameTODO is the name of the Kubernetes plane to use when the plane name is not known. + // This is similar to context.TODO() in the Go standard library. When we support multiple kubernetes + // clusters in a single Radius instance, we will need to remove this and replace all occurrences. + PlaneNameTODO = "local" + + // ScopeTypeNamespaces defines the type name of the Kubernetes namespace scope. + ScopeNamespaces = "namespaces" +) + +// ToParts returns the component parts of the given UCP resource ID. +func ToParts(id resources.ID) (group, kind, namespace, name string) { + namespace = id.FindScope(ScopeNamespaces) + name = id.Name() + group = id.ProviderNamespace() + if group == "core" { + group = "" + } + _, kind, _ = strings.Cut(id.Type(), "/") + return group, kind, namespace, name +} + +// IDFromMeta returns the UCP resource ID for the given Kubernetes object specified by its GroupVersionKind +// and ObjectMeta. +func IDFromMeta(planeName string, gvk schema.GroupVersionKind, objectMeta metav1.ObjectMeta) resources.ID { + return IDFromParts(planeName, gvk.Group, gvk.Kind, objectMeta.Namespace, objectMeta.Name) +} + +// IDFromParts returns the UCP resource ID for the given Kubernetes object specified by its component parts. +func IDFromParts(planeName string, group string, kind string, namespace string, name string) resources.ID { + if group == "" { + group = "core" + } + + scopes := []resources.ScopeSegment{ + { + Type: PlaneTypeKubernetes, + Name: planeName, + }, + } + + if namespace != "" { + scopes = append(scopes, resources.ScopeSegment{ + Type: ScopeNamespaces, + Name: namespace, + }) + } + + types := []resources.TypeSegment{ + { + Type: group + "/" + kind, + Name: name, + }, + } + + return resources.MustParse(resources.MakeUCPID(scopes, types, nil)) +} diff --git a/pkg/ucp/resources/kubernetes/resource_types.go b/pkg/ucp/resources/kubernetes/resource_types.go new file mode 100644 index 0000000000..6c6e7c6b9d --- /dev/null +++ b/pkg/ucp/resources/kubernetes/resource_types.go @@ -0,0 +1,68 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubernetes + +import "k8s.io/apimachinery/pkg/runtime/schema" + +const ( + // KindDeployment is the kind of a Kubernetes Deployment. + KindDeployment = "Deployment" + // ResourceTypeDeployment is the resource type of a Kubernetes Deployment. + ResourceTypeDeployment = "apps/Deployment" + // KindSecret is the kind of a Kubernetes Secret. + KindSecret = "Secret" + // ResourceTypeSecret is the resource type of a Kubernetes Secret. + ResourceTypeSecret = "core/Secret" + // KindService is the kind of a Kubernetes Service. + KindService = "Service" + // ResourceTypeService is the resource type of a Kubernetes Service. + ResourceTypeService = "core/Service" + // KindServiceAccount is the kind of a Kubernetes ServiceAccount. + KindServiceAccount = "ServiceAccount" + // ResourceTypeServiceAccount is the resource type of a Kubernetes ServiceAccount. + ResourceTypeServiceAccount = "core/ServiceAccount" + // KindRole is the kind of a Kubernetes Role. + KindRole = "Role" + // ResourceTypeRole is the resource type of a Kubernetes Role. + ResourceTypeRole = "rbac.authorization.k8s.io/Role" + // KindRoleBinding is the kind of a Kubernetes RoleBinding. + KindRoleBinding = "RoleBinding" + // ResourceTypeRoleBinding is the resource type of a Kubernetes RoleBinding. + ResourceTypeRoleBinding = "rbac.authorization.k8s.io/RoleBinding" + // KindSecretProviderClass is the kind of a Kubernetes SecretProviderClass. + KindSecretProviderClass = "SecretProviderClass" + // ResourceTypeSecretProviderClass is the resource type of a Kubernetes SecretProviderClass. + ResourceTypeSecretProviderClass = "secrets-store.csi.x-k8s.io/SecretProviderClass" + + // KindContourHTTPProxy is the kind of a Contour HTTPProxy. + KindContourHTTPProxy = "HTTPProxy" + // ResourceTypeContourHTTPProxy is the resource type of a Contour HTTPProxy. + ResourceTypeContourHTTPProxy = "projectcontour.io/HTTPProxy" + + // ResourceTypeDaprComponent is the resource type of a Dapr component. + ResourceTypeDaprComponent = "dapr.io/Component" +) + +// ResourceTypeFromGVK returns the resource type of a Kubernetes resource given its group, version, and kind. +func ResourceTypeFromGVK(gvk schema.GroupVersionKind) string { + group := gvk.Group + if group == "" { + group = "core" + } + + return group + "/" + gvk.Kind +} diff --git a/pkg/ucp/resources/radius/doc.go b/pkg/ucp/resources/radius/doc.go new file mode 100644 index 0000000000..363be57a77 --- /dev/null +++ b/pkg/ucp/resources/radius/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package radius defines utility functions and constants for working with Radius types and UCP resource IDs. +package radius diff --git a/pkg/ucp/resources/radius/radius.go b/pkg/ucp/resources/radius/radius.go new file mode 100644 index 0000000000..0ec81f2939 --- /dev/null +++ b/pkg/ucp/resources/radius/radius.go @@ -0,0 +1,43 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package radius + +import "github.com/project-radius/radius/pkg/ucp/resources" + +const ( + // PlaneTypeRadius defines the type name of the Radius plane. + PlaneTypeRadius = "radius" + + // ScopeResourceGroups is the scope for a Radius Resource Group. + ScopeResourceGroups = "resourcegroups" + + // NamespaceApplicationsCore defines the namespace for the Radius Applications.Core resource provider. + NamespaceApplicationsCore = "Applications.Core" + // NamespaceApplicationsLink defines the namespace for the Radius Applications.Link resource provider. + NamespaceApplicationsLink = "Applications.Link" + // NamespaceApplicationsDatastores defines the namespace for the Radius Applications.Datastores resource provider. + NamespaceApplicationsDatastores = "Applications.Datastores" + // NamespaceApplicationsDapr defines the namespace for the Radius Applications.Dapr resource provider. + NamespaceApplicationsDapr = "Applications.Dapr" + // NamespaceApplicationsMessaging defines the namespace for the Radius Applications.Messaging resource provider. + NamespaceApplicationsMessaging = "Applications.Messaging" +) + +// IsRadiusResource checks if the given ID represents a resource type, and is defined in the Radius plane. +func IsRadiusResource(id resources.ID) bool { + return id.FindScope("radius") != "" && id.IsResource() +} diff --git a/pkg/ucp/resources/radius/radius_test.go b/pkg/ucp/resources/radius/radius_test.go new file mode 100644 index 0000000000..b3521118b5 --- /dev/null +++ b/pkg/ucp/resources/radius/radius_test.go @@ -0,0 +1,56 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package radius + +import ( + "fmt" + "testing" + + "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/stretchr/testify/require" +) + +func Test_IsRadiusResource(t *testing.T) { + values := []struct { + testID resources.ID + expected bool + }{ + { + testID: resources.MustParse("/planes/radius/local/resourceGroups/r1/providers/Applications.Core/containers/test-container"), + expected: true, + }, + { + testID: resources.MustParse("/planes/radius/local/resourceGroups/r1/providers/Applications.Link/mongoDatabases/test-mongo"), + expected: true, + }, + { + testID: resources.MustParse("/planes/radius/local/resourceGroups/r1/providers/Applications.foo/containers/test-container"), + expected: true, + }, + { + testID: resources.MustParse("/planes/kubernetes/local/resourceGroups/r1/providers/Applications.core/containers/test-container"), + expected: false, + }, + } + + for i, v := range values { + t.Run(fmt.Sprintf("%d: %v", i, v.testID.String()), func(t *testing.T) { + radiusResource := IsRadiusResource(v.testID) + require.Equal(t, v.expected, radiusResource) + }) + } +} diff --git a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go index 0ebf58fe57..0a6d273531 100644 --- a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go +++ b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go @@ -22,6 +22,7 @@ import ( "strings" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/store" "github.com/vippsas/go-cosmosdb/cosmosapi" ) @@ -449,7 +450,7 @@ func (c *CosmosDBStorageClient) Save(ctx context.Context, obj *store.Object, opt // /planes/radius/local/... - Partition Key: radius/local // subscriptions/{guid}/... - Partition Key: {guid} func GetPartitionKey(id resources.ID) (string, error) { - partitionKey := NormalizeSubscriptionID(id.FindScope(resources.SubscriptionsSegment)) + partitionKey := NormalizeSubscriptionID(id.FindScope(resources_azure.ScopeSubscriptions)) if id.IsUCPQualfied() { partitionKey = NormalizeLetterOrDigitToUpper(id.PlaneNamespace()) diff --git a/pkg/ucp/store/cosmosdb/util.go b/pkg/ucp/store/cosmosdb/util.go index afb5936303..7af102d4e2 100644 --- a/pkg/ucp/store/cosmosdb/util.go +++ b/pkg/ucp/store/cosmosdb/util.go @@ -23,6 +23,7 @@ import ( "unicode" "github.com/project-radius/radius/pkg/ucp/resources" + resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" "github.com/project-radius/radius/pkg/ucp/store" "github.com/spaolacci/murmur3" ) @@ -131,9 +132,9 @@ func NormalizeStorageKey(storageKey string, maxLength int) (string, error) { // GenerateCosmosDBKey takes in an ID object and returns a string and an error if the resource group or resource type and // name fail to normalize. func GenerateCosmosDBKey(id resources.ID) (string, error) { - storageKeys := []string{NormalizeSubscriptionID(id.FindScope(resources.SubscriptionsSegment))} + storageKeys := []string{NormalizeSubscriptionID(id.FindScope(resources_azure.ScopeSubscriptions))} - resourceGroup := id.FindScope(resources.ResourceGroupsSegment) + resourceGroup := id.FindScope(resources_azure.ScopeResourceGroups) if resourceGroup != "" { uniqueResourceGroup, err := NormalizeStorageKey(resourceGroup, ResourceGroupNameMaxStorageKeyLen) diff --git a/pkg/ucp/store/map.go b/pkg/ucp/store/map.go index 110688ff50..ab236e8f3f 100644 --- a/pkg/ucp/store/map.go +++ b/pkg/ucp/store/map.go @@ -30,7 +30,8 @@ func DecodeMap(in any, out any) error { Result: out, Squash: true, DecodeHook: mapstructure.ComposeDecodeHookFunc( - toTimeHookFunc()), + toTimeHookFunc(), + mapstructure.TextUnmarshallerHookFunc()), } decoder, err := mapstructure.NewDecoder(cfg) if err != nil { diff --git a/pkg/ucp/store/map_test.go b/pkg/ucp/store/map_test.go index d3898f5d7e..6f66cc792f 100644 --- a/pkg/ucp/store/map_test.go +++ b/pkg/ucp/store/map_test.go @@ -22,6 +22,7 @@ import ( "time" "github.com/mitchellh/mapstructure" + "github.com/project-radius/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) @@ -105,3 +106,31 @@ func TestDecodeMap_WithTimeDecodeHook(t *testing.T) { require.Equal(t, now, out.CreatedAt.UTC()) } } + +func TestDecodeMap_WithResourceIDs(t *testing.T) { + type datatype struct { + ID resources.ID + } + + t.Run("valid", func(t *testing.T) { + data := map[string]any{ + "ID": "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/test-app", + } + + out := datatype{} + err := DecodeMap(data, &out) + require.NoError(t, err) + + require.Equal(t, data["ID"], out.ID.String()) + }) + + t.Run("invalid", func(t *testing.T) { + data := map[string]any{ + "ID": "asdf", + } + + out := datatype{} + err := DecodeMap(data, &out) + require.Error(t, err) + }) +} diff --git a/test/functional/daprrp/dapr_pubsub_test.go b/test/functional/daprrp/dapr_pubsub_test.go index d14ec499ea..b0c24bebb8 100644 --- a/test/functional/daprrp/dapr_pubsub_test.go +++ b/test/functional/daprrp/dapr_pubsub_test.go @@ -20,7 +20,6 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -96,16 +95,6 @@ func Test_DaprPubSubBroker_Recipe(t *testing.T) { Name: "dpsb-recipe", Type: validation.DaprPubSubBrokersResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource1", - }, - }, }, }, }, diff --git a/test/functional/daprrp/dapr_statestore_test.go b/test/functional/daprrp/dapr_statestore_test.go index ea77a4b32b..1b15ec49c5 100644 --- a/test/functional/daprrp/dapr_statestore_test.go +++ b/test/functional/daprrp/dapr_statestore_test.go @@ -20,7 +20,6 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -98,16 +97,6 @@ func Test_DaprStateStore_Recipe(t *testing.T) { Name: "dapr-sts-recipe", Type: validation.DaprStateStoresResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource1", - }, - }, }, }, }, diff --git a/test/functional/datastoresrp/resources/mongodb_test.go b/test/functional/datastoresrp/resources/mongodb_test.go index d3ac23d228..e4f46b9bd2 100644 --- a/test/functional/datastoresrp/resources/mongodb_test.go +++ b/test/functional/datastoresrp/resources/mongodb_test.go @@ -20,7 +20,6 @@ import ( "os" "testing" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -165,16 +164,6 @@ func Test_MongoDB_RecipeParameters(t *testing.T) { Name: "mdb-recipe-param-db", Type: validation.MongoDatabasesResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource1", - }, - }, }, }, }, @@ -230,16 +219,6 @@ func Test_MongoDB_Recipe_ContextParameter(t *testing.T) { Name: "mdb-ctx", Type: validation.MongoDatabasesResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource1", - }, - }, }, }, }, diff --git a/test/functional/shared/api_test.go b/test/functional/shared/api_test.go index c39701a8f1..ba1bfcb9f9 100644 --- a/test/functional/shared/api_test.go +++ b/test/functional/shared/api_test.go @@ -23,6 +23,7 @@ import ( "github.com/project-radius/radius/pkg/cli/clients" "github.com/project-radius/radius/pkg/cli/clients_new/generated" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" "github.com/project-radius/radius/test/testcontext" "github.com/stretchr/testify/require" @@ -43,7 +44,7 @@ func Test_ResourceList(t *testing.T) { parsed, err := resources.ParseScope("/" + scope) require.NoError(t, err) - require.NotEmpty(t, parsed.FindScope(resources.ResourceGroupsSegment), "workspace scope must contain resource group segment") + require.NotEmpty(t, parsed.FindScope(resources_radius.ScopeResourceGroups), "workspace scope must contain resource group segment") resourceGroupScope := parsed.String() planeScope := parsed.Truncate().String() diff --git a/test/functional/shared/resources/dapr_pubsub_test.go b/test/functional/shared/resources/dapr_pubsub_test.go index 33a73bb08c..2c4525aa43 100644 --- a/test/functional/shared/resources/dapr_pubsub_test.go +++ b/test/functional/shared/resources/dapr_pubsub_test.go @@ -20,7 +20,6 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -96,16 +95,6 @@ func Test_DaprPubSubBroker_Recipe(t *testing.T) { Name: "dpsb-recipe-old", Type: validation.O_DaprPubSubBrokersResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource1", - }, - }, }, }, }, diff --git a/test/functional/shared/resources/dapr_statestore_test.go b/test/functional/shared/resources/dapr_statestore_test.go index 85f57b6ac7..255f17ab6b 100644 --- a/test/functional/shared/resources/dapr_statestore_test.go +++ b/test/functional/shared/resources/dapr_statestore_test.go @@ -20,7 +20,6 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -98,16 +97,6 @@ func Test_DaprStateStore_Recipe(t *testing.T) { Name: "dapr-sts-recipe-old", Type: validation.O_DaprStateStoresResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderKubernetes, - LocalID: "RecipeResource1", - }, - }, }, }, }, diff --git a/test/functional/shared/resources/extender_test.go b/test/functional/shared/resources/extender_test.go index cec5aef0c7..dfc1b96803 100644 --- a/test/functional/shared/resources/extender_test.go +++ b/test/functional/shared/resources/extender_test.go @@ -22,7 +22,6 @@ import ( "os" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -99,11 +98,11 @@ func Test_Extender_Recipe(t *testing.T) { } func Test_Extender_RecipeAWS(t *testing.T) { - awsAccountId := os.Getenv("AWS_ACCOUNT_ID") + awsAccountID := os.Getenv("AWS_ACCOUNT_ID") awsRegion := os.Getenv("AWS_REGION") // Error the test if the required environment variables are not set // for running locally set the environment variables - if awsAccountId == "" || awsRegion == "" { + if awsAccountID == "" || awsRegion == "" { t.Error("This test needs the env variables AWS_ACCOUNT_ID and AWS_REGION to be set") } @@ -111,6 +110,7 @@ func Test_Extender_RecipeAWS(t *testing.T) { name := "corerp-resources-extenders-aws-s3-recipe" appName := "corerp-resources-extenders-aws-s3-recipe-app" bucketName := generateS3BucketName() + bucketID := fmt.Sprintf("/planes/aws/aws/accounts/%s/regions/%s/providers/AWS.S3/Bucket/%s", awsAccountID, awsRegion, bucketName) test := shared.NewRPTest(t, name, []shared.TestStep{ { @@ -138,8 +138,7 @@ func Test_Extender_RecipeAWS(t *testing.T) { App: appName, OutputResources: []validation.OutputResourceResponse{ { - Provider: resourcemodel.ProviderAWS, - LocalID: "RecipeResource0", + ID: bucketID, }, }, }, diff --git a/test/functional/shared/resources/mongodb_test.go b/test/functional/shared/resources/mongodb_test.go index 228cd08238..fe8dc5c7e9 100644 --- a/test/functional/shared/resources/mongodb_test.go +++ b/test/functional/shared/resources/mongodb_test.go @@ -20,7 +20,6 @@ import ( "os" "testing" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -165,16 +164,6 @@ func Test_MongoDB_RecipeParameters(t *testing.T) { Name: "mdb-recipe-param-db-old", Type: validation.O_MongoDatabasesResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource1", - }, - }, }, }, }, @@ -230,16 +219,6 @@ func Test_MongoDB_Recipe_ContextParameter(t *testing.T) { Name: "mdb-ctx-old", Type: validation.O_MongoDatabasesResource, App: name, - OutputResources: []validation.OutputResourceResponse{ - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource0", - }, - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource1", - }, - }, }, }, }, diff --git a/test/functional/shared/resources/recipe_bicep_test.go b/test/functional/shared/resources/recipe_bicep_test.go index 2e5c2b034f..98daad06b2 100644 --- a/test/functional/shared/resources/recipe_bicep_test.go +++ b/test/functional/shared/resources/recipe_bicep_test.go @@ -206,27 +206,12 @@ func Test_BicepRecipe_ResourceCreation(t *testing.T) { scope := strings.ReplaceAll(parsed.RootScope(), "resourcegroups", "resourceGroups") expected := []any{ map[string]any{ - "Identity": map[string]any{ - "apiVersion": "unknown", - "kind": "Secret", - "name": name, - "namespace": name + "-app", - }, - "LocalID": "RecipeResource0", - "Provider": "kubernetes", + "id": "/planes/kubernetes/local/namespaces/" + name + "-app/providers/core/Secret/" + name, }, map[string]any{ - "Identity": map[string]interface{}{ - "id": scope + "/providers/Applications.Link/extenders/" + name + "-created", - }, - "LocalID": "RecipeResource1", - "Provider": "radius", + "id": scope + "/providers/Applications.Link/extenders/" + name + "-created", }, map[string]interface{}{ - "Identity": map[string]interface{}{ - "id": scope + "/providers/Applications.Link/extenders/" + name + "-module", - }, - "LocalID": "RecipeResource2", - "Provider": "radius", + "id": scope + "/providers/Applications.Link/extenders/" + name + "-module", }, } actual := resource.Properties["status"].(map[string]any)["outputResources"].([]any) diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 55a0e1cb7c..41d0f81ec4 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -33,8 +33,8 @@ import ( "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/project-radius/radius/pkg/resourcemodel" "github.com/project-radius/radius/pkg/ucp/resources" + resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" @@ -123,7 +123,7 @@ func Test_TerraformRecipe_Context(t *testing.T) { r, err := resources.ParseResource(string(decoded)) require.NoError(t, err) - rgName := r.FindScope(resources.ResourceGroupsSegment) + rgName := r.FindScope(resources_radius.ScopeResourceGroups) tests := []struct { key string @@ -180,13 +180,6 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { Name: "corerp-resources-terraform-azstorage", Type: validation.ExtendersResource, App: appName, - OutputResources: []validation.OutputResourceResponse{ - // Azure storage account. - { - Provider: resourcemodel.ProviderAzure, - LocalID: "RecipeResource0", - }, - }, }, }, }, diff --git a/test/k8sutil/fake.go b/test/k8sutil/fake.go index 3eb1c259ca..ea45baba19 100644 --- a/test/k8sutil/fake.go +++ b/test/k8sutil/fake.go @@ -25,6 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" k8sfake "k8s.io/client-go/kubernetes/fake" clienttesting "k8s.io/client-go/testing" @@ -97,3 +98,34 @@ func (c *testClient) Patch(ctx context.Context, obj client.Object, patch client. return c.WithWatch.Update(ctx, obj) } } + +type DiscoveryClient struct { + Groups *metav1.APIGroupList + Resources []*metav1.APIResourceList + APIGroup []*metav1.APIGroup +} + +// ServerGroups returns a list of API groups supported by the server. +func (d *DiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) { + return d.Groups, nil +} + +// This function returns a slice of API resource lists. +func (d *DiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { + return d.Resources, nil +} + +// This function returns a slice of API resource lists. +func (d *DiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error) { + return d.Resources, nil +} + +// ServerGroupsAndResources returns a list of API groups and resources associated with the discovery client. +func (d *DiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error) { + return d.APIGroup, d.Resources, nil +} + +// ServerResourcesForGroupVersion returns nil for the API resource list. +func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { + return nil, nil +} diff --git a/test/testutil/resourcetypeutil/types.go b/test/testutil/resourcetypeutil/types.go new file mode 100644 index 0000000000..b8754dbd10 --- /dev/null +++ b/test/testutil/resourcetypeutil/types.go @@ -0,0 +1,77 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resourcetypeutil + +import ( + "encoding/json" + + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" +) + +// FakeResource is a fake resource type. +type FakeResource struct{} + +// Always returns "FakeResource" as the name. +func (f *FakeResource) ResourceTypeName() string { + return "FakeResource" +} + +func (f *FakeResource) GetSystemData() *v1.SystemData { + return nil +} + +func (f *FakeResource) GetBaseResource() *v1.BaseResource { + return nil +} + +func (f *FakeResource) ProvisioningState() v1.ProvisioningState { + return v1.ProvisioningStateAccepted +} + +func (f *FakeResource) SetProvisioningState(state v1.ProvisioningState) { +} + +func (f *FakeResource) UpdateMetadata(ctx *v1.ARMRequestContext, oldResource *v1.BaseResource) { +} + +// MustPopulateResourceStatus populates a ResourceStatus object with an output resource commonly used in our +// test fixtures. +// +// Example usage (in a converter test): +// +// ..ResourceStatus: resourcetypeutil.MustPopulateResourceStatus(&myapiversion.ResourceStatus{}) +func MustPopulateResourceStatus[T any](obj T) T { + data := map[string]any{ + "outputResources": []map[string]any{ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource", + }, + }, + } + + b, err := json.Marshal(data) + if err != nil { + panic(err) + } + + err = json.Unmarshal(b, obj) + if err != nil { + panic(err) + } + + return obj +} diff --git a/test/testutil/util.go b/test/testutil/util.go index adf86dd691..01ed6931b1 100644 --- a/test/testutil/util.go +++ b/test/testutil/util.go @@ -19,6 +19,7 @@ package testutil import ( "encoding/json" "os" + "path" ) // MustGetTestData reads testdata and unmarshals it to the given type, panicking if an error occurs. @@ -32,8 +33,16 @@ func MustGetTestData[T any](file string) *T { } // ReadFixture reads testdata fixtures, panicking if an error occurs. +// +// The prefix `./testdata/` is automatically added to the filename. Tests can 'escape' the testdata directory by +// prefixing the filename with `../`. +// +// Example: +// +// ReadFixture("foo.json") -> ./testdata/foo.json func ReadFixture(filename string) []byte { - raw, err := os.ReadFile("./testdata/" + filename) + p := path.Clean("./testdata/" + filename) + raw, err := os.ReadFile(p) if err != nil { panic(err) } diff --git a/test/validation/aws.go b/test/validation/aws.go index 10f4fbd91f..7ee37a8c8c 100644 --- a/test/validation/aws.go +++ b/test/validation/aws.go @@ -30,6 +30,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sts" awsclient "github.com/project-radius/radius/pkg/ucp/aws" "github.com/project-radius/radius/pkg/ucp/resources" + resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" "github.com/stretchr/testify/require" ) @@ -175,7 +176,7 @@ func GetResourceTypeName(ctx context.Context, resource *AWSResource) (string, er return "", err } - resourceType := resources.ToAWSResourceType(resourceID) + resourceType := resources_aws.ToAWSResourceType(resourceID) return resourceType, nil } diff --git a/test/validation/shared.go b/test/validation/shared.go index 2ecd6f6a9b..fd5fee369a 100644 --- a/test/validation/shared.go +++ b/test/validation/shared.go @@ -26,8 +26,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/project-radius/radius/pkg/cli/clients" "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" "github.com/project-radius/radius/test/radcli" @@ -68,13 +66,10 @@ type RPResource struct { OutputResources []OutputResourceResponse } -// Output resource fields returned as a part of get/list response payload for Radius resources -// https://github.com/project-radius/radius/blob/main/pkg/rp/types.go#L173 +// Output resource fields returned as a part of get/list response payload for Radius resources. type OutputResourceResponse struct { - LocalID string - Provider string - Identity any - Name string // Name of the underlying resource within its platform (Azure/AWS/Kubernetes) + // ID is the resource ID of the output resource. + ID string } type RPResourceSet struct { @@ -91,12 +86,15 @@ func DeleteRPResource(ctx context.Context, t *testing.T, cli *radcli.CLI, client ctxWithResp := runtime.WithCaptureResponse(ctx, &respFromCtx) _, err := client.DeleteEnv(ctxWithResp, resource.Name) + if err != nil { + return err + } if respFromCtx.StatusCode == 204 { output.LogInfo("Environment '%s' does not exist or has already been deleted.", resource.Name) } - return err + return nil // TODO: this should probably call the CLI, but if you create an // environment via bicep deployment, it will not be reflected in the @@ -152,6 +150,7 @@ func ValidateRPResources(ctx context.Context, t *testing.T, expected *RPResource // Validate expected output resources are present in the response if len(expectedResource.OutputResources) > 0 { + t.Log("validating output resources") bytes, err := json.Marshal(res.Properties["status"]) require.NoError(t, err) @@ -159,27 +158,15 @@ func ValidateRPResources(ctx context.Context, t *testing.T, expected *RPResource err = json.Unmarshal(bytes, &outputResourcesMap) require.NoError(t, err) outputResources := outputResourcesMap["outputResources"] + for _, outputResource := range outputResources { + t.Logf("Found output resource: %+v", outputResource) + } require.Equalf(t, len(expectedResource.OutputResources), len(outputResources), "expected output resources: %v, actual: %v", expectedResource.OutputResources, outputResources) for _, expectedOutputResource := range expectedResource.OutputResources { found := false for _, actualOutputResource := range outputResources { - if expectedOutputResource.LocalID == actualOutputResource.LocalID && expectedOutputResource.Provider == actualOutputResource.Provider { + if strings.EqualFold(expectedOutputResource.ID, actualOutputResource.ID) { found = true - // if the test has the OutputResourceResponse.Name set then validate - // the actual outputresource name with the expected resource name based on the provider type. - if expectedOutputResource.Name != "" { - if expectedOutputResource.Provider == resourcemodel.ProviderAzure { - identity := actualOutputResource.Identity.(map[string]interface{}) - actualID := identity["id"].(string) - actualResource, err := resources.ParseResource(actualID) - require.NoError(t, err) - require.Equal(t, expectedOutputResource.Name, actualResource.Name()) - } - if expectedOutputResource.Provider == resourcemodel.ProviderKubernetes { - identity := actualOutputResource.Identity.(map[string]interface{}) - require.Equal(t, expectedOutputResource.Name, identity["name"].(string)) - } - } break } } From 7323ed4b23a5096d3713266b2200c13ed4454caa Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Wed, 23 Aug 2023 08:44:05 -0700 Subject: [PATCH 04/57] Initial commit of Applications.Core typespec (#6097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is the initial commit of Applications.Core TypeSpec and this also addresses the following issues: * Supported multiple API version typespec files. * Use the standard typespec libraries to define ARM compatible APIs instead of using our custom model/interface. * Added extender resource types with `additionalProperties: true` * Added template typespec files for new namespace. * Added multiple refactoring to simplify the typespec authoring. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: https://github.com/project-radius/radius/issues/4677 ## Auto-generated summary ### 🤖 Generated by Copilot at 4ebb9da ### Summary 🚀🔄🔒 This pull request migrates the Applications.Core resource provider from the cadl language to the typespec language, and adds or updates the schema and operations for various resource types, such as applications, environments, gateways, extensions, and volumes. The pull request also adds the tspconfig.yaml file to configure the typespec emitter and the main.tsp file to define the namespace and service attributes. The purpose is to improve the expressiveness and consistency of the resource provider and to generate the swagger specification using the typespec language. > _We're sailing on the Radius ship, we've got a lot to do_ > _We're changing all the cadl files to typespec, that's true_ > _We're heaving on the `ApplicationResource` and the `GatewayTls`_ > _We're working hard to make the swagger spec, so sing with us_ ### Walkthrough * Migrate the code from the cadl language to the typespec language, which is more expressive and consistent. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-2553d0a4d44d5fd892709f1faa145d082da41b18d3fd4749005239870cf38068R1-R85), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-2f6aafcf2254375fcc862209ee3215f55971480a9b1366325e357572b55d65d5R1-R19), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L17-R66), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-5e7cc0434028240361b19227fbb7952072ace57475500607ab872a73de93478eL17-R63), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-993974354af46f750f30ef3a418ef81e376b6ee12207aa1921aece672d4a9b35R1-R40), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-afc2e0a1e0f94ae6c09481d8a49f29a3c1b0abb13e3bea2c006a9fe73f17592bR1-R7), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-67a4b83a0a0961982a7c49b7418a2ad7ec7aa1d4438fa68464f0b5943ced82cb), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-ce70c04775dceee7eb76ad8ba2f28f833fcb6c6c999e53f54842158fb9140f00), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-8a08fe24c63a1d572519ef2bebcf8532888a9e6384875eea6266f1b4fce61824)) * Define the schema and operations for the Applications.Core resource provider, which represents a Radius application and its components. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-2553d0a4d44d5fd892709f1faa145d082da41b18d3fd4749005239870cf38068R1-R85), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L197-R269), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-35a96dc15dedfabb9011894c0aa4e614c7a44245b457ce0a9fc8ac70a5c39943R1-R172), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-ebe173b6fa899088a2f56dd537a1ab98e2cd20f8a2c8f8b0434226bf46e73393R1-R80), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-5e7cc0434028240361b19227fbb7952072ace57475500607ab872a73de93478eL81-R133), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-93cf3fcfb36152fa2cfa7caa16709fa4b694564636b0ef71c93e79f3d3976e73R1-R93), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-23e8ad1bb4897f0a4375275daac014de0a6b1147b5dbf8fc787ba0ab7001be29R1-R146), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-de695cc2df5a64aa02723f69d749c919973eee57f8c6b97f03669f0c778a9bd8R1-R176), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-993974354af46f750f30ef3a418ef81e376b6ee12207aa1921aece672d4a9b35R1-R40)) * Add the code for the `Extension` model and its subclasses, which define the schema for the extensions that can be applied to the environment or application resources to customize their behavior and features. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-fb7d177799dd53c7f4c532d7576bff5f80a3182edbaed14e7364cb8ab0361779R1-R100)) * Add the code for the `GatewayTls` model and the `TlsMinVersion` enum, which define the schema for the TLS configuration for the gateway resource. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-5e7cc0434028240361b19227fbb7952072ace57475500607ab872a73de93478eL63-R96)) * Add the code for the `scheme` and `port` properties in the `ContainerPortProperties` model, which allow specifying the URL scheme and the exposed port for the container port. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294R75-R80)) * Add the code for the `timeoutSeconds` property in the `ProbeProperties` model, which allows specifying the timeout for the readiness and liveness probes for the container. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294R94-R96)) * Update the code to use the `Record` type instead of the `Map` type, which is more consistent with the typespec syntax and semantics. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L78-R111), [link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L185-R190)) * Update the code to make the `mountPath` property in the `Volume` model required instead of optional, as it is necessary to specify where the volume is mounted in the container. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L103-R136)) * Update the code to rename the `rbac` property in the `PersistentVolume` model to `permission`, which is more descriptive and consistent with the `VolumePermission` enum name. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L121-R154)) * Update the code to rename the `Kind` enum type in the `IamProperties` model to `IAMKind`, which is more specific and avoids conflicts with other types. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-d32ec0fc98b41f6a0bb37978dd4efa089a48d86c870efe77f5b61635e68a0294L127-R166)) * Configure the typespec project to generate the swagger specification for the Applications.Core resource provider. ([link](https://github.com/project-radius/radius/pull/6097/files?diff=unified&w=0#diff-afc2e0a1e0f94ae6c09481d8a49f29a3c1b0abb13e3bea2c006a9fe73f17592bR1-R7)) --- .gitignore | 2 +- .../cadl-output/containers.json | 914 --------------- .../cadl-output/environment.json | 462 -------- .../cadl-output/gateways.json | 552 --------- .../cadl-output/httpRoutes.json | 504 -------- cadl/Applications.Core/environment.cadl | 95 -- cadl/Applications.Core/global.cadl | 14 - cadl/Applications.Core/httpRoutes.cadl | 96 -- .../examples/Containers_CreateOrUpdate.json | 66 ++ .../examples/Containers_Delete.json | 14 + .../examples/Containers_Get.json | 44 + .../examples/Containers_List.json | 103 ++ .../examples/Containers_ListByScope.json | 106 ++ .../examples/ExtendersPatch.json | 60 + typespec/Applications.Core/applications.tsp | 93 ++ typespec/Applications.Core/common.tsp | 19 + .../Applications.Core/containers.tsp | 238 ++-- typespec/Applications.Core/environments.tsp | 177 +++ .../Applications_CreateOrUpdate.json | 62 + .../Applications_Delete.json | 14 + .../Applications_Get.json | 39 + .../Applications_List.json | 52 + .../Applications_ListByScope.json | 35 + .../Applications_Update.json | 62 + .../Containers_CreateOrUpdate.json | 66 ++ .../Containers_Delete.json | 14 + .../Containers_Get.json | 44 + .../Containers_List.json | 103 ++ .../Containers_ListByScope.json | 106 ++ .../Containers_Update.json | 84 ++ .../Environments_CreateOrUpdate.json | 87 ++ .../Environments_DeleteEnv0.json | 14 + .../Environments_GetEnv0.json | 56 + .../Environments_GetRecipeMetadata.json | 29 + .../Environments_List.json | 125 ++ .../Environments_ListByScope.json | 65 ++ .../Environments_PatchEnv0.json | 74 ++ .../Extenders_CreateOrUpdate.json | 62 + .../Extenders_CreateOrUpdateWithRecipe.json | 54 + .../Extenders_Delete.json | 14 + .../Extenders_Get.json | 31 + .../Extenders_List.json | 34 + .../Extenders_ListByRootScope.json | 34 + .../Extenders_ListSecrets.json | 19 + .../Extenders_Update.json | 61 + .../Gateways_CreateOrUpdate.json | 50 + .../Gateways_Delete.json | 14 + .../Gateways_Get.json | 33 + .../Gateways_List.json | 37 + .../Gateways_ListByScope.json | 59 + .../Gateways_Update.json | 50 + .../HttpRoutes_CreateOrUpdate.json | 28 + .../HttpRoutes_Delete.json | 14 + .../HttpRoutes_Get.json | 22 + .../HttpRoutes_List.json | 35 + .../HttpRoutes_ListByScope.json | 35 + .../HttpRoutes_Update.json | 28 + .../Operations_List.json | 195 ++++ .../SecretStores_CreateOrUpdate.json | 51 + .../SecretStores_CreateOrUpdateValueFrom.json | 61 + .../SecretStores_Delete.json | 14 + .../SecretStores_Get.json | 30 + .../SecretStores_Get_AzureKeyVault.json | 39 + .../SecretStores_List.json | 60 + .../SecretStores_ListSecrets.json | 22 + .../SecretStores_Update.json | 61 + .../Volumes_CreateOrUpdate.json | 61 + .../Volumes_Delete.json | 14 + .../Volumes_Get.json | 55 + .../Volumes_List.json | 100 ++ .../Volumes_ListByScope.json | 101 ++ .../Volumes_Update.json | 61 + typespec/Applications.Core/extenders.tsp | 103 ++ typespec/Applications.Core/extensions.tsp | 80 ++ .../Applications.Core/gateways.tsp | 143 ++- typespec/Applications.Core/httproutes.tsp | 96 ++ typespec/Applications.Core/main.tsp | 48 + typespec/Applications.Core/secretstores.tsp | 149 +++ typespec/Applications.Core/tspconfig.yaml | 10 + typespec/Applications.Core/volumes.tsp | 179 +++ typespec/README.md | 111 ++ typespec/Test.Resource/common.tsp | 21 + .../TestAsyncResource_CreateOrUpdate.json | 30 + .../TestAsyncResource_Delete.json | 14 + .../TestAsyncResource_Get.json | 22 + .../TestAsyncResource_List.json | 35 + .../TestAsyncResource_ListByScope.json | 35 + .../TestAsyncResource_Update.json | 30 + .../TestAsyncResource_CreateOrUpdate.json | 30 + .../2023-08-19/TestAsyncResource_Delete.json | 14 + .../2023-08-19/TestAsyncResource_Get.json | 22 + .../2023-08-19/TestAsyncResource_List.json | 35 + .../TestAsyncResource_ListByScope.json | 35 + .../2023-08-19/TestAsyncResource_Update.json | 30 + .../TestSyncResource_CreateOrUpdate.json | 30 + .../2023-08-19/TestSyncResource_Delete.json | 14 + .../2023-08-19/TestSyncResource_Get.json | 22 + .../2023-08-19/TestSyncResource_List.json | 35 + .../TestSyncResource_ListByScope.json | 35 + .../2023-08-19/TestSyncResource_Update.json | 30 + typespec/Test.Resource/main.tsp | 49 + typespec/Test.Resource/testasyncresources.tsp | 85 ++ typespec/Test.Resource/testsyncresources.tsp | 83 ++ typespec/Test.Resource/tspconfig.yaml | 10 + typespec/package-lock.json | 1039 +++++++++++++++++ typespec/package.json | 19 + typespec/radius/v1/resources.tsp | 167 +++ typespec/radius/v1/ucprootscope.tsp | 43 + 108 files changed, 6443 insertions(+), 2819 deletions(-) delete mode 100644 cadl/Applications.Core/cadl-output/containers.json delete mode 100644 cadl/Applications.Core/cadl-output/environment.json delete mode 100644 cadl/Applications.Core/cadl-output/gateways.json delete mode 100644 cadl/Applications.Core/cadl-output/httpRoutes.json delete mode 100644 cadl/Applications.Core/environment.cadl delete mode 100644 cadl/Applications.Core/global.cadl delete mode 100644 cadl/Applications.Core/httpRoutes.cadl create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json create mode 100644 typespec/Applications.Core/applications.tsp create mode 100644 typespec/Applications.Core/common.tsp rename cadl/Applications.Core/containers.cadl => typespec/Applications.Core/containers.tsp (57%) create mode 100644 typespec/Applications.Core/environments.tsp create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_ListByScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Update.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_ListByScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Update.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_DeleteEnv0.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_ListByScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdateWithRecipe.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListByRootScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListSecrets.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Update.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_ListByScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Update.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_ListByScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Update.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Operations_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdateValueFrom.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get_AzureKeyVault.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_ListSecrets.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Update.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_CreateOrUpdate.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Delete.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Get.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_List.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_ListByScope.json create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Update.json create mode 100644 typespec/Applications.Core/extenders.tsp create mode 100644 typespec/Applications.Core/extensions.tsp rename cadl/Applications.Core/gateways.cadl => typespec/Applications.Core/gateways.tsp (51%) create mode 100644 typespec/Applications.Core/httproutes.tsp create mode 100644 typespec/Applications.Core/main.tsp create mode 100644 typespec/Applications.Core/secretstores.tsp create mode 100644 typespec/Applications.Core/tspconfig.yaml create mode 100644 typespec/Applications.Core/volumes.tsp create mode 100644 typespec/README.md create mode 100644 typespec/Test.Resource/common.tsp create mode 100644 typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_CreateOrUpdate.json create mode 100644 typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Delete.json create mode 100644 typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Get.json create mode 100644 typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_List.json create mode 100644 typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_ListByScope.json create mode 100644 typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Update.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_CreateOrUpdate.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Delete.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Get.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_List.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_ListByScope.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Update.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestSyncResource_CreateOrUpdate.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Delete.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Get.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestSyncResource_List.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestSyncResource_ListByScope.json create mode 100644 typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Update.json create mode 100644 typespec/Test.Resource/main.tsp create mode 100644 typespec/Test.Resource/testasyncresources.tsp create mode 100644 typespec/Test.Resource/testsyncresources.tsp create mode 100644 typespec/Test.Resource/tspconfig.yaml create mode 100644 typespec/package-lock.json create mode 100644 typespec/package.json create mode 100644 typespec/radius/v1/resources.tsp create mode 100644 typespec/radius/v1/ucprootscope.tsp diff --git a/.gitignore b/.gitignore index 33fc1778fe..b989e02b5b 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,7 @@ default.profraw pkg/handlers/gomock_* # node modules -cadl/node_modules +node_modules # terraform state .terraform/ diff --git a/cadl/Applications.Core/cadl-output/containers.json b/cadl/Applications.Core/cadl-output/containers.json deleted file mode 100644 index 4ca1cd5f35..0000000000 --- a/cadl/Applications.Core/cadl-output/containers.json +++ /dev/null @@ -1,914 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "version": "0000-00-00", - "description": "REST API for Applications.Core Container Resource", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "" - } - } - }, - "tags": [ - { - "name": "Containers" - }, - { - "name": "Operations" - } - ], - "paths": { - "/{rootScope}/providers/Applications.Core/containers": { - "get": { - "tags": [ - "Containers" - ], - "operationId": "Containers_ListByResourceGroup", - "description": "List ContainerResource resources by resource group", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/ContainerResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/containers/{containerName}": { - "get": { - "tags": [ - "Containers" - ], - "operationId": "Containers_Get", - "description": "Get a ContainerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ContainerResource.containerName" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Containers" - ], - "operationId": "Containers_CreateOrUpdate", - "description": "Create a ContainerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ContainerResource.containerName" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "tags": [ - "Containers" - ], - "operationId": "Containers_Update", - "description": "Update a ContainerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ContainerResource.containerName" - }, - { - "name": "properties", - "in": "body", - "required": true, - "description": "The resource properties to be updated.", - "schema": { - "$ref": "#/definitions/ContainerResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Containers" - ], - "operationId": "Containers_Delete", - "description": "Delete a ContainerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ContainerResource.containerName" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/providers/Applications.Core/operations": { - "get": { - "tags": [ - "Operations" - ], - "operationId": "Operations_List", - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "BasicResourceProperties": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource." - } - }, - "description": "Basic properties of a Radius resource.", - "required": [ - "status" - ] - }, - "ConnectionProperties": { - "type": "object", - "properties": { - "source": { - "type": "string", - "description": "The source of the connection" - }, - "disableDefaultEnvVars": { - "type": "boolean", - "description": "default environment variable override", - "default": false - }, - "iam": { - "$ref": "#/definitions/IamProperties", - "description": "iam properties" - } - }, - "description": "Connection Properties", - "required": [ - "source" - ] - }, - "Container": { - "type": "object", - "properties": { - "image": { - "type": "string", - "description": "The registry and image to download and run in your container" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-cadl-name": "Map", - "description": "environment" - }, - "ports": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ContainerPort" - }, - "x-cadl-name": "Map", - "description": "container ports" - }, - "readinessProbe": { - "$ref": "#/definitions/HealthProbeProperties", - "description": "readiness probe properties" - }, - "livenessProbe": { - "$ref": "#/definitions/HealthProbeProperties", - "description": "liveness probe properties" - }, - "volumes": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Volume" - }, - "x-cadl-name": "Map", - "description": "container volumes" - } - }, - "description": "Definition of a container", - "required": [ - "image" - ] - }, - "ContainerPort": { - "type": "object", - "properties": { - "containerPort": { - "type": "integer", - "format": "int32", - "description": "The listening port number" - }, - "protocol": { - "$ref": "#/definitions/PortProtocol", - "description": "Protocol in use by the port" - }, - "provides": { - "type": "string", - "description": "Specifies a route provided by this port" - } - }, - "description": "Specifies a listening port for the container", - "required": [ - "containerPort" - ] - }, - "ContainerProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the last operation." - }, - "application": { - "type": "string", - "description": "Specifies resource id of the application" - }, - "connections": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ConnectionProperties" - }, - "x-cadl-name": "Map", - "description": "Specifies a connection to another resource." - }, - "container": { - "$ref": "#/definitions/Container", - "description": "Definition of a container." - }, - "extensions": { - "type": "array", - "items": { - "$ref": "#/definitions/Extension" - }, - "x-ms-identifiers": [], - "x-cadl-name": "Extension[]", - "description": "Extensions spec of the resource" - } - }, - "description": "Container properties", - "required": [ - "application", - "connections", - "container", - "extensions" - ], - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "ContainerResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/ContainerProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-mutability": [ - "read", - "create" - ], - "x-ms-client-flatten": true - } - }, - "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", - "required": [ - "properties" - ], - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "ContainerResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/ContainerResource" - }, - "x-cadl-name": "ContainerResource[]", - "description": "The ContainerResource items on this page" - }, - "nextLink": { - "type": "string", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a ContainerResource list operation.", - "required": [ - "value" - ] - }, - "ContainerResourceUpdate": { - "type": "object", - "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-cadl-name": "Record", - "description": "Resource tags." - }, - "properties": { - "$ref": "#/definitions/ContainerResourceUpdateProperties" - } - }, - "description": "The type used for update operations of the ContainerResource." - }, - "ContainerResourceUpdateProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the last operation." - }, - "application": { - "type": "string", - "description": "Specifies resource id of the application" - }, - "connections": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ConnectionProperties" - }, - "x-cadl-name": "Map", - "description": "Specifies a connection to another resource." - }, - "container": { - "$ref": "#/definitions/Container", - "description": "Definition of a container." - }, - "extensions": { - "type": "array", - "items": { - "$ref": "#/definitions/Extension" - }, - "x-ms-identifiers": [], - "x-cadl-name": "Extension[]", - "description": "Extensions spec of the resource" - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource." - } - }, - "description": "The updatable properties of the ContainerResource." - }, - "DaprProtocol": { - "type": "string", - "enum": [ - "http", - "grpc" - ], - "x-ms-enum": { - "name": "DaprProtocol", - "modelAsString": true - } - }, - "DaprSidecarExtension": { - "type": "object", - "properties": { - "appPort": { - "type": "integer", - "format": "int32", - "description": "The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. " - }, - "appId": { - "type": "string", - "description": "The Dapr appId. Specifies the identifier used by Dapr for service invocation." - }, - "config": { - "type": "string", - "description": "Specifies the Dapr configuration to use for the resource." - }, - "protocol": { - "$ref": "#/definitions/DaprProtocol", - "description": "Specifies the Dapr app-protocol to use for the resource." - }, - "provides": { - "type": "string", - "description": "Specifies the resource id of a dapr.io.InvokeHttpRoute that can route traffic to this resource." - } - }, - "description": "Specifies the resource should have a Dapr sidecar injected", - "required": [ - "appId", - "provides" - ], - "allOf": [ - { - "$ref": "#/definitions/Extension" - } - ], - "x-ms-discriminator-value": "daprSidecar" - }, - "EphemeralVolume": { - "type": "object", - "properties": { - "managedStore": { - "$ref": "#/definitions/ManagedStore", - "description": "Backing store for the ephemeral volume" - } - }, - "description": "Specifies an ephemeral volume for a container", - "required": [ - "managedStore" - ], - "allOf": [ - { - "$ref": "#/definitions/Volume" - } - ], - "x-ms-discriminator-value": "ephemeral" - }, - "ExecHealthProbeProperties": { - "type": "object", - "properties": { - "command": { - "type": "string", - "description": "Command to execute to probe readiness/liveness" - } - }, - "description": "Specifies the properties for readiness/liveness probe using an executable", - "required": [ - "command" - ], - "allOf": [ - { - "$ref": "#/definitions/HealthProbeProperties" - } - ], - "x-ms-discriminator-value": "exec" - }, - "Extension": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for Extension." - } - }, - "description": "Extension of a resource.", - "discriminator": "kind", - "required": [ - "kind" - ] - }, - "HealthProbeProperties": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for HealthProbeProperties." - }, - "initialDelaySeconds": { - "type": "number", - "format": "float", - "description": "Initial delay in seconds before probing for readiness/liveness" - }, - "failureThreshold": { - "type": "number", - "format": "float", - "description": "Threshold number of times the probe fails after which a failure would be reported" - }, - "periodSeconds": { - "type": "number", - "format": "float", - "description": "Interval for the readiness/liveness probe in seconds" - } - }, - "description": "Properties for readiness/liveness probe", - "discriminator": "kind", - "required": [ - "kind" - ] - }, - "HttpGetHealthProbeProperties": { - "type": "object", - "properties": { - "containerPort": { - "type": "integer", - "format": "int32", - "description": "The listening port number" - }, - "path": { - "type": "string", - "description": "The route to make the HTTP request on" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-cadl-name": "Map", - "description": "Custom HTTP headers to add to the get request" - } - }, - "description": "Specifies the properties for readiness/liveness probe using HTTP Get", - "required": [ - "containerPort", - "path" - ], - "allOf": [ - { - "$ref": "#/definitions/HealthProbeProperties" - } - ], - "x-ms-discriminator-value": "httpGet" - }, - "IamProperties": { - "type": "object", - "properties": { - "kind": { - "$ref": "#/definitions/Kind", - "description": "The kind of IAM provider to configure" - }, - "roles": { - "type": "array", - "items": { - "type": "string" - }, - "x-cadl-name": "string[]", - "description": "RBAC permissions to be assigned on the source resource" - } - }, - "description": "Iam properties", - "required": [ - "kind", - "roles" - ] - }, - "Kind": { - "type": "string", - "enum": [ - "azure" - ], - "x-ms-enum": { - "name": "Kind", - "modelAsString": true - } - }, - "ManagedStore": { - "type": "string", - "enum": [ - "memory", - "disk" - ], - "x-ms-enum": { - "name": "ManagedStore", - "modelAsString": true - } - }, - "ManualScalingExtension": { - "type": "object", - "properties": { - "replicas": { - "type": "integer", - "format": "int32", - "description": "Replica count." - } - }, - "description": "ManualScaling Extension", - "required": [ - "replicas" - ], - "allOf": [ - { - "$ref": "#/definitions/Extension" - } - ], - "x-ms-discriminator-value": "manualScaling" - }, - "OutputResource": { - "type": "object", - "properties": {}, - "description": "Properties of an output resource." - }, - "PersistentVolume": { - "type": "object", - "properties": { - "rbac": { - "$ref": "#/definitions/VolumePermission", - "description": "Container read/write access to the volume" - }, - "source": { - "type": "string", - "description": "The source of the volume" - } - }, - "description": "Specifies a persistent volume for a container", - "required": [ - "source" - ], - "allOf": [ - { - "$ref": "#/definitions/Volume" - } - ], - "x-ms-discriminator-value": "persistent" - }, - "PortProtocol": { - "type": "string", - "enum": [ - "TCP", - "UDP" - ], - "x-ms-enum": { - "name": "PortProtocol", - "modelAsString": true - } - }, - "ProvisioningState": { - "type": "string", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "ResourceStatus": { - "type": "object", - "properties": { - "outputResources": { - "type": "array", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" - } - }, - "description": "Status of a resource.", - "required": [ - "outputResources" - ] - }, - "TcpHealthProbeProperties": { - "type": "object", - "properties": { - "containerPort": { - "type": "integer", - "format": "int32", - "description": "The listening port number" - } - }, - "description": "Specifies the properties for readiness/liveness probe using TCP", - "required": [ - "containerPort" - ], - "allOf": [ - { - "$ref": "#/definitions/HealthProbeProperties" - } - ], - "x-ms-discriminator-value": "tcp" - }, - "Volume": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for Volume." - }, - "mountPath": { - "type": "string", - "description": "The path where the volume is mounted" - } - }, - "description": "Specifies a volume for a container", - "discriminator": "kind", - "required": [ - "kind" - ] - }, - "VolumePermission": { - "type": "string", - "enum": [ - "read", - "write" - ], - "x-ms-enum": { - "name": "VolumePermission", - "modelAsString": true - } - } - }, - "parameters": { - "ContainerResource.containerName": { - "name": "containerName", - "in": "path", - "required": true, - "description": "Container name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string", - "x-ms-parameter-location": "method" - }, - "RootScopeParam": { - "name": "rootScope", - "in": "path", - "required": true, - "description": "root scope path", - "minLength": 1, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/cadl/Applications.Core/cadl-output/environment.json b/cadl/Applications.Core/cadl-output/environment.json deleted file mode 100644 index 26fdb1c8a6..0000000000 --- a/cadl/Applications.Core/cadl-output/environment.json +++ /dev/null @@ -1,462 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "version": "0000-00-00", - "description": "REST API for Applications.Core Environment Resource", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "" - } - } - }, - "tags": [ - { - "name": "Environment" - }, - { - "name": "Operations" - } - ], - "paths": { - "/{rootScope}/providers/Applications.Core/environments": { - "get": { - "tags": [ - "Environment" - ], - "operationId": "Environment_ListByResourceGroup", - "description": "List EnvironmentResource resources by resource group", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/EnvironmentResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/environments/{environmentName}": { - "get": { - "tags": [ - "Environment" - ], - "operationId": "Environment_Get", - "description": "Get a EnvironmentResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/EnvironmentResource.environmentName" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Environment" - ], - "operationId": "Environment_CreateOrUpdate", - "description": "Create a EnvironmentResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/EnvironmentResource.environmentName" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "tags": [ - "Environment" - ], - "operationId": "Environment_Update", - "description": "Update a EnvironmentResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/EnvironmentResource.environmentName" - }, - { - "name": "properties", - "in": "body", - "required": true, - "description": "The resource properties to be updated.", - "schema": { - "$ref": "#/definitions/EnvironmentResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Environment" - ], - "operationId": "Environment_Delete", - "description": "Delete a EnvironmentResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/EnvironmentResource.environmentName" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/providers/Applications.Core/operations": { - "get": { - "tags": [ - "Operations" - ], - "operationId": "Operations_List", - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "EnvironmentCompute": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for EnvironmentCompute." - }, - "resourceId": { - "type": "string", - "description": "The resource id of the compute resource for application environment." - } - }, - "description": "Compute resource used by application environment resource.", - "discriminator": "kind", - "required": [ - "kind", - "resourceId" - ] - }, - "EnvironmentProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the last operation.", - "readOnly": true - }, - "compute": { - "$ref": "#/definitions/EnvironmentCompute", - "description": "The compute resource used by application environment." - } - }, - "description": "Environment properties", - "required": [ - "compute" - ] - }, - "EnvironmentResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/EnvironmentProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-mutability": [ - "read", - "create" - ], - "x-ms-client-flatten": true - } - }, - "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", - "required": [ - "properties" - ], - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "EnvironmentResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/EnvironmentResource" - }, - "x-cadl-name": "EnvironmentResource[]", - "description": "The EnvironmentResource items on this page" - }, - "nextLink": { - "type": "string", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a EnvironmentResource list operation.", - "required": [ - "value" - ] - }, - "EnvironmentResourceUpdate": { - "type": "object", - "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-cadl-name": "Record", - "description": "Resource tags." - }, - "properties": { - "$ref": "#/definitions/EnvironmentResourceUpdateProperties" - } - }, - "description": "The type used for update operations of the EnvironmentResource." - }, - "EnvironmentResourceUpdateProperties": { - "type": "object", - "properties": { - "compute": { - "$ref": "#/definitions/EnvironmentCompute", - "description": "The compute resource used by application environment." - } - }, - "description": "The updatable properties of the EnvironmentResource." - }, - "KubernetesCompute": { - "type": "object", - "properties": { - "nameSpace": { - "type": "string", - "description": "The namespace to use for the environment" - } - }, - "description": "Specifies the properties for Kubernetes compute environment", - "required": [ - "nameSpace" - ], - "allOf": [ - { - "$ref": "#/definitions/EnvironmentCompute" - } - ], - "x-ms-discriminator-value": "kubernetes" - }, - "ProvisioningState": { - "type": "string", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - } - }, - "parameters": { - "EnvironmentResource.environmentName": { - "name": "environmentName", - "in": "path", - "required": true, - "description": "environment name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string", - "x-ms-parameter-location": "method" - }, - "RootScopeParam": { - "name": "rootScope", - "in": "path", - "required": true, - "description": "root scope path", - "minLength": 1, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/cadl/Applications.Core/cadl-output/gateways.json b/cadl/Applications.Core/cadl-output/gateways.json deleted file mode 100644 index 0897679d8b..0000000000 --- a/cadl/Applications.Core/cadl-output/gateways.json +++ /dev/null @@ -1,552 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "version": "0000-00-00", - "description": "REST API for Applications.Core Gateway Resource", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "" - } - } - }, - "tags": [ - { - "name": "Gateway" - }, - { - "name": "Operations" - } - ], - "paths": { - "/{rootScope}/providers/Applications.Core/gateways": { - "get": { - "tags": [ - "Gateway" - ], - "operationId": "Gateway_ListByResourceGroup", - "description": "List GatewayResource resources by resource group", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/GatewayResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}": { - "get": { - "tags": [ - "Gateway" - ], - "operationId": "Gateway_Get", - "description": "Get a GatewayResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/GatewayResource.gatewayName" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "Gateway" - ], - "operationId": "Gateway_CreateOrUpdate", - "description": "Create a GatewayResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/GatewayResource.gatewayName" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "tags": [ - "Gateway" - ], - "operationId": "Gateway_Update", - "description": "Update a GatewayResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/GatewayResource.gatewayName" - }, - { - "name": "properties", - "in": "body", - "required": true, - "description": "The resource properties to be updated.", - "schema": { - "$ref": "#/definitions/GatewayResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "Gateway" - ], - "operationId": "Gateway_Delete", - "description": "Delete a GatewayResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/GatewayResource.gatewayName" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/providers/Applications.Core/operations": { - "get": { - "tags": [ - "Operations" - ], - "operationId": "Operations_List", - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "BasicResourceProperties": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource." - } - }, - "description": "Basic properties of a Radius resource.", - "required": [ - "status" - ] - }, - "GatewayProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the Gateway at the time the operation was called.", - "readOnly": true - }, - "application": { - "type": "string", - "description": "The resource id of the application linked to Gateway resource." - }, - "internal": { - "type": "boolean", - "description": "Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", - "default": false - }, - "hostname": { - "$ref": "#/definitions/GatewayPropertiesHostname", - "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io." - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/GatewayRoute" - }, - "x-ms-identifiers": [], - "x-cadl-name": "GatewayRoute[]", - "description": "Routes attached to this Gateway" - }, - "url": { - "type": "string", - "description": "URL of the gateway resource. Readonly", - "readOnly": true - } - }, - "description": "Gateway properties", - "required": [ - "application", - "routes" - ], - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "GatewayPropertiesHostname": { - "type": "object", - "properties": { - "prefix": { - "type": "string", - "description": "Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined." - }, - "fullyQualifiedHostname": { - "type": "string", - "description": "Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined." - } - }, - "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io.", - "required": [ - "prefix", - "fullyQualifiedHostname" - ] - }, - "GatewayResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/GatewayProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-mutability": [ - "read", - "create" - ], - "x-ms-client-flatten": true - } - }, - "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", - "required": [ - "properties" - ], - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "GatewayResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/GatewayResource" - }, - "x-cadl-name": "GatewayResource[]", - "description": "The GatewayResource items on this page" - }, - "nextLink": { - "type": "string", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a GatewayResource list operation.", - "required": [ - "value" - ] - }, - "GatewayResourceUpdate": { - "type": "object", - "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-cadl-name": "Record", - "description": "Resource tags." - }, - "properties": { - "$ref": "#/definitions/GatewayResourceUpdateProperties" - } - }, - "description": "The type used for update operations of the GatewayResource." - }, - "GatewayResourceUpdateProperties": { - "type": "object", - "properties": { - "application": { - "type": "string", - "description": "The resource id of the application linked to Gateway resource." - }, - "internal": { - "type": "boolean", - "description": "Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", - "default": false - }, - "hostname": { - "$ref": "#/definitions/GatewayPropertiesHostname", - "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io." - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/GatewayRoute" - }, - "x-ms-identifiers": [], - "x-cadl-name": "GatewayRoute[]", - "description": "Routes attached to this Gateway" - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource." - } - }, - "description": "The updatable properties of the GatewayResource." - }, - "GatewayRoute": { - "type": "object", - "properties": { - "path": { - "type": "string", - "description": "The path to match the incoming request path on. Ex - /myservice." - }, - "destination": { - "type": "string", - "description": "The HttpRoute to route to. Ex - myserviceroute.id." - }, - "replacePrefix": { - "type": "string", - "description": "Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'" - } - }, - "description": "Route attached to Gateway", - "required": [ - "path", - "destination", - "replacePrefix" - ] - }, - "OutputResource": { - "type": "object", - "properties": {}, - "description": "Properties of an output resource." - }, - "ProvisioningState": { - "type": "string", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "ResourceStatus": { - "type": "object", - "properties": { - "outputResources": { - "type": "array", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" - } - }, - "description": "Status of a resource.", - "required": [ - "outputResources" - ] - } - }, - "parameters": { - "GatewayResource.gatewayName": { - "name": "gatewayName", - "in": "path", - "required": true, - "description": "Gateway name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string", - "x-ms-parameter-location": "method" - }, - "RootScopeParam": { - "name": "rootScope", - "in": "path", - "required": true, - "description": "root scope path", - "minLength": 1, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/cadl/Applications.Core/cadl-output/httpRoutes.json b/cadl/Applications.Core/cadl-output/httpRoutes.json deleted file mode 100644 index 17b70d6074..0000000000 --- a/cadl/Applications.Core/cadl-output/httpRoutes.json +++ /dev/null @@ -1,504 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "version": "0000-00-00", - "description": "REST API for Applications.Core HttpRoute Resource", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "" - } - } - }, - "tags": [ - { - "name": "HttpRoute" - }, - { - "name": "Operations" - } - ], - "paths": { - "/{rootScope}/providers/Applications.Core/httpRoute": { - "get": { - "tags": [ - "HttpRoute" - ], - "operationId": "HttpRoute_ListByResourceGroup", - "description": "List HttpRouteResource resources by resource group", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/httpRoute/{httpRouteName}": { - "get": { - "tags": [ - "HttpRoute" - ], - "operationId": "HttpRoute_Get", - "description": "Get a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/HttpRouteResource.httpRouteName" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "HttpRoute" - ], - "operationId": "HttpRoute_CreateOrUpdate", - "description": "Create a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/HttpRouteResource.httpRouteName" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "tags": [ - "HttpRoute" - ], - "operationId": "HttpRoute_Update", - "description": "Update a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/HttpRouteResource.httpRouteName" - }, - { - "name": "properties", - "in": "body", - "required": true, - "description": "The resource properties to be updated.", - "schema": { - "$ref": "#/definitions/HttpRouteResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "HttpRoute" - ], - "operationId": "HttpRoute_Delete", - "description": "Delete a HttpRouteResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/HttpRouteResource.httpRouteName" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/providers/Applications.Core/operations": { - "get": { - "tags": [ - "Operations" - ], - "operationId": "Operations_List", - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "BasicResourceProperties": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource." - } - }, - "description": "Basic properties of a Radius resource.", - "required": [ - "status" - ] - }, - "HttpRouteProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the HttpRoute at the time the operation was called.", - "readOnly": true - }, - "application": { - "type": "string", - "description": "The resource id of the application linked to HTTP Route resource." - }, - "internal": { - "type": "boolean", - "description": "Sets HttpRoute to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", - "default": false - }, - "hostname": { - "type": "string", - "description": "The internal hostname accepting traffic for the HTTP Route. Readonly.", - "readOnly": true - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port number for the HTTP Route. Defaults to 80. Readonly.", - "default": 80, - "readOnly": true - }, - "scheme": { - "type": "string", - "description": "The scheme used for traffic. Readonly." - }, - "url": { - "type": "string", - "description": "A stable URL that that can be used to route traffic to a resource. Readonly.", - "readOnly": true - } - }, - "description": "HttpRoute properties", - "required": [ - "application" - ], - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "HttpRouteResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/HttpRouteProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-mutability": [ - "read", - "create" - ], - "x-ms-client-flatten": true - } - }, - "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", - "required": [ - "properties" - ], - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "HttpRouteResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/HttpRouteResource" - }, - "x-cadl-name": "HttpRouteResource[]", - "description": "The HttpRouteResource items on this page" - }, - "nextLink": { - "type": "string", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a HttpRouteResource list operation.", - "required": [ - "value" - ] - }, - "HttpRouteResourceUpdate": { - "type": "object", - "properties": { - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "x-cadl-name": "Record", - "description": "Resource tags." - }, - "properties": { - "$ref": "#/definitions/HttpRouteResourceUpdateProperties" - } - }, - "description": "The type used for update operations of the HttpRouteResource." - }, - "HttpRouteResourceUpdateProperties": { - "type": "object", - "properties": { - "application": { - "type": "string", - "description": "The resource id of the application linked to HTTP Route resource." - }, - "internal": { - "type": "boolean", - "description": "Sets HttpRoute to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", - "default": false - }, - "scheme": { - "type": "string", - "description": "The scheme used for traffic. Readonly." - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource." - } - }, - "description": "The updatable properties of the HttpRouteResource." - }, - "OutputResource": { - "type": "object", - "properties": {}, - "description": "Properties of an output resource." - }, - "ProvisioningState": { - "type": "string", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "ResourceStatus": { - "type": "object", - "properties": { - "outputResources": { - "type": "array", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" - } - }, - "description": "Status of a resource.", - "required": [ - "outputResources" - ] - } - }, - "parameters": { - "HttpRouteResource.httpRouteName": { - "name": "httpRouteName", - "in": "path", - "required": true, - "description": "HttpRoute name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string", - "x-ms-parameter-location": "method" - }, - "RootScopeParam": { - "name": "rootScope", - "in": "path", - "required": true, - "description": "root scope path", - "minLength": 1, - "type": "string", - "x-ms-parameter-location": "method" - } - } -} diff --git a/cadl/Applications.Core/environment.cadl b/cadl/Applications.Core/environment.cadl deleted file mode 100644 index f2402e20ba..0000000000 --- a/cadl/Applications.Core/environment.cadl +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; - -@armNamespace -@serviceTitle("Applications.Core Management APIs") -@doc("REST API for Applications.Core Environment Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Core; - -@discriminator("kind") -@doc("Compute resource used by application environment resource.") -model EnvironmentCompute { - @doc("The resource id of the compute resource for application environment.") - resourceId: string; -} - -@doc("Specifies the properties for Kubernetes compute environment") -model KubernetesCompute extends EnvironmentCompute { - @doc("resource compute kind") - kind: "kubernetes"; - - @doc("The namespace to use for the environment") - nameSpace: string; -} - -@doc("Environment properties") -model EnvironmentProperties { - @visibility("read") - @doc("The status of the last operation.") - provisioningState?: ProvisioningState; - - @doc("The compute resource used by application environment.") - compute: EnvironmentCompute; -} - -model EnvironmentResource is TrackedResource { - @doc("environment name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("environmentName") - @path - @segment("environments") - name: string; -} - -@armResourceOperations -interface Environment - extends Radius.RootScopeResourceOperations< - EnvironmentResource, - EnvironmentProperties, - RootScopeParam - > {} - -@knownValues(ProvisioningStateKV) -model ProvisioningState is string; -enum ProvisioningStateKV { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, -} diff --git a/cadl/Applications.Core/global.cadl b/cadl/Applications.Core/global.cadl deleted file mode 100644 index 5746c8b3ab..0000000000 --- a/cadl/Applications.Core/global.cadl +++ /dev/null @@ -1,14 +0,0 @@ -@doc("Basic properties of a Radius resource.") -model BasicResourceProperties { - @doc("Status of a resource.") - status: ResourceStatus; -} - -@doc("Status of a resource.") -model ResourceStatus { - @doc("Properties of an output resource") - outputResources: OutputResource[]; -} - -@doc("Properties of an output resource.") -model OutputResource {} diff --git a/cadl/Applications.Core/httpRoutes.cadl b/cadl/Applications.Core/httpRoutes.cadl deleted file mode 100644 index 78a0ff3d6d..0000000000 --- a/cadl/Applications.Core/httpRoutes.cadl +++ /dev/null @@ -1,96 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; - -@armNamespace -@serviceTitle("Applications.Core Management APIs") -@doc("REST API for Applications.Core HttpRoute Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Core; - -@doc("HttpRoute properties") -model HttpRouteProperties extends BasicResourceProperties { - @doc("Provisioning state of the HttpRoute at the time the operation was called.") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("The resource id of the application linked to HTTP Route resource.") - application: string; - - @doc("Sets HttpRoute to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).") - internal?: boolean = false; - - @doc("The internal hostname accepting traffic for the HTTP Route. Readonly.") - @visibility("read") - hostname?: string; - - @doc("The port number for the HTTP Route. Defaults to 80. Readonly.") - @visibility("read") - port?: int32 = 80; - - @doc("The scheme used for traffic. Readonly.") - scheme?: string; - - @doc("A stable URL that that can be used to route traffic to a resource. Readonly.") - @visibility("read") - url?: string; -} - -model HttpRouteResource is TrackedResource { - @doc("HttpRoute name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("httpRouteName") - @path - @segment("httpRoute") - name: string; -} - -@armResourceOperations -interface HttpRoute - extends Radius.RootScopeResourceOperations< - HttpRouteResource, - HttpRouteProperties, - RootScopeParam - > {} - -@knownValues(ProvisioningStateKV) -model ProvisioningState is string; -enum ProvisioningStateKV { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json new file mode 100644 index 0000000000..bfcecc926c --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json @@ -0,0 +1,66 @@ +{ + "operationId": "Containers_CreateOrUpdate", + "title": "Create or update an container resource", + "parameters": { + "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "containerName": "app0", + "api-version": "2022-03-15-privatepreview", + "ContainerResource": { + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json new file mode 100644 index 0000000000..fc81d08572 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Containers_Delete", + "title": "Delete an container resource", + "parameters": { + "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "containerName": "app0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json new file mode 100644 index 0000000000..174df5b10d --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json @@ -0,0 +1,44 @@ +{ + "operationId": "Containers_Get", + "title": "Get an container resource", + "parameters": { + "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "containerName": "container0" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json new file mode 100644 index 0000000000..de9317f83c --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json @@ -0,0 +1,103 @@ +{ + "operationId": "Containers_ListByScope", + "title": "List containers at resource group", + "parameters": { + "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container1", + "name": "container1", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app1", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + ], + "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json new file mode 100644 index 0000000000..fbff32bcb0 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json @@ -0,0 +1,106 @@ +{ + "operationId": "Containers_ListByScope", + "title": "List containers at root scope", + "parameters": { + "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http", + "provides": "provides", + "port": 443, + "scheme": "https" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container1", + "name": "container1", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app1", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + ], + "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json new file mode 100644 index 0000000000..9b2ad183a7 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json @@ -0,0 +1,60 @@ +{ + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview", + "ExtenderParameters": { + "location": "West US", + "properties": { + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "name": "extender1", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + } + } +} + \ No newline at end of file diff --git a/typespec/Applications.Core/applications.tsp b/typespec/Applications.Core/applications.tsp new file mode 100644 index 0000000000..d0d8c284dc --- /dev/null +++ b/typespec/Applications.Core/applications.tsp @@ -0,0 +1,93 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; +import "./extensions.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; + +@doc("Radius Application resource") +model ApplicationResource is TrackedResource { + @doc("The application name") + @path + @key("applicationName") + @segment("applications") + name: ResourceNameString; +} + +@doc("Application properties") +model ApplicationProperties { + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; + + @doc("Fully qualified resource ID for the environment that the portable resource is linked to") + environment: string; + + @doc("The application extension.") + @extension("x-ms-identifiers", []) + extensions: Array; +} + +#suppress "@azure-tools/typespec-azure-core/casing-style" +@armResourceOperations +interface Applications { + get is ArmResourceRead< + ApplicationResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceSync< + ApplicationResource, + UCPBaseParameters + >; + + update is ArmResourcePatchSync< + ApplicationResource, + EnvironmentProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteSync< + ApplicationResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + ApplicationResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Applications.Core/common.tsp b/typespec/Applications.Core/common.tsp new file mode 100644 index 0000000000..13aac0cadd --- /dev/null +++ b/typespec/Applications.Core/common.tsp @@ -0,0 +1,19 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; + +using OpenAPI; diff --git a/cadl/Applications.Core/containers.cadl b/typespec/Applications.Core/containers.tsp similarity index 57% rename from cadl/Applications.Core/containers.cadl rename to typespec/Applications.Core/containers.tsp index 12b7dc4e61..88620cefac 100644 --- a/cadl/Applications.Core/containers.cadl +++ b/typespec/Applications.Core/containers.tsp @@ -14,32 +14,57 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; +import "./extensions.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; +model ContainerResource is TrackedResource { + @doc("Container name") + @path + @key("containerName") + @segment("containers") + name: ResourceNameString; +} -import "./global.cadl"; +@doc("Container properties") +model ContainerProperties { + ...ApplicationScopedResource; -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; + @doc("Definition of a container.") + container: Container; -@armNamespace -@serviceTitle("Applications.Core Management APIs") -@doc("REST API for Applications.Core Container Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Core; + @doc("Specifies a connection to another resource.") + connections?: Record; + + @doc("Configuration for supported external identity providers") + identity?: IdentitySettings; + + @doc("Extensions spec of the resource") + @extension("x-ms-identifiers", []) + extensions?: Extension[]; +} @doc("Specifies a listening port for the container") -model ContainerPort { +model ContainerPortProperties { @doc("The listening port number") containerPort: int32; @@ -48,6 +73,12 @@ model ContainerPort { @doc("Specifies a route provided by this port") provides?: string; + + @doc("Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value") + scheme?: string; + + @doc("Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired") + port?: int32; } @doc("Properties for readiness/liveness probe") @@ -61,6 +92,9 @@ model HealthProbeProperties { @doc("Interval for the readiness/liveness probe in seconds") periodSeconds?: float32; + + @doc("Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds") + timeoutSeconds?: float32 = 5.0; } @doc("Specifies the properties for readiness/liveness probe using HTTP Get") @@ -75,7 +109,7 @@ model HttpGetHealthProbeProperties extends HealthProbeProperties { path: string; @doc("Custom HTTP headers to add to the get request") - headers?: Map; + headers?: Record; } @doc("Specifies the properties for readiness/liveness probe using TCP") @@ -100,7 +134,7 @@ model ExecHealthProbeProperties extends HealthProbeProperties { @doc("Specifies a volume for a container") model Volume { @doc("The path where the volume is mounted") - mountPath?: string; + mountPath: string; } @doc("Specifies an ephemeral volume for a container") @@ -118,50 +152,19 @@ model PersistentVolume extends Volume { kind: "persistent"; @doc("Container read/write access to the volume") - rbac?: VolumePermission; + permission?: VolumePermission; @doc("The source of the volume") source: string; } -@doc("Extension of a resource.") -@discriminator("kind") -model Extension {} - -@doc("ManualScaling Extension") -model ManualScalingExtension extends Extension { - @doc("Specifies the extension of the resource") - kind: "manualScaling"; - - @doc("Replica count.") - replicas: int32; -} - -@doc("Specifies the resource should have a Dapr sidecar injected") -model DaprSidecarExtension extends Extension { - @doc("Specifies the extension of the resource") - kind: "daprSidecar"; - - @doc("The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. ") - appPort?: int32; - - @doc("The Dapr appId. Specifies the identifier used by Dapr for service invocation.") - appId: string; - - @doc("Specifies the Dapr configuration to use for the resource.") - config?: string; - - @doc("Specifies the Dapr app-protocol to use for the resource.") - protocol?: DaprProtocol; -} - -@doc("Iam properties") +@doc("IAM properties") model IamProperties { @doc("The kind of IAM provider to configure") - kind: Kind; + kind: IAMKind; @doc("RBAC permissions to be assigned on the source resource") - roles: string[]; + roles?: string[]; } @doc("Connection Properties") @@ -182,10 +185,10 @@ model Container { image: string; @doc("environment") - env?: Map; + env?: Record; @doc("container ports") - ports?: Map; + ports?: Record; @doc("readiness probe properties") readinessProbe?: HealthProbeProperties; @@ -194,87 +197,78 @@ model Container { livenessProbe?: HealthProbeProperties; @doc("container volumes") - volumes?: Map; -} - -@doc("Container properties") -model ContainerProperties extends BasicResourceProperties { - @doc("The status of the last operation.") - provisioningState?: ProvisioningState; + volumes?: Record; - @doc("Specifies resource id of the application") - application: string; + @doc("Entrypoint array. Overrides the container image's ENTRYPOINT") + command?: string[]; - @doc("Specifies a connection to another resource.") - connections: Map; + @doc("Arguments to the entrypoint. Overrides the container image's CMD") + args?: string[]; - @doc("Definition of a container.") - container: Container; - - @doc("Extensions spec of the resource") - extensions: Extension[]; + @doc("Working directory for the container") + workingDir: string; } -model ContainerResource is TrackedResource { - @doc("Container name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("containerName") - @path - @segment("containers") - name: string; -} - -@armResourceOperations -interface Containers - extends Radius.RootScopeResourceOperations< - ContainerResource, - ContainerProperties, - RootScopeParam - > {} - -@knownValues(ProvisioningStateKV) -model ProvisioningState is string; -enum ProvisioningStateKV { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, -} - -@knownValues(PortProtocolKV) -model PortProtocol is string; -enum PortProtocolKV { +@doc("The protocol in use by the port") +enum PortProtocol { + @doc("TCP protocol") TCP, + + @doc("UDP protocol") UDP, } -@knownValues(ManagedStoreKV) -model ManagedStore is string; -enum ManagedStoreKV { +@doc("The managed store for the ephemeral volume") +enum ManagedStore { + @doc("Memory store") memory, + + @doc("Disk store") disk, } -@knownValues(VolumePermissionKV) -model VolumePermission is string; -enum VolumePermissionKV { +@doc("The persistent volume permission") +enum VolumePermission { + @doc("Read only") read, + + @doc("Read and write") write, } -@knownValues(KindKV) -model Kind is string; -enum KindKV { +@doc("The kind of IAM provider to configure") +enum IAMKind { + @doc("Azure Active Directory") azure, } -@knownValues(DaprProtocolKV) -model DaprProtocol is string; -enum DaprProtocolKV { - http, - grpc, +@armResourceOperations +interface Containers { + get is ArmResourceRead< + ContainerResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + ContainerResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + ContainerResource, + ContainerProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + ContainerResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + ContainerResource, + UCPBaseParameters, + "Scope", + "Scope" + >; } diff --git a/typespec/Applications.Core/environments.tsp b/typespec/Applications.Core/environments.tsp new file mode 100644 index 0000000000..00da83fc20 --- /dev/null +++ b/typespec/Applications.Core/environments.tsp @@ -0,0 +1,177 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; +import "./extensions.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; + +@doc("The environment resource") +model EnvironmentResource is TrackedResource { + @doc("environment name") + @key("environmentName") + @path + @segment("environments") + name: ResourceNameString; +} + +@doc("Environment properties") +model EnvironmentProperties { + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; + + @doc("The compute resource used by application environment.") + compute: EnvironmentCompute; + + @doc("Cloud providers configuration for the environment.") + providers?: Providers; + + @doc("Specifies Recipes linked to the Environment.") + recipes?: Record>; + + @doc("The environment extension.") + @extension("x-ms-identifiers", []) + extensions?: Array; +} + +@doc("The Cloud providers configuration") +model Providers { + @doc("The Azure cloud provider configuration") + azure?: ProvidersAzure; + + @doc("The AWS cloud provider configuration") + aws?: ProvidersAws; +} + +@doc("The Azure cloud provider definition") +model ProvidersAzure { + @doc("Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'") + scope: string; +} + +@doc("The AWS cloud provider definition") +model ProvidersAws { + @doc("Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'") + scope: string; +} + +@doc("Format of the template provided by the recipe. Allowed values: bicep, terraform.") +@discriminator("templateKind") +model RecipeProperties { + @doc("Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported.") + templatePath: string; + + @doc("Key/value parameters to pass to the recipe template at deployment") + parameters?: {}; +} + +@doc("Represents Bicep recipe properties.") +model BicepRecipeProperties extends RecipeProperties { + @doc("The Bicep template kind.") + templateKind: "bicep"; +} + +@doc("Represents Terraform recipe properties.") +model TerraformRecipeProperties extends RecipeProperties { + @doc("The Terraform template kind.") + templateKind: "terraform"; + + @doc("Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources.") + templateVersion: string; +} + +@doc("Represents the request body of the getmetadata action.") +model RecipeGetMetadata { + @doc("Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases'") + linkType: string; + + @doc("The name of the recipe registered to the environment") + name: string; +} + +@doc("The properties of a Recipe linked to an Environment.") +model RecipeGetMetadataResponse { + @doc("The format of the template provided by the recipe. Allowed values: bicep, terraform.") + templateKind: string; + + @doc("The path to the template provided by the recipe. Currently only link to Azure Container Registry is supported.") + templatePath: string; + + @doc("The version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources.") + templateVersion: string; + + @doc("The key/value parameters to pass to the recipe template at deployment.") + parameters: {}; +} + +@armResourceOperations +interface Environments { + get is ArmResourceRead< + EnvironmentResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceSync< + EnvironmentResource, + UCPBaseParameters + >; + + update is ArmResourcePatchSync< + EnvironmentResource, + EnvironmentProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteSync< + EnvironmentResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + EnvironmentResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("Gets recipe metadata including parameters and any constraints on the parameters.") + @action("getmetadata") + getmetadata is ArmResourceActionSync< + EnvironmentResource, + RecipeGetMetadata, + RecipeGetMetadataResponse, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_CreateOrUpdate.json new file mode 100644 index 0000000000..14c050a927 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_CreateOrUpdate.json @@ -0,0 +1,62 @@ +{ + "operationId": "Applications_CreateOrUpdate", + "title": "Create or update an application resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "applicationName": "app0", + "api-version": "2022-03-15-privatepreview", + "ApplicationResource": { + "location": "West US", + "properties": { + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + }, + { + "kind": "kubernetesNamespace", + "namespace": "app-ns" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "name": "app0", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + }, + { + "kind": "kubernetesNamespace", + "namespace": "app-ns" + } + ] + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Delete.json new file mode 100644 index 0000000000..fb1d0bce84 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Applications_Delete", + "title": "Delete an application resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "applicationName": "app0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Get.json new file mode 100644 index 0000000000..ff352ff388 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Get.json @@ -0,0 +1,39 @@ +{ + "operationId": "Applications_Get", + "title": "Get an application resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "applicationName": "app0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "name": "app0", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + }, + { + "kind": "kubernetesNamespace", + "namespace": "app-ns" + } + ] + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_List.json new file mode 100644 index 0000000000..a043784e0d --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_List.json @@ -0,0 +1,52 @@ +{ + "operationId": "Applications_ListByScope", + "title": "Get applications by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "name": "app0", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + }, + { + "kind": "kubernetesNamespace", + "namespace": "app-ns" + } + ] + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/app1", + "name": "app1", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_ListByScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_ListByScope.json new file mode 100644 index 0000000000..0367e5fb54 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "Applications_ListByScope", + "title": "Get applications by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "name": "app0", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/app1", + "name": "app1", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/applications?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Update.json new file mode 100644 index 0000000000..b4dc7bc7d5 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Applications_Update.json @@ -0,0 +1,62 @@ +{ + "operationId": "Applications_Update", + "title": "Update (Patch) an application resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "applicationName": "app0", + "api-version": "2022-03-15-privatepreview", + "ApplicationResource": { + "location": "West US", + "properties": { + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + }, + { + "kind": "kubernetesNamespace", + "namespace": "app-ns" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "name": "app0", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + }, + { + "kind": "kubernetesNamespace", + "namespace": "app-ns" + } + ] + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate.json new file mode 100644 index 0000000000..e565785399 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate.json @@ -0,0 +1,66 @@ +{ + "operationId": "Containers_CreateOrUpdate", + "title": "Create or update an container resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "containerName": "app0", + "api-version": "2022-03-15-privatepreview", + "ContainerResource": { + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Delete.json new file mode 100644 index 0000000000..9a9bf28c14 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Containers_Delete", + "title": "Delete an container resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "containerName": "app0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Get.json new file mode 100644 index 0000000000..371b16c101 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Get.json @@ -0,0 +1,44 @@ +{ + "operationId": "Containers_Get", + "title": "Get an container resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "containerName": "container0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_List.json new file mode 100644 index 0000000000..a19eab3370 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_List.json @@ -0,0 +1,103 @@ +{ + "operationId": "Containers_ListByScope", + "title": "List containers at resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container1", + "name": "container1", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app1", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_ListByScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_ListByScope.json new file mode 100644 index 0000000000..48084fdec0 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_ListByScope.json @@ -0,0 +1,106 @@ +{ + "operationId": "Containers_ListByScope", + "title": "List containers at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http", + "provides": "provides", + "port": 443, + "scheme": "https" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container1", + "name": "container1", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app1", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Update.json new file mode 100644 index 0000000000..b923bd1ed6 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_Update.json @@ -0,0 +1,84 @@ +{ + "operationId": "Containers_Patch", + "title": "Update an container resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "containerName": "container0", + "api-version": "2022-03-15-privatepreview", + "ContainerResource": { + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json new file mode 100644 index 0000000000..8fa30b4e24 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json @@ -0,0 +1,87 @@ +{ + "operationId": "Environments_CreateOrUpdate", + "title": "Create or Update an environment resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "environmentName": "env0", + "api-version": "2022-03-15-privatepreview", + "EnvironmentResource": { + "location": "West US", + "properties": { + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + } + } + }, + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "name": "env0", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default" + }, + "providers" : { + "azure" : { + "scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + } + } + }, + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_DeleteEnv0.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_DeleteEnv0.json new file mode 100644 index 0000000000..3f57144f67 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_DeleteEnv0.json @@ -0,0 +1,14 @@ +{ + "operationId": "Environments_Delete", + "title": "Delete an environment resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "environmentName": "env0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json new file mode 100644 index 0000000000..cf12255d83 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json @@ -0,0 +1,56 @@ +{ + "operationId": "Environments_Get", + "title": "Get an environment resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "environmentName": "env0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "name": "env0", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "providers" : { + "azure" : { + "scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + } + } + }, + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json new file mode 100644 index 0000000000..9cc8e2155c --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json @@ -0,0 +1,29 @@ +{ + "operationId": "Environments_GetMetadata", + "title": "Get recipe metadata from environment", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "environmentName": "env0", + "recipeName": "mongotest" + }, + "responses": { + "200": { + "body": { + "linkType": "Applications.Link/mongoDatabases", + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", + "parameters": { + "throughput": { + "type" : "int", + "defaultValue" : 400 + }, + "location": { + "type" : "string", + "defaultValue" : "[resourceGroup().location]" + } + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json new file mode 100644 index 0000000000..33606a3b17 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json @@ -0,0 +1,125 @@ +{ + "operationId": "Environments_ListByScope", + "title": "Get environments by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "name": "env0", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "providers" : { + "azure" : { + "scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + }, + "default":{ + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/mongo" + } + }, + "Applications.Link/redisCaches":{ + "redis-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/rediscache" + }, + "default":{ + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/redis" + } + } + }, + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "name": "env0", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "providers" : { + "aws" : { + "scope":"/planes/aws/aws/accounts/140313373712/regions/us-west-2" + } + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "name": "env1", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster1", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "providers" : { + "azure" : { + "scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + } + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_ListByScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_ListByScope.json new file mode 100644 index 0000000000..cc9fe2cf6d --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_ListByScope.json @@ -0,0 +1,65 @@ +{ + "operationId": "Environments_ListByScope", + "title": "Get environments by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "name": "env0", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "name": "env1", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster1", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/radius-mi-app" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/environments?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json new file mode 100644 index 0000000000..b34faeafaf --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json @@ -0,0 +1,74 @@ +{ + "operationId": "Environments_Update", + "title": "Update an environment resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "environmentName": "env0", + "api-version": "2022-03-15-privatepreview", + "EnvironmentResource": { + "location": "West US", + "properties": { + "compute": { + "kind": "Kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default", + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + } + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "name": "env0", + "type": "Applications.Core/environments", + "properties": { + "provisioningState": "Succeeded", + "compute": { + "kind": "kubernetes", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", + "namespace": "default" + }, + "providers" : { + "azure" : { + "scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup" + } + }, + "recipes": { + "Applications.Link/mongoDatabases":{ + "cosmos-recipe": { + "templateKind": "bicep", + "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" + } + } + }, + "extensions": [ + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdate.json new file mode 100644 index 0000000000..36a863f2f1 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdate.json @@ -0,0 +1,62 @@ +{ + "operationId": "Extenders_CreateOrUpdate", + "title": "Create or Update an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview", + "ExtenderParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "name": "extender1", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + } + } +} + \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdateWithRecipe.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdateWithRecipe.json new file mode 100644 index 0000000000..f7b994db37 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_CreateOrUpdateWithRecipe.json @@ -0,0 +1,54 @@ +{ + "operationId": "Extenders_CreateOrUpdate", + "title": "Create or Update an extender resource with recipe", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview", + "ExtenderParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "s3" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "s3" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "name": "extender1", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "s3" + } + } + } + } + } +} + \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Delete.json new file mode 100644 index 0000000000..f8241d9c17 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Extenders_Delete", + "title": "Delete an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Get.json new file mode 100644 index 0000000000..a6883eaa24 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Get.json @@ -0,0 +1,31 @@ +{ + "operationId": "Extenders_Get", + "title": "Get an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2022-03-15-privatepreview", + "extenderName": "extender0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_List.json new file mode 100644 index 0000000000..544a601a76 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_List.json @@ -0,0 +1,34 @@ +{ + "operationId": "Extenders_ListByScope", + "title": "List extender resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListByRootScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListByRootScope.json new file mode 100644 index 0000000000..29aaa22970 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListByRootScope.json @@ -0,0 +1,34 @@ +{ + "operationId": "Extenders_ListByScope", + "title": "List extender resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/extenders?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListSecrets.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListSecrets.json new file mode 100644 index 0000000000..3ba02d58b5 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_ListSecrets.json @@ -0,0 +1,19 @@ +{ + "operationId": "Extenders_ListSecrets", + "title": "List the secrets from extender resources", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testGroup", + "api-version": "2022-03-15-privatepreview", + "extenderName": "extender0" + }, + "responses": { + "200": { + "body": { + "accountSid": "sid", + "authToken:": "token" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Update.json new file mode 100644 index 0000000000..ebdcfcd21a --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Extenders_Update.json @@ -0,0 +1,61 @@ +{ + "operationId": "Extenders_Update", + "title": "Update an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview", + "ExtenderParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "name": "extender1", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_CreateOrUpdate.json new file mode 100644 index 0000000000..cecb497c19 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_CreateOrUpdate.json @@ -0,0 +1,50 @@ +{ + "operationId": "Gateways_CreateOrUpdate", + "title": "Create or update a gateway resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "gatewayName": "gateway0", + "api-version": "2022-03-15-privatepreview", + "GatewayResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Delete.json new file mode 100644 index 0000000000..10c4503eb1 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Gateways_Delete", + "title": "Delete an gateway resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "gatewayName": "gateway0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Get.json new file mode 100644 index 0000000000..e71430e547 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Get.json @@ -0,0 +1,33 @@ +{ + "operationId": "Gateways_Get", + "title": "Get an gateway resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "gatewayName": "gateway0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_List.json new file mode 100644 index 0000000000..35f79c6018 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_List.json @@ -0,0 +1,37 @@ +{ + "operationId": "Gateways_ListByScope", + "title": "List gateway resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_ListByScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_ListByScope.json new file mode 100644 index 0000000000..7e69b93d1f --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_ListByScope.json @@ -0,0 +1,59 @@ +{ + "operationId": "Gateways_ListByScope", + "title": "List gateway resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte", + "path":"/" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway1", + "name": "gateway1", + "type": "Applications.Core/gateways", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-back-rte", + "path":"/backend2" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/gateways?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Update.json new file mode 100644 index 0000000000..cbf4bb3383 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Gateways_Update.json @@ -0,0 +1,50 @@ +{ + "operationId": "Gateways_Update", + "title": "Update a gateway resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "gatewayName": "gateway0", + "api-version": "2022-03-15-privatepreview", + "GatewayResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + } + ], + "tls":{ + "sslPassthrough": true, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "name": "gateway0", + "type": "Applications.Core/gateways", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "routes":[ + { + "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" + } + ], + "tls":{ + "sslPassthrough": false, + "hostname": "myapp.radapp.dev", + "minimumProtocolVersion": "1.2", + "certificateFrom": "myapp-tls-cert" + } + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_CreateOrUpdate.json new file mode 100644 index 0000000000..41f0d24102 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_CreateOrUpdate.json @@ -0,0 +1,28 @@ +{ + "operationId": "HttpRoutes_CreateOrUpdate", + "title": "Create or Update httpRoutes resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "httpRouteName": "route0", + "api-version": "2022-03-15-privatepreview", + "HttpRouteResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", + "name": "routes0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Delete.json new file mode 100644 index 0000000000..0a2aa56541 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "HttpRoutes_Delete", + "title": "Delete a httpRoutes resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "httpRouteName": "route0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Get.json new file mode 100644 index 0000000000..e9e2411461 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "HttpRoutes_Get", + "title": "Get a httpRoutes resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "httpRouteName": "route0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_List.json new file mode 100644 index 0000000000..134bef7b10 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "HttpRoutes_ListByScope", + "title": "List httpRoutes resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", + "name": "route1", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httproutes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_ListByScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_ListByScope.json new file mode 100644 index 0000000000..cd929b0da1 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "HttpRoutes_ListByScope", + "title": "List httpRoutes resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", + "name": "route1", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/httproutes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Update.json new file mode 100644 index 0000000000..46cd2cf074 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/HttpRoutes_Update.json @@ -0,0 +1,28 @@ +{ + "operationId": "HttpRoutes_Update", + "title": "Update a httpRoutes resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "httpRouteName": "route0", + "api-version": "2022-03-15-privatepreview", + "HttpRouteResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", + "name": "routes0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Operations_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Operations_List.json new file mode 100644 index 0000000000..d5a1aaa939 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Operations_List.json @@ -0,0 +1,195 @@ +{ + "operationId": "Operations_List", + "title": "Get the operations for the Applications.Core resource provider", + "parameters": { + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Applications.Core/operations/read", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "Operations", + "operation": "Get operations", + "description": "Get the list of Operations" + } + }, + { + "name": "Applications.Core/environments/read", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "environments", + "operation": "Get/List environment", + "description": "Get or list of environments." + } + }, + { + "name": "Applications.Core/environments/write", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "environments", + "operation": "Create/Update environment", + "description": "Create or update an environment." + } + }, + { + "name": "Applications.Core/environments/delete", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "environments", + "operation": "Delete environment", + "description": "Deletes an environment." + } + }, + { + "name": "Applications.Core/environments/join/action", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "environments", + "operation": "Join environment", + "description": "Join to application environment." + } + }, + { + "name": "Applications.Core/register/action", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "Applications.Core", + "operation": "Register the Applications.Core", + "description": "Register the subscription for Applications.Core" + } + }, + { + "name": "Applications.Core/unregister/action", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "Applications.Core", + "operation": "Unregister the Applications.Core", + "description": "Unregister the subscription for Applications.Core" + } + }, + { + "name": "Applications.Core/applications/read", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "applications", + "operation": "Get/List application", + "description": "Get or list of applications." + } + }, + { + "name": "Applications.Core/applications/write", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "applications", + "operation": "Create/Update application", + "description": "Create or update an application." + } + }, + { + "name": "Applications.Core/applications/delete", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "applications", + "operation": "Delete application", + "description": "Deletes an application." + } + }, + { + "name": "Applications.Core/applications/join/action", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "applications", + "operation": "Join application", + "description": "Join to application." + } + }, + { + "name": "Applications.Core/httpRoutes/read", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "httpRoutes", + "operation": "Get/List HTTP Route", + "description": "Get or list of HTTP Routes." + } + }, + { + "name": "Applications.Core/httpRoutes/write", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "httpRoutes", + "operation": "Create/Update HTTP Route", + "description": "Create or update an HTTP Route." + } + }, + { + "name": "Applications.Core/httpRoutes/delete", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "httpRoutes", + "operation": "Delete HTTP Route", + "description": "Deletes an HTTP Route." + } + }, + { + "name": "Applications.Core/gateways/read", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "gateways", + "operation": "Get/List Gateways", + "description": "Get or list of Gateways." + } + }, + { + "name": "Applications.Core/gateways/write", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "gateways", + "operation": "Create/Update Gateway", + "description": "Create or update a Gateway." + } + }, + { + "name": "Applications.Core/gateways/delete", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "gateways", + "operation": "Delete Gateway", + "description": "Deletes a Gateway." + } + }, + { + "name": "Applications.Core/gateways/join/action", + "isDataAction": false, + "display": { + "provider": "Applications.Core", + "resource": "gateways", + "operation": "Join Gateway", + "description": "Join to Gateway." + } + } + ] + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json new file mode 100644 index 0000000000..8350409c65 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json @@ -0,0 +1,51 @@ +{ + "operationId": "SecretStores_CreateOrUpdate", + "title": "Create or Update a secret store resource with azure keyvault", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "secretazkv", + "api-version": "2022-03-15-privatepreview", + "SecretStoreResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "encoding": "base64", + "value": "certificate" + }, + "tls.key": { + "encoding": "base64", + "value": "certificate" + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "name": "secretazkv", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "encoding": "base64" + }, + "tls.key": { + "encoding": "base64" + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdateValueFrom.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdateValueFrom.json new file mode 100644 index 0000000000..470379feb9 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdateValueFrom.json @@ -0,0 +1,61 @@ +{ + "operationId": "SecretStores_CreateOrUpdate", + "title": "Create or Update a secret store resource with valueFrom", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "secretazkv", + "api-version": "2022-03-15-privatepreview", + "SecretStoreResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/public_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/private_key", + "version": "1" + } + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "name": "secretazkv", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/public_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/private_key", + "version": "1" + } + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Delete.json new file mode 100644 index 0000000000..2511b39056 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "SecretStores_Update", + "title": "Update a secret store resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "volumeName": "keyvault0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get.json new file mode 100644 index 0000000000..4ed53c64f2 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get.json @@ -0,0 +1,30 @@ +{ + "operationId": "SecretStores_Get", + "title": "Get a secret store", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "secretStoreName": "secret0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secret0", + "name": "secret0", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + }, + "tls.key": { + } + } + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get_AzureKeyVault.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get_AzureKeyVault.json new file mode 100644 index 0000000000..635c47fbfb --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Get_AzureKeyVault.json @@ -0,0 +1,39 @@ +{ + "operationId": "SecretStores_Get", + "title": "Get a secret store for Azure Keyvault", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "secretStoreName": "secretazkv" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "name": "secretazkv", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/public_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/private_key", + "version": "1" + } + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_List.json new file mode 100644 index 0000000000..3e66a39aba --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_List.json @@ -0,0 +1,60 @@ +{ + "operationId": "SecretStores_ListByScope", + "title": "List secret stores", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secret0", + "name": "secret0", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + }, + "tls.key": { + } + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "name": "secretazkv", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/public_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/private_key", + "version": "1" + } + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_ListSecrets.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_ListSecrets.json new file mode 100644 index 0000000000..b5e9ed9e71 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_ListSecrets.json @@ -0,0 +1,22 @@ +{ + "operationId": "SecretStores_ListSecrets", + "title": "List secret stores", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "secretStoreName": "secret0" + }, + "responses": { + "200": { + "type": "certificate", + "data": { + "tls.crt": { + "value": "secrets ..." + }, + "tls.key": { + "value": "secrets ..." + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Update.json new file mode 100644 index 0000000000..c04faeab9e --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/SecretStores_Update.json @@ -0,0 +1,61 @@ +{ + "operationId": "SecretStores_Update", + "title": "Update a secret store", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "secretazkv", + "api-version": "2022-03-15-privatepreview", + "SecretStoreResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/public_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/private_key", + "version": "1" + } + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "name": "secretazkv", + "type": "Applications.Core/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "type": "certificate", + "data": { + "tls.crt": { + "valueFrom": { + "name": "secret/public_cert", + "version": "1" + } + }, + "tls.key": { + "valueFrom": { + "name": "secret/private_key", + "version": "1" + } + } + }, + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0" + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_CreateOrUpdate.json new file mode 100644 index 0000000000..db34af3074 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_CreateOrUpdate.json @@ -0,0 +1,61 @@ +{ + "operationId": "Volumes_CreateOrUpdate", + "title": "Create or update a volume", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "volumeName": "keyvault0", + "api-version": "2022-03-15-privatepreview", + "HttpRouteResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/routes0", + "name": "keyvault0", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Delete.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Delete.json new file mode 100644 index 0000000000..ec812ffa7e --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Volumes_Delete", + "title": "Delete a volume", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "volumeName": "keyvault0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Get.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Get.json new file mode 100644 index 0000000000..5d3c065c62 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Get.json @@ -0,0 +1,55 @@ +{ + "operationId": "Volumes_Get", + "title": "Get a volume", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "volumeName": "keyvault0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", + "name": "keyvault0", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_List.json new file mode 100644 index 0000000000..f52dc9ae53 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_List.json @@ -0,0 +1,100 @@ +{ + "operationId": "Volumes_ListByScope", + "title": "List volumes by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [{ + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", + "name": "keyvault0", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault1", + "name": "keyvault1", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_ListByScope.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_ListByScope.json new file mode 100644 index 0000000000..4d14bacbc3 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_ListByScope.json @@ -0,0 +1,101 @@ +{ + "operationId": "Volumes_ListByScope", + "title": "List volumes by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", + "name": "keyvault0", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault1", + "name": "keyvault1", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/volumes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Update.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Update.json new file mode 100644 index 0000000000..413bb773d3 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Volumes_Update.json @@ -0,0 +1,61 @@ +{ + "operationId": "Volumes_Update", + "title": "Update a volume", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "volumeName": "keyvault0", + "api-version": "2022-03-15-privatepreview", + "HttpRouteResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/routes0", + "name": "keyvault0", + "type": "Applications.Core/volumes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "kind": "azure.com.keyvault", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", + "secrets": { + "mysecret-1": { + "name": "mysecret-1", + "version": "1" + }, + "mysecret-2": { + "name": "mysecret-2", + "encoding": "base64" + } + }, + "keys": { + "mykey-1": { + "name": "key1", + "version": "1" + }, + "mykey-2": { + "name": "key2" + } + }, + "certificates": { + "mycert-1": { + "name": "cert1", + "certType": "certificate" + }, + "mycert-2": { + "name": "cert2", + "certType": "privatekey", + "format": "pfx", + "encoding": "hex" + } + } + } + } + } + } +} diff --git a/typespec/Applications.Core/extenders.tsp b/typespec/Applications.Core/extenders.tsp new file mode 100644 index 0000000000..aeae0499e2 --- /dev/null +++ b/typespec/Applications.Core/extenders.tsp @@ -0,0 +1,103 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; + +@doc("Response for list secrets API call") +model ExtenderListSecretResponse is Record; + +@doc("ExtenderResource link") +model ExtenderResource is TrackedResource { + @path + @doc("The name of the ExtenderResource link resource") + @key("extenderName") + @segment("extenders") + name: ResourceNameString; +} + +// ExtenderResoruce allows to get the additional properties. To ensure that `additionalProperties` is true, +// we need to extend `Record`. +// Reference: https://github.com/Azure/typespec-azure/blob/main/packages/typespec-autorest/test/additional-properties.test.ts +#suppress "@azure-tools/typespec-azure-core/bad-record-type" +@doc("ExtenderResource link properties") +model ExtenderProperties extends Record { + ...EnvironmentScopedResource; + + @doc("The secrets for referenced resource") + secrets?: Record; + + @doc("The recipe used to automatically deploy underlying infrastructure for the extender link") + recipe?: Recipe; + + @doc("Specifies how the underlying service/resource is provisioned and managed.") + resourceProvisioning?: ResourceProvisioning; +} + +@armResourceOperations +interface Extenders { + get is ArmResourceRead>; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + ExtenderResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + ExtenderResource, + ExtenderProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + ExtenderResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + ExtenderResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("Lists secrets values for the specified RedisCache resource") + @action("listSecrets") + listSecrets is ArmResourceActionSync< + ExtenderResource, + {}, + ExtenderListSecretResponse, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Core/extensions.tsp b/typespec/Applications.Core/extensions.tsp new file mode 100644 index 0000000000..c3f819c547 --- /dev/null +++ b/typespec/Applications.Core/extensions.tsp @@ -0,0 +1,80 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; + +using OpenAPI; + +@doc("Extension of a environment/application resource.") +@discriminator("kind") +model Extension {} + +@doc("Kubernetes namespace extension of a environment/application resource.") +model KubernetesNamespaceExtension extends Extension { + @doc("The kind of the resource.") + kind: "kubernetesNamespace"; + + @doc("The namespace of the application environment.") + `namespace`: string; +} + +@doc("Kubernetes metadata extension of a environment/application resource.") +model KubernetesMetadataExtension extends Extension { + @doc("The kind of the resource.") + kind: "kubernetesMetadata"; + + @doc("Annotations to be applied to the Kubernetes resources output by the resource") + annotations: Record; + + @doc("Labels to be applied to the Kubernetes resources output by the resource") + labels: Record; +} + +@doc("ManualScaling Extension") +model ManualScalingExtension extends Extension { + @doc("Specifies the extension of the resource") + kind: "manualScaling"; + + @doc("Replica count.") + replicas: int32; +} + +@doc("Specifies the resource should have a Dapr sidecar injected") +model DaprSidecarExtension extends Extension { + @doc("Specifies the extension of the resource") + kind: "daprSidecar"; + + @doc("The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. ") + appPort?: int32; + + @doc("The Dapr appId. Specifies the identifier used by Dapr for service invocation.") + appId: string; + + @doc("Specifies the Dapr configuration to use for the resource.") + config?: string; + + @doc("Specifies the Dapr app-protocol to use for the resource.") + protocol?: DaprSidecarExtensionProtocol; +} + +@doc("The Dapr sidecar extension protocol") +enum DaprSidecarExtensionProtocol { + @doc("HTTP protocol") + http, + + @doc("gRPC protocol") + grpc, +} diff --git a/cadl/Applications.Core/gateways.cadl b/typespec/Applications.Core/gateways.tsp similarity index 51% rename from cadl/Applications.Core/gateways.cadl rename to typespec/Applications.Core/gateways.tsp index 988425f1bc..5b7ea798f8 100644 --- a/cadl/Applications.Core/gateways.cadl +++ b/typespec/Applications.Core/gateways.tsp @@ -14,59 +14,86 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -@armNamespace -@serviceTitle("Applications.Core Management APIs") -@doc("REST API for Applications.Core Gateway Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) +using OpenAPI; + namespace Applications.Core; -@doc("Gateway properties") -model GatewayProperties extends BasicResourceProperties { - @doc("Provisioning state of the Gateway at the time the operation was called.") - @visibility("read") - provisioningState?: ProvisioningState; +model GatewayResource is TrackedResource { + @doc("Gateway name") + @key("gatewayName") + @path + @segment("gateways") + name: ResourceNameString; +} - @doc("The resource id of the application linked to Gateway resource.") - application: string; +@doc("Gateway properties") +model GatewayProperties { + ...ApplicationScopedResource; @doc("Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).") internal?: boolean = false; @doc("Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io.") - hostname?: GatewayPropertiesHostname; + hostname?: GatewayHostname; @doc("Routes attached to this Gateway") + @extension("x-ms-identifiers", []) routes: GatewayRoute[]; + @doc("TLS configuration for the Gateway.") + tls?: GatewayTls; + @doc("URL of the gateway resource. Readonly") @visibility("read") url?: string; } +@doc("Tls Minimum versions for Gateway resource.") +enum TlsMinVersion { + @doc("TLS Version 1.2") + tls12: "1.2", + + @doc("TLS Version 1.3") + tls13: "1.3", +} + +@doc("TLS configuration definition for Gateway resource.") +model GatewayTls { + @doc("If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption.") + sslPassthrough?: boolean = false; + + @doc("TLS minimum protocol version (defaults to 1.2).") + minimumProtocolVersion?: TlsMinVersion = TlsMinVersion.tls12; + + @doc("The resource id for the secret containing the TLS certificate and key for the gateway.") + certificateFrom?: string; +} + @doc("Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io.") -model GatewayPropertiesHostname { +model GatewayHostname { @doc("Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined.") - prefix: string; + prefix?: string; @doc("Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined.") - fullyQualifiedHostname: string; + fullyQualifiedHostname?: string; } @doc("Route attached to Gateway") @@ -78,35 +105,33 @@ model GatewayRoute { destination: string; @doc("Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'") - replacePrefix: string; -} - -model GatewayResource is TrackedResource { - @doc("Gateway name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("gatewayName") - @path - @segment("gateways") - name: string; + replacePrefix?: string; } @armResourceOperations -interface Gateway - extends Radius.RootScopeResourceOperations< - GatewayResource, - GatewayProperties, - RootScopeParam - > {} - -@knownValues(ProvisioningStateKV) -model ProvisioningState is string; -enum ProvisioningStateKV { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, +interface Gateways { + get is ArmResourceRead>; + + create is ArmResourceCreateOrReplaceAsync< + GatewayResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourcePatchAsync< + GatewayResource, + GatewayProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + GatewayResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + GatewayResource, + UCPBaseParameters, + "Scope", + "Scope" + >; } diff --git a/typespec/Applications.Core/httproutes.tsp b/typespec/Applications.Core/httproutes.tsp new file mode 100644 index 0000000000..72192ec790 --- /dev/null +++ b/typespec/Applications.Core/httproutes.tsp @@ -0,0 +1,96 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; + +@doc("Radius HTTPRoute Resource.") +model HttpRouteResource is TrackedResource { + @doc("HTTPRoute name") + @key("httpRouteName") + @path + @segment("httpRoutes") + name: ResourceNameString; +} + +@doc("HTTPRoute properties") +model HttpRouteProperties { + ...ApplicationScopedResource; + + @doc("The internal hostname accepting traffic for the HTTP Route. Readonly.") + hostname?: string; + + @doc("The port number for the HTTP Route. Defaults to 80. Readonly.") + port?: int32; + + @doc("The scheme used for traffic. Readonly.") + @visibility("read") + scheme?: string; + + @doc("A stable URL that that can be used to route traffic to a resource. Readonly.") + @visibility("read") + url?: string; +} + +@armResourceOperations +interface HttpRoutes { + get is ArmResourceRead< + HttpRouteResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + HttpRouteResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + HttpRouteResource, + HttpRouteProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + HttpRouteResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + HttpRouteResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Applications.Core/main.tsp b/typespec/Applications.Core/main.tsp new file mode 100644 index 0000000000..9862c3dc57 --- /dev/null +++ b/typespec/Applications.Core/main.tsp @@ -0,0 +1,48 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-resource-manager"; + +import "./environments.tsp"; +import "./applications.tsp"; +import "./containers.tsp"; +import "./gateways.tsp"; +import "./httproutes.tsp"; +import "./secretstores.tsp"; +import "./volumes.tsp"; +import "./extenders.tsp"; + +using TypeSpec.Versioning; +using Azure.ResourceManager; + +@armProviderNamespace +@service({ + title: "Applications.Core Management APIs", +}) +@doc("REST API for Applications.Core") +@versioned(Versions) +namespace Applications.Core; + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Supported API versions for the Applications.Core resource provider.") +enum Versions { + @doc("2022-03-15-privatepreview") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2022_03_15_privatepreview: "2022-03-15-privatepreview", +} diff --git a/typespec/Applications.Core/secretstores.tsp b/typespec/Applications.Core/secretstores.tsp new file mode 100644 index 0000000000..4ca7a5c4fb --- /dev/null +++ b/typespec/Applications.Core/secretstores.tsp @@ -0,0 +1,149 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; + +model SecretStoreResource is TrackedResource { + @doc("SecretStore name") + @key("secretStoreName") + @path + @segment("secretStores") + name: ResourceNameString; +} + +@doc("SecretStore properties") +model SecretStoreProperties { + ...ApplicationScopedResource; + + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" + @doc("The type of secret store data") + type?: SecretStoreDataType = SecretStoreDataType.generic; + + @doc("An object to represent key-value type secrets") + data: Record; + + @doc("The resource id of external secret store.") + resource?: string; +} + +@doc("SecretStore data type") +enum SecretStoreDataType { + @doc("Generic secret data type") + generic, + + @doc("Certificate secret data type") + certificate, +} + +@doc("SecretValue Encoding type") +enum SecretValueEncoding { + @doc("The raw secret value") + raw, + + @doc("The base64-encoded secret value") + base64, +} + +@doc("The Secret value source properties") +model ValueFromProperties { + @doc("The name of the referenced secret.") + name: string; + + @doc("The version of the referenced secret.") + version?: string; +} + +@doc("SecretValue properties") +model SecretValueProperties { + @doc("The encoding of value") + encoding?: SecretValueEncoding = SecretValueEncoding.raw; + + @doc("The value of secret.") + @secret + value: string; + + @doc("The referenced secret in properties.resource") + valueFrom?: ValueFromProperties; +} + +@doc("The list of secrets") +model SecretStoreListSecretsResult { + @doc("The type of secret store data") + type: SecretStoreDataType; + + @doc("An object to represent key-value type secrets") + data: Record; +} + +@armResourceOperations +interface SecretStores { + get is ArmResourceRead< + SecretStoreResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + SecretStoreResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + SecretStoreResource, + SecretStoreProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + SecretStoreResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + SecretStoreResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("List the secrets of a secret stores.") + @action("listSecrets") + listSecrets is ArmResourceActionSync< + SecretStoreResource, + {}, + SecretStoreListSecretsResult, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Core/tspconfig.yaml b/typespec/Applications.Core/tspconfig.yaml new file mode 100644 index 0000000000..38f0dc630d --- /dev/null +++ b/typespec/Applications.Core/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + azure-resource-provider-folder: "resource-manager" + examples-directory: "examples" + emitter-output-dir: "{project-root}/../../swagger/specification/applications" + arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/Applications.Core/volumes.tsp b/typespec/Applications.Core/volumes.tsp new file mode 100644 index 0000000000..ef53e24cdb --- /dev/null +++ b/typespec/Applications.Core/volumes.tsp @@ -0,0 +1,179 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Core; + +@doc("Radius Volume resource.") +model VolumeResource is TrackedResource { + @doc("Volume name") + @key("volumeName") + @path + @segment("volumes") + name: ResourceNameString; +} + +@doc("Volume properties") +@discriminator("kind") +model VolumeProperties { + ...ApplicationScopedResource; +} + +@doc("Represents Azure Key Vault Volume properties") +model AzureKeyVaultVolumeProperties extends VolumeProperties { + @doc("The Azure Key Vault Volume kind") + kind: "azure.com.keyvault"; + + @doc("The KeyVault certificates that this volume exposes") + certificates?: Record; + + @doc("The KeyVault keys that this volume exposes") + keys?: Record; + + @doc("The ID of the keyvault to use for this volume resource") + resource: string; + + @doc("The KeyVault secrets that this volume exposes") + secrets?: Record; +} + +@doc("Represents certificate object properties") +model CertificateObjectProperties { + @doc("File name when written to disk") + `alias`?: string; + + @doc("Encoding format. Default utf-8") + encoding?: VolumeSecretEncodings = VolumeSecretEncodings.utf8; + + @doc("Certificate format. Default pem") + format?: CertificateFormats = CertificateFormats.pem; + + @doc("The name of the certificate") + name: string; + + @doc("Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate") + certType?: CertificateTypes; + + @doc("Certificate version") + version?: string; +} + +@doc("Represents certificate formats") +enum CertificateFormats { + @doc("PEM Certificate format") + pem: "pem", + + @doc("PFX Certificate format") + pfx: "pfx", +} + +@doc("Represents secret encodings") +enum VolumeSecretEncodings { + @doc("UTF-8 encoding") + utf8: "utf-8", + + @doc("Hex encoding") + hex: "hex", + + @doc("Base64 encoding") + base64: "base64", +} + +@doc("Represents certificate types") +enum CertificateTypes { + @doc("Certificate type") + certificate: "certificate", + + @doc("Private Key type") + privatekey: "privatekey", + + @doc("Public Key type") + publickey: "publickey", +} + +@doc("Represents secret object properties") +model SecretObjectProperties { + @doc("File name when written to disk") + `alias`?: string; + + @doc("Encoding format. Default utf-8") + encoding?: VolumeSecretEncodings = VolumeSecretEncodings.utf8; + + @doc("The name of the certificate") + name: string; + + @doc("Certificate version") + version?: string; +} + +@doc("Represents key object properties") +model KeyObjectProperties { + @doc("File name when written to disk") + `alias`?: string; + + @doc("The name of the certificate") + name: string; + + @doc("Certificate version") + version?: string; +} + +@armResourceOperations +interface Volumes { + get is ArmResourceRead>; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + VolumeResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + VolumeResource, + VolumeProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + VolumeResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + VolumeResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/README.md b/typespec/README.md new file mode 100644 index 0000000000..2cef191e60 --- /dev/null +++ b/typespec/README.md @@ -0,0 +1,111 @@ +# TypeSpec for Radius + +TypeSpec is a language for describing cloud service APIs and generating other API description languages, client and service code, documentation, and other assets. TypeSpec provides highly extensible core language primitives that can describe API shapes common among REST, GraphQL, gRPC, and other protocols. + +## Directory structure + +### TypeSpec + +* **[Applications.Core](./Applications.Core/)**: This directory contains Applications.Core TypeSpec files to define its namespace and resource types. +* **[Test.Resource](./Test.Resource/)**: This directory contains the template typespec files to create new namespace and resource types. +* **[radius/v1](./radius/v1/)**: This directory contains the radius shared typespec v1 libraries used by each namespace. + +### OpenAPIv2 Spec file output + +Once you compile your typespec files, the default output OpenAPIv2 spec file will be emitted to [/swagger/specification/applications/resource-manager](../swagger/specification/swagger/specification/applications/resource-manager). + +## Prerequisite + +1. Install [NodeJS 16+](https://nodejs.org/en/download) +1. Install [TypeSpec compiler](https://microsoft.github.io/typespec/introduction/installation) + ```bash + npm install -g @typespec/compiler + ``` + +## Build TypeSpec to OpenAPI swagger. + +Radius uses [OpenAPIv2 specifications](../swagger/) for defining API and validating the API request. You can compile and emit swagger spec files by following steps. + +1. Install dependencies + ```bash + tsp install + ``` +1. Compile and emit the swagger files + ```bash + tsp compile ./Test.Resource + ``` + Please ensure that you resolve all warnings and errors from the compiler. +1. Review your emitted swagger file under [/swagger/specification/applications/resource-manager/Test.Resource](../swagger/specification/applications/resource-manager/Test.Resource). + + +## TypeSpec authoring guideline + +This section provides the tips and guidelines to define APIs with TypeSpec. + +### TypeSpec file formatting + +TypeSpec compiler has its own formatting TypeSpec files. Ensure that you run the following command once you edit spec files. + +```bash +tsp format **/*.tsp +``` + +### Use [Test.Resource](./Test.Resource/) template to create new namespace + +1. Copy the entire [Test.Resource](./Test.Resource/) directory to new directory with the new namespace name under [typespec](./). +1. Open [main.tsp](./Test.Resource/main.tsp) and update `Versions` enum to support new API version for your namespace. +1. Create new `ResourceTypeName.tsp` file to define new resource type based on [testasyncresources.tsp](./Test.Resource/testasyncresources.tsp) or [testsyncresources.tsp](./Test.Resource/testsyncresources.tsp). +1. Add `import "ResourceTypeName.tsp";` in `main.tsp` and remove the sample resource type tsp imports. +1. Run the formatter and compiler + ```bash + tsp format **/*.tsp + tsp compile ./YourNamespace + ``` + +### Support multiple API versions + +You can manage multiple API versions with the decorator of [TypeSpec.Versioning](https://microsoft.github.io/typespec/standard-library/versioning/reference) library. + +1. Describe the supported version in `enum Verisons` of `main.tsp`. For example, [Test.Resource/main.tsp](./Test.Resource/main.tsp) supports two API verisons, `2022-08-19-preview` and `2023-08-19`. +1. Use [the versioning decorators](https://microsoft.github.io/typespec/standard-library/versioning/reference#decorators) for model and property. [Test.Resource/typesyncresources.tsp](./Test.Resource/testsyncresources.tsp) includes the example to use `@added` decorator to add new resource type in `v2023-08-19` API version. + +### Link API operation to example files with `x-ms-examples` custom property + +With TypeSpec, we do not need to specify the properties for `x-ms-examples`. Instead, TypeSpec emitter library has the built-in feature to link resource operations to request/response example files automatically. To leverage this feature, JSON example files needs to be located under +`/typespec//examples//`. `operationId` property value in example file must match `_`. + +For example, [TestSyncResource](./Test.Resource/testsyncresources.tsp) defines the following operations: + +```ts +@added(Versions.v2023_08_19) +@armResourceOperations +interface TestSyncResources { + get is ArmResourceRead>; + + createOrUpdate is ArmResourceCreateOrReplaceSync< + TestSyncResource, + UCPBaseParameters + >; + ... +``` + +You can create [TestSyncResource_Get.json](./Test.Resource/examples/2023-08-19/TestSyncResource_Get.json) and [TestSyncResource_CreateOrUpdate.json](./Test.Resource/examples/2023-08-19/TestSyncResource_CreateOrUpdate.json) in `Test.Resource/examples/2023-08-19/` like the following sample. + +```json +{ + "operationId": "TestSyncResources_Get", // <-- This must match the name convention - "_". + "title": "Get a TestSyncResources resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + // ... +``` + +## References + +* [Introduction to TypeSpec](https://microsoft.github.io/typespec/) +* [TypeSpec Azure](https://azure.github.io/typespec-azure/) +* [TypeSpec Samples](https://github.com/microsoft/typespec/tree/main/packages/samples) +* [TypeSpec Azure samples](https://github.com/Azure/typespec-azure/tree/main/packages/samples/specs/resource-manager) \ No newline at end of file diff --git a/typespec/Test.Resource/common.tsp b/typespec/Test.Resource/common.tsp new file mode 100644 index 0000000000..a8c58440dd --- /dev/null +++ b/typespec/Test.Resource/common.tsp @@ -0,0 +1,21 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; + +using OpenAPI; + +// TODO: Add shared models here. diff --git a/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_CreateOrUpdate.json b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_CreateOrUpdate.json new file mode 100644 index 0000000000..4b6cf1b500 --- /dev/null +++ b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_CreateOrUpdate", + "title": "Create or Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2022-08-19-preview", + "TestAsyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Delete.json b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Delete.json new file mode 100644 index 0000000000..dc4fd265ef --- /dev/null +++ b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "TestAsyncResources_Delete", + "title": "Delete a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2022-08-19-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Get.json b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Get.json new file mode 100644 index 0000000000..8c4f351bc3 --- /dev/null +++ b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "TestAsyncResources_Get", + "title": "Get a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2022-08-19-preview" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_List.json b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_List.json new file mode 100644 index 0000000000..bb7f6f5eff --- /dev/null +++ b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources by resourcegroup", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2022-08-19-preview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_ListByScope.json b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_ListByScope.json new file mode 100644 index 0000000000..37e52d2155 --- /dev/null +++ b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2022-08-19-preview&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Update.json b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Update.json new file mode 100644 index 0000000000..e23e021d59 --- /dev/null +++ b/typespec/Test.Resource/examples/2022-08-19-preview/TestAsyncResource_Update.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_Update", + "title": "Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2022-08-19-preview", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_CreateOrUpdate.json b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_CreateOrUpdate.json new file mode 100644 index 0000000000..ab9354729d --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_CreateOrUpdate", + "title": "Create or Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestAsyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Delete.json b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Delete.json new file mode 100644 index 0000000000..bf27a5e050 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "TestAsyncResources_Delete", + "title": "Delete a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Get.json b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Get.json new file mode 100644 index 0000000000..be851ac706 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "TestAsyncResources_Get", + "title": "Get a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_List.json b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_List.json new file mode 100644 index 0000000000..a3b3f205ed --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources by resourcegroup", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_ListByScope.json b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_ListByScope.json new file mode 100644 index 0000000000..07fde44c99 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Update.json b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Update.json new file mode 100644 index 0000000000..2c1ff5c348 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestAsyncResource_Update.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_Update", + "title": "Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_CreateOrUpdate.json b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_CreateOrUpdate.json new file mode 100644 index 0000000000..d449d53a12 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestSyncResources_CreateOrUpdate", + "title": "Create or Update TestSyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Delete.json b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Delete.json new file mode 100644 index 0000000000..4285aaa3f2 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "TestSyncResource_Delete", + "title": "Delete a TestSyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Get.json b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Get.json new file mode 100644 index 0000000000..a3b3d18932 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "TestSyncResources_Get", + "title": "Get a TestSyncResources resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_List.json b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_List.json new file mode 100644 index 0000000000..2738f17a34 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestSyncResources_ListByScope", + "title": "List TestSyncResource resources by resourcegroup", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2023-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testSyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_ListByScope.json b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_ListByScope.json new file mode 100644 index 0000000000..78a0e58803 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestSyncResources_ListByScope", + "title": "List TestSyncResource resources at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2023-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testSyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Update.json b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Update.json new file mode 100644 index 0000000000..f710358466 --- /dev/null +++ b/typespec/Test.Resource/examples/2023-08-19/TestSyncResource_Update.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestSyncResources_Update", + "title": "Update TestSyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/typespec/Test.Resource/main.tsp b/typespec/Test.Resource/main.tsp new file mode 100644 index 0000000000..3676b08b53 --- /dev/null +++ b/typespec/Test.Resource/main.tsp @@ -0,0 +1,49 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-resource-manager"; + +// TODO: after creating a copy of this file, create individual .tsp files for each of your resources and +// use the 'import' keyword to import them here. +import "./testsyncresources.tsp"; +import "./testasyncresources.tsp"; + +using TypeSpec.Versioning; +using Azure.ResourceManager; + +@armProviderNamespace +@service({ + title: "Test.Resource Resource Management APIs", +}) +@doc("REST API for Test.Resource") +@versioned(Versions) +namespace Test.Resource; + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Supported API versions for the Test.Resource resource provider.") +enum Versions { + @doc("2022-08-19-preview") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2022_08_19_preview: "2022-08-19-preview", + + @doc("2023-08-19") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2023_08_19: "2023-08-19", +} diff --git a/typespec/Test.Resource/testasyncresources.tsp b/typespec/Test.Resource/testasyncresources.tsp new file mode 100644 index 0000000000..daa3bdd423 --- /dev/null +++ b/typespec/Test.Resource/testasyncresources.tsp @@ -0,0 +1,85 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Test.Resource; + +@doc("The TestAsyncResource which implements asynchornous API.") +model TestAsyncResource is TrackedResource { + @doc("The name of TestSyncResource") + @path + @key("testAsyncResourceName") + @segment("testAsyncResources") + name: ResourceNameString; +} + +@doc("TestAsyncResource properties") +model TestAsyncResourceProperties { + ...ApplicationScopedResource; + + @doc("The property1 of TestASyncResource") + property1: string; +} + +@armResourceOperations +interface TestAsyncResources { + get is ArmResourceRead< + TestAsyncResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + TestAsyncResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + TestAsyncResource, + TestAsyncResourceProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + TestAsyncResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + TestAsyncResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Test.Resource/testsyncresources.tsp b/typespec/Test.Resource/testsyncresources.tsp new file mode 100644 index 0000000000..896a1801ee --- /dev/null +++ b/typespec/Test.Resource/testsyncresources.tsp @@ -0,0 +1,83 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Test.Resource; + +@doc("The TestSyncResource type.") +model TestSyncResource is TrackedResource { + @doc("The name of TestSyncResource") + @path + @key("testSyncResourceName") + @segment("testSyncResources") + name: ResourceNameString; +} + +@doc("TestSyncResource properties") +model TestSyncResourceProperties { + ...ApplicationScopedResource; + + @doc("The property1 of TestSyncResource") + property1: string; +} + +@added(Versions.v2023_08_19) +@armResourceOperations +interface TestSyncResources { + get is ArmResourceRead>; + + createOrUpdate is ArmResourceCreateOrReplaceSync< + TestSyncResource, + UCPBaseParameters + >; + + update is ArmResourcePatchSync< + TestSyncResource, + TestSyncResourceProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteSync< + TestSyncResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + TestSyncResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Test.Resource/tspconfig.yaml b/typespec/Test.Resource/tspconfig.yaml new file mode 100644 index 0000000000..38f0dc630d --- /dev/null +++ b/typespec/Test.Resource/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + azure-resource-provider-folder: "resource-manager" + examples-directory: "examples" + emitter-output-dir: "{project-root}/../../swagger/specification/applications" + arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/package-lock.json b/typespec/package-lock.json new file mode 100644 index 0000000000..e3d5a76cd7 --- /dev/null +++ b/typespec/package-lock.json @@ -0,0 +1,1039 @@ +{ + "name": "radius", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "radius", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@azure-tools/typespec-autorest": "latest", + "@azure-tools/typespec-azure-core": "latest", + "@azure-tools/typespec-azure-resource-manager": "latest", + "@azure-tools/typespec-providerhub": "latest", + "@typespec/compiler": "latest", + "@typespec/http": "latest", + "@typespec/openapi": "latest", + "@typespec/rest": "latest", + "@typespec/versioning": "latest" + } + }, + "node_modules/@azure-tools/typespec-autorest": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.33.0.tgz", + "integrity": "sha512-xA29JJt6Dnb8402xYJrR1dAwzEuhen/gcYeUk4KZrfn/3FsLpfiGQCwTAfcCd6iyLDRx7yQ34ysJmLt5ebcOdw==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.33.0", + "@typespec/compiler": "~0.47.0", + "@typespec/http": "~0.47.0", + "@typespec/openapi": "~0.47.0", + "@typespec/rest": "~0.47.0", + "@typespec/versioning": "~0.47.0" + } + }, + "node_modules/@azure-tools/typespec-azure-core": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.33.1.tgz", + "integrity": "sha512-g2MbyofjGo5GrPu/L0D3dXRcYXJOIA+abLWS6CRwwGN0RT0W+tnV8SFvGWRbBFsU0gWEZapfJKBwpVVwau6pVQ==", + "dependencies": { + "@typespec/lint": "~0.47.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.47.0", + "@typespec/http": "~0.47.0", + "@typespec/rest": "~0.47.0" + } + }, + "node_modules/@azure-tools/typespec-azure-resource-manager": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.33.0.tgz", + "integrity": "sha512-8jkOae2Yf5fsYVh7ZgdC+a06Ghlfnk6DvLIQPouwOIftsmnUXScJdDIPodqxjdHuR5AWr053+OiKtVrJDWYgjw==", + "dependencies": { + "@typespec/lint": "~0.47.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-autorest": "~0.33.0", + "@azure-tools/typespec-azure-core": "~0.33.0", + "@typespec/compiler": "~0.47.0", + "@typespec/http": "~0.47.0", + "@typespec/openapi": "~0.47.0", + "@typespec/rest": "~0.47.0", + "@typespec/versioning": "~0.47.0" + } + }, + "node_modules/@azure-tools/typespec-providerhub": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-providerhub/-/typespec-providerhub-0.33.0.tgz", + "integrity": "sha512-18HRdQUwSrzcyDxP95REu4qIOL8SMjUhifZAJjGThwhkqczTxoeqPI3ek3ISFj9C7SsSvvlLAsL09kiy+GKYZA==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-autorest": "~0.33.0", + "@azure-tools/typespec-azure-core": "~0.33.0", + "@azure-tools/typespec-azure-resource-manager": "~0.33.0", + "@typespec/compiler": "~0.47.0", + "@typespec/http": "~0.47.0", + "@typespec/openapi": "~0.47.0", + "@typespec/rest": "~0.47.0", + "@typespec/versioning": "~0.47.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.10.tgz", + "integrity": "sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==", + "dependencies": { + "@babel/highlight": "^7.22.10", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.10.tgz", + "integrity": "sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.5", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@typespec/compiler": { + "version": "0.47.1", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.47.1.tgz", + "integrity": "sha512-EBTweucgrUiFLVbBLYJobgV1emoGzM50iPrOz/Fr3dwFFnISpZJ8wzapq+z0okrvx75+W5q12bms8DjsUWapTA==", + "dependencies": { + "@babel/code-frame": "~7.22.5", + "ajv": "~8.12.0", + "change-case": "~4.1.2", + "globby": "~13.1.1", + "js-yaml": "~4.1.0", + "mustache": "~4.2.0", + "picocolors": "~1.0.0", + "prettier": "~3.0.1", + "prompts": "~2.4.1", + "semver": "^7.3.8", + "vscode-languageserver": "~8.1.0", + "vscode-languageserver-textdocument": "~1.0.1", + "yargs": "~17.7.1" + }, + "bin": { + "tsp": "cmd/tsp.js", + "tsp-server": "cmd/tsp-server.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@typespec/http": { + "version": "0.47.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.47.0.tgz", + "integrity": "sha512-HrVu5mGV+p3KGPtcNFHB5gXm9pU4rYRG3hJWZdLcN8fy+OuwbhmOgjOGN4AB7HLllnISmcFn6LtlqGnr0LpyfA==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.47.0" + } + }, + "node_modules/@typespec/lint": { + "version": "0.47.0", + "resolved": "https://registry.npmjs.org/@typespec/lint/-/lint-0.47.0.tgz", + "integrity": "sha512-+CZ8OC8ABHU+HljjWvkVfLDZzyj2kc8VqEOHoXYdomt7PTo2GdVubyOXZMAYFiXWJr/k4YWHD2moPcvu+e2yTQ==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.47.0" + } + }, + "node_modules/@typespec/openapi": { + "version": "0.47.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.47.0.tgz", + "integrity": "sha512-p10NA5MQ1/z/yltTmK9g/RHgRQa+UPJg7ntcix8I9DIwX6u3yJReYwWBrKLeRNExd8ylNHNqjXTwiHJfptmR3w==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.47.0", + "@typespec/http": "~0.47.0", + "@typespec/rest": "~0.47.0" + } + }, + "node_modules/@typespec/rest": { + "version": "0.47.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.47.0.tgz", + "integrity": "sha512-sjxCY2dQ6Wc51W7NYDLgcZdeTI35vFJR0aK+tuYHMTwjhZJK20ezwb/c+RZQ8xyGIyX+vUj9yhTc7lBZGw4n1A==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.47.0" + } + }, + "node_modules/@typespec/versioning": { + "version": "0.47.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.47.0.tgz", + "integrity": "sha512-j3NUBm61k40ZI5aljgqfVFvduoR+q7ijLpwt+lzXw/DecOgNWZX7R/GGzwCmUVyfJUZpMA/8zhuxmx4fB36P7g==", + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.47.0" + } + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "dependencies": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", + "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", + "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "dependencies": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "engines": { + "node": ">=6" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.2.tgz", + "integrity": "sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", + "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" + }, + "node_modules/upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vscode-jsonrpc": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", + "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageserver": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", + "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.3" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", + "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "dependencies": { + "vscode-jsonrpc": "8.1.0", + "vscode-languageserver-types": "3.17.3" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.8.tgz", + "integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/typespec/package.json b/typespec/package.json new file mode 100644 index 0000000000..44eb82d565 --- /dev/null +++ b/typespec/package.json @@ -0,0 +1,19 @@ +{ + "name": "radius", + "version": "0.1.0", + "type": "module", + "dependencies": { + "@typespec/compiler": "latest", + "@azure-tools/typespec-autorest": "latest", + "@azure-tools/typespec-azure-core": "latest", + "@azure-tools/typespec-azure-resource-manager": "latest", + "@azure-tools/typespec-providerhub": "latest", + "@typespec/http": "latest", + "@typespec/openapi": "latest", + "@typespec/rest": "latest", + "@typespec/versioning": "latest" + }, + "private": true, + "author": "Radius Authors", + "license": "Apache-2.0" +} \ No newline at end of file diff --git a/typespec/radius/v1/resources.tsp b/typespec/radius/v1/resources.tsp new file mode 100644 index 0000000000..c86806d223 --- /dev/null +++ b/typespec/radius/v1/resources.tsp @@ -0,0 +1,167 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@typespec/openapi"; + +using OpenAPI; +using Azure.Core; +using Azure.ResourceManager; + +@doc("The resource name") +@maxLength(63) +@pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") +scalar ResourceNameString extends string; + +@doc("Base properties of a Environment-scoped resource") +model EnvironmentScopedResource { + @doc("Fully qualified resource ID for the environment that the portable resource is linked to") + environment: string; + + @doc("Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)") + application?: string; + + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; + + @doc("Status of a resource.") + @visibility("read") + status?: ResourceStatus; +} + +@doc("Base properties of a Application-scoped resource") +model ApplicationScopedResource { + @doc("Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)") + environment?: string; + + @doc("Fully qualified resource ID for the application that the portable resource is consumed by") + application: string; + + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; + + @doc("Status of a resource.") + @visibility("read") + status?: ResourceStatus; +} + +@doc("IdentitySettings is the external identity setting.") +model IdentitySettings { + @doc("kind of identity setting") + kind: IdentitySettingKind; + + @doc("The URI for your compute platform's OIDC issuer") + oidcIssuer?: string; + + @doc("The resource ID of the provisioned identity") + resource?: string; +} + +@doc("IdentitySettingKind is the kind of supported external identity setting") +enum IdentitySettingKind { + @doc("undefined identity") + undefined: "undefined", + + @doc("azure ad workload identity") + `azure.com.workload`: "azure.com.workload", +} + +@discriminator("kind") +@doc("Represents backing compute resource") +model EnvironmentCompute { + @doc("The resource id of the compute resource for application environment.") + resourceId?: string; + + @doc("Configuration for supported external identity providers") + identity?: IdentitySettings; +} + +@doc("The Kubernetes compute configuration") +model KubernetesCompute extends EnvironmentCompute { + @doc("The Kubernetes compute kind") + kind: "kubernetes"; + + @doc("The namespace to use for the environment.") + `namespace`: string; +} + +@doc("Status of a resource.") +model ResourceStatus { + @doc("The compute resource associated with the resource.") + compute?: EnvironmentCompute; + + @doc("Properties of an output resource") + @extension("x-ms-identifiers", []) + outputResources?: OutputResource[]; +} + +@doc("Properties of an output resource.") +model OutputResource { + @doc("The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships.") + localId?: string; + + @doc("The UCP resource ID of the underlying resource.") + id?: string; + + @doc("Determines whether Radius manages the lifecycle of the underlying resource.") + radiusManaged?: boolean; +} + +@doc("Describes a reference to an existing resource") +model ResourceReference { + @doc("Resource id of an existing resource") + id: string; +} + +@doc("Provisioning state of the portable resource at the time the operation was called") +@lroStatus +enum ProvisioningState { + ...ResourceProvisioningState, + + @doc("The resource is being provisioned") + Provisioning, + + @doc("The resource is updating") + Updating, + + @doc("The resource is being deleted") + Deleting, + + @doc("The resource create request has been accepted") + Accepted, +} + +@doc("Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.") +enum ResourceProvisioning { + @doc("The resource lifecycle will be managed by Radius") + recipe, + + @doc("The resource lifecycle will be managed by the user") + manual, +} + +@doc("The recipe used to automatically deploy underlying infrastructure for a link") +model Recipe { + @doc("The name of the recipe within the environment to use") + name: string; + + @doc("Key/value parameters to pass into the recipe at deployment") + parameters?: {}; +} diff --git a/typespec/radius/v1/ucprootscope.tsp b/typespec/radius/v1/ucprootscope.tsp new file mode 100644 index 0000000000..fbdf0076b5 --- /dev/null +++ b/typespec/radius/v1/ucprootscope.tsp @@ -0,0 +1,43 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +using OpenAPI; +using TypeSpec.Http; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; + +@doc("The default rootScope parameter type.") +model RootScopeParameter { + @path + @minLength(1) + @maxLength(90) + @pattern("^[-\\w\\._\\(\\)]+$") + @extension("x-ms-skip-url-encoding", true) + @extension("x-ms-parameter-location", "client") + @doc("The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}") + rootScope: string; +} + +@doc("The UCP HTTP request base parameters.") +model UCPBaseParameters { + ...ApiVersionParameter; + ...RootScopeParameter; +} From d77e519f94f8d004672c149b9ed989f1e292553e Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Wed, 23 Aug 2023 12:43:40 -0700 Subject: [PATCH 05/57] Terraform Delete Logic Implementation (#6091) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This PR adds the following: 1. BaseOptions, ExecuteOptions, and DeleteOptions for the Driver operations. 2. Implementation of Terraform Delete logic. 3. Adding and updating unit tests. 4. Updating one of the Terraform functional tests to do the deletion. 5. Adding Secret Deletion verification to one of the functional tests. ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 2dd0d17 ### Summary 🗑️🧪🚧 Added `Delete` method to `terraformExecutor` interface and its implementations in `terraformDriver` and `MockTerraformExecutor`. This enables the deletion of resources provisioned by the Terraform driver in the Radius project. > _Oh, we are the drivers of Terraform_ > _We create and delete with skill and charm_ > _When the recipe is done, we don't leave a trace_ > _We call the `Delete` method and destroy the place_ ### Walkthrough * Implement the `Delete` method for the `terraformDriver` struct to delete the resources created by the Terraform recipe using the `terraformExecutor` interface ([link](https://github.com/project-radius/radius/pull/6091/files?diff=unified&w=0#diff-1b98bc9b02b96687752860c11c68d87d99ad99f24ecdfc5497fda6823abc0612L115-R148)) * Extend the `terraformExecutor` interface to define the `Delete` method that takes the `Options` struct and deletes the Terraform resources ([link](https://github.com/project-radius/radius/pull/6091/files?diff=unified&w=0#diff-0ad85ed086350c77c3e366408120b4c3020d1cec542671ab3586fd0c34dafe6fR34-R36)) * Provide the implementation of the `Delete` method for the `executor` struct that installs Terraform, creates a working directory, generates a config, and runs Terraform destroy using the `destroy` helper function ([link](https://github.com/project-radius/radius/pull/6091/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482R99-R133), [link](https://github.com/project-radius/radius/pull/6091/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482R252-R269)) * Provide a mock implementation of the `Delete` method for the `MockTerraformExecutor` struct that simulates the deletion of the Terraform resources for testing purposes ([link](https://github.com/project-radius/radius/pull/6091/files?diff=unified&w=0#diff-0b4cf4663fdbba1f4b6a80956c645dca9c402e48fc2e7965c35faa12c36680a2R38-R51)) --- pkg/recipes/driver/bicep.go | 26 +-- pkg/recipes/driver/bicep_test.go | 8 +- pkg/recipes/driver/mock_driver.go | 11 +- pkg/recipes/driver/terraform.go | 95 +++++++--- pkg/recipes/driver/terraform_test.go | 127 ++++++++++++- pkg/recipes/driver/types.go | 29 ++- pkg/recipes/engine/engine.go | 26 ++- pkg/recipes/engine/engine_test.go | 174 +++++++++++++++--- pkg/recipes/terraform/execute.go | 71 +++++++ pkg/recipes/terraform/install.go | 14 +- pkg/recipes/terraform/mock_executor.go | 14 ++ pkg/recipes/terraform/types.go | 4 + .../shared/resources/recipe_terraform_test.go | 59 +++++- 13 files changed, 558 insertions(+), 100 deletions(-) diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index b41262035f..f7c4807175 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -53,7 +53,11 @@ var _ Driver = (*bicepDriver)(nil) // NewBicepDriver creates a new bicep driver instance with the given ARM client options, deployment client and resource client. func NewBicepDriver(armOptions *arm.ClientOptions, deploymentClient *clients.ResourceDeploymentsClient, client processors.ResourceClient) Driver { - return &bicepDriver{ArmClientOptions: armOptions, DeploymentClient: deploymentClient, ResourceClient: client} + return &bicepDriver{ + ArmClientOptions: armOptions, + DeploymentClient: deploymentClient, + ResourceClient: client, + } } type bicepDriver struct { @@ -65,23 +69,23 @@ type bicepDriver struct { // Execute fetches recipe contents from container registry, creates a deployment ID, a recipe context parameter, recipe parameters, // a provider config, and deploys a bicep template for the recipe using UCP deployment client, then polls until the deployment // is done and prepares the recipe response. -func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configuration, recipe recipes.ResourceMetadata, definition recipes.EnvironmentDefinition) (*recipes.RecipeOutput, error) { +func (d *bicepDriver) Execute(ctx context.Context, opts ExecuteOptions) (*recipes.RecipeOutput, error) { logger := logr.FromContextOrDiscard(ctx) - logger.Info(fmt.Sprintf("Deploying recipe: %q, template: %q", definition.Name, definition.TemplatePath)) + logger.Info(fmt.Sprintf("Deploying recipe: %q, template: %q", opts.Definition.Name, opts.Definition.TemplatePath)) recipeData := make(map[string]any) downloadStartTime := time.Now() - err := util.ReadFromRegistry(ctx, definition.TemplatePath, &recipeData) + err := util.ReadFromRegistry(ctx, opts.Definition.TemplatePath, &recipeData) if err != nil { metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, - metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, recipe.Name, &definition, metrics.FailedOperationState)) + metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, opts.Recipe.Name, &opts.Definition, metrics.FailedOperationState)) return nil, recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, - metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, recipe.Name, &definition, metrics.SuccessfulOperationState)) + metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, opts.Recipe.Name, &opts.Definition, metrics.SuccessfulOperationState)) // create the context object to be passed to the recipe deployment - recipeContext, err := recipecontext.New(&recipe, &configuration) + recipeContext, err := recipecontext.New(&opts.Recipe, &opts.Configuration) if err != nil { return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } @@ -89,7 +93,7 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu // get the parameters after resolving the conflict between developer and operator parameters // if the recipe template also has the context parameter defined then add it to the parameter for deployment isContextParameterDefined := hasContextParameter(recipeData) - parameters := createRecipeParameters(recipe.Parameters, definition.Parameters, isContextParameterDefined, recipeContext) + parameters := createRecipeParameters(opts.Recipe.Parameters, opts.Definition.Parameters, isContextParameterDefined, recipeContext) deploymentName := deploymentPrefix + strconv.FormatInt(time.Now().UnixNano(), 10) deploymentID, err := createDeploymentID(recipeContext.Resource.ID, deploymentName) @@ -98,7 +102,7 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu } // Provider config will specify the Azure and AWS scopes (if provided). - providerConfig := newProviderConfig(deploymentID.FindScope(resources_radius.ScopeResourceGroups), configuration.Providers) + providerConfig := newProviderConfig(deploymentID.FindScope(resources_radius.ScopeResourceGroups), opts.Configuration.Providers) logger.Info("deploying bicep template for recipe", "deploymentID", deploymentID) if providerConfig.AWS != nil { @@ -140,10 +144,10 @@ func (d *bicepDriver) Execute(ctx context.Context, configuration recipes.Configu // Delete deletes output resources in reverse dependency order, logging each resource deleted and skipping any // resources that are not managed by Radius. It returns an error if any of the resources fail to delete. -func (d *bicepDriver) Delete(ctx context.Context, outputResources []rpv1.OutputResource) error { +func (d *bicepDriver) Delete(ctx context.Context, opts DeleteOptions) error { logger := ucplog.FromContextOrDiscard(ctx) - orderedOutputResources, err := rpv1.OrderOutputResources(outputResources) + orderedOutputResources, err := rpv1.OrderOutputResources(opts.OutputResources) if err != nil { return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index f04c87dcb9..77d13373d5 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -391,7 +391,9 @@ func Test_Bicep_Delete_Success(t *testing.T) { } client.EXPECT().Delete(ctx, "/planes/kubernetes/local/namespaces/recipe-app/providers/apps/Deployment/redis").Times(1).Return(nil) - err := driver.Delete(ctx, outputResources) + err := driver.Delete(ctx, DeleteOptions{ + OutputResources: outputResources, + }) require.NoError(t, err) } @@ -420,7 +422,9 @@ func Test_Bicep_Delete_Error(t *testing.T) { Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].GetResourceType().Type)). Times(1) - err := driver.Delete(ctx, outputResources) + err := driver.Delete(ctx, DeleteOptions{ + OutputResources: outputResources, + }) require.Error(t, err) require.Equal(t, err, &recipeError) } diff --git a/pkg/recipes/driver/mock_driver.go b/pkg/recipes/driver/mock_driver.go index 459b97e431..6b0131dc1d 100644 --- a/pkg/recipes/driver/mock_driver.go +++ b/pkg/recipes/driver/mock_driver.go @@ -10,7 +10,6 @@ import ( gomock "github.com/golang/mock/gomock" recipes "github.com/project-radius/radius/pkg/recipes" - v1 "github.com/project-radius/radius/pkg/rp/v1" ) // MockDriver is a mock of Driver interface. @@ -37,7 +36,7 @@ func (m *MockDriver) EXPECT() *MockDriverMockRecorder { } // Delete mocks base method. -func (m *MockDriver) Delete(arg0 context.Context, arg1 []v1.OutputResource) error { +func (m *MockDriver) Delete(arg0 context.Context, arg1 DeleteOptions) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delete", arg0, arg1) ret0, _ := ret[0].(error) @@ -51,16 +50,16 @@ func (mr *MockDriverMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { } // Execute mocks base method. -func (m *MockDriver) Execute(arg0 context.Context, arg1 recipes.Configuration, arg2 recipes.ResourceMetadata, arg3 recipes.EnvironmentDefinition) (*recipes.RecipeOutput, error) { +func (m *MockDriver) Execute(arg0 context.Context, arg1 ExecuteOptions) (*recipes.RecipeOutput, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "Execute", arg0, arg1) ret0, _ := ret[0].(*recipes.RecipeOutput) ret1, _ := ret[1].(error) return ret0, ret1 } // Execute indicates an expected call of Execute. -func (mr *MockDriverMockRecorder) Execute(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { +func (mr *MockDriverMockRecorder) Execute(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriver)(nil).Execute), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriver)(nil).Execute), arg0, arg1) } diff --git a/pkg/recipes/driver/terraform.go b/pkg/recipes/driver/terraform.go index 9eb5b911ca..95b99943ea 100644 --- a/pkg/recipes/driver/terraform.go +++ b/pkg/recipes/driver/terraform.go @@ -28,7 +28,6 @@ import ( "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/terraform" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/sdk" ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" "github.com/project-radius/radius/pkg/ucp/ucplog" @@ -42,7 +41,10 @@ var _ Driver = (*terraformDriver)(nil) // NewTerraformDriver creates a new instance of driver to execute a Terraform recipe. func NewTerraformDriver(ucpConn sdk.Connection, secretProvider *ucp_provider.SecretProvider, options TerraformOptions, k8sClientSet kubernetes.Interface) Driver { - return &terraformDriver{terraformExecutor: terraform.NewExecutor(ucpConn, secretProvider, k8sClientSet), options: options} + return &terraformDriver{ + terraformExecutor: terraform.NewExecutor(ucpConn, secretProvider, k8sClientSet), + options: options, + } } // Options represents the options required for execution of Terraform driver. @@ -62,30 +64,12 @@ type terraformDriver struct { // Execute creates a unique directory for each execution of terraform and deploys the recipe using the // the Terraform CLI through terraform-exec. It returns a RecipeOutput or an error if the deployment fails. -func (d *terraformDriver) Execute(ctx context.Context, configuration recipes.Configuration, recipe recipes.ResourceMetadata, definition recipes.EnvironmentDefinition) (*recipes.RecipeOutput, error) { +func (d *terraformDriver) Execute(ctx context.Context, opts ExecuteOptions) (*recipes.RecipeOutput, error) { logger := ucplog.FromContextOrDiscard(ctx) - if d.options.Path == "" { - return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, "path is a required option for Terraform driver", nil) - } - - // We need a unique directory per execution of terraform. We generate this using the unique operation id of the async request so that names are always unique, - // but we can also trace them to the resource we were working on through operationID. - dirID := "" - armCtx := v1.ARMRequestContextFromContext(ctx) - if armCtx.OperationID != uuid.Nil { - dirID = armCtx.OperationID.String() - } else { - // If the operationID is nil, we generate a new UUID for unique directory name combined with resource id so that we can trace it to the resource. - // Ideally operationID should not be nil. - logger.Info("Empty operation ID provided in the request context, using uuid to generate a unique directory name") - dirID = util.NormalizeStringToLower(recipe.ResourceID) + "/" + uuid.NewString() - } - requestDirPath := filepath.Join(d.options.Path, dirID) - - logger.Info(fmt.Sprintf("Deploying terraform recipe: %q, template: %q, execution directory: %q", recipe.Name, definition.TemplatePath, requestDirPath)) - if err := os.MkdirAll(requestDirPath, 0755); err != nil { - return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, fmt.Sprintf("failed to create directory %q to execute terraform: %s", requestDirPath, err.Error()), recipes.GetRecipeErrorDetails(err)) + requestDirPath, err := d.createExecutionDirectory(ctx, opts.Recipe, opts.Definition) + if err != nil { + return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } defer func() { if err := os.RemoveAll(requestDirPath); err != nil { @@ -95,9 +79,9 @@ func (d *terraformDriver) Execute(ctx context.Context, configuration recipes.Con tfState, err := d.terraformExecutor.Deploy(ctx, terraform.Options{ RootDir: requestDirPath, - EnvConfig: &configuration, - ResourceRecipe: &recipe, - EnvRecipe: &definition, + EnvConfig: &opts.Configuration, + ResourceRecipe: &opts.Recipe, + EnvRecipe: &opts.Definition, }) if err != nil { return nil, recipes.NewRecipeError(recipes.RecipeDeploymentFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) @@ -112,9 +96,30 @@ func (d *terraformDriver) Execute(ctx context.Context, configuration recipes.Con } // Delete returns an error if called as it is not yet implemented. -func (d *terraformDriver) Delete(ctx context.Context, outputResources []rpv1.OutputResource) error { - // TODO: to be implemented in follow up PR - return errors.New("terraform delete support is not implemented yet") +func (d *terraformDriver) Delete(ctx context.Context, opts DeleteOptions) error { + logger := ucplog.FromContextOrDiscard(ctx) + + requestDirPath, err := d.createExecutionDirectory(ctx, opts.Recipe, opts.Definition) + if err != nil { + return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) + } + defer func() { + if err := os.RemoveAll(requestDirPath); err != nil { + logger.Info(fmt.Sprintf("Failed to cleanup Terraform execution directory %q. Err: %s", requestDirPath, err.Error())) + } + }() + + err = d.terraformExecutor.Delete(ctx, terraform.Options{ + RootDir: requestDirPath, + EnvConfig: &opts.Configuration, + ResourceRecipe: &opts.Recipe, + EnvRecipe: &opts.Definition, + }) + if err != nil { + return recipes.NewRecipeError(recipes.RecipeDeletionFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) + } + + return nil } // prepareRecipeResponse populates the recipe response from the module output named "result" and the @@ -138,3 +143,33 @@ func (d *terraformDriver) prepareRecipeResponse(tfState *tfjson.State) (*recipes return recipeResponse, nil } + +// createExecutionDirectory creates a unique directory for each execution of terraform. +func (d *terraformDriver) createExecutionDirectory(ctx context.Context, recipe recipes.ResourceMetadata, definition recipes.EnvironmentDefinition) (string, error) { + logger := ucplog.FromContextOrDiscard(ctx) + + if d.options.Path == "" { + return "", fmt.Errorf("path is a required option for Terraform driver") + } + + // We need a unique directory per execution of terraform. We generate this using the unique operation id of the async request so that names are always unique, + // but we can also trace them to the resource we were working on through operationID. + dirID := "" + armCtx := v1.ARMRequestContextFromContext(ctx) + if armCtx.OperationID != uuid.Nil { + dirID = armCtx.OperationID.String() + } else { + // If the operationID is nil, we generate a new UUID for unique directory name combined with resource id so that we can trace it to the resource. + // Ideally operationID should not be nil. + logger.Info("Empty operation ID provided in the request context, using uuid to generate a unique directory name") + dirID = util.NormalizeStringToLower(recipe.ResourceID) + "/" + uuid.NewString() + } + requestDirPath := filepath.Join(d.options.Path, dirID) + + logger.Info(fmt.Sprintf("Deploying terraform recipe: %q, template: %q, execution directory: %q", recipe.Name, definition.TemplatePath, requestDirPath)) + if err := os.MkdirAll(requestDirPath, 0755); err != nil { + return "", fmt.Errorf("failed to create directory %q to execute terraform: %s", requestDirPath, err.Error()) + } + + return requestDirPath, nil +} diff --git a/pkg/recipes/driver/terraform_test.go b/pkg/recipes/driver/terraform_test.go index b2797d6bdd..41ddbb1d9f 100644 --- a/pkg/recipes/driver/terraform_test.go +++ b/pkg/recipes/driver/terraform_test.go @@ -29,9 +29,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/recipes" + rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/recipes/terraform" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/test/testcontext" "github.com/stretchr/testify/require" ) @@ -115,7 +115,13 @@ func Test_Terraform_Execute_Success(t *testing.T) { tfExecutor.EXPECT().Deploy(ctx, options).Times(1).Return(expectedTFState, nil) - recipeOutput, err := driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) + recipeOutput, err := driver.Execute(ctx, ExecuteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + }) require.NoError(t, err) require.Equal(t, expectedOutput, recipeOutput) // Verify directory cleanup @@ -147,7 +153,13 @@ func Test_Terraform_Execute_DeploymentFailure(t *testing.T) { } tfExecutor.EXPECT().Deploy(ctx, options).Times(1).Return(nil, errors.New("Failed to deploy terraform module")) - _, err := driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) + _, err := driver.Execute(ctx, ExecuteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + }) require.Error(t, err) require.Equal(t, err, &recipeError) // Verify directory cleanup @@ -195,7 +207,13 @@ func Test_Terraform_Execute_OutputsFailure(t *testing.T) { } tfExecutor.EXPECT().Deploy(ctx, options).Times(1).Return(expectedTFState, nil) - _, err := driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) + _, err := driver.Execute(ctx, ExecuteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + }) require.Error(t, err) require.Equal(t, err, &recipeError) // Verify directory cleanup @@ -213,7 +231,13 @@ func Test_Terraform_Execute_EmptyPath(t *testing.T) { Message: "path is a required option for Terraform driver", }, } - _, err := driver.Execute(testcontext.New(t), envConfig, recipeMetadata, envRecipe) + _, err := driver.Execute(testcontext.New(t), ExecuteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + }) require.Error(t, err) require.Equal(t, err, &expErr) @@ -249,9 +273,18 @@ func Test_Terraform_Execute_EmptyOperationID_Success(t *testing.T) { }, } - tfExecutor.EXPECT().Deploy(ctx, gomock.Any()).Times(1).Return(expectedTFState, nil) + tfExecutor.EXPECT(). + Deploy(ctx, gomock.Any()). + Times(1). + Return(expectedTFState, nil) - recipeOutput, err := driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) + recipeOutput, err := driver.Execute(ctx, ExecuteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + }) require.NoError(t, err) require.Equal(t, expectedOutput, recipeOutput) } @@ -264,18 +297,92 @@ func Test_Terraform_Execute_MissingARMRequestContext_Panics(t *testing.T) { envConfig, recipeMetadata, envRecipe := buildTestInputs() require.Panics(t, func() { - _, _ = driver.Execute(ctx, envConfig, recipeMetadata, envRecipe) + _, _ = driver.Execute(ctx, ExecuteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + }) }) } func Test_Terraform_Delete_Success(t *testing.T) { ctx := testcontext.New(t) + ctx = v1.WithARMRequestContext(ctx, &v1.ARMRequestContext{}) + tfExecutor, driver := setup(t) + envConfig, recipeMetadata, envRecipe := buildTestInputs() + + tfExecutor.EXPECT(). + Delete(ctx, gomock.Any()). + Times(1). + Return(nil) + + err := driver.Delete(ctx, DeleteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + OutputResources: []rpv1.OutputResource{}, + }) + require.NoError(t, err) +} + +func Test_Terraform_Delete_EmptyPath(t *testing.T) { _, driver := setup(t) + driver.options.Path = "" + envConfig, recipeMetadata, envRecipe := buildTestInputs() - err := driver.Delete(ctx, []rpv1.OutputResource{}) + expErr := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeDeletionFailed, + Message: "path is a required option for Terraform driver", + }, + } + + err := driver.Delete(testcontext.New(t), DeleteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + OutputResources: []rpv1.OutputResource{}, + }) + require.Error(t, err) + require.Equal(t, err, &expErr) +} + +func Test_Terraform_Delete_Failure(t *testing.T) { + ctx := testcontext.New(t) + ctx = v1.WithARMRequestContext(ctx, &v1.ARMRequestContext{}) + + tfExecutor, driver := setup(t) + envConfig, recipeMetadata, envRecipe := buildTestInputs() + + tfExecutor.EXPECT(). + Delete(ctx, gomock.Any()). + Times(1). + Return(errors.New("Failed to delete terraform module")) + + expErr := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeDeletionFailed, + Message: "Failed to delete terraform module", + }, + } + + err := driver.Delete(ctx, DeleteOptions{ + BaseOptions: BaseOptions{ + Configuration: envConfig, + Recipe: recipeMetadata, + Definition: envRecipe, + }, + OutputResources: []rpv1.OutputResource{}, + }) require.Error(t, err) - require.Equal(t, "terraform delete support is not implemented yet", err.Error()) + require.Equal(t, &expErr, err) } func Test_Terraform_PrepareRecipeResponse(t *testing.T) { diff --git a/pkg/recipes/driver/types.go b/pkg/recipes/driver/types.go index 51b48a3b26..e646c363bc 100644 --- a/pkg/recipes/driver/types.go +++ b/pkg/recipes/driver/types.go @@ -26,8 +26,33 @@ import ( // Driver is an interface to implement recipe deployment and recipe resources deletion. type Driver interface { // Execute fetches the recipe contents and deploys the recipe and returns deployed resources, secrets and values. - Execute(ctx context.Context, configuration recipes.Configuration, recipe recipes.ResourceMetadata, definition recipes.EnvironmentDefinition) (*recipes.RecipeOutput, error) + Execute(ctx context.Context, opts ExecuteOptions) (*recipes.RecipeOutput, error) // Delete handles deletion of output resources for the recipe deployment. - Delete(ctx context.Context, outputResources []rpv1.OutputResource) error + Delete(ctx context.Context, opts DeleteOptions) error +} + +// BaseOptions is the base options for the driver operations. +type BaseOptions struct { + // Configuration is the configuration for the recipe. + Configuration recipes.Configuration + + // Recipe is the recipe metadata. + Recipe recipes.ResourceMetadata + + // Definition is the environment definition for the recipe. + Definition recipes.EnvironmentDefinition +} + +// ExecuteOptions is the options for the Execute method. +type ExecuteOptions struct { + BaseOptions +} + +// DeleteOptions is the options for the Delete method. +type DeleteOptions struct { + BaseOptions + + // OutputResources is the list of output resources for the recipe. + OutputResources []rpv1.OutputResource } diff --git a/pkg/recipes/engine/engine.go b/pkg/recipes/engine/engine.go index 6ac8f9ec49..b0e36f7bbc 100644 --- a/pkg/recipes/engine/engine.go +++ b/pkg/recipes/engine/engine.go @@ -24,7 +24,7 @@ import ( "github.com/project-radius/radius/pkg/metrics" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" - "github.com/project-radius/radius/pkg/recipes/driver" + recipedriver "github.com/project-radius/radius/pkg/recipes/driver" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -38,7 +38,7 @@ var _ Engine = (*engine)(nil) // Options represents the configuration loader and type of driver used to deploy recipe. type Options struct { ConfigurationLoader configloader.ConfigurationLoader - Drivers map[string]driver.Driver + Drivers map[string]recipedriver.Driver } type engine struct { @@ -83,7 +83,13 @@ func (e *engine) executeCore(ctx context.Context, recipe recipes.ResourceMetadat return nil, definition, err } - res, err := driver.Execute(ctx, *configuration, recipe, *definition) + res, err := driver.Execute(ctx, recipedriver.ExecuteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *configuration, + Recipe: recipe, + Definition: *definition, + }, + }) if err != nil { return nil, definition, err } @@ -123,7 +129,19 @@ func (e *engine) deleteCore(ctx context.Context, recipe recipes.ResourceMetadata return definition, fmt.Errorf("could not find driver %s", definition.Driver) } - err = driver.Delete(ctx, outputResources) + configuration, err := e.options.ConfigurationLoader.LoadConfiguration(ctx, recipe) + if err != nil { + return definition, err + } + + err = driver.Delete(ctx, recipedriver.DeleteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *configuration, + Recipe: recipe, + Definition: *definition, + }, + OutputResources: outputResources, + }) if err != nil { return definition, err } diff --git a/pkg/recipes/engine/engine_test.go b/pkg/recipes/engine/engine_test.go index ff896f4edf..262767282d 100644 --- a/pkg/recipes/engine/engine_test.go +++ b/pkg/recipes/engine/engine_test.go @@ -25,20 +25,20 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" - "github.com/project-radius/radius/pkg/recipes/driver" + recipedriver "github.com/project-radius/radius/pkg/recipes/driver" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/test/testcontext" "github.com/stretchr/testify/require" ) -func setup(t *testing.T) (engine, configloader.MockConfigurationLoader, driver.MockDriver) { +func setup(t *testing.T) (engine, configloader.MockConfigurationLoader, recipedriver.MockDriver) { ctrl := gomock.NewController(t) configLoader := configloader.NewMockConfigurationLoader(ctrl) - mDriver := driver.NewMockDriver(ctrl) + mDriver := recipedriver.NewMockDriver(ctrl) options := Options{ ConfigurationLoader: configLoader, - Drivers: map[string]driver.Driver{ + Drivers: map[string]recipedriver.Driver{ recipes.TemplateKindBicep: mDriver, recipes.TemplateKindTerraform: mDriver, }, @@ -89,9 +89,24 @@ func Test_Engine_Execute_Success(t *testing.T) { ctx := testcontext.New(t) engine, configLoader, driver := setup(t) - configLoader.EXPECT().LoadConfiguration(gomock.Any(), gomock.Any()).Times(1).Return(envConfig, nil) - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(recipeDefinition, nil) - driver.EXPECT().Execute(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(recipeResult, nil) + configLoader.EXPECT(). + LoadConfiguration(ctx, recipeMetadata). + Times(1). + Return(envConfig, nil) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(recipeDefinition, nil) + driver.EXPECT(). + Execute(ctx, recipedriver.ExecuteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *envConfig, + Recipe: recipeMetadata, + Definition: *recipeDefinition, + }, + }). + Times(1). + Return(recipeResult, nil) result, err := engine.Execute(ctx, recipeMetadata) require.NoError(t, err) @@ -128,9 +143,24 @@ func Test_Engine_Execute_Failure(t *testing.T) { ctx := testcontext.New(t) engine, configLoader, driver := setup(t) - configLoader.EXPECT().LoadConfiguration(gomock.Any(), gomock.Any()).Times(1).Return(envConfig, nil) - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(recipeDefinition, nil) - driver.EXPECT().Execute(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(nil, errors.New("failed to execute recipe")) + configLoader.EXPECT(). + LoadConfiguration(ctx, recipeMetadata). + Times(1). + Return(envConfig, nil) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(recipeDefinition, nil) + driver.EXPECT(). + Execute(ctx, recipedriver.ExecuteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *envConfig, + Recipe: recipeMetadata, + Definition: *recipeDefinition, + }, + }). + Times(1). + Return(nil, errors.New("failed to execute recipe")) result, err := engine.Execute(ctx, recipeMetadata) require.Nil(t, result) @@ -179,9 +209,24 @@ func Test_Engine_Terraform_Success(t *testing.T) { ctx := testcontext.New(t) engine, configLoader, driver := setup(t) - configLoader.EXPECT().LoadConfiguration(gomock.Any(), gomock.Any()).Times(1).Return(envConfig, nil) - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(recipeDefinition, nil) - driver.EXPECT().Execute(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(recipeResult, nil) + configLoader.EXPECT(). + LoadConfiguration(ctx, recipeMetadata). + Times(1). + Return(envConfig, nil) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(recipeDefinition, nil) + driver.EXPECT(). + Execute(ctx, recipedriver.ExecuteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *envConfig, + Recipe: recipeMetadata, + Definition: *recipeDefinition, + }, + }). + Times(1). + Return(recipeResult, nil) result, err := engine.Execute(ctx, recipeMetadata) require.NoError(t, err) @@ -208,7 +253,10 @@ func Test_Engine_InvalidDriver(t *testing.T) { }, } - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(recipeDefinition, nil) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(recipeDefinition, nil) _, err := engine.Execute(ctx, recipeMetadata) require.Error(t, err) require.Equal(t, err.Error(), "could not find driver invalid") @@ -226,7 +274,10 @@ func Test_Engine_Lookup_Error(t *testing.T) { "resourceName": "resource1", }, } - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(nil, errors.New("could not find recipe mongo-azure in environment env1")) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(nil, errors.New("could not find recipe mongo-azure in environment env1")) _, err := engine.Execute(ctx, recipeMetadata) require.Error(t, err) } @@ -248,8 +299,14 @@ func Test_Engine_Load_Error(t *testing.T) { TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", ResourceType: "Applications.Link/mongoDatabases", } - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(recipeDefinition, nil) - configLoader.EXPECT().LoadConfiguration(gomock.Any(), gomock.Any()).Times(1).Return(nil, errors.New("unable to fetch namespace information")) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(recipeDefinition, nil) + configLoader.EXPECT(). + LoadConfiguration(ctx, recipeMetadata). + Times(1). + Return(nil, errors.New("unable to fetch namespace information")) _, err := engine.Execute(ctx, recipeMetadata) require.Error(t, err) } @@ -257,11 +314,43 @@ func Test_Engine_Load_Error(t *testing.T) { func Test_Engine_Delete_Success(t *testing.T) { recipeMetadata, recipeDefinition, outputResources := getDeleteInputs() + envConfig := &recipes.Configuration{ + Runtime: recipes.RuntimeConfiguration{ + Kubernetes: &recipes.KubernetesRuntime{ + Namespace: "default", + }, + }, + Providers: datamodel.Providers{ + Azure: datamodel.ProvidersAzure{ + Scope: "scope", + }, + }, + } + ctx := testcontext.New(t) engine, configLoader, driver := setup(t) - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(&recipeDefinition, nil) - driver.EXPECT().Delete(ctx, outputResources).Times(1).Return(nil) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(&recipeDefinition, nil) + + configLoader.EXPECT(). + LoadConfiguration(ctx, recipeMetadata). + Times(1). + Return(envConfig, nil) + + driver.EXPECT(). + Delete(ctx, recipedriver.DeleteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *envConfig, + Recipe: recipeMetadata, + Definition: recipeDefinition, + }, + OutputResources: outputResources, + }). + Times(1). + Return(nil) err := engine.Delete(ctx, recipeMetadata, outputResources) require.NoError(t, err) @@ -270,11 +359,44 @@ func Test_Engine_Delete_Success(t *testing.T) { func Test_Engine_Delete_Error(t *testing.T) { recipeMetadata, recipeDefinition, outputResources := getDeleteInputs() + envConfig := &recipes.Configuration{ + Runtime: recipes.RuntimeConfiguration{ + Kubernetes: &recipes.KubernetesRuntime{ + Namespace: "default", + }, + }, + Providers: datamodel.Providers{ + Azure: datamodel.ProvidersAzure{ + Scope: "scope", + }, + }, + } + ctx := testcontext.New(t) engine, configLoader, driver := setup(t) - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(&recipeDefinition, nil) - driver.EXPECT().Delete(ctx, outputResources).Times(1).Return(fmt.Errorf("could not find API version for type %q, no supported API versions", outputResources[0].ID)) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(&recipeDefinition, nil) + + configLoader.EXPECT(). + LoadConfiguration(ctx, recipeMetadata). + Times(1). + Return(envConfig, nil) + + driver.EXPECT(). + Delete(ctx, recipedriver.DeleteOptions{ + BaseOptions: recipedriver.BaseOptions{ + Configuration: *envConfig, + Recipe: recipeMetadata, + Definition: recipeDefinition, + }, + OutputResources: outputResources, + }). + Times(1). + Return(fmt.Errorf("could not find API version for type %q, no supported API versions", + outputResources[0].ID)) err := engine.Delete(ctx, recipeMetadata, outputResources) require.Error(t, err) @@ -287,7 +409,10 @@ func Test_Delete_InvalidDriver(t *testing.T) { ctx := testcontext.New(t) engine, configLoader, _ := setup(t) - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(&recipeDefinition, nil) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(&recipeDefinition, nil) err := engine.Delete(ctx, recipeMetadata, outputResources) require.Error(t, err) require.Equal(t, err.Error(), "could not find driver invalid") @@ -298,7 +423,10 @@ func Test_Delete_Lookup_Error(t *testing.T) { engine, configLoader, _ := setup(t) recipeMetadata, _, outputResources := getDeleteInputs() - configLoader.EXPECT().LoadRecipe(gomock.Any(), gomock.Any()).Times(1).Return(nil, errors.New("could not find recipe mongo-azure in environment env1")) + configLoader.EXPECT(). + LoadRecipe(ctx, &recipeMetadata). + Times(1). + Return(nil, errors.New("could not find recipe mongo-azure in environment env1")) err := engine.Delete(ctx, recipeMetadata, outputResources) require.Error(t, err) } diff --git a/pkg/recipes/terraform/execute.go b/pkg/recipes/terraform/execute.go index e824ec880c..d070bf1c5f 100644 --- a/pkg/recipes/terraform/execute.go +++ b/pkg/recipes/terraform/execute.go @@ -109,6 +109,7 @@ func (e *executor) Deploy(ctx context.Context, options Options) (*tfjson.State, if err != nil { return nil, err } + // verifying if kubernetes secret is created as part of terraform init // this is valid only for the backend of type kubernetes err = verifyKubernetesSecret(ctx, options, e.k8sClientSet, secretSuffix) @@ -122,6 +123,49 @@ func (e *executor) Deploy(ctx context.Context, options Options) (*tfjson.State, return state, nil } +// Delete installs Terraform, creates a working directory, generates a config, and runs Terraform destroy +// in the working directory, returning an error if any of these steps fail. +func (e *executor) Delete(ctx context.Context, options Options) error { + logger := ucplog.FromContextOrDiscard(ctx) + + // Install Terraform + i := install.NewInstaller() + execPath, err := Install(ctx, i, options.RootDir) + // The terraform zip for installation is downloaded in a location outside of the install directory and is only accessible through the installer.Remove function - + // stored in latestVersion.pathsToRemove. So this needs to be called for complete cleanup even if the root terraform directory is deleted. + defer func() { + if err := i.Remove(ctx); err != nil { + logger.Info(fmt.Sprintf("Failed to cleanup Terraform installation: %s", err.Error())) + } + }() + if err != nil { + return err + } + + // Create Working Directory + workingDir, err := createWorkingDir(ctx, options.RootDir) + if err != nil { + return err + } + + // Create Terraform config in the working directory + secretSuffix, err := e.generateConfig(ctx, workingDir, execPath, options) + if err != nil { + return err + } + + // Run TF Destroy in the working directory + err = initAndDestroy(ctx, workingDir, execPath) + if err != nil { + return err + } + + // Delete the kubernetes secret created as part of `terraform apply` in the execute flow. + return e.k8sClientSet.CoreV1(). + Secrets(backends.RadiusNamespace). + Delete(ctx, terraformStateKubernetesPrefix+secretSuffix, metav1.DeleteOptions{}) +} + func createWorkingDir(ctx context.Context, tfDir string) (string, error) { logger := ucplog.FromContextOrDiscard(ctx) @@ -272,3 +316,30 @@ func verifyKubernetesSecret(ctx context.Context, options Options, k8s kubernetes return nil } + +// initAndDestroy runs Terraform init and destroy in the provided working directory. +func initAndDestroy(ctx context.Context, workingDir, execPath string) error { + logger := ucplog.FromContextOrDiscard(ctx) + + tf, err := NewTerraform(ctx, workingDir, execPath) + if err != nil { + return err + } + + // Initialize Terraform + logger.Info("Initializing Terraform") + + terraformInitStartTime := time.Now() + if err := tf.Init(ctx); err != nil { + return fmt.Errorf("terraform init failure: %w", err) + } + metrics.DefaultRecipeEngineMetrics.RecordTerraformInitializationDuration(ctx, terraformInitStartTime, nil) + + // Destroy Terraform configuration + logger.Info("Running Terraform destroy") + if err := tf.Destroy(ctx); err != nil { + return fmt.Errorf("terraform destroy failure: %w", err) + } + + return nil +} diff --git a/pkg/recipes/terraform/install.go b/pkg/recipes/terraform/install.go index 31fe1a68b4..ffae120958 100644 --- a/pkg/recipes/terraform/install.go +++ b/pkg/recipes/terraform/install.go @@ -51,7 +51,6 @@ func Install(ctx context.Context, installer *install.Installer, tfDir string) (s logger.Info(fmt.Sprintf("Installing Terraform in the directory: %q", installDir)) installStartTime := time.Now() - result := metrics.SuccessfulOperationState // Re-visit this: consider checking if an existing installation of same version of Terraform is available. // For initial iteration we will always install Terraform for every execution of the recipe driver. execPath, err := installer.Ensure(ctx, []src.Source{ @@ -61,18 +60,23 @@ func Install(ctx context.Context, installer *install.Installer, tfDir string) (s }, }) if err != nil { - result = metrics.FailedOperationState + metrics.DefaultRecipeEngineMetrics.RecordTerraformInstallationDuration(ctx, installStartTime, + []attribute.KeyValue{ + metrics.TerraformVersionAttrKey.String("latest"), + metrics.OperationStateAttrKey.String(metrics.FailedOperationState), + }, + ) + return "", err } - // TODO: Update the metric to record the TF version when we start using a versioned TF installation. metrics.DefaultRecipeEngineMetrics.RecordTerraformInstallationDuration(ctx, installStartTime, []attribute.KeyValue{ metrics.TerraformVersionAttrKey.String("latest"), - metrics.OperationStateAttrKey.String(result), + metrics.OperationStateAttrKey.String(metrics.SuccessfulOperationState), }, ) logger.Info(fmt.Sprintf("Terraform latest version installed to: %q", execPath)) - return execPath, err + return execPath, nil } diff --git a/pkg/recipes/terraform/mock_executor.go b/pkg/recipes/terraform/mock_executor.go index 9d6527a40e..c5fc7c3dcd 100644 --- a/pkg/recipes/terraform/mock_executor.go +++ b/pkg/recipes/terraform/mock_executor.go @@ -35,6 +35,20 @@ func (m *MockTerraformExecutor) EXPECT() *MockTerraformExecutorMockRecorder { return m.recorder } +// Delete mocks base method. +func (m *MockTerraformExecutor) Delete(arg0 context.Context, arg1 Options) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delete", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// Delete indicates an expected call of Delete. +func (mr *MockTerraformExecutorMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockTerraformExecutor)(nil).Delete), arg0, arg1) +} + // Deploy mocks base method. func (m *MockTerraformExecutor) Deploy(arg0 context.Context, arg1 Options) (*terraform_json.State, error) { m.ctrl.T.Helper() diff --git a/pkg/recipes/terraform/types.go b/pkg/recipes/terraform/types.go index 641a27a3f1..9d4b2b362b 100644 --- a/pkg/recipes/terraform/types.go +++ b/pkg/recipes/terraform/types.go @@ -31,6 +31,10 @@ import ( type TerraformExecutor interface { // Deploy installs terraform and runs terraform init and apply on the terraform module referenced by the recipe using terraform-exec. Deploy(ctx context.Context, options Options) (*tfjson.State, error) + + // Delete installs terraform and runs terraform destroy on the terraform module referenced by the recipe using terraform-exec, + // and deletes the Kubernetes secret created for terraform state store. + Delete(ctx context.Context, options Options) error } // Options represents the options required to build inputs to interact with Terraform. diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 41d0f81ec4..7fc02a0239 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -26,11 +26,15 @@ package resource_test import ( "context" + "crypto/sha1" "encoding/base64" + "fmt" "strings" "testing" "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/project-radius/radius/pkg/ucp/resources" @@ -49,6 +53,7 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { template := "testdata/corerp-resources-terraform-redis.bicep" name := "corerp-resources-terraform-redis" appName := "corerp-resources-terraform-redis-app" + envName := "corerp-resources-terraform-redis-env" redisCacheName := "tf-redis-cache" test := shared.NewRPTest(t, name, []shared.TestStep{ @@ -57,7 +62,7 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { RPResources: &validation.RPResourceSet{ Resources: []validation.RPResource{ { - Name: "corerp-resources-terraform-redis-env", + Name: envName, Type: validation.EnvironmentsResource, }, { @@ -65,7 +70,7 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { Type: validation.ApplicationsResource, }, { - Name: "corerp-resources-terraform-redis", + Name: name, Type: validation.ExtendersResource, App: appName, OutputResources: []validation.OutputResourceResponse{}, // No output resources because Terraform Recipe outputs aren't integreted yet. @@ -79,7 +84,10 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { }, }, }, - SkipResourceDeletion: true, // Skip deletion because Terraform Recipe deletion isn't supported yet. + PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { + resourceID := "/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/" + name + testSecretDeletion(t, ctx, test, appName, envName, resourceID) + }, }, }) test.Test(t) @@ -88,7 +96,6 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { func Test_TerraformRecipe_Context(t *testing.T) { template := "testdata/corerp-resources-terraform-context.bicep" name := "corerp-resources-terraform-context" - appNamespace := "corerp-resources-terraform-context-app" test := shared.NewRPTest(t, name, []shared.TestStep{ @@ -162,6 +169,7 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { template := "testdata/corerp-resources-terraform-azurestorage.bicep" name := "corerp-resources-terraform-azstorage" appName := "corerp-resources-terraform-azstorage-app" + envName := "corerp-resources-terraform-azstorage-env" test := shared.NewRPTest(t, name, []shared.TestStep{ { @@ -169,7 +177,7 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { RPResources: &validation.RPResourceSet{ Resources: []validation.RPResource{ { - Name: "corerp-resources-terraform-azstorage-env", + Name: envName, Type: validation.EnvironmentsResource, }, { @@ -177,15 +185,52 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { Type: validation.ApplicationsResource, }, { - Name: "corerp-resources-terraform-azstorage", + Name: name, Type: validation.ExtendersResource, App: appName, }, }, }, SkipObjectValidation: true, - SkipResourceDeletion: true, // Skip deletion because Terraform Recipe deletion isn't supported yet. + PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { + resourceID := "/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/" + name + testSecretDeletion(t, ctx, test, appName, envName, resourceID) + }, }, }) test.Test(t) } + +func testSecretDeletion(t *testing.T, ctx context.Context, test shared.RPTest, appName, envName, resourceID string) { + secretSuffix, err := getSecretSuffix(resourceID, envName, appName) + require.NoError(t, err) + + secret, err := test.Options.K8sClient.CoreV1().Secrets(appName). + Get(ctx, "tfstate-default-"+secretSuffix, metav1.GetOptions{}) + require.Error(t, err) + require.True(t, apierrors.IsNotFound(err)) + require.Equal(t, secret, &corev1.Secret{}) +} + +func getSecretSuffix(resourceID, envName, appName string) (string, error) { + parsedResourceID, err := resources.Parse(resourceID) + if err != nil { + return "", err + } + + prefix := fmt.Sprintf("%s-%s-%s", envName, appName, parsedResourceID.Name()) + maxResourceNameLen := 22 + if len(prefix) >= maxResourceNameLen { + prefix = prefix[:maxResourceNameLen] + } + + hasher := sha1.New() + _, err = hasher.Write([]byte(strings.ToLower(fmt.Sprintf("%s-%s-%s", envName, appName, parsedResourceID.String())))) + if err != nil { + return "", err + } + hash := hasher.Sum(nil) + + // example: env-app-redis.ec291e26078b7ea8a74abfac82530005a0ecbf15 + return fmt.Sprintf("%s.%x", prefix, hash), nil +} From 92e31ead86e4de8f77bffcffdb0d12f49fd42fc5 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:15:20 -0700 Subject: [PATCH 06/57] SplitNamespace: Application.Core/extenders Functional Tests (#6094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Added functional tests for Applications.Core/extenders resource. Prerequisite to this PR : https://github.com/project-radius/radius/pull/6018 and https://github.com/project-radius/radius/pull/6079 have been merged. ## Type of change Creating tests for Applications.Core/extenders. [ADO Task](https://dev.azure.com/azure-octo/Incubations/_workitems/edit/7519) - This pull request adds or changes features of Radius and has an approved issue #3499 Fixes: Part of #3499 ## Auto-generated summary ### 🤖 Generated by Copilot at 6469403 ### Summary 📝🧪🚀 This pull request updates and adds Bicep templates and tests for CoreRP and LinkRP extender resources. It fixes typos and inconsistencies in the resource type names and template filenames. It also adds new scenarios and coverage for the LinkRP resource provider, which supports the `Applications.Link/extenders` resource type. > _We are the extenders, we link the worlds_ > _We use the recipes, we deploy the resources_ > _We face the changes, we fix the typos_ > _We run the tests, we verify the functions_ ### Walkthrough * Renamed and updated `corerp-resources-extenders-aws-s3-recipe.bicep` template to use `Applications.Core/extenders` resource type and fix typo ([link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-80869dcb1f7de53e939cf202cb3178d6e529447a80b3cf58470cd707c44810b9L24-R24), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-80869dcb1f7de53e939cf202cb3178d6e529447a80b3cf58470cd707c44810b9L51-R51)) * Updated other CoreRP templates to use `Applications.Core/extenders` resource type instead of `Applications.Link/extenders` resource type ([link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-e59d1b0e80ab28188f596cf74a80b98dff22c5150c8a3e1ce29154c22ea1b910L17-R17), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-e59d1b0e80ab28188f596cf74a80b98dff22c5150c8a3e1ce29154c22ea1b910L44-R44), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-4f2353dc9b07176b9a23194e44c58fa894afaef0874aa826a119910bc87eb358L14-R14), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-86a1fa3f6521a3f229498f14f3ab6d37af6e055fadf815a646b3eeee693bae36L26-R26), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-86a1fa3f6521a3f229498f14f3ab6d37af6e055fadf815a646b3eeee693bae36L52-R52), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-b623663e1cc8e8a27dbc78821a9451ce52cb2d00e5490ca4dc1dc38106759718L16-R16), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-b7c2981f22fc53dc845fb6ed327a6cc2c794e490335253917fd29f8620e27242L30-R30), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-b7c2981f22fc53dc845fb6ed327a6cc2c794e490335253917fd29f8620e27242L54-R54), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-2b886db7cfb72e7dc319f55f2b2e247dc06f20e990e78c573a4eb0beb0b752e7L32-R32), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-b6b3e9d578940fec96ac2b07d78688c8de161269207df1b8524a09a3efdd7f9dL25-R25), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-b6b3e9d578940fec96ac2b07d78688c8de161269207df1b8524a09a3efdd7f9dL53-R53), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-8228029742c7031e2b27069e4e4f8959bf5240801d2d52fed6c53505f63992e4L21-R21), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-8228029742c7031e2b27069e4e4f8959bf5240801d2d52fed6c53505f63992e4L44-R44), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-390952171b5d230db3a62dff0428453e85bb4a66efb9b5ec724ca092796cb7e2L21-R21), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-390952171b5d230db3a62dff0428453e85bb4a66efb9b5ec724ca092796cb7e2L44-R44)) * Updated `Test_Extender_RecipeAWS` function to use renamed template ([link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-ea6b32716a499d0deffb7fc13fe99ab1fb5b4fa7f67576e4b89757e76d813b5bL110-R110)) * Added `linkrp_extender_test.go` file with tests for LinkRP extender resources and recipes ([link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-557a8ad0af722920784c17eb32fd0507a523803ad9100c1112c705cb4d0d14c5R1-R166)) * Added `Test_LinkRP_Extender_Manual` function to test LinkRP extender resource without recipe ([link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-ee37d954a2b087bcfd86204fabbd03ed1e7827fc381c39d380c71f1e9c4c76deR1-R198)) * Added LinkRP templates to create extender resources with and without recipes, and with different resource types ([link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-c474a48823b7d3084f119048b700b5ccf9a54d3bbb5f52767c6e214339f81ca8R1-R63), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-e67ed655c36e35753a7a7a9fa7b5ee373e07f4c6c08940f5a993f2cf84c7a357R1-R50), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-10eb3ce04060b8d1feac003ecb8b5cefcc94ad1feed4a7e0b292a70d9aaeb6fdR1-R42), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-b13340d2ea5c7c6c3613d63830398beb7cd08bcc1cc42a9014c47948f83830b9R1-R60), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-5f494a098322eda9cf1794af14937b33b93aaf7a2295b858dc53aaf4c69e4be6R1-R25), [link](https://github.com/project-radius/radius/pull/6094/files?diff=unified&w=0#diff-0c0e44bc91b8aa99c6ddf117b5a1ea7292d22eaaf7bf401d028e8ce1bd1953aaR1-R64)) --- deploy/Chart/templates/rp/configmaps.yaml | 2 + .../shared/resources/extender_test.go | 2 +- .../shared/resources/linkrp_extender_test.go | 165 ++++++++++++++++++ .../shared/resources/recipe_bicep_test.go | 8 +- .../shared/resources/recipe_terraform_test.go | 4 +- ...rp-resources-extender-aws-s3-recipe.bicep} | 4 +- .../corerp-resources-extender-recipe.bicep | 4 +- .../testdata/corerp-resources-extender.bicep | 2 +- ...-recipe-bicep-resourcecreation.step0.bicep | 4 +- ...-recipe-bicep-resourcecreation.step1.bicep | 2 +- .../corerp-resources-recipe-bicep.bicep | 4 +- .../corerp-resources-recipe-notfound.bicep | 2 +- ...erp-resources-terraform-azurestorage.bicep | 4 +- .../corerp-resources-terraform-context.bicep | 4 +- .../corerp-resources-terraform-redis.bicep | 4 +- ...krp-resources-extender-aws-s3-recipe.bicep | 63 +++++++ .../linkrp-resources-extender-recipe.bicep | 50 ++++++ .../testdata/linkrp-resources-extender.bicep | 42 +++++ .../_resource-creation.bicep | 2 +- .../test-bicep-recipes/language-failure.bicep | 2 +- .../resource-creation-failure.bicep | 2 +- .../resource-creation.bicep | 4 +- test/validation/shared.go | 3 +- 23 files changed, 353 insertions(+), 30 deletions(-) create mode 100644 test/functional/shared/resources/linkrp_extender_test.go rename test/functional/shared/resources/testdata/{corerp-resources-extenders-aws-s3-recipe.bicep => corerp-resources-extender-aws-s3-recipe.bicep} (93%) create mode 100644 test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep create mode 100644 test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep create mode 100644 test/functional/shared/resources/testdata/linkrp-resources-extender.bicep diff --git a/deploy/Chart/templates/rp/configmaps.yaml b/deploy/Chart/templates/rp/configmaps.yaml index b6ce94b4b8..7b0719c905 100644 --- a/deploy/Chart/templates/rp/configmaps.yaml +++ b/deploy/Chart/templates/rp/configmaps.yaml @@ -50,6 +50,8 @@ data: zipkin: url: {{ .Values.global.zipkin.url }} {{- end }} + terraform: + path: "/terraform" link-self-host.yaml: |- # Radius configuration file. diff --git a/test/functional/shared/resources/extender_test.go b/test/functional/shared/resources/extender_test.go index dfc1b96803..04e60e075a 100644 --- a/test/functional/shared/resources/extender_test.go +++ b/test/functional/shared/resources/extender_test.go @@ -106,7 +106,7 @@ func Test_Extender_RecipeAWS(t *testing.T) { t.Error("This test needs the env variables AWS_ACCOUNT_ID and AWS_REGION to be set") } - template := "testdata/corerp-resources-extenders-aws-s3-recipe.bicep" + template := "testdata/corerp-resources-extender-aws-s3-recipe.bicep" name := "corerp-resources-extenders-aws-s3-recipe" appName := "corerp-resources-extenders-aws-s3-recipe-app" bucketName := generateS3BucketName() diff --git a/test/functional/shared/resources/linkrp_extender_test.go b/test/functional/shared/resources/linkrp_extender_test.go new file mode 100644 index 0000000000..2077c4188d --- /dev/null +++ b/test/functional/shared/resources/linkrp_extender_test.go @@ -0,0 +1,165 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resource_test + +import ( + "fmt" + "testing" + + "os" + + "github.com/project-radius/radius/test/functional" + "github.com/project-radius/radius/test/functional/shared" + "github.com/project-radius/radius/test/step" + "github.com/project-radius/radius/test/validation" +) + +func Test_LinkRP_Extender_Manual(t *testing.T) { + template := "testdata/linkrp-resources-extender.bicep" + name := "linkrp-resources-extender" + appNamespace := "default-linkrp-resources-extender" + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: "extr-ctnr-old", + Type: validation.ContainersResource, + App: name, + }, + { + Name: "extr-twilio-old", + Type: validation.O_ExtendersResource, + }, + }, + }, + K8sObjects: &validation.K8sObjectSet{ + Namespaces: map[string][]validation.K8sObject{ + appNamespace: { + validation.NewK8sPodForResource(name, "extr-ctnr-old"), + }, + }, + }, + }, + }) + + test.Test(t) +} + +func Test_LinkRP_Extender_Recipe(t *testing.T) { + template := "testdata/linkrp-resources-extender-recipe.bicep" + name := "linkrp-resources-extender-recipe" + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor(template, functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: "linkrp-resources-extender-recipe-env", + Type: validation.EnvironmentsResource, + }, + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: "extender-recipe-old", + Type: validation.O_ExtendersResource, + App: name, + }, + }, + }, + SkipObjectValidation: true, + }, + }) + + test.Test(t) +} + +func Test_LinkRP_Extender_RecipeAWS(t *testing.T) { + awsAccountID := os.Getenv("AWS_ACCOUNT_ID") + awsRegion := os.Getenv("AWS_REGION") + // Error the test if the required environment variables are not set + // for running locally set the environment variables + if awsAccountID == "" || awsRegion == "" { + t.Error("This test needs the env variables AWS_ACCOUNT_ID and AWS_REGION to be set") + } + + template := "testdata/linkrp-resources-extender-aws-s3-recipe.bicep" + name := "linkrp-resources-extenders-aws-s3-recipe" + appName := "linkrp-resources-extenders-aws-s3-recipe-app" + bucketName := generateS3BucketName() + bucketID := fmt.Sprintf("/planes/aws/aws/accounts/%s/regions/%s/providers/AWS.S3/Bucket/%s", awsAccountID, awsRegion, bucketName) + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor( + template, + fmt.Sprintf("bucketName=%s", bucketName), + functional.GetAWSAccountId(), + functional.GetAWSRegion(), + functional.GetBicepRecipeRegistry(), + functional.GetBicepRecipeVersion(), + ), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: "linkrp-resources-extenders-aws-s3-recipe-env", + Type: validation.EnvironmentsResource, + }, + { + Name: "linkrp-resources-extenders-aws-s3-recipe-app", + Type: validation.ApplicationsResource, + }, + { + Name: "linkrp-resources-extenders-aws-s3-recipe", + Type: validation.O_ExtendersResource, + App: appName, + OutputResources: []validation.OutputResourceResponse{ + { + ID: bucketID, + }, + }, + }, + }, + }, + AWSResources: &validation.AWSResourceSet{ + Resources: []validation.AWSResource{ + { + Name: bucketName, + Type: validation.AWSS3BucketResourceType, + Identifier: bucketName, + Properties: map[string]any{ + "BucketName": bucketName, + }, + SkipDeletion: true, // will be deleted by the recipe + }, + }, + }, + SkipObjectValidation: true, + }, + }) + + test.Test(t) +} diff --git a/test/functional/shared/resources/recipe_bicep_test.go b/test/functional/shared/resources/recipe_bicep_test.go index 98daad06b2..ee5cc438fc 100644 --- a/test/functional/shared/resources/recipe_bicep_test.go +++ b/test/functional/shared/resources/recipe_bicep_test.go @@ -85,7 +85,7 @@ func Test_BicepRecipe_ParametersAndOutputs(t *testing.T) { }, K8sObjects: &validation.K8sObjectSet{}, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { - resource, err := test.Options.ManagementClient.ShowResource(ctx, "Applications.Link/extenders", name) + resource, err := test.Options.ManagementClient.ShowResource(ctx, "Applications.Core/extenders", name) require.NoError(t, err) text, err := json.MarshalIndent(resource, "", " ") @@ -192,7 +192,7 @@ func Test_BicepRecipe_ResourceCreation(t *testing.T) { // This currently fails. SkipResourceDeletion: true, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { - resource, err := test.Options.ManagementClient.ShowResource(ctx, "Applications.Link/extenders", name) + resource, err := test.Options.ManagementClient.ShowResource(ctx, "Applications.Core/extenders", name) require.NoError(t, err) text, err := json.MarshalIndent(resource, "", " ") @@ -209,9 +209,9 @@ func Test_BicepRecipe_ResourceCreation(t *testing.T) { "id": "/planes/kubernetes/local/namespaces/" + name + "-app/providers/core/Secret/" + name, }, map[string]any{ - "id": scope + "/providers/Applications.Link/extenders/" + name + "-created", + "id": scope + "/providers/Applications.Core/extenders/" + name + "-created", }, map[string]interface{}{ - "id": scope + "/providers/Applications.Link/extenders/" + name + "-module", + "id": scope + "/providers/Applications.Core/extenders/" + name + "-module", }, } actual := resource.Properties["status"].(map[string]any)["outputResources"].([]any) diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 7fc02a0239..085632c7b8 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -138,7 +138,7 @@ func Test_TerraformRecipe_Context(t *testing.T) { }{ { key: "resource.type", - expected: "Applications.Link/extenders", + expected: "Applications.Core/extenders", }, { key: "azure.subscription_id", @@ -146,7 +146,7 @@ func Test_TerraformRecipe_Context(t *testing.T) { }, { key: "recipe_context", - expected: "{\"application\":{\"id\":\"/planes/radius/local/resourcegroups/radiusGroup/providers/Applications.Core/applications/corerp-resources-terraform-context\",\"name\":\"corerp-resources-terraform-context\"},\"aws\":null,\"azure\":{\"resourceGroup\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-100000000000/resourceGroups/rg-terraform-context\",\"name\":\"rg-terraform-context\"},\"subscription\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-100000000000\",\"subscriptionId\":\"00000000-0000-0000-0000-100000000000\"}},\"environment\":{\"id\":\"/planes/radius/local/resourcegroups/radiusGroup/providers/Applications.Core/environments/corerp-resources-terraform-context\",\"name\":\"corerp-resources-terraform-context\"},\"resource\":{\"id\":\"/planes/radius/local/resourcegroups/radiusGroup/providers/Applications.Link/extenders/corerp-resources-terraform-context\",\"name\":\"corerp-resources-terraform-context\",\"type\":\"Applications.Link/extenders\"},\"runtime\":{\"kubernetes\":{\"environmentNamespace\":\"corerp-resources-terraform-context-env\",\"namespace\":\"corerp-resources-terraform-context-app\"}}}", + expected: "{\"application\":{\"id\":\"/planes/radius/local/resourcegroups/radiusGroup/providers/Applications.Core/applications/corerp-resources-terraform-context\",\"name\":\"corerp-resources-terraform-context\"},\"aws\":null,\"azure\":{\"resourceGroup\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-100000000000/resourceGroups/rg-terraform-context\",\"name\":\"rg-terraform-context\"},\"subscription\":{\"id\":\"/subscriptions/00000000-0000-0000-0000-100000000000\",\"subscriptionId\":\"00000000-0000-0000-0000-100000000000\"}},\"environment\":{\"id\":\"/planes/radius/local/resourcegroups/radiusGroup/providers/Applications.Core/environments/corerp-resources-terraform-context\",\"name\":\"corerp-resources-terraform-context\"},\"resource\":{\"id\":\"/planes/radius/local/resourcegroups/radiusGroup/providers/Applications.Core/extenders/corerp-resources-terraform-context\",\"name\":\"corerp-resources-terraform-context\",\"type\":\"Applications.Core/extenders\"},\"runtime\":{\"kubernetes\":{\"environmentNamespace\":\"corerp-resources-terraform-context-env\",\"namespace\":\"corerp-resources-terraform-context-app\"}}}", }, } diff --git a/test/functional/shared/resources/testdata/corerp-resources-extenders-aws-s3-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-extender-aws-s3-recipe.bicep similarity index 93% rename from test/functional/shared/resources/testdata/corerp-resources-extenders-aws-s3-recipe.bicep rename to test/functional/shared/resources/testdata/corerp-resources-extender-aws-s3-recipe.bicep index f8d3c78adf..e16692c321 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-extenders-aws-s3-recipe.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-extender-aws-s3-recipe.bicep @@ -21,7 +21,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { } } recipes: { - 'Applications.Link/extenders': { + 'Applications.Core/extenders': { s3: { templateKind: 'bicep' templatePath: '${registry}/test/functional/shared/recipes/extenders-aws-s3-recipe:${version}' @@ -48,7 +48,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: 'corerp-resources-extenders-aws-s3-recipe' properties: { environment: env.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-extender-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-extender-recipe.bicep index e9e94ad4c9..cde129c0b4 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-extender-recipe.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-extender-recipe.bicep @@ -14,7 +14,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { namespace: 'corerp-resources-extender-recipe-env' } recipes: { - 'Applications.Link/extenders':{ + 'Applications.Core/extenders':{ default: { templateKind: 'bicep' templatePath: '${registry}/test/functional/shared/recipes/extender-recipe:${version}' @@ -41,7 +41,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: 'extender-recipe' properties: { environment: env.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-extender.bicep b/test/functional/shared/resources/testdata/corerp-resources-extender.bicep index c3de618a5d..f71897fa79 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-extender.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-extender.bicep @@ -11,7 +11,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource twilio 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource twilio 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: 'extr-twilio' properties: { environment: environment diff --git a/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step0.bicep b/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step0.bicep index aaf1d2a978..9b2a4c6da8 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step0.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step0.bicep @@ -23,7 +23,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { namespace: '${basename}-env' } recipes: { - 'Applications.Link/extenders': { + 'Applications.Core/extenders': { '${environmentRecipeName}': { templateKind: 'bicep' templatePath: '${registry}/test/functional/shared/recipes/${recipe}:${version}' @@ -49,7 +49,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { // This resources is intentionally NOT using a recipe. It's being created so we can reference // it inside a recipe in the next step. -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: '${basename}-existing' properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step1.bicep b/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step1.bicep index 67abf7b5a3..ffd637a24c 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step1.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep-resourcecreation.step1.bicep @@ -13,7 +13,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' existing name: basename } -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: basename properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep.bicep b/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep.bicep index ebe11880de..fb2f560f4d 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-recipe-bicep.bicep @@ -27,7 +27,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { namespace: '${basename}-env' } recipes: { - 'Applications.Link/extenders': { + 'Applications.Core/extenders': { '${environmentRecipeName}': { templateKind: 'bicep' templatePath: '${registry}/test/functional/shared/recipes/${recipe}:${version}' @@ -51,7 +51,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: basename properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-recipe-notfound.bicep b/test/functional/shared/resources/testdata/corerp-resources-recipe-notfound.bicep index afd356ba4c..2396a1dd0e 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-recipe-notfound.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-recipe-notfound.bicep @@ -29,7 +29,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: basename properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep b/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep index 18d2b458b4..0bf9aa8fb6 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-terraform-azurestorage.bicep @@ -22,7 +22,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { } } recipes: { - 'Applications.Link/extenders': { + 'Applications.Core/extenders': { default: { templateKind: 'terraform' templatePath: '${moduleServer}/azure-storage.zip' @@ -50,7 +50,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource webapp 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource webapp 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: 'corerp-resources-terraform-azstorage' properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-terraform-context.bicep b/test/functional/shared/resources/testdata/corerp-resources-terraform-context.bicep index ad191b7dee..f2334ee6e4 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-terraform-context.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-terraform-context.bicep @@ -18,7 +18,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { } } recipes: { - 'Applications.Link/extenders': { + 'Applications.Core/extenders': { default: { templateKind: 'terraform' templatePath: '${moduleServer}/k8ssecret-context.zip' @@ -41,7 +41,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource webapp 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource webapp 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: 'corerp-resources-terraform-context' properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/corerp-resources-terraform-redis.bicep b/test/functional/shared/resources/testdata/corerp-resources-terraform-redis.bicep index b07f916c9a..310ef9c9ef 100644 --- a/test/functional/shared/resources/testdata/corerp-resources-terraform-redis.bicep +++ b/test/functional/shared/resources/testdata/corerp-resources-terraform-redis.bicep @@ -18,7 +18,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { namespace: 'corerp-resources-terraform-redis-env' } recipes: { - 'Applications.Link/extenders': { + 'Applications.Core/extenders': { default: { templateKind: 'terraform' templatePath: '${moduleServer}/kubernetes-redis.zip' @@ -41,7 +41,7 @@ resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { } } -resource webapp 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource webapp 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: 'corerp-resources-terraform-redis' properties: { application: app.id diff --git a/test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep b/test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep new file mode 100644 index 0000000000..da581e8ffd --- /dev/null +++ b/test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep @@ -0,0 +1,63 @@ +import radius as rad + +param bucketName string +param awsAccountId string +param awsRegion string +param registry string +param version string + +resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { + name: 'linkrp-resources-extenders-aws-s3-recipe-env' + location: 'global' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'linkrp-resources-extenders-aws-s3-recipe-env' + } + providers: { + aws: { + scope: '/planes/aws/aws/accounts/${awsAccountId}/regions/${awsRegion}' + } + } + recipes: { + 'Applications.Link/extenders': { + s3: { + templateKind: 'bicep' + templatePath: '${registry}/test/functional/shared/recipes/extenders-aws-s3-recipe:${version}' + parameters: { + bucketName: bucketName + } + } + } + } + } +} + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'linkrp-resources-extenders-aws-s3-recipe-app' + location: 'global' + properties: { + environment: env.id + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: 'linkrp-resources-extenders-aws-s3-recipe-app' + } + ] + } +} + +resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { + name: 'linkrp-resources-extenders-aws-s3-recipe' + properties: { + environment: env.id + application: app.id + recipe: { + name: 's3' + parameters: { + bucketName: bucketName + } + } + } +} diff --git a/test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep b/test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep new file mode 100644 index 0000000000..fc0ffce9cb --- /dev/null +++ b/test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep @@ -0,0 +1,50 @@ +import radius as radius + +param registry string + +param version string + +resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { + name: 'linkrp-resources-extender-recipe-env' + location: 'global' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'linkrp-resources-extender-recipe-env' + } + recipes: { + 'Applications.Link/extenders':{ + default: { + templateKind: 'bicep' + templatePath: '${registry}/test/functional/shared/recipes/extender-recipe:${version}' + parameters: { + containerImage: '${registry}/magpiego:${version}' + } + } + } + } + } +} + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'linkrp-resources-extender-recipe' + location: 'global' + properties: { + environment: env.id + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: 'linkrp-resources-extender-recipe-app' + } + ] + } +} + +resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { + name: 'extender-recipe-old' + properties: { + environment: env.id + application: app.id + } +} diff --git a/test/functional/shared/resources/testdata/linkrp-resources-extender.bicep b/test/functional/shared/resources/testdata/linkrp-resources-extender.bicep new file mode 100644 index 0000000000..3fd635779d --- /dev/null +++ b/test/functional/shared/resources/testdata/linkrp-resources-extender.bicep @@ -0,0 +1,42 @@ +import radius as radius + +param magpieimage string +param environment string + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'linkrp-resources-extender' + location: 'global' + properties: { + environment: environment + } +} + +resource twilio 'Applications.Link/extenders@2022-03-15-privatepreview' = { + name: 'extr-twilio-old' + properties: { + environment: environment + fromNumber: '222-222-2222' + secrets: { + accountSid: 'sid' + authToken: 'token' + } + resourceProvisioning: 'manual' + } +} + +resource container 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'extr-ctnr-old' + location: 'global' + properties: { + application: app.id + container: { + image: magpieimage + env: { + TWILIO_NUMBER: twilio.properties.fromNumber + TWILIO_SID: twilio.secrets('accountSid') + TWILIO_ACCOUNT: twilio.secrets('authToken') + } + } + connections: {} + } +} diff --git a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/_resource-creation.bicep b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/_resource-creation.bicep index 18022b53bf..13c5a601c5 100644 --- a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/_resource-creation.bicep +++ b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/_resource-creation.bicep @@ -6,7 +6,7 @@ var basename = context.resource.name // This is not a realistic user scenario (creating a Radius resource in a recipe). We're // doing things this way to test the UCP functionality without using cloud resources. -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: '${basename}-module' properties: { application: context.application.id diff --git a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/language-failure.bicep b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/language-failure.bicep index 4446b0bd00..1ca9e662a9 100644 --- a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/language-failure.bicep +++ b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/language-failure.bicep @@ -6,7 +6,7 @@ var basename = context.resource.name // This is not a realistic user scenario (creating a Radius resource in a recipe). We're // doing things this way to test a bicep language failure without using cloud resources. -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: '${basename}-failure' properties: { application: context.application.id diff --git a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation-failure.bicep b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation-failure.bicep index 0291ed86dd..f626178d2c 100644 --- a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation-failure.bicep +++ b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation-failure.bicep @@ -6,7 +6,7 @@ var basename = context.resource.name // This is not a realistic user scenario (creating a Radius resource in a recipe). We're // doing things this way to test a provisioning failure without using cloud resources. -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: '${basename}-failure' properties: { application: 'not an id, just deal with it' diff --git a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation.bicep b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation.bicep index c282f5ee29..f5dbd70712 100644 --- a/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation.bicep +++ b/test/functional/shared/resources/testdata/recipes/test-bicep-recipes/resource-creation.bicep @@ -6,7 +6,7 @@ var basename = context.resource.name // This is not a realistic user scenario (creating a Radius resource in a recipe). We're // doing things this way to test the UCP functionality without using cloud resources. -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { +resource extender 'Applications.Core/extenders@2022-03-15-privatepreview' = { name: '${basename}-created' properties: { application: context.application.id @@ -17,7 +17,7 @@ resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { } #disable-next-line no-unused-existing-resources -resource existing 'Applications.Link/extenders@2022-03-15-privatepreview' existing = { +resource existing 'Applications.Core/extenders@2022-03-15-privatepreview' existing = { name: '${basename}-existing' } diff --git a/test/validation/shared.go b/test/validation/shared.go index fd5fee369a..4b3452b78f 100644 --- a/test/validation/shared.go +++ b/test/validation/shared.go @@ -47,7 +47,7 @@ const ( O_DaprPubSubBrokersResource = "applications.link/daprPubSubBrokers" O_DaprSecretStoresResource = "applications.link/daprSecretStores" O_DaprStateStoresResource = "applications.link/daprStateStores" - ExtendersResource = "applications.link/extenders" + O_ExtendersResource = "applications.link/extenders" // New resources after splitting LinkRP namespace RabbitMQQueuesResource = "applications.messaging/rabbitMQQueues" @@ -57,6 +57,7 @@ const ( MongoDatabasesResource = "applications.datastores/mongoDatabases" RedisCachesResource = "applications.datastores/redisCaches" SQLDatabasesResource = "applications.datastores/sqlDatabases" + ExtendersResource = "applications.core/extenders" ) type RPResource struct { From 6f611deb10e92eb8793a82fb14d338ebf9df84f1 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Wed, 23 Aug 2023 17:07:16 -0700 Subject: [PATCH 07/57] Applications.Core - Regen models and clients from TypeSpec emitted swagger files (#6108) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is the change to use the models generated from TypeSpec emitted swagger files. Depends on #6097 ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 19c952d ### Summary 🔄🆕🛠️ This pull request updates the CLI and core RP code to use the latest API definitions for the Radius project. It mainly affects the types and functions related to recipes, environments, applications, and containers. It also consolidates the API specification files into one openapi.json file. > _`Recipe` types change_ > _Aligning with API_ > _Winter of refactor_ ### Walkthrough * Update the type of the recipe parameter and return value of the ShowRecipe method in the ApplicationsManagementClient interface and its implementations to match the updated API definition of the RecipeGetMetadata and RecipeGetMetadataResponse types ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-b18b7839db664b7ea7e3dee7fb9e1fb08f7246f7c6e02bd946e6c60ab9b3f211L172-R172), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL621-R632), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-a6f10a0125ba5ff86166bb7dd0369942834185ce5533c250891f995dae6ed236L155-R155), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L99-R99), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L174-R174), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL137-R137), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL200-R200)) * Update the field name of the ApplicationResourceListResult and EnvironmentResourceListResult types to match the updated API definition ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL226-R226), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL443-R443), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL480-R480)) * Update the method name of the ApplicationsClient and EnvironmentsClient types from CreateOrUpdate to Create to match the updated API definition ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL321-R321), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL350-R350), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaL369-R369)) * Update the type of the Recipes field of the EnvironmentProperties type and the return value of the GetDevRecipes method in the DevRecipeClient interface and its implementations to match the updated API definition of the RecipePropertiesClassification type ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-49df15dcc08b5543113b5cadc02b3b8d4bc9d670e7d73e3c15213d7d188e4d9fL322-R325), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-c8b9a3315a934ca0d8e0b750b2872603b1c504239f5d310251e87e5fb6a8e4a2L280-R280), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-c8b9a3315a934ca0d8e0b750b2872603b1c504239f5d310251e87e5fb6a8e4a2L306-R306), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-043b8a9fb42a3b3d2876c07a59c8975147156ed05f3e2c30c934e8a0e65d2ecfL251-R251), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-a6aea1316b5b38221ce3b6e03cb2d3fb22a0f339f4952190d4ca1a6c2614cb5aL586-R586), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-a6aea1316b5b38221ce3b6e03cb2d3fb22a0f339f4952190d4ca1a6c2614cb5aL594-R594), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-a6aea1316b5b38221ce3b6e03cb2d3fb22a0f339f4952190d4ca1a6c2614cb5aL608-R608), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-a6aea1316b5b38221ce3b6e03cb2d3fb22a0f339f4952190d4ca1a6c2614cb5aL637-R637), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-a6aea1316b5b38221ce3b6e03cb2d3fb22a0f339f4952190d4ca1a6c2614cb5aL666-R666), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-2918474decdd8eda8947fb6dad7690cf22e764b0f77e3e2b9a0b4d7a36a06699L39-R42), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-8d95f3c1fe28429c99ace05511baa39ad8209147381755da6007c8781ed17be2L39-R39), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-8d95f3c1fe28429c99ace05511baa39ad8209147381755da6007c8781ed17be2L52-R52), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-8d95f3c1fe28429c99ace05511baa39ad8209147381755da6007c8781ed17be2L64-R64), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-8d95f3c1fe28429c99ace05511baa39ad8209147381755da6007c8781ed17be2L107-R108), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-8d95f3c1fe28429c99ace05511baa39ad8209147381755da6007c8781ed17be2L128-R128), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-c87f030551272551caefea8389b7c31b6159f47554e26f88ca38453234bd92a1L137-R137), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-c87f030551272551caefea8389b7c31b6159f47554e26f88ca38453234bd92a1L145-R145), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-c87f030551272551caefea8389b7c31b6159f47554e26f88ca38453234bd92a1L161-R161), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-c87f030551272551caefea8389b7c31b6159f47554e26f88ca38453234bd92a1L186-R186), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-455cce87d0a66ee8bd33b2e8549200653478b7e582745b3976b77200d45aed91L88-R88), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L177-R179), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L198-R198), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL287-R287), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL350-R350), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL103-R103), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL161-R161), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL217-R217), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL277-R277), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL315-R315), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL379-R379), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-5f83571cb3da4d9bd0cc6028463f1e877dcd7222a4d7b1acfac8e503dddef7e7L83-R83), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL73-R73), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL138-R140), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL288-R288), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL313-R313)) * Update the type of the extensions variable and the return value of the fromExtensionClassificationDataModel and toExtensionDataModel functions in the ApplicationResource, ContainerResource, and EnvironmentResource types to match the updated API definition of the ExtensionClassification type ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f53dbe19953ee4250f0a9a3521e2461858787d41977fded63e9be39481776adbL86-R86), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f53dbe19953ee4250f0a9a3521e2461858787d41977fded63e9be39481776adbL98-R102), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f53dbe19953ee4250f0a9a3521e2461858787d41977fded63e9be39481776adbL118-R120), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL216-R216), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL484-R500), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL500-R519), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL517-R533), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL534-R550), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL162-R162), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL258-R262), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL273-R275)) * Update the type of the kind variable and the return value of the fromKindDataModel and toKindDataModel functions in the ContainerResource type to match the updated API definition of the IAMKind type ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL158-R158), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL332-R334), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL341-R402)) * Update the name of the toProtocolDataModel and fromProtocolDataModel functions in the ContainerResource type to match the updated API definition of the PortProtocol and DaprSidecarExtensionProtocol types ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL73-R73), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL191-R195), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL500-R519), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL534-R550)) * Update the type of the c parameter in the fromAppExtensionClassificationDataModel, toAppExtensionDataModel, toExtensionDataModel, and fromExtensionClassificationDataModel functions in the ApplicationResource and ContainerResource types to match the updated API definition of the KubernetesNamespaceExtension and DaprSidecarExtension types ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f53dbe19953ee4250f0a9a3521e2461858787d41977fded63e9be39481776adbL108-R108), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-f53dbe19953ee4250f0a9a3521e2461858787d41977fded63e9be39481776adbL128-R128), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL500-R519), [link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL534-R550)) * Update the input-file list of the core-2022-03-15-privatepreview tag in the `README.md` file to use the consolidated `openapi.json` file instead of the individual json files for each resource type ([link](https://github.com/project-radius/radius/pull/6108/files?diff=unified&w=0#diff-b5a3780977870b27e08ef6f0e97cadef48e9a7c247801f62274dcbf89e5c3fedL37-R37)) --- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 310 +- hack/bicep-types-radius/generated/index.json | 2 +- pkg/cli/clients/clients.go | 2 +- pkg/cli/clients/management.go | 16 +- pkg/cli/clients/mock_applicationsclient.go | 4 +- pkg/cli/cmd/env/update/update_test.go | 4 +- pkg/cli/cmd/radinit/init.go | 2 +- pkg/cli/cmd/radinit/init_test.go | 10 +- pkg/cli/cmd/radinit/mock_devrecipeclient.go | 4 +- pkg/cli/cmd/radinit/recipe.go | 12 +- pkg/cli/cmd/radinit/recipe_test.go | 8 +- pkg/cli/cmd/recipe/list/list_test.go | 2 +- pkg/cli/cmd/recipe/register/register.go | 6 +- pkg/cli/cmd/recipe/register/register_test.go | 8 +- pkg/cli/cmd/recipe/show/show.go | 2 +- pkg/cli/cmd/recipe/show/show_test.go | 4 +- .../cmd/recipe/unregister/unregister_test.go | 12 +- pkg/cli/cmd/utils.go | 2 +- pkg/corerp/api/README.md | 9 +- .../application_conversion.go | 14 +- .../container_conversion.go | 86 +- .../environment_conversion.go | 20 +- .../environment_conversion_test.go | 14 +- .../environmentrecipeproperties_conversion.go | 6 +- ...ronmentrecipeproperties_conversion_test.go | 8 +- .../extender_conversion.go | 8 +- .../extender_conversion_test.go | 6 +- .../gateway_conversion.go | 20 +- .../gateway_conversion_test.go | 4 +- .../httproute_conversion.go | 2 +- .../secretstore_conversion.go | 2 +- .../api/v20220315privatepreview/util.go | 20 + .../volume_conversion.go | 44 +- .../zz_generated_applications_client.go | 48 +- .../zz_generated_client_factory.go | 9 +- .../zz_generated_constants.go | 232 +- .../zz_generated_containers_client.go | 151 +- .../zz_generated_environments_client.go | 86 +- .../zz_generated_extenders_client.go | 209 +- .../zz_generated_gateways_client.go | 222 +- .../zz_generated_httproutes_client.go | 153 +- .../zz_generated_interfaces.go | 72 +- .../zz_generated_models.go | 1250 ++-- .../zz_generated_models_serde.go | 2188 +++++-- .../zz_generated_operations_client.go | 93 + .../zz_generated_options.go | 158 +- .../zz_generated_polymorphic_helpers.go | 177 +- .../zz_generated_response_types.go | 152 +- .../zz_generated_secretstores_client.go | 198 +- .../zz_generated_volumes_client.go | 154 +- .../environmentrecipeproperties_converter.go | 4 +- ...ironmentrecipeproperties_converter_test.go | 2 +- .../environments/getrecipemetadata_test.go | 2 +- .../v20220315privatepreview_test.go | 10 +- pkg/recipes/configloader/environment.go | 6 +- pkg/recipes/configloader/environment_test.go | 2 +- .../applications.json | 412 -- .../2022-03-15-privatepreview/containers.json | 787 --- .../environments.json | 593 -- .../examples/ApplicationsListByScope.json | 33 - ....json => Applications_CreateOrUpdate.json} | 10 +- ...nsDelete.json => Applications_Delete.json} | 4 +- ...icationsGet.json => Applications_Get.json} | 8 +- ...ationsList.json => Applications_List.json} | 15 +- .../examples/Applications_ListByScope.json | 35 + ...onsPatch.json => Applications_Update.json} | 10 +- .../examples/ContainersDelete.json | 13 - .../examples/ContainersGet.json | 42 - .../examples/ContainersList.json | 101 - .../examples/ContainersListByScope.json | 104 - .../examples/ContainersPatch.json | 82 - .../examples/ContainersPut.json | 64 - .../examples/Containers_CreateOrUpdate.json | 8 +- .../examples/Containers_Delete.json | 2 +- .../examples/Containers_Get.json | 6 +- .../examples/Containers_List.json | 12 +- .../examples/Containers_ListByScope.json | 202 +- ....json => Environments_CreateOrUpdate.json} | 6 +- ...Env0.json => Environments_DeleteEnv0.json} | 4 +- ...GetEnv0.json => Environments_GetEnv0.json} | 6 +- ...on => Environments_GetRecipeMetadata.json} | 4 +- ...nmentsList.json => Environments_List.json} | 12 +- ...ope.json => Environments_ListByScope.json} | 10 +- ...hEnv0.json => Environments_PatchEnv0.json} | 6 +- .../examples/ExtendersDelete.json | 13 - .../examples/ExtendersGet.json | 30 - .../examples/ExtendersList.json | 33 - .../examples/ExtendersListByRootScope.json | 33 - .../examples/ExtendersListSecrets.json | 17 - .../examples/ExtendersPatch.json | 60 - .../examples/ExtendersPutWithRecipe.json | 52 - ...Put.json => Extenders_CreateOrUpdate.json} | 18 +- .../Extenders_CreateOrUpdateWithRecipe.json | 54 + .../examples/Extenders_Delete.json | 14 + .../examples/Extenders_Get.json | 31 + .../examples/Extenders_List.json | 34 + .../examples/Extenders_ListByRootScope.json | 34 + .../examples/Extenders_ListSecrets.json | 19 + .../examples/Extenders_Update.json | 61 + .../examples/GatewaysPatch.json | 48 - ...sPut.json => Gateways_CreateOrUpdate.json} | 10 +- ...tewaysDelete.json => Gateways_Delete.json} | 4 +- .../{GatewaysGet.json => Gateways_Get.json} | 8 +- .../{GatewaysList.json => Gateways_List.json} | 10 +- ...ByScope.json => Gateways_ListByScope.json} | 14 +- .../examples/HttpRoutesGet.json | 20 - .../examples/HttpRoutesList.json | 33 - .../examples/HttpRoutesListByScope.json | 33 - .../examples/HttpRoutesPatch.json | 26 - .../examples/HttpRoutesPut.json | 26 - .../examples/HttpRoutes_CreateOrUpdate.json | 28 + ...utesDelete.json => HttpRoutes_Delete.json} | 4 +- .../examples/HttpRoutes_Get.json | 22 + .../examples/HttpRoutes_List.json | 35 + .../examples/HttpRoutes_ListByScope.json | 35 + .../examples/HttpRoutes_Update.json | 28 + ...erationsList.json => Operations_List.json} | 2 + ....json => SecretStores_CreateOrUpdate.json} | 10 +- ...SecretStores_CreateOrUpdateValueFrom.json} | 10 +- ...esDelete.json => SecretStores_Delete.json} | 4 +- ...etStoresGet.json => SecretStores_Get.json} | 8 +- ...on => SecretStores_Get_AzureKeyVault.json} | 8 +- ...StoresList.json => SecretStores_List.json} | 14 +- ...ets.json => SecretStores_ListSecrets.json} | 4 +- ...alueFrom.json => SecretStores_Update.json} | 10 +- ...Patch.json => Volumes_CreateOrUpdate.json} | 10 +- ...tStoresDelete.json => Volumes_Delete.json} | 4 +- .../{VolumesGet.json => Volumes_Get.json} | 8 +- .../{VolumesList.json => Volumes_List.json} | 14 +- ...tByScope.json => Volumes_ListByScope.json} | 14 +- .../{VolumesPut.json => Volumes_Update.json} | 10 +- .../2022-03-15-privatepreview/extenders.json | 406 -- .../2022-03-15-privatepreview/gateways.json | 431 -- .../2022-03-15-privatepreview/global.json | 242 - .../2022-03-15-privatepreview/httpRoutes.json | 369 -- .../2022-03-15-privatepreview/openapi.json | 5153 +++++++++++++++++ .../secretstores.json | 483 -- .../2022-03-15-privatepreview/volumes.json | 514 -- .../resource-manager/readme.csharp.md | 4 +- .../applications/resource-manager/readme.md | 10 +- swagger/specs.go | 2 +- .../shared/resources/recipe_bicep_test.go | 9 +- typespec/Applications.Core/applications.tsp | 6 +- typespec/Applications.Core/containers.tsp | 2 +- typespec/Applications.Core/environments.tsp | 4 +- typespec/Applications.Core/extenders.tsp | 6 +- typespec/Applications.Core/gateways.tsp | 4 +- typespec/Applications.Core/secretstores.tsp | 10 +- typespec/Applications.Core/tspconfig.yaml | 2 +- typespec/Applications.Core/volumes.tsp | 8 +- typespec/Test.Resource/tspconfig.yaml | 2 +- typespec/radius/v1/ucprootscope.tsp | 2 - 153 files changed, 10083 insertions(+), 7447 deletions(-) create mode 100644 pkg/corerp/api/v20220315privatepreview/zz_generated_operations_client.go delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/applications.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/containers.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsListByScope.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{ApplicationsPut.json => Applications_CreateOrUpdate.json} (71%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{ApplicationsDelete.json => Applications_Delete.json} (52%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{ApplicationsGet.json => Applications_Get.json} (67%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{ApplicationsList.json => Applications_List.json} (55%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_ListByScope.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{ApplicationsPatch.json => Applications_Update.json} (71%) delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersListByScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPatch.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPut.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsPutEnv0.json => Environments_CreateOrUpdate.json} (90%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsDeleteEnv0.json => Environments_DeleteEnv0.json} (52%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsGetEnv0.json => Environments_GetEnv0.json} (86%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsGetRecipeMetadata.json => Environments_GetRecipeMetadata.json} (79%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsList.json => Environments_List.json} (85%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsListByScope.json => Environments_ListByScope.json} (79%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{EnvironmentsPatchEnv0.json => Environments_PatchEnv0.json} (89%) delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{ExtendersPut.json => Extenders_CreateOrUpdate.json} (53%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdateWithRecipe.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Get.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_List.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListByRootScope.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListSecrets.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPatch.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{GatewaysPut.json => Gateways_CreateOrUpdate.json} (68%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{GatewaysDelete.json => Gateways_Delete.json} (54%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{GatewaysGet.json => Gateways_Get.json} (65%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{GatewaysList.json => Gateways_List.json} (58%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{GatewaysListByScope.json => Gateways_ListByScope.json} (64%) delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesListByScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPatch.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPut.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_CreateOrUpdate.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{HttpRoutesDelete.json => HttpRoutes_Delete.json} (53%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Get.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_List.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_ListByScope.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Update.json rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{OperationsList.json => Operations_List.json} (98%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresPutValue.json => SecretStores_CreateOrUpdate.json} (69%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresPatch.json => SecretStores_CreateOrUpdateValueFrom.json} (73%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{VolumesDelete.json => SecretStores_Delete.json} (52%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresGet.json => SecretStores_Get.json} (56%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresGet_AzureKeyVault.json => SecretStores_Get_AzureKeyVault.json} (69%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresList.json => SecretStores_List.json} (61%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresListSecrets.json => SecretStores_ListSecrets.json} (69%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresPutValueFrom.json => SecretStores_Update.json} (73%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{VolumesPatch.json => Volumes_CreateOrUpdate.json} (72%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{SecretStoresDelete.json => Volumes_Delete.json} (56%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{VolumesGet.json => Volumes_Get.json} (76%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{VolumesList.json => Volumes_List.json} (76%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{VolumesListByScope.json => Volumes_ListByScope.json} (76%) rename swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/{VolumesPut.json => Volumes_Update.json} (72%) delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/extenders.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/gateways.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/global.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/httpRoutes.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/secretstores.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/volumes.json diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index 2fdf52671f..bafee37f18 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":22,"Flags":1,"Description":"Application environment properties"},"tags":{"Type":54,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":16,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":21,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[12,13,14,15]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[17,18,19,20]}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":30,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"compute":{"Type":31,"Flags":1,"Description":"Compute resource used by application environment resource."},"providers":{"Type":38,"Flags":0,"Description":"Cloud providers configuration"},"recipes":{"Type":47,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":53,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[23,24,25,26,27,28,29]}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":32,"Flags":0}},"Elements":{"kubernetes":36}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":35,"Flags":1,"Description":"Configuration for supported external identity providers"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[33,34]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":37,"Flags":1,"Description":"Type of compute resource."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":39,"Flags":0,"Description":"Azure cloud provider configuration"},"aws":{"Type":40,"Flags":0,"Description":"AWS cloud provider configuration"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":0,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":0,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"EnvironmentRecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":42,"terraform":44}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":43,"Flags":1,"Description":"Format of the template provided by the recipe. Allowed values: bicep, terraform."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":45,"Flags":1,"Description":"Format of the template provided by the recipe. Allowed values: bicep, terraform."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfEnvironmentRecipeProperties","Properties":{},"AdditionalProperties":41}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":46}},{"7":{"Name":"EnvironmentExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"kubernetesMetadata":49}}},{"2":{"Name":"EnvironmentKubernetesMetadataExtension","Properties":{"annotations":{"Type":50,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":51,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":52,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"EnvironmentKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"EnvironmentKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"3":{"ItemType":48}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":56,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":57,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":59,"Flags":1,"Description":"Application properties"},"tags":{"Type":78,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":67,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"environment":{"Type":4,"Flags":1,"Description":"The resource id of the environment linked to application."},"extensions":{"Type":75,"Flags":0,"Description":"Extensions spec of the resource"},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[60,61,62,63,64,65,66]}},{"7":{"Name":"ApplicationExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"kubernetesMetadata":69,"kubernetesNamespace":73}}},{"2":{"Name":"ApplicationKubernetesMetadataExtension","Properties":{"annotations":{"Type":70,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":71,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":72,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"ApplicationKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ApplicationKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"ApplicationKubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The Kubernetes namespace to use for this application."},"kind":{"Type":74,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"kubernetesNamespace"}},{"3":{"ItemType":68}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":31,"Flags":0,"Description":"Compute resource used by application environment resource."},"outputResources":{"Type":77,"Flags":0,"Description":"Array of AnyObject"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":58}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":80,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":81,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":83,"Flags":1,"Description":"HTTP Route properties"},"tags":{"Type":92,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"provisioningState":{"Type":91,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":0,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":0,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[84,85,86,87,88,89,90]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":82}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":94,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":95,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":97,"Flags":1,"Description":"Gateway properties"},"tags":{"Type":113,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"GatewayProperties","Properties":{"provisioningState":{"Type":105,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":106,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"tls":{"Type":107,"Flags":0,"Description":"TLS configuration for the Gateway."},"routes":{"Type":112,"Flags":1,"Description":"Routes attached to this Gateway"},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly."},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[98,99,100,101,102,103,104]}},{"2":{"Name":"GatewayPropertiesHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayPropertiesTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":110,"Flags":0,"Description":"TLS minimum protocol version (defaults to 1.2)."},"certificateFrom":{"Type":4,"Flags":0,"Description":"Declares which Kubernetes TLS secret will be used."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[108,109]}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":111}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":96}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":115,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":116,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":118,"Flags":1,"Description":"Container properties"},"tags":{"Type":178,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ContainerProperties","Properties":{"provisioningState":{"Type":126,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"connections":{"Type":131,"Flags":0,"Description":"Dictionary of "},"container":{"Type":132,"Flags":1,"Description":"Definition of a container."},"identity":{"Type":32,"Flags":0},"extensions":{"Type":177,"Flags":0,"Description":"Extensions spec of the resource"},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[119,120,121,122,123,124,125]}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0},"iam":{"Type":128,"Flags":0,"Description":"The properties of IAM"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":129,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":130,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":127}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":133,"Flags":0,"Description":"Dictionary of "},"ports":{"Type":140,"Flags":0,"Description":"Dictionary of "},"readinessProbe":{"Type":141,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":141,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":160,"Flags":0,"Description":"Dictionary of "},"command":{"Type":161,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":162,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPort","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":139,"Flags":0,"Description":"Protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value."},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired."}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[135,136,137,138]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":134}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":142,"httpGet":144,"tcp":147}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":143,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":145,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":146,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":148,"Flags":1,"Description":"The HealthProbeProperties kind"}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":150,"persistent":155}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":153,"Flags":1,"Description":"Backing store for the ephemeral volume"},"kind":{"Type":154,"Flags":1,"Description":"The Volume kind"}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[151,152]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":158,"Flags":0,"Description":"Container read/write access to the volume"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":159,"Flags":1,"Description":"The Volume kind"}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[156,157]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":149}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"7":{"Name":"ContainerExtension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":164,"kubernetesMetadata":171,"manualScaling":175}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":169,"Flags":0,"Description":"Protocol in use by the port"},"kind":{"Type":170,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[165,166,167,168]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"ContainerKubernetesMetadataExtension","Properties":{"annotations":{"Type":172,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":173,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":174,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"2":{"Name":"ContainerKubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerKubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":0,"Description":"Replica count."},"kind":{"Type":176,"Flags":1,"Description":"Specifies the extensions of a resource."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":163}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":117}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":180,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":181,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":183,"Flags":1},"tags":{"Type":215,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"provisioningState":{"Type":191,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}},"Elements":{"azure.com.keyvault":192}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[184,185,186,187,188,189,190]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":205,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":207,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":213,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":214,"Flags":1,"Description":"The volume kind"}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"encoding":{"Type":197,"Flags":0,"Description":"Encoding format. Default utf-8"},"format":{"Type":200,"Flags":0,"Description":"Certificate format. Default pem"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":204,"Flags":0,"Description":"Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[194,195,196]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[198,199]}},{"6":{"Value":"certificate"}},{"6":{"Value":"publickey"}},{"6":{"Value":"privatekey"}},{"5":{"Elements":[201,202,203]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":193}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":206}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk."},"encoding":{"Type":212,"Flags":0,"Description":"Encoding format. Default utf-8"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"Secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[209,210,211]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":208}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":182}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":217,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":218,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":220,"Flags":1},"tags":{"Type":238,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"provisioningState":{"Type":228,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"type":{"Type":231,"Flags":0,"Description":"The type of secret store data"},"data":{"Type":237,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":0,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":1,"Description":"Specifies the resource id of the application"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[221,222,223,224,225,226,227]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[229,230]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":235,"Flags":0,"Description":"The encoding of value"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":236,"Flags":0}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[233,234]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":232}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":219}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":240,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":241,"Flags":10,"Description":"The resource api version"},"systemData":{"Type":11,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."},"properties":{"Type":243,"Flags":1,"Description":"Extender portable resource properties."},"tags":{"Type":257,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"}}}},{"2":{"Name":"ExtenderProperties","Properties":{"provisioningState":{"Type":251,"Flags":2,"Description":"Provisioning state of the resource at the time the operation was called."},"secrets":{"Type":252,"Flags":0,"Description":"The secret values for the given Extender portable resource."},"resourceProvisioning":{"Type":255,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"recipe":{"Type":256,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource."},"status":{"Type":76,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"The resource id of the environment linked to the resource"},"application":{"Type":4,"Flags":0,"Description":"Specifies the resource id of the application"}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Accepted"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Provisioning"}},{"5":{"Elements":[244,245,246,247,248,249,250]}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[253,254]}},{"2":{"Name":"ResourceRecipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":242}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":262,"Flags":2,"Description":"The type of secret store data"},"data":{"Type":263,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[260,261]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":232}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":259}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":265}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":1,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":1,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":105,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":1,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":107,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":108,"Flags":10,"Description":"The resource api version"},"properties":{"Type":110,"Flags":0,"Description":"Environment properties"},"tags":{"Type":130,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":118,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":119,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":128,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":129,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[111,112,113,114,115,116,117]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":120,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":121,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":123,"terraform":125}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":124,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":1,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":122}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":127}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":109}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":132,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":133,"Flags":10,"Description":"The resource api version"},"properties":{"Type":135,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":148,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":143,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":144,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":147,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[136,137,138,139,140,141,142]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[145,146]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":134}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":150,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":151,"Flags":10,"Description":"The resource api version"},"properties":{"Type":153,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":169,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":161,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":162,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":164,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":165,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[154,155,156,157,158,159,160]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":163}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":168,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[166,167]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":152}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":171,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":172,"Flags":10,"Description":"The resource api version"},"properties":{"Type":174,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":183,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":182,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[175,176,177,178,179,180,181]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":173}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":185,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":186,"Flags":10,"Description":"The resource api version"},"properties":{"Type":188,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":206,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":196,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":199,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":205,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[189,190,191,192,193,194,195]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[197,198]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":203,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":204,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[201,202]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":200}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":187}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":208,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":209,"Flags":10,"Description":"The resource api version"},"properties":{"Type":211,"Flags":0,"Description":"Volume properties"},"tags":{"Type":243,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":219,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":220}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[212,213,214,215,216,217,218]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":233,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":235,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":241,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":242,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":225,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":228,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":232,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[222,223,224]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[226,227]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":221}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":240,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[237,238,239]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":236}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":210}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":249,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":250,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[247,248]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":200}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":246,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index f470ba43e4..89c3ea7844 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -7,7 +7,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [ApplicationProperties](#applicationproperties) (Required): Application properties +* **properties**: [ApplicationProperties](#applicationproperties): Application properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/applications' (ReadOnly, DeployTimeConstant): The resource type @@ -19,7 +19,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [ContainerProperties](#containerproperties) (Required): Container properties +* **properties**: [ContainerProperties](#containerproperties): Container properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/containers' (ReadOnly, DeployTimeConstant): The resource type @@ -31,7 +31,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [EnvironmentProperties](#environmentproperties) (Required): Application environment properties +* **properties**: [EnvironmentProperties](#environmentproperties): Environment properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/environments' (ReadOnly, DeployTimeConstant): The resource type @@ -43,7 +43,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [ExtenderProperties](#extenderproperties) (Required): Extender portable resource properties. +* **properties**: [ExtenderProperties](#extenderproperties): ExtenderResource link properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/extenders' (ReadOnly, DeployTimeConstant): The resource type @@ -55,7 +55,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [GatewayProperties](#gatewayproperties) (Required): Gateway properties +* **properties**: [GatewayProperties](#gatewayproperties): Gateway properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/gateways' (ReadOnly, DeployTimeConstant): The resource type @@ -67,7 +67,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [HttpRouteProperties](#httprouteproperties) (Required): HTTP Route properties +* **properties**: [HttpRouteProperties](#httprouteproperties): HTTPRoute properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/httpRoutes' (ReadOnly, DeployTimeConstant): The resource type @@ -79,7 +79,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [SecretStoreProperties](#secretstoreproperties) (Required) +* **properties**: [SecretStoreProperties](#secretstoreproperties): The properties of SecretStore * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/secretStores' (ReadOnly, DeployTimeConstant): The resource type @@ -91,77 +91,98 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [VolumeProperties](#volumeproperties) (Required) +* **properties**: [VolumeProperties](#volumeproperties): Volume properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/volumes' (ReadOnly, DeployTimeConstant): The resource type +## Function listSecrets (Applications.Core/extenders@2022-03-15-privatepreview) +* **Resource**: Applications.Core/extenders +* **ApiVersion**: 2022-03-15-privatepreview +* **Input**: any +* **Output**: any + ## Function listSecrets (Applications.Core/secretStores@2022-03-15-privatepreview) * **Resource**: Applications.Core/secretStores * **ApiVersion**: 2022-03-15-privatepreview +* **Input**: any * **Output**: [SecretStoreListSecretsResult](#secretstorelistsecretsresult) -## Function listSecrets (Applications.Core/extenders@2022-03-15-privatepreview) -* **Resource**: Applications.Core/extenders -* **ApiVersion**: 2022-03-15-privatepreview -* **Output**: [ExtenderSecrets](#extendersecrets) - ## ApplicationProperties ### Properties -* **environment**: string (Required): The resource id of the environment linked to application. -* **extensions**: [ApplicationExtension](#applicationextension)[]: Extensions spec of the resource -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. +* **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to +* **extensions**: [Extension](#extension)[]: The application extension. +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -## ApplicationExtension +## Extension * **Discriminator**: kind ### Base Properties -### ApplicationKubernetesMetadataExtension +### DaprSidecarExtension +#### Properties +* **appId**: string (Required): The Dapr appId. Specifies the identifier used by Dapr for service invocation. +* **appPort**: int: The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. +* **config**: string: Specifies the Dapr configuration to use for the resource. +* **kind**: 'daprSidecar' (Required): Discriminator property for Extension. +* **protocol**: 'grpc' | 'http': The Dapr sidecar extension protocol + +### KubernetesMetadataExtension +#### Properties +* **annotations**: [KubernetesMetadataExtensionAnnotations](#kubernetesmetadataextensionannotations) (Required): Annotations to be applied to the Kubernetes resources output by the resource +* **kind**: 'kubernetesMetadata' (Required): Discriminator property for Extension. +* **labels**: [KubernetesMetadataExtensionLabels](#kubernetesmetadataextensionlabels) (Required): Labels to be applied to the Kubernetes resources output by the resource + +### KubernetesNamespaceExtension #### Properties -* **annotations**: [ApplicationKubernetesMetadataExtensionAnnotations](#applicationkubernetesmetadataextensionannotations): Annotations to be applied to the Kubernetes resources output by the resource -* **kind**: 'kubernetesMetadata' (Required): Specifies the extensions of a resource. -* **labels**: [ApplicationKubernetesMetadataExtensionLabels](#applicationkubernetesmetadataextensionlabels): Labels to be applied to the Kubernetes resources output by the resource +* **kind**: 'kubernetesNamespace' (Required): Discriminator property for Extension. +* **namespace**: string (Required): The namespace of the application environment. -### ApplicationKubernetesNamespaceExtension +### ManualScalingExtension #### Properties -* **kind**: 'kubernetesNamespace' (Required): Specifies the extensions of a resource. -* **namespace**: string (Required): The Kubernetes namespace to use for this application. +* **kind**: 'manualScaling' (Required): Discriminator property for Extension. +* **replicas**: int (Required): Replica count. -## ApplicationKubernetesMetadataExtensionAnnotations +## KubernetesMetadataExtensionAnnotations ### Properties ### Additional Properties * **Additional Properties Type**: string -## ApplicationKubernetesMetadataExtensionLabels +## KubernetesMetadataExtensionLabels ### Properties ### Additional Properties * **Additional Properties Type**: string ## ResourceStatus ### Properties -* **compute**: [EnvironmentCompute](#environmentcompute): Compute resource used by application environment resource. -* **outputResources**: any[]: Array of AnyObject +* **compute**: [EnvironmentCompute](#environmentcompute): Represents backing compute resource +* **outputResources**: [OutputResource](#outputresource)[]: Properties of an output resource ## EnvironmentCompute * **Discriminator**: kind ### Base Properties -* **identity**: [IdentitySettings](#identitysettings) +* **identity**: [IdentitySettings](#identitysettings): IdentitySettings is the external identity setting. * **resourceId**: string: The resource id of the compute resource for application environment. ### KubernetesCompute #### Properties -* **kind**: 'kubernetes' (Required): Type of compute resource. +* **kind**: 'kubernetes' (Required): Discriminator property for EnvironmentCompute. * **namespace**: string (Required): The namespace to use for the environment. ## IdentitySettings ### Properties -* **kind**: 'azure.com.workload' | 'undefined' (Required): Configuration for supported external identity providers +* **kind**: 'azure.com.workload' | 'undefined' (Required): IdentitySettingKind is the kind of supported external identity setting * **oidcIssuer**: string: The URI for your compute platform's OIDC issuer * **resource**: string: The resource ID of the provisioned identity +## OutputResource +### Properties +* **id**: string: The UCP resource ID of the underlying resource. +* **localId**: string: The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships. +* **radiusManaged**: bool: Determines whether Radius manages the lifecycle of the underlying resource. + ## SystemData ### Properties * **createdAt**: string: The timestamp of resource creation (UTC). @@ -178,13 +199,13 @@ ## ContainerProperties ### Properties -* **application**: string (Required): Specifies the resource id of the application -* **connections**: [ContainerPropertiesConnections](#containerpropertiesconnections): Dictionary of -* **container**: [Container](#container) (Required): Definition of a container. -* **environment**: string: The resource id of the environment linked to the resource -* **extensions**: [ContainerExtension](#containerextension)[]: Extensions spec of the resource -* **identity**: [IdentitySettings](#identitysettings) -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. +* **application**: string (Required): Fully qualified resource ID for the application that the portable resource is consumed by +* **connections**: [ContainerPropertiesConnections](#containerpropertiesconnections): Specifies a connection to another resource. +* **container**: [Container](#container) (Required): Definition of a container +* **environment**: string: Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) +* **extensions**: [Extension](#extension)[]: Extensions spec of the resource +* **identity**: [IdentitySettings](#identitysettings): IdentitySettings is the external identity setting. +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. ## ContainerPropertiesConnections @@ -194,8 +215,8 @@ ## ConnectionProperties ### Properties -* **disableDefaultEnvVars**: bool -* **iam**: [IamProperties](#iamproperties): The properties of IAM +* **disableDefaultEnvVars**: bool: default environment variable override +* **iam**: [IamProperties](#iamproperties): IAM properties * **source**: string (Required): The source of the connection ## IamProperties @@ -207,12 +228,12 @@ ### Properties * **args**: string[]: Arguments to the entrypoint. Overrides the container image's CMD * **command**: string[]: Entrypoint array. Overrides the container image's ENTRYPOINT -* **env**: [ContainerEnv](#containerenv): Dictionary of +* **env**: [ContainerEnv](#containerenv): environment * **image**: string (Required): The registry and image to download and run in your container * **livenessProbe**: [HealthProbeProperties](#healthprobeproperties): Properties for readiness/liveness probe -* **ports**: [ContainerPorts](#containerports): Dictionary of +* **ports**: [ContainerPorts](#containerports): container ports * **readinessProbe**: [HealthProbeProperties](#healthprobeproperties): Properties for readiness/liveness probe -* **volumes**: [ContainerVolumes](#containervolumes): Dictionary of +* **volumes**: [ContainerVolumes](#containervolumes): container volumes * **workingDir**: string: Working directory for the container ## ContainerEnv @@ -231,19 +252,19 @@ ### ExecHealthProbeProperties #### Properties * **command**: string (Required): Command to execute to probe readiness/liveness -* **kind**: 'exec' (Required): The HealthProbeProperties kind +* **kind**: 'exec' (Required): Discriminator property for HealthProbeProperties. ### HttpGetHealthProbeProperties #### Properties * **containerPort**: int (Required): The listening port number * **headers**: [HttpGetHealthProbePropertiesHeaders](#httpgethealthprobepropertiesheaders): Custom HTTP headers to add to the get request -* **kind**: 'httpGet' (Required): The HealthProbeProperties kind +* **kind**: 'httpGet' (Required): Discriminator property for HealthProbeProperties. * **path**: string (Required): The route to make the HTTP request on ### TcpHealthProbeProperties #### Properties * **containerPort**: int (Required): The listening port number -* **kind**: 'tcp' (Required): The HealthProbeProperties kind +* **kind**: 'tcp' (Required): Discriminator property for HealthProbeProperties. ## HttpGetHealthProbePropertiesHeaders @@ -254,15 +275,15 @@ ## ContainerPorts ### Properties ### Additional Properties -* **Additional Properties Type**: [ContainerPort](#containerport) +* **Additional Properties Type**: [ContainerPortProperties](#containerportproperties) -## ContainerPort +## ContainerPortProperties ### Properties * **containerPort**: int (Required): The listening port number -* **port**: int: Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired. -* **protocol**: 'TCP' | 'UDP' | 'grpc' | 'http': Protocol in use by the port +* **port**: int: Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired +* **protocol**: 'TCP' | 'UDP': The protocol in use by the port * **provides**: string: Specifies a route provided by this port -* **scheme**: string: Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value. +* **scheme**: string: Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value ## ContainerVolumes ### Properties @@ -273,53 +294,19 @@ * **Discriminator**: kind ### Base Properties -* **mountPath**: string: The path where the volume is mounted +* **mountPath**: string (Required): The path where the volume is mounted ### EphemeralVolume #### Properties -* **kind**: 'ephemeral' (Required): The Volume kind -* **managedStore**: 'disk' | 'memory' (Required): Backing store for the ephemeral volume +* **kind**: 'ephemeral' (Required): Discriminator property for Volume. +* **managedStore**: 'disk' | 'memory' (Required): The managed store for the ephemeral volume ### PersistentVolume #### Properties -* **kind**: 'persistent' (Required): The Volume kind -* **permission**: 'read' | 'write': Container read/write access to the volume +* **kind**: 'persistent' (Required): Discriminator property for Volume. +* **permission**: 'read' | 'write': The persistent volume permission * **source**: string (Required): The source of the volume -## ContainerExtension -* **Discriminator**: kind - -### Base Properties -### DaprSidecarExtension -#### Properties -* **appId**: string (Required): The Dapr appId. Specifies the identifier used by Dapr for service invocation. -* **appPort**: int: The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. -* **config**: string: Specifies the Dapr configuration to use for the resource. -* **kind**: 'daprSidecar' (Required): Specifies the extensions of a resource. -* **protocol**: 'TCP' | 'UDP' | 'grpc' | 'http': Protocol in use by the port - -### ContainerKubernetesMetadataExtension -#### Properties -* **annotations**: [ContainerKubernetesMetadataExtensionAnnotations](#containerkubernetesmetadataextensionannotations): Annotations to be applied to the Kubernetes resources output by the resource -* **kind**: 'kubernetesMetadata' (Required): Specifies the extensions of a resource. -* **labels**: [ContainerKubernetesMetadataExtensionLabels](#containerkubernetesmetadataextensionlabels): Labels to be applied to the Kubernetes resources output by the resource - -### ManualScalingExtension -#### Properties -* **kind**: 'manualScaling' (Required): Specifies the extensions of a resource. -* **replicas**: int: Replica count. - - -## ContainerKubernetesMetadataExtensionAnnotations -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## ContainerKubernetesMetadataExtensionLabels -### Properties -### Additional Properties -* **Additional Properties Type**: string - ## TrackedResourceTags ### Properties ### Additional Properties @@ -327,57 +314,36 @@ ## EnvironmentProperties ### Properties -* **compute**: [EnvironmentCompute](#environmentcompute) (Required): Compute resource used by application environment resource. -* **extensions**: [EnvironmentExtension](#environmentextension)[]: Extensions spec of the resource -* **providers**: [Providers](#providers): Cloud providers configuration -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. +* **compute**: [EnvironmentCompute](#environmentcompute) (Required): Represents backing compute resource +* **extensions**: [Extension](#extension)[]: The environment extension. +* **providers**: [Providers](#providers): The Cloud providers configuration +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **recipes**: [EnvironmentPropertiesRecipes](#environmentpropertiesrecipes): Specifies Recipes linked to the Environment. -## EnvironmentExtension -* **Discriminator**: kind - -### Base Properties -### EnvironmentKubernetesMetadataExtension -#### Properties -* **annotations**: [EnvironmentKubernetesMetadataExtensionAnnotations](#environmentkubernetesmetadataextensionannotations): Annotations to be applied to the Kubernetes resources output by the resource -* **kind**: 'kubernetesMetadata' (Required): Specifies the extensions of a resource. -* **labels**: [EnvironmentKubernetesMetadataExtensionLabels](#environmentkubernetesmetadataextensionlabels): Labels to be applied to the Kubernetes resources output by the resource - - -## EnvironmentKubernetesMetadataExtensionAnnotations -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## EnvironmentKubernetesMetadataExtensionLabels -### Properties -### Additional Properties -* **Additional Properties Type**: string - ## Providers ### Properties -* **aws**: [ProvidersAws](#providersaws): AWS cloud provider configuration -* **azure**: [ProvidersAzure](#providersazure): Azure cloud provider configuration +* **aws**: [ProvidersAws](#providersaws): The AWS cloud provider definition +* **azure**: [ProvidersAzure](#providersazure): The Azure cloud provider definition ## ProvidersAws ### Properties -* **scope**: string: Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2' +* **scope**: string (Required): Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2' ## ProvidersAzure ### Properties -* **scope**: string: Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup' +* **scope**: string (Required): Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup' ## EnvironmentPropertiesRecipes ### Properties ### Additional Properties -* **Additional Properties Type**: [DictionaryOfEnvironmentRecipeProperties](#dictionaryofenvironmentrecipeproperties) +* **Additional Properties Type**: [DictionaryOfRecipeProperties](#dictionaryofrecipeproperties) -## DictionaryOfEnvironmentRecipeProperties +## DictionaryOfRecipeProperties ### Properties ### Additional Properties -* **Additional Properties Type**: [EnvironmentRecipeProperties](#environmentrecipeproperties) +* **Additional Properties Type**: [RecipeProperties](#recipeproperties) -## EnvironmentRecipeProperties +## RecipeProperties * **Discriminator**: templateKind ### Base Properties @@ -385,12 +351,12 @@ * **templatePath**: string (Required): Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. ### BicepRecipeProperties #### Properties -* **templateKind**: 'bicep' (Required): Format of the template provided by the recipe. Allowed values: bicep, terraform. +* **templateKind**: 'bicep' (Required): Discriminator property for RecipeProperties. ### TerraformRecipeProperties #### Properties -* **templateKind**: 'terraform' (Required): Format of the template provided by the recipe. Allowed values: bicep, terraform. -* **templateVersion**: string: Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources. +* **templateKind**: 'terraform' (Required): Discriminator property for RecipeProperties. +* **templateVersion**: string (Required): Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources. ## TrackedResourceTags @@ -400,26 +366,21 @@ ## ExtenderProperties ### Properties -* **application**: string: Specifies the resource id of the application -* **environment**: string (Required): The resource id of the environment linked to the resource -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. -* **recipe**: [ResourceRecipe](#resourcerecipe): The recipe used to automatically deploy underlying infrastructure for a portable resource. +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) +* **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **secrets**: [ExtenderSecrets](#extendersecrets): The secret values for the given Extender portable resource. +* **secrets**: any: Any object * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. ### Additional Properties * **Additional Properties Type**: any -## ResourceRecipe +## Recipe ### Properties -* **name**: string (Required): The name of the recipe within the environment to use. +* **name**: string (Required): The name of the recipe within the environment to use * **parameters**: any: Any object -## ExtenderSecrets -### Properties -### Additional Properties -* **Additional Properties Type**: any - ## TrackedResourceTags ### Properties ### Additional Properties @@ -427,17 +388,17 @@ ## GatewayProperties ### Properties -* **application**: string (Required): Specifies the resource id of the application -* **environment**: string: The resource id of the environment linked to the resource -* **hostname**: [GatewayPropertiesHostname](#gatewaypropertieshostname): Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io. +* **application**: string (Required): Fully qualified resource ID for the application that the portable resource is consumed by +* **environment**: string: Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) +* **hostname**: [GatewayHostname](#gatewayhostname): Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io. * **internal**: bool: Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet). -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **routes**: [GatewayRoute](#gatewayroute)[] (Required): Routes attached to this Gateway * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **tls**: [GatewayPropertiesTls](#gatewaypropertiestls): TLS configuration for the Gateway. -* **url**: string (ReadOnly): URL of the gateway resource. Readonly. +* **tls**: [GatewayTls](#gatewaytls): TLS configuration definition for Gateway resource. +* **url**: string (ReadOnly): URL of the gateway resource. Readonly -## GatewayPropertiesHostname +## GatewayHostname ### Properties * **fullyQualifiedHostname**: string: Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined. * **prefix**: string: Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined. @@ -448,10 +409,10 @@ * **path**: string: The path to match the incoming request path on. Ex - /myservice. * **replacePrefix**: string: Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute' -## GatewayPropertiesTls +## GatewayTls ### Properties -* **certificateFrom**: string: Declares which Kubernetes TLS secret will be used. -* **minimumProtocolVersion**: '1.2' | '1.3': TLS minimum protocol version (defaults to 1.2). +* **certificateFrom**: string: The resource id for the secret containing the TLS certificate and key for the gateway. +* **minimumProtocolVersion**: '1.2' | '1.3': Tls Minimum versions for Gateway resource. * **sslPassthrough**: bool: If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption. ## TrackedResourceTags @@ -461,14 +422,14 @@ ## HttpRouteProperties ### Properties -* **application**: string (Required): Specifies the resource id of the application -* **environment**: string: The resource id of the environment linked to the resource +* **application**: string (Required): Fully qualified resource ID for the application that the portable resource is consumed by +* **environment**: string: Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) * **hostname**: string: The internal hostname accepting traffic for the HTTP Route. Readonly. * **port**: int: The port number for the HTTP Route. Defaults to 80. Readonly. -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. -* **scheme**: string: The scheme used for traffic. Readonly. +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called +* **scheme**: string (ReadOnly): The scheme used for traffic. Readonly. * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **url**: string: A stable URL that that can be used to route traffic to a resource. Readonly. +* **url**: string (ReadOnly): A stable URL that that can be used to route traffic to a resource. Readonly. ## TrackedResourceTags ### Properties @@ -477,13 +438,13 @@ ## SecretStoreProperties ### Properties -* **application**: string (Required): Specifies the resource id of the application +* **application**: string (Required): Fully qualified resource ID for the application that the portable resource is consumed by * **data**: [SecretStorePropertiesData](#secretstorepropertiesdata) (Required): An object to represent key-value type secrets -* **environment**: string: The resource id of the environment linked to the resource -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. +* **environment**: string: Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **resource**: string: The resource id of external secret store. * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: 'certificate' | 'generic': The type of secret store data +* **type**: 'certificate' | 'generic': The type of SecretStore data ## SecretStorePropertiesData ### Properties @@ -492,9 +453,9 @@ ## SecretValueProperties ### Properties -* **encoding**: 'base64' | 'raw': The encoding of value +* **encoding**: 'base64' | 'raw': The type of SecretValue Encoding * **value**: string: The value of secret. -* **valueFrom**: [ValueFromProperties](#valuefromproperties) +* **valueFrom**: [ValueFromProperties](#valuefromproperties): The Secret value source properties ## ValueFromProperties ### Properties @@ -510,15 +471,15 @@ * **Discriminator**: kind ### Base Properties -* **application**: string (Required): Specifies the resource id of the application -* **environment**: string: The resource id of the environment linked to the resource -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the resource at the time the operation was called. +* **application**: string (Required): Fully qualified resource ID for the application that the portable resource is consumed by +* **environment**: string: Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) +* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. ### AzureKeyVaultVolumeProperties #### Properties * **certificates**: [AzureKeyVaultVolumePropertiesCertificates](#azurekeyvaultvolumepropertiescertificates): The KeyVault certificates that this volume exposes * **keys**: [AzureKeyVaultVolumePropertiesKeys](#azurekeyvaultvolumepropertieskeys): The KeyVault keys that this volume exposes -* **kind**: 'azure.com.keyvault' (Required): The volume kind +* **kind**: 'azure.com.keyvault' (Required): Discriminator property for VolumeProperties. * **resource**: string (Required): The ID of the keyvault to use for this volume resource * **secrets**: [AzureKeyVaultVolumePropertiesSecrets](#azurekeyvaultvolumepropertiessecrets): The KeyVault secrets that this volume exposes @@ -530,10 +491,10 @@ ## CertificateObjectProperties ### Properties -* **alias**: string: File name when written to disk. -* **certType**: 'certificate' | 'privatekey' | 'publickey': Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate -* **encoding**: 'base64' | 'hex' | 'utf-8': Encoding format. Default utf-8 -* **format**: 'pem' | 'pfx': Certificate format. Default pem +* **alias**: string: File name when written to disk +* **certType**: 'certificate' | 'privatekey' | 'publickey': Represents certificate types +* **encoding**: 'base64' | 'hex' | 'utf-8': Represents secret encodings +* **format**: 'pem' | 'pfx': Represents certificate formats * **name**: string (Required): The name of the certificate * **version**: string: Certificate version @@ -544,7 +505,7 @@ ## KeyObjectProperties ### Properties -* **alias**: string: File name when written to disk. +* **alias**: string: File name when written to disk * **name**: string (Required): The name of the key * **version**: string: Key version @@ -555,10 +516,10 @@ ## SecretObjectProperties ### Properties -* **alias**: string: File name when written to disk. -* **encoding**: 'base64' | 'hex' | 'utf-8': Encoding format. Default utf-8 +* **alias**: string: File name when written to disk +* **encoding**: 'base64' | 'hex' | 'utf-8': Represents secret encodings * **name**: string (Required): The name of the secret -* **version**: string: Secret version +* **version**: string: secret version ## TrackedResourceTags ### Properties @@ -568,15 +529,10 @@ ## SecretStoreListSecretsResult ### Properties * **data**: [SecretStoreListSecretsResultData](#secretstorelistsecretsresultdata) (ReadOnly): An object to represent key-value type secrets -* **type**: 'certificate' | 'generic' (ReadOnly): The type of secret store data +* **type**: 'certificate' | 'generic' (ReadOnly): The type of SecretStore data ## SecretStoreListSecretsResultData ### Properties ### Additional Properties * **Additional Properties Type**: [SecretValueProperties](#secretvalueproperties) -## ExtenderSecrets -### Properties -### Additional Properties -* **Additional Properties Type**: any - diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 0bb925d6f2..f066b31885 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":55},"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":79},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":93},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":114},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":179},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":216},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":239},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":258},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":40},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":57},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":75},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":41},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":60},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":79},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":41}},"Functions":{"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":264}]},"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":266}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":81}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":43}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":106},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":131},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":149},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":170},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":184},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":207},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":244},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":40},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":57},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":75},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":41},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":60},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":79},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":41}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":245}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":81}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":43}]}}} \ No newline at end of file diff --git a/pkg/cli/clients/clients.go b/pkg/cli/clients/clients.go index 6a877a9d4c..a506b8a003 100644 --- a/pkg/cli/clients/clients.go +++ b/pkg/cli/clients/clients.go @@ -169,7 +169,7 @@ type ApplicationsManagementClient interface { ListUCPGroup(ctx context.Context, planeType string, planeName string) ([]ucp_v20220901privatepreview.ResourceGroupResource, error) // ShowRecipe shows recipe details including list of all parameters for a given recipe registered to an environment - ShowRecipe(ctx context.Context, environmentName string, recipe corerp.Recipe) (corerp.RecipeMetadataProperties, error) + ShowRecipe(ctx context.Context, environmentName string, recipe corerp.RecipeGetMetadata) (corerp.RecipeGetMetadataResponse, error) } // ShallowCopy creates a shallow copy of the DeploymentParameters object by iterating through the original object and diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index b722af9b81..080d595224 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -224,7 +224,7 @@ func (amc *UCPApplicationsManagementClient) ListApplications(ctx context.Context if err != nil { return results, err } - applicationList := nextPage.ApplicationResourceList.Value + applicationList := nextPage.ApplicationResourceListResult.Value for _, application := range applicationList { results = append(results, *application) } @@ -441,7 +441,7 @@ func (amc *UCPApplicationsManagementClient) ListEnvironmentsInResourceGroup(ctx if err != nil { return envResourceList, err } - applicationList := nextPage.EnvironmentResourceList.Value + applicationList := nextPage.EnvironmentResourceListResult.Value for _, application := range applicationList { envResourceList = append(envResourceList, *application) } @@ -478,7 +478,7 @@ func (amc *UCPApplicationsManagementClient) ListEnvironmentsAll(ctx context.Cont return []corerpv20220315.EnvironmentResource{}, err } - for _, environment := range nextPage.EnvironmentResourceList.Value { + for _, environment := range nextPage.EnvironmentResourceListResult.Value { environments = append(environments, *environment) } } @@ -619,16 +619,16 @@ func (amc *UCPApplicationsManagementClient) ListUCPGroup(ctx context.Context, pl // ShowRecipe creates a new EnvironmentsClient, gets the recipe metadata from the // environment, and returns the EnvironmentRecipeProperties or an error if one occurs. -func (amc *UCPApplicationsManagementClient) ShowRecipe(ctx context.Context, environmentName string, recipeName corerpv20220315.Recipe) (corerpv20220315.RecipeMetadataProperties, error) { +func (amc *UCPApplicationsManagementClient) ShowRecipe(ctx context.Context, environmentName string, recipeName corerpv20220315.RecipeGetMetadata) (corerpv20220315.RecipeGetMetadataResponse, error) { client, err := corerpv20220315.NewEnvironmentsClient(amc.RootScope, &aztoken.AnonymousCredential{}, amc.ClientOptions) if err != nil { - return corerpv20220315.RecipeMetadataProperties{}, err + return corerpv20220315.RecipeGetMetadataResponse{}, err } - resp, err := client.GetRecipeMetadata(ctx, environmentName, recipeName, &corerpv20220315.EnvironmentsClientGetRecipeMetadataOptions{}) + resp, err := client.GetMetadata(ctx, environmentName, recipeName, &corerpv20220315.EnvironmentsClientGetMetadataOptions{}) if err != nil { - return corerpv20220315.RecipeMetadataProperties{}, err + return corerpv20220315.RecipeGetMetadataResponse{}, err } - return corerpv20220315.RecipeMetadataProperties(resp.RecipeMetadataProperties), nil + return corerpv20220315.RecipeGetMetadataResponse(resp.RecipeGetMetadataResponse), nil } diff --git a/pkg/cli/clients/mock_applicationsclient.go b/pkg/cli/clients/mock_applicationsclient.go index 3a68526bb5..e5c4ce8b4a 100644 --- a/pkg/cli/clients/mock_applicationsclient.go +++ b/pkg/cli/clients/mock_applicationsclient.go @@ -319,10 +319,10 @@ func (mr *MockApplicationsManagementClientMockRecorder) ShowApplication(arg0, ar } // ShowRecipe mocks base method. -func (m *MockApplicationsManagementClient) ShowRecipe(arg0 context.Context, arg1 string, arg2 v20220315privatepreview.Recipe) (v20220315privatepreview.RecipeMetadataProperties, error) { +func (m *MockApplicationsManagementClient) ShowRecipe(arg0 context.Context, arg1 string, arg2 v20220315privatepreview.RecipeGetMetadata) (v20220315privatepreview.RecipeGetMetadataResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ShowRecipe", arg0, arg1, arg2) - ret0, _ := ret[0].(v20220315privatepreview.RecipeMetadataProperties) + ret0, _ := ret[0].(v20220315privatepreview.RecipeGetMetadataResponse) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/pkg/cli/cmd/env/update/update_test.go b/pkg/cli/cmd/env/update/update_test.go index 6604562e8a..4c0fdc08ed 100644 --- a/pkg/cli/cmd/env/update/update_test.go +++ b/pkg/cli/cmd/env/update/update_test.go @@ -277,7 +277,7 @@ func Test_Update(t *testing.T) { environment := corerp.EnvironmentResource{ Name: to.Ptr("test-env"), Properties: &corerp.EnvironmentProperties{ - Recipes: map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{}, + Recipes: map[string]map[string]corerp.RecipePropertiesClassification{}, Compute: &corerp.KubernetesCompute{ Namespace: to.Ptr("default"), Kind: to.Ptr("kubernetes"), @@ -303,7 +303,7 @@ func Test_Update(t *testing.T) { testEnvProperties := &corerp.EnvironmentProperties{ Providers: testProviders, - Recipes: map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{}, + Recipes: map[string]map[string]corerp.RecipePropertiesClassification{}, Compute: &corerp.KubernetesCompute{ Namespace: to.Ptr("default"), Kind: to.Ptr("kubernetes"), diff --git a/pkg/cli/cmd/radinit/init.go b/pkg/cli/cmd/radinit/init.go index 4ef1ee9cba..e5fda2d902 100644 --- a/pkg/cli/cmd/radinit/init.go +++ b/pkg/cli/cmd/radinit/init.go @@ -248,7 +248,7 @@ func (r *Runner) Run(ctx context.Context) error { return err } - var recipes map[string]map[string]corerp.EnvironmentRecipePropertiesClassification + var recipes map[string]map[string]corerp.RecipePropertiesClassification if r.Options.Recipes.DevRecipes { recipes, err = r.DevRecipeClient.GetDevRecipes(ctx) if err != nil { diff --git a/pkg/cli/cmd/radinit/init_test.go b/pkg/cli/cmd/radinit/init_test.go index 6a0e504c0a..efee1541ac 100644 --- a/pkg/cli/cmd/radinit/init_test.go +++ b/pkg/cli/cmd/radinit/init_test.go @@ -583,7 +583,7 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { full bool azureProvider *azure.Provider awsProvider *aws.Provider - recipes map[string]map[string]corerp.EnvironmentRecipePropertiesClassification + recipes map[string]map[string]corerp.RecipePropertiesClassification expectedOutput []any }{ { @@ -591,7 +591,7 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { full: false, azureProvider: nil, awsProvider: nil, - recipes: map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{ + recipes: map[string]map[string]corerp.RecipePropertiesClassification{ "Applications.Link/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -605,7 +605,7 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { full: false, azureProvider: nil, awsProvider: nil, - recipes: map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{}, + recipes: map[string]map[string]corerp.RecipePropertiesClassification{}, expectedOutput: []any{}, }, { @@ -634,7 +634,7 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { Region: "us-west-2", AccountID: "test-account-id", }, - recipes: map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{}, + recipes: map[string]map[string]corerp.RecipePropertiesClassification{}, expectedOutput: []any{}, }, { @@ -663,7 +663,7 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { full: false, azureProvider: nil, awsProvider: nil, - recipes: map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{}, + recipes: map[string]map[string]corerp.RecipePropertiesClassification{}, expectedOutput: []any{}, }, } diff --git a/pkg/cli/cmd/radinit/mock_devrecipeclient.go b/pkg/cli/cmd/radinit/mock_devrecipeclient.go index 37e58fad91..902555c85a 100644 --- a/pkg/cli/cmd/radinit/mock_devrecipeclient.go +++ b/pkg/cli/cmd/radinit/mock_devrecipeclient.go @@ -36,10 +36,10 @@ func (m *MockDevRecipeClient) EXPECT() *MockDevRecipeClientMockRecorder { } // GetDevRecipes mocks base method. -func (m *MockDevRecipeClient) GetDevRecipes(arg0 context.Context) (map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification, error) { +func (m *MockDevRecipeClient) GetDevRecipes(arg0 context.Context) (map[string]map[string]v20220315privatepreview.RecipePropertiesClassification, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetDevRecipes", arg0) - ret0, _ := ret[0].(map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification) + ret0, _ := ret[0].(map[string]map[string]v20220315privatepreview.RecipePropertiesClassification) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/pkg/cli/cmd/radinit/recipe.go b/pkg/cli/cmd/radinit/recipe.go index b63fa7917c..6131a216f2 100644 --- a/pkg/cli/cmd/radinit/recipe.go +++ b/pkg/cli/cmd/radinit/recipe.go @@ -36,7 +36,7 @@ const ( //go:generate mockgen -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/project-radius/radius/pkg/cli/cmd/radinit github.com/project-radius/radius/pkg/cli/cmd/radinit DevRecipeClient type DevRecipeClient interface { - GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.EnvironmentRecipePropertiesClassification, error) + GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.RecipePropertiesClassification, error) } type devRecipeClient struct { @@ -49,7 +49,7 @@ func NewDevRecipeClient() DevRecipeClient { // GetDevRecipes is a function that queries a registry for recipes with a specific tag and returns a map of recipes. // If an error occurs, an error is returned. -func (drc *devRecipeClient) GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.EnvironmentRecipePropertiesClassification, error) { +func (drc *devRecipeClient) GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.RecipePropertiesClassification, error) { reg, err := remote.NewRegistry(DevRecipesRegistry) if err != nil { return nil, fmt.Errorf("failed to create client to registry %s - %s", DevRecipesRegistry, err.Error()) @@ -61,7 +61,7 @@ func (drc *devRecipeClient) GetDevRecipes(ctx context.Context) (map[string]map[s tag = "latest" } - recipes := map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{} + recipes := map[string]map[string]corerp.RecipePropertiesClassification{} // if repository has the correct path it should look like: /recipes//: // Ex: radius.azurecr.io/recipes/local-dev/rediscaches:0.20 @@ -104,8 +104,8 @@ func (drc *devRecipeClient) GetDevRecipes(ctx context.Context) (map[string]map[s } // processRepositories processes the repositories and returns the recipes. -func processRepositories(repos []string, tag string) map[string]map[string]corerp.EnvironmentRecipePropertiesClassification { - recipes := map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{} +func processRepositories(repos []string, tag string) map[string]map[string]corerp.RecipePropertiesClassification { + recipes := map[string]map[string]corerp.RecipePropertiesClassification{} // We are using the default recipe. name := "default" @@ -125,7 +125,7 @@ func processRepositories(repos []string, tag string) map[string]map[string]corer repoPath := DevRecipesRegistry + "/" + repo - recipes[linkType] = map[string]corerp.EnvironmentRecipePropertiesClassification{ + recipes[linkType] = map[string]corerp.RecipePropertiesClassification{ name: &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipe_types.TemplateKindBicep), TemplatePath: to.Ptr(repoPath + ":" + tag), diff --git a/pkg/cli/cmd/radinit/recipe_test.go b/pkg/cli/cmd/radinit/recipe_test.go index 380263351a..f477709224 100644 --- a/pkg/cli/cmd/radinit/recipe_test.go +++ b/pkg/cli/cmd/radinit/recipe_test.go @@ -134,7 +134,7 @@ func Test_processRepositories(t *testing.T) { name string repos []string tag string - want map[string]map[string]corerp.EnvironmentRecipePropertiesClassification + want map[string]map[string]corerp.RecipePropertiesClassification }{ { "Valid Repository with Redis Cache", @@ -142,7 +142,7 @@ func Test_processRepositories(t *testing.T) { "recipes/local-dev/rediscaches", }, "0.20", - map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{ + map[string]map[string]corerp.RecipePropertiesClassification{ "Applications.Link/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -158,7 +158,7 @@ func Test_processRepositories(t *testing.T) { "recipes/local-dev/mongodatabases", }, "0.20", - map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{ + map[string]map[string]corerp.RecipePropertiesClassification{ "Applications.Link/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -183,7 +183,7 @@ func Test_processRepositories(t *testing.T) { "recipes/unsupported/unsupported", }, "latest", - map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{ + map[string]map[string]corerp.RecipePropertiesClassification{ "Applications.Link/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), diff --git a/pkg/cli/cmd/recipe/list/list_test.go b/pkg/cli/cmd/recipe/list/list_test.go index e10aea5453..e4f6ef86c4 100644 --- a/pkg/cli/cmd/recipe/list/list_test.go +++ b/pkg/cli/cmd/recipe/list/list_test.go @@ -85,7 +85,7 @@ func Test_Run(t *testing.T) { Type: to.Ptr("applications.core/environments"), Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), diff --git a/pkg/cli/cmd/recipe/register/register.go b/pkg/cli/cmd/recipe/register/register.go index 0de3084e9b..ba890fa717 100644 --- a/pkg/cli/cmd/recipe/register/register.go +++ b/pkg/cli/cmd/recipe/register/register.go @@ -174,9 +174,9 @@ func (r *Runner) Run(ctx context.Context) error { envRecipes := envResource.Properties.Recipes if envRecipes == nil { - envRecipes = map[string]map[string]corerp.EnvironmentRecipePropertiesClassification{} + envRecipes = map[string]map[string]corerp.RecipePropertiesClassification{} } - var properties corerp.EnvironmentRecipePropertiesClassification + var properties corerp.RecipePropertiesClassification switch r.TemplateKind { case recipes.TemplateKindTerraform: properties = &corerp.TerraformRecipeProperties{ @@ -195,7 +195,7 @@ func (r *Runner) Run(ctx context.Context) error { if val, ok := envRecipes[r.LinkType]; ok { val[r.RecipeName] = properties } else { - envRecipes[r.LinkType] = map[string]corerp.EnvironmentRecipePropertiesClassification{ + envRecipes[r.LinkType] = map[string]corerp.RecipePropertiesClassification{ r.RecipeName: properties, } } diff --git a/pkg/cli/cmd/recipe/register/register_test.go b/pkg/cli/cmd/recipe/register/register_test.go index 65997d820a..9c45c0161a 100644 --- a/pkg/cli/cmd/recipe/register/register_test.go +++ b/pkg/cli/cmd/recipe/register/register_test.go @@ -134,7 +134,7 @@ func Test_Run(t *testing.T) { t.Run("Register recipe Success", func(t *testing.T) { ctrl := gomock.NewController(t) - testRecipes := map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + testRecipes := map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -197,7 +197,7 @@ func Test_Run(t *testing.T) { t.Run("Register recipe Failure", func(t *testing.T) { ctrl := gomock.NewController(t) - testRecipes := map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + testRecipes := map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -284,7 +284,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -347,7 +347,7 @@ func Test_Run(t *testing.T) { t.Run("Register recipe with no namespace", func(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), diff --git a/pkg/cli/cmd/recipe/show/show.go b/pkg/cli/cmd/recipe/show/show.go index f111cacf2a..4db49063af 100644 --- a/pkg/cli/cmd/recipe/show/show.go +++ b/pkg/cli/cmd/recipe/show/show.go @@ -152,7 +152,7 @@ func (r *Runner) Run(ctx context.Context) error { return err } - recipeDetails, err := client.ShowRecipe(ctx, r.Workspace.Environment, v20220315privatepreview.Recipe{Name: &r.RecipeName, LinkType: &r.LinkType}) + recipeDetails, err := client.ShowRecipe(ctx, r.Workspace.Environment, v20220315privatepreview.RecipeGetMetadata{Name: &r.RecipeName, LinkType: &r.LinkType}) if err != nil { return err } diff --git a/pkg/cli/cmd/recipe/show/show_test.go b/pkg/cli/cmd/recipe/show/show_test.go index ef72baa529..fe444dae58 100644 --- a/pkg/cli/cmd/recipe/show/show_test.go +++ b/pkg/cli/cmd/recipe/show/show_test.go @@ -96,7 +96,7 @@ func Test_Validate(t *testing.T) { func Test_Run(t *testing.T) { t.Run("Show bicep recipe details - Success", func(t *testing.T) { ctrl := gomock.NewController(t) - envRecipe := v20220315privatepreview.RecipeMetadataProperties{ + envRecipe := v20220315privatepreview.RecipeGetMetadataResponse{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), Parameters: map[string]any{ @@ -171,7 +171,7 @@ func Test_Run(t *testing.T) { t.Run("Show terraformn recipe details - Success", func(t *testing.T) { ctrl := gomock.NewController(t) - envRecipe := v20220315privatepreview.RecipeMetadataProperties{ + envRecipe := v20220315privatepreview.RecipeGetMetadataResponse{ TemplateKind: to.Ptr(recipes.TemplateKindTerraform), TemplatePath: to.Ptr("Azure/cosmosdb/azurerm"), TemplateVersion: to.Ptr("1.1.0"), diff --git a/pkg/cli/cmd/recipe/unregister/unregister_test.go b/pkg/cli/cmd/recipe/unregister/unregister_test.go index 47613d4923..cf5cafa55a 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister_test.go +++ b/pkg/cli/cmd/recipe/unregister/unregister_test.go @@ -100,7 +100,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -158,7 +158,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -214,7 +214,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -274,7 +274,7 @@ func Test_Run(t *testing.T) { Type: to.Ptr("applications.core/environments"), Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -312,7 +312,7 @@ func Test_Run(t *testing.T) { Type: to.Ptr("applications.core/environments"), Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "testResource": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), @@ -376,7 +376,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ - Recipes: map[string]map[string]v20220315privatepreview.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ linkrp.MongoDatabasesResourceType: { "testResource": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), diff --git a/pkg/cli/cmd/utils.go b/pkg/cli/cmd/utils.go index 23a4382ef6..e3c916f51d 100644 --- a/pkg/cli/cmd/utils.go +++ b/pkg/cli/cmd/utils.go @@ -80,7 +80,7 @@ func GetNamespace(envResource corerp.EnvironmentResource) string { // CheckIfRecipeExists checks if a given recipe exists in a given environment and returns the environment resource, recipe // properties and an error if the recipe does not exist. -func CheckIfRecipeExists(ctx context.Context, client clients.ApplicationsManagementClient, environmentName string, recipeName string, resourceType string) (corerp.EnvironmentResource, map[string]map[string]corerp.EnvironmentRecipePropertiesClassification, error) { +func CheckIfRecipeExists(ctx context.Context, client clients.ApplicationsManagementClient, environmentName string, recipeName string, resourceType string) (corerp.EnvironmentResource, map[string]map[string]corerp.RecipePropertiesClassification, error) { envResource, err := client.GetEnvDetails(ctx, environmentName) if err != nil { return corerp.EnvironmentResource{}, nil, err diff --git a/pkg/corerp/api/README.md b/pkg/corerp/api/README.md index 859cf9e292..f0899717bb 100644 --- a/pkg/corerp/api/README.md +++ b/pkg/corerp/api/README.md @@ -34,14 +34,7 @@ These settings apply only when `--tag=core-2022-03-15-privatepreview` is specifi ```yaml $(tag) == 'core-2022-03-15-privatepreview' input-file: - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/applications.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/httpRoutes.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/gateways.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/containers.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/volumes.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/secretstores.json - - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/extenders.json + - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json modelerfour: treat-type-object-as-anything: false diff --git a/pkg/corerp/api/v20220315privatepreview/application_conversion.go b/pkg/corerp/api/v20220315privatepreview/application_conversion.go index 3ac9b36283..05f94a845c 100644 --- a/pkg/corerp/api/v20220315privatepreview/application_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/application_conversion.go @@ -83,7 +83,7 @@ func (dst *ApplicationResource) ConvertFrom(src v1.DataModelInterface) error { }, } - var extensions []ApplicationExtensionClassification + var extensions []ExtensionClassification if app.Properties.Extensions != nil { for _, e := range app.Properties.Extensions { extensions = append(extensions, fromAppExtensionClassificationDataModel(e)) @@ -95,17 +95,17 @@ func (dst *ApplicationResource) ConvertFrom(src v1.DataModelInterface) error { } // fromAppExtensionClassificationDataModel: Converts from base datamodel to versioned datamodel -func fromAppExtensionClassificationDataModel(e datamodel.Extension) ApplicationExtensionClassification { +func fromAppExtensionClassificationDataModel(e datamodel.Extension) ExtensionClassification { switch e.Kind { case datamodel.KubernetesMetadata: var ann, lbl = fromExtensionClassificationFields(e) - return &ApplicationKubernetesMetadataExtension{ + return &KubernetesMetadataExtension{ Kind: to.Ptr(string(e.Kind)), Annotations: *to.StringMapPtr(ann), Labels: *to.StringMapPtr(lbl), } case datamodel.KubernetesNamespaceExtension: - return &ApplicationKubernetesNamespaceExtension{ + return &KubernetesNamespaceExtension{ Kind: to.Ptr(string(e.Kind)), Namespace: to.Ptr(e.KubernetesNamespace.Namespace), } @@ -115,9 +115,9 @@ func fromAppExtensionClassificationDataModel(e datamodel.Extension) ApplicationE } // toAppExtensionDataModel: Converts from versioned datamodel to base datamodel -func toAppExtensionDataModel(e ApplicationExtensionClassification) *datamodel.Extension { +func toAppExtensionDataModel(e ExtensionClassification) *datamodel.Extension { switch c := e.(type) { - case *ApplicationKubernetesMetadataExtension: + case *KubernetesMetadataExtension: return &datamodel.Extension{ Kind: datamodel.KubernetesMetadata, KubernetesMetadata: &datamodel.KubeMetadataExtension{ @@ -125,7 +125,7 @@ func toAppExtensionDataModel(e ApplicationExtensionClassification) *datamodel.Ex Labels: to.StringMap(c.Labels), }, } - case *ApplicationKubernetesNamespaceExtension: + case *KubernetesNamespaceExtension: if c.Namespace == nil || *c.Namespace == "" { return nil } diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion.go b/pkg/corerp/api/v20220315privatepreview/container_conversion.go index 84dcda801b..207f112c76 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion.go @@ -70,7 +70,7 @@ func (src *ContainerResource) ConvertTo() (v1.DataModelInterface, error) { for key, val := range src.Properties.Container.Ports { port := datamodel.ContainerPort{ ContainerPort: to.Int32(val.ContainerPort), - Protocol: toProtocolDataModel(val.Protocol), + Protocol: toPortProtocolDataModel(val.Protocol), Provides: to.String(val.Provides), } @@ -155,7 +155,7 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { connections := make(map[string]*ConnectionProperties) for key, val := range c.Properties.Connections { roles := []*string{} - var kind *Kind + var kind *IAMKind for _, r := range val.IAM.Roles { roles = append(roles, to.Ptr(r)) @@ -188,11 +188,11 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { readinessProbe = fromHealthProbePropertiesDataModel(c.Properties.Container.ReadinessProbe) } - ports := make(map[string]*ContainerPort) + ports := make(map[string]*ContainerPortProperties) for key, val := range c.Properties.Container.Ports { - ports[key] = &ContainerPort{ + ports[key] = &ContainerPortProperties{ ContainerPort: to.Ptr(val.ContainerPort), - Protocol: fromProtocolDataModel(val.Protocol), + Protocol: fromPortProtocolDataModel(val.Protocol), Provides: to.Ptr(val.Provides), } @@ -213,7 +213,7 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { } } - var extensions []ContainerExtensionClassification + var extensions []ExtensionClassification if c.Properties.Extensions != nil { for _, e := range c.Properties.Extensions { extensions = append(extensions, fromExtensionClassificationDataModel(e)) @@ -237,7 +237,7 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(c.Tags) dst.Properties = &ContainerProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(c.Properties.Status.OutputResources), + OutputResources: toOutputResources(c.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(c.InternalMetadata.AsyncProvisioningState), Application: to.Ptr(c.Properties.Application), @@ -329,57 +329,73 @@ func fromHealthProbePropertiesDataModel(h datamodel.HealthProbeProperties) Healt return nil } -func toKindDataModel(kind *Kind) datamodel.IAMKind { +func toKindDataModel(kind *IAMKind) datamodel.IAMKind { switch *kind { - case KindAzure: + case IAMKindAzure: return datamodel.KindAzure default: return datamodel.KindAzure } } -func fromKindDataModel(kind datamodel.IAMKind) *Kind { - var k Kind +func fromKindDataModel(kind datamodel.IAMKind) *IAMKind { + var k IAMKind switch kind { case datamodel.KindAzure: - k = KindAzure + k = IAMKindAzure default: - k = KindAzure + k = IAMKindAzure } return &k } -func toProtocolDataModel(protocol *Protocol) datamodel.Protocol { +func toPortProtocolDataModel(protocol *PortProtocol) datamodel.Protocol { + if protocol == nil { + return datamodel.ProtocolTCP + } + switch *protocol { + case PortProtocolTCP: + return datamodel.ProtocolTCP + case PortProtocolUDP: + return datamodel.ProtocolUDP + default: + return datamodel.ProtocolTCP + } +} + +func toDaprProtocolDataModel(protocol *DaprSidecarExtensionProtocol) datamodel.Protocol { if protocol == nil { return datamodel.ProtocolHTTP } switch *protocol { - case ProtocolHTTP: + case DaprSidecarExtensionProtocolHTTP: return datamodel.ProtocolHTTP - case ProtocolGrpc: + case DaprSidecarExtensionProtocolGrpc: return datamodel.ProtocolGrpc - case ProtocolTCP: - return datamodel.ProtocolTCP - case ProtocolUDP: - return datamodel.ProtocolUDP default: return datamodel.ProtocolHTTP } } - -func fromProtocolDataModel(protocol datamodel.Protocol) *Protocol { - var p Protocol +func fromPortProtocolDataModel(protocol datamodel.Protocol) *PortProtocol { + var p PortProtocol switch protocol { - case datamodel.ProtocolHTTP: - p = ProtocolHTTP - case datamodel.ProtocolGrpc: - p = ProtocolGrpc case datamodel.ProtocolTCP: - p = ProtocolTCP + p = PortProtocolTCP case datamodel.ProtocolUDP: - p = ProtocolUDP + p = PortProtocolUDP + default: + p = PortProtocolTCP + } + return &p +} + +func fromProtocolDataModel(protocol datamodel.Protocol) *DaprSidecarExtensionProtocol { + var p DaprSidecarExtensionProtocol + switch protocol { + case datamodel.ProtocolGrpc: + p = DaprSidecarExtensionProtocolGrpc default: - p = ProtocolHTTP + p = DaprSidecarExtensionProtocolHTTP } return &p } @@ -481,7 +497,7 @@ func fromPermissionDataModel(rbac datamodel.VolumePermission) *VolumePermission } // toExtensionDataModel: Converts from versioned datamodel to base datamodel -func toExtensionDataModel(e ContainerExtensionClassification) datamodel.Extension { +func toExtensionDataModel(e ExtensionClassification) datamodel.Extension { switch c := e.(type) { case *ManualScalingExtension: return datamodel.Extension{ @@ -497,10 +513,10 @@ func toExtensionDataModel(e ContainerExtensionClassification) datamodel.Extensio AppID: to.String(c.AppID), AppPort: to.Int32(c.AppPort), Config: to.String(c.Config), - Protocol: toProtocolDataModel(c.Protocol), + Protocol: toDaprProtocolDataModel(c.Protocol), }, } - case *ContainerKubernetesMetadataExtension: + case *KubernetesMetadataExtension: return datamodel.Extension{ Kind: datamodel.KubernetesMetadata, KubernetesMetadata: &datamodel.KubeMetadataExtension{ @@ -514,7 +530,7 @@ func toExtensionDataModel(e ContainerExtensionClassification) datamodel.Extensio } // fromExtensionClassificationDataModel: Converts from base datamodel to versioned datamodel -func fromExtensionClassificationDataModel(e datamodel.Extension) ContainerExtensionClassification { +func fromExtensionClassificationDataModel(e datamodel.Extension) ExtensionClassification { switch e.Kind { case datamodel.ManualScaling: return &ManualScalingExtension{ @@ -531,7 +547,7 @@ func fromExtensionClassificationDataModel(e datamodel.Extension) ContainerExtens } case datamodel.KubernetesMetadata: var ann, lbl = fromExtensionClassificationFields(e) - return &ContainerKubernetesMetadataExtension{ + return &KubernetesMetadataExtension{ Kind: to.Ptr(string(e.Kind)), Annotations: *to.StringMapPtr(ann), Labels: *to.StringMapPtr(lbl), diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go index 0c196d0457..73129c89e7 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go @@ -70,7 +70,7 @@ func (src *EnvironmentResource) ConvertTo() (v1.DataModelInterface, error) { envRecipes[resourceType] = map[string]datamodel.EnvironmentRecipeProperties{} for recipeName, recipeDetails := range recipes { if recipeDetails != nil { - if recipeDetails.GetEnvironmentRecipeProperties().TemplateKind == nil || !isValidTemplateKind(*recipeDetails.GetEnvironmentRecipeProperties().TemplateKind) { + if recipeDetails.GetRecipeProperties().TemplateKind == nil || !isValidTemplateKind(*recipeDetails.GetRecipeProperties().TemplateKind) { formats := []string{} for _, format := range types.SupportedTemplateKind { formats = append(formats, fmt.Sprintf("%q", format)) @@ -135,9 +135,9 @@ func (dst *EnvironmentResource) ConvertFrom(src v1.DataModelInterface) error { } if env.Properties.Recipes != nil { - recipes := make(map[string]map[string]EnvironmentRecipePropertiesClassification) + recipes := make(map[string]map[string]RecipePropertiesClassification) for resourceType, recipe := range env.Properties.Recipes { - recipes[resourceType] = map[string]EnvironmentRecipePropertiesClassification{} + recipes[resourceType] = map[string]RecipePropertiesClassification{} for recipeName, recipeDetails := range recipe { recipes[resourceType][recipeName] = fromRecipePropertiesClassificationDatamodel(recipeDetails) } @@ -159,7 +159,7 @@ func (dst *EnvironmentResource) ConvertFrom(src v1.DataModelInterface) error { } } - var extensions []EnvironmentExtensionClassification + var extensions []ExtensionClassification if env.Properties.Extensions != nil { for _, e := range env.Properties.Extensions { extensions = append(extensions, fromEnvExtensionClassificationDataModel(e)) @@ -255,11 +255,11 @@ func fromEnvironmentComputeKind(kind rpv1.EnvironmentComputeKind) *string { } // fromExtensionClassificationEnvDataModel: Converts from base datamodel to versioned datamodel -func fromEnvExtensionClassificationDataModel(e datamodel.Extension) EnvironmentExtensionClassification { +func fromEnvExtensionClassificationDataModel(e datamodel.Extension) ExtensionClassification { switch e.Kind { case datamodel.KubernetesMetadata: var ann, lbl = fromExtensionClassificationFields(e) - return &EnvironmentKubernetesMetadataExtension{ + return &KubernetesMetadataExtension{ Kind: to.Ptr(string(e.Kind)), Annotations: *to.StringMapPtr(ann), Labels: *to.StringMapPtr(lbl), @@ -270,9 +270,9 @@ func fromEnvExtensionClassificationDataModel(e datamodel.Extension) EnvironmentE } // toEnvExtensionDataModel: Converts from versioned datamodel to base datamodel -func toEnvExtensionDataModel(e EnvironmentExtensionClassification) datamodel.Extension { +func toEnvExtensionDataModel(e ExtensionClassification) datamodel.Extension { switch c := e.(type) { - case *EnvironmentKubernetesMetadataExtension: + case *KubernetesMetadataExtension: return datamodel.Extension{ Kind: datamodel.KubernetesMetadata, KubernetesMetadata: &datamodel.KubeMetadataExtension{ @@ -285,7 +285,7 @@ func toEnvExtensionDataModel(e EnvironmentExtensionClassification) datamodel.Ext return datamodel.Extension{} } -func toEnvironmentRecipeProperties(e EnvironmentRecipePropertiesClassification) (datamodel.EnvironmentRecipeProperties, error) { +func toEnvironmentRecipeProperties(e RecipePropertiesClassification) (datamodel.EnvironmentRecipeProperties, error) { switch c := e.(type) { case *TerraformRecipeProperties: if c.TemplatePath != nil { @@ -310,7 +310,7 @@ func toEnvironmentRecipeProperties(e EnvironmentRecipePropertiesClassification) return datamodel.EnvironmentRecipeProperties{}, nil } -func fromRecipePropertiesClassificationDatamodel(e datamodel.EnvironmentRecipeProperties) EnvironmentRecipePropertiesClassification { +func fromRecipePropertiesClassificationDatamodel(e datamodel.EnvironmentRecipeProperties) RecipePropertiesClassification { switch e.TemplateKind { case types.TemplateKindTerraform: return &TerraformRecipeProperties{ diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go index 78dfe02583..10d0f0fabd 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go @@ -327,17 +327,17 @@ func TestConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "kubernetes", string(*versioned.Properties.Compute.GetEnvironmentCompute().Kind)) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", string(*versioned.Properties.Compute.GetEnvironmentCompute().ResourceID)) require.Equal(t, 1, len(versioned.Properties.Recipes)) - require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetEnvironmentRecipeProperties().TemplatePath)) - require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetEnvironmentRecipeProperties().TemplateKind)) - require.Equal(t, map[string]any{"throughput": float64(400)}, versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetEnvironmentRecipeProperties().Parameters) + require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplatePath)) + require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplateKind)) + require.Equal(t, map[string]any{"throughput": float64(400)}, versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().Parameters) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", string(*versioned.Properties.Providers.Azure.Scope)) require.Equal(t, "/planes/aws/aws/accounts/140313373712/regions/us-west-2", string(*versioned.Properties.Providers.Aws.Scope)) require.Equal(t, "kubernetesMetadata", *versioned.Properties.Extensions[0].GetExtension().Kind) require.Equal(t, 1, len(versioned.Properties.Extensions)) recipeDetails := versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"] if tt.filename == "environmentresourcedatamodel.json" { - require.Equal(t, "Azure/cosmosdb/azurerm", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"].GetEnvironmentRecipeProperties().TemplatePath)) - require.Equal(t, recipes.TemplateKindTerraform, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"].GetEnvironmentRecipeProperties().TemplateKind)) + require.Equal(t, "Azure/cosmosdb/azurerm", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"].GetRecipeProperties().TemplatePath)) + require.Equal(t, recipes.TemplateKindTerraform, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"].GetRecipeProperties().TemplateKind)) switch c := recipeDetails.(type) { case *TerraformRecipeProperties: @@ -396,8 +396,8 @@ func TestConvertDataModelWithIdentityToVersioned(t *testing.T) { require.Equal(t, "kubernetes", string(*versioned.Properties.Compute.GetEnvironmentCompute().Kind)) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", string(*versioned.Properties.Compute.GetEnvironmentCompute().ResourceID)) require.Equal(t, 1, len(versioned.Properties.Recipes)) - require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetEnvironmentRecipeProperties().TemplatePath)) - require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetEnvironmentRecipeProperties().TemplateKind)) + require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplatePath)) + require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplateKind)) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", string(*versioned.Properties.Providers.Azure.Scope)) require.Equal(t, &IdentitySettings{ diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go index af53255a50..cf09b545b4 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go @@ -26,12 +26,12 @@ import ( ) // ConvertTo returns an error as it does not support converting Environment Recipe Properties to a version-agnostic object. -func (src *RecipeMetadataProperties) ConvertTo() (v1.DataModelInterface, error) { +func (src *RecipeGetMetadataResponse) ConvertTo() (v1.DataModelInterface, error) { return nil, fmt.Errorf("converting Environment Recipe Properties to a version-agnostic object is not supported") } // ConvertFrom converts from version-agnostic datamodel to the versioned Environment recipe properties resource. -func (dst *RecipeMetadataProperties) ConvertFrom(src v1.DataModelInterface) error { +func (dst *RecipeGetMetadataResponse) ConvertFrom(src v1.DataModelInterface) error { recipe, ok := src.(*datamodel.EnvironmentRecipeProperties) if !ok { return v1.ErrInvalidModelConversion @@ -46,7 +46,7 @@ func (dst *RecipeMetadataProperties) ConvertFrom(src v1.DataModelInterface) erro } // ConvertTo converts from the versioned Environment Recipe Properties resource to version-agnostic datamodel. -func (src *Recipe) ConvertTo() (v1.DataModelInterface, error) { +func (src *RecipeGetMetadata) ConvertTo() (v1.DataModelInterface, error) { return &datamodel.Recipe{ Name: to.String(src.Name), LinkType: to.String(src.LinkType), diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go index bc303544c2..41102417d2 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go @@ -30,7 +30,7 @@ import ( func TestEnvironmentRecipePropertiesConvertVersionedToDataModel(t *testing.T) { t.Run("Convert to Data Model", func(t *testing.T) { - r := &RecipeMetadataProperties{} + r := &RecipeGetMetadataResponse{} // act _, err := r.ConvertTo() @@ -49,7 +49,7 @@ func TestEnvironmentRecipePropertiesConvertDataModelToVersioned(t *testing.T) { require.NoError(t, err) // act - versioned := &RecipeMetadataProperties{} + versioned := &RecipeGetMetadataResponse{} err = versioned.ConvertFrom(r) // assert require.NoError(t, err) @@ -72,7 +72,7 @@ func TestEnvironmentRecipePropertiesConvertDataModelToVersioned_EmptyTemplateKin require.NoError(t, err) // act - versioned := &RecipeMetadataProperties{} + versioned := &RecipeGetMetadataResponse{} err = versioned.ConvertFrom(r) // assert require.NoError(t, err) @@ -93,7 +93,7 @@ func TestRecipeConvertVersionedToDataModel(t *testing.T) { Name: "mongo-azure", } rawPayload := testutil.ReadFixture(filename) - r := &Recipe{} + r := &RecipeGetMetadata{} err := json.Unmarshal(rawPayload, r) require.NoError(t, err) // act diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go index f6430242a3..ee4fcdc4c2 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go @@ -78,7 +78,7 @@ func (dst *ExtenderResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(extender.Tags) dst.Properties = &ExtenderProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(extender.Properties.Status.OutputResources), + OutputResources: toOutputResources(extender.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(extender.InternalMetadata.AsyncProvisioningState), Environment: to.Ptr(extender.Properties.Environment), @@ -117,14 +117,14 @@ func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) return &converted } -func fromRecipeDataModel(r linkrp.LinkRecipe) *ResourceRecipe { - return &ResourceRecipe{ +func fromRecipeDataModel(r linkrp.LinkRecipe) *Recipe { + return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, } } -func toRecipeDataModel(r *ResourceRecipe) linkrp.LinkRecipe { +func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { if r == nil { return linkrp.LinkRecipe{ Name: linkrp_apiver.DefaultRecipeName, diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go index 6efd9da996..886225435a 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go @@ -159,7 +159,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), ResourceProvisioning: to.Ptr(ResourceProvisioningManual), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &ResourceRecipe{Name: to.Ptr(""), Parameters: nil}, + Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, @@ -181,7 +181,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), ResourceProvisioning: to.Ptr(ResourceProvisioningManual), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &ResourceRecipe{Name: to.Ptr(""), Parameters: nil}, + Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, Status: &ResourceStatus{}, }, @@ -203,7 +203,7 @@ func TestExtender_ConvertDataModelToVersioned(t *testing.T) { Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &ResourceRecipe{Name: to.Ptr("test-recipe"), Parameters: nil}, + Recipe: &Recipe{Name: to.Ptr("test-recipe"), Parameters: nil}, Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), }, Tags: map[string]*string{ diff --git a/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go b/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go index 3d29041144..631ad9d322 100644 --- a/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go @@ -97,9 +97,9 @@ func (dst *GatewayResource) ConvertFrom(src v1.DataModelInterface) error { return v1.ErrInvalidModelConversion } - var tls *GatewayPropertiesTLS + var tls *GatewayTLS if g.Properties.TLS != nil { - tls = &GatewayPropertiesTLS{ + tls = &GatewayTLS{ CertificateFrom: to.Ptr(g.Properties.TLS.CertificateFrom), MinimumProtocolVersion: fromTLSMinVersionDataModel(g.Properties.TLS.MinimumProtocolVersion), SSLPassthrough: to.Ptr(g.Properties.TLS.SSLPassthrough), @@ -118,9 +118,9 @@ func (dst *GatewayResource) ConvertFrom(src v1.DataModelInterface) error { } } - var hostname *GatewayPropertiesHostname + var hostname *GatewayHostname if g.Properties.Hostname != nil { - hostname = &GatewayPropertiesHostname{ + hostname = &GatewayHostname{ FullyQualifiedHostname: to.Ptr(g.Properties.Hostname.FullyQualifiedHostname), Prefix: to.Ptr(g.Properties.Hostname.Prefix), } @@ -134,7 +134,7 @@ func (dst *GatewayResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(g.Tags) dst.Properties = &GatewayProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(g.Properties.Status.OutputResources), + OutputResources: toOutputResources(g.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(g.InternalMetadata.AsyncProvisioningState), Application: to.Ptr(g.Properties.Application), @@ -153,9 +153,9 @@ func toTLSMinVersionDataModel(tlsMinVersion *TLSMinVersion) datamodel.MinimumTLS } switch *tlsMinVersion { - case TLSMinVersionOne2: + case TLSMinVersionTls12: return datamodel.TLSMinVersion12 - case TLSMinVersionOne3: + case TLSMinVersionTls13: return datamodel.TLSMinVersion13 default: return datamodel.DefaultTLSMinVersion @@ -166,11 +166,11 @@ func fromTLSMinVersionDataModel(tlsMinVersion datamodel.MinimumTLSProtocolVersio var t TLSMinVersion switch tlsMinVersion { case datamodel.TLSMinVersion12: - t = TLSMinVersionOne2 + t = TLSMinVersionTls12 case datamodel.TLSMinVersion13: - t = TLSMinVersionOne3 + t = TLSMinVersionTls13 default: - t = TLSMinVersionOne2 + t = TLSMinVersionTls12 } return &t diff --git a/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go index eb419ed673..02366a0cf5 100644 --- a/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go @@ -190,7 +190,7 @@ func TestGatewayTLSTerminationConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "http://myprefix.myapp.mydomain.com", *versioned.Properties.URL) require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, "secretname", *versioned.Properties.TLS.CertificateFrom) - require.Equal(t, TLSMinVersionOne3, *versioned.Properties.TLS.MinimumProtocolVersion) + require.Equal(t, TLSMinVersionTls13, *versioned.Properties.TLS.MinimumProtocolVersion) } func TestGatewayTLSTerminationConvertVersionedToDataModel_NoMinProtocolVersion(t *testing.T) { @@ -247,7 +247,7 @@ func TestGatewayTLSTerminationConvertDataModelToVersioned_NoMinProtocolVersion(t require.Equal(t, "http://myprefix.myapp.mydomain.com", *versioned.Properties.URL) require.Equal(t, resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), versioned.Properties.Status) require.Equal(t, "secretname", *versioned.Properties.TLS.CertificateFrom) - require.Equal(t, TLSMinVersionOne2, *versioned.Properties.TLS.MinimumProtocolVersion) + require.Equal(t, TLSMinVersionTls12, *versioned.Properties.TLS.MinimumProtocolVersion) } func TestGatewayConvertFromValidation(t *testing.T) { diff --git a/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go b/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go index 258b8fe7ac..87a3847892 100644 --- a/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go @@ -68,7 +68,7 @@ func (dst *HTTPRouteResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(route.Tags) dst.Properties = &HTTPRouteProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(route.Properties.Status.OutputResources), + OutputResources: toOutputResources(route.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(route.InternalMetadata.AsyncProvisioningState), Application: to.Ptr(route.Properties.Application), diff --git a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go index 21750be56b..7649dd584d 100644 --- a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go @@ -66,7 +66,7 @@ func (dst *SecretStoreResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(ss.Tags) dst.Properties = &SecretStoreProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(ss.Properties.Status.OutputResources), + OutputResources: toOutputResources(ss.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(ss.InternalMetadata.AsyncProvisioningState), Application: to.Ptr(ss.Properties.Application), diff --git a/pkg/corerp/api/v20220315privatepreview/util.go b/pkg/corerp/api/v20220315privatepreview/util.go index 04924090d6..2daa31303b 100644 --- a/pkg/corerp/api/v20220315privatepreview/util.go +++ b/pkg/corerp/api/v20220315privatepreview/util.go @@ -148,3 +148,23 @@ func isValidLinkType(link string) bool { func isValidTemplateKind(templateKind string) bool { return slices.Contains(recipes.SupportedTemplateKind, templateKind) } + +func toOutputResources(outputResources []rpv1.OutputResource) []*OutputResource { + var outResources []*OutputResource + for _, or := range outputResources { + r := &OutputResource{ + ID: to.Ptr(or.ID.String()), + } + + // We will not serialize the following fields if they are empty or nil. + if or.LocalID != "" { + r.LocalID = to.Ptr(or.LocalID) + } + if or.RadiusManaged != nil { + r.RadiusManaged = or.RadiusManaged + } + + outResources = append(outResources, r) + } + return outResources +} diff --git a/pkg/corerp/api/v20220315privatepreview/volume_conversion.go b/pkg/corerp/api/v20220315privatepreview/volume_conversion.go index 876c013a19..bb859f53cb 100644 --- a/pkg/corerp/api/v20220315privatepreview/volume_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/volume_conversion.go @@ -95,7 +95,7 @@ func (dst *VolumeResource) ConvertFrom(src v1.DataModelInterface) error { azProp := resource.Properties.AzureKeyVault p := &AzureKeyVaultVolumeProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(resource.Properties.Status.OutputResources), + OutputResources: toOutputResources(resource.Properties.Status.OutputResources), }, Kind: to.Ptr(resource.Properties.Kind), Application: to.Ptr(resource.Properties.Application), @@ -167,8 +167,8 @@ func toSecretDataModel(s *SecretObjectProperties) *datamodel.SecretObjectPropert } } -func fromEncoding(encode *datamodel.SecretEncoding) *Encoding { - enc := EncodingUTF8 +func fromEncoding(encode *datamodel.SecretEncoding) *VolumeSecretEncodings { + enc := VolumeSecretEncodingsUTF8 if encode == nil { return &enc @@ -176,18 +176,18 @@ func fromEncoding(encode *datamodel.SecretEncoding) *Encoding { switch *encode { case datamodel.SecretObjectPropertiesEncodingBase64: - enc = EncodingBase64 + enc = VolumeSecretEncodingsBase64 case datamodel.SecretObjectPropertiesEncodingHex: - enc = EncodingHex + enc = VolumeSecretEncodingsHex case datamodel.SecretObjectPropertiesEncodingUTF8: - enc = EncodingUTF8 + enc = VolumeSecretEncodingsUTF8 default: - enc = EncodingUTF8 + enc = VolumeSecretEncodingsUTF8 } return &enc } -func toEncoding(e *Encoding) *datamodel.SecretEncoding { +func toEncoding(e *VolumeSecretEncodings) *datamodel.SecretEncoding { enc := datamodel.SecretObjectPropertiesEncodingUTF8 if e == nil { @@ -195,11 +195,11 @@ func toEncoding(e *Encoding) *datamodel.SecretEncoding { } switch *e { - case EncodingBase64: + case VolumeSecretEncodingsBase64: enc = datamodel.SecretObjectPropertiesEncodingBase64 - case EncodingHex: + case VolumeSecretEncodingsHex: enc = datamodel.SecretObjectPropertiesEncodingHex - case EncodingUTF8: + case VolumeSecretEncodingsUTF8: enc = datamodel.SecretObjectPropertiesEncodingUTF8 default: enc = datamodel.SecretObjectPropertiesEncodingUTF8 @@ -217,9 +217,9 @@ func toCertDataModel(c *CertificateObjectProperties) *datamodel.CertificateObjec if c.Format != nil { switch *c.Format { - case FormatPem: + case CertificateFormatsPem: prop.Format = to.Ptr(datamodel.CertificateFormatPEM) - case FormatPfx: + case CertificateFormatsPfx: prop.Format = to.Ptr(datamodel.CertificateFormatPFX) default: prop.Format = to.Ptr(datamodel.CertificateFormatPEM) @@ -228,11 +228,11 @@ func toCertDataModel(c *CertificateObjectProperties) *datamodel.CertificateObjec if c.CertType != nil { switch *c.CertType { - case CertTypeCertificate: + case CertificateTypesCertificate: prop.CertType = to.Ptr(datamodel.CertificateTypeCertificate) - case CertTypePrivatekey: + case CertificateTypesPrivatekey: prop.CertType = to.Ptr(datamodel.CertificateTypePrivateKey) - case CertTypePublickey: + case CertificateTypesPublickey: prop.CertType = to.Ptr(datamodel.CertificateTypePublicKey) } } @@ -251,22 +251,22 @@ func fromCertDataModel(dm *datamodel.CertificateObjectProperties) *CertificateOb if dm.Format != nil { switch *dm.Format { case datamodel.CertificateFormatPEM: - prop.Format = to.Ptr(FormatPem) + prop.Format = to.Ptr(CertificateFormatsPem) case datamodel.CertificateFormatPFX: - prop.Format = to.Ptr(FormatPfx) + prop.Format = to.Ptr(CertificateFormatsPfx) default: - prop.Format = to.Ptr(FormatPem) + prop.Format = to.Ptr(CertificateFormatsPem) } } if dm.CertType != nil { switch *dm.CertType { case datamodel.CertificateTypeCertificate: - prop.CertType = to.Ptr(CertTypeCertificate) + prop.CertType = to.Ptr(CertificateTypesCertificate) case datamodel.CertificateTypePrivateKey: - prop.CertType = to.Ptr(CertTypePrivatekey) + prop.CertType = to.Ptr(CertificateTypesPrivatekey) case datamodel.CertificateTypePublicKey: - prop.CertType = to.Ptr(CertTypePublickey) + prop.CertType = to.Ptr(CertificateTypesPublickey) } } diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_applications_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_applications_client.go index c06ce943cb..df7731ffad 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_applications_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_applications_client.go @@ -27,7 +27,9 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewApplicationsClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { @@ -42,17 +44,17 @@ func NewApplicationsClient(rootScope string, credential azcore.TokenCredential, return client, nil } -// CreateOrUpdate - Create or update an Application. +// CreateOrUpdate - Create a ApplicationResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - applicationName - The name of the application. -// - applicationResource - application details +// - applicationName - The application name +// - resource - Resource create parameters. // - options - ApplicationsClientCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.CreateOrUpdate // method. -func (client *ApplicationsClient) CreateOrUpdate(ctx context.Context, applicationName string, applicationResource ApplicationResource, options *ApplicationsClientCreateOrUpdateOptions) (ApplicationsClientCreateOrUpdateResponse, error) { +func (client *ApplicationsClient) CreateOrUpdate(ctx context.Context, applicationName string, resource ApplicationResource, options *ApplicationsClientCreateOrUpdateOptions) (ApplicationsClientCreateOrUpdateResponse, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, applicationName, applicationResource, options) + req, err := client.createOrUpdateCreateRequest(ctx, applicationName, resource, options) if err != nil { return ApplicationsClientCreateOrUpdateResponse{}, err } @@ -69,7 +71,7 @@ func (client *ApplicationsClient) CreateOrUpdate(ctx context.Context, applicatio } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, applicationName string, applicationResource ApplicationResource, options *ApplicationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Context, applicationName string, resource ApplicationResource, options *ApplicationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/applications/{applicationName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if applicationName == "" { @@ -84,7 +86,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, applicationResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil @@ -99,11 +101,11 @@ func (client *ApplicationsClient) createOrUpdateHandleResponse(resp *http.Respon return result, nil } -// Delete - Delete an Application. +// Delete - Delete a ApplicationResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - applicationName - The name of the application. +// - applicationName - The application name // - options - ApplicationsClientDeleteOptions contains the optional parameters for the ApplicationsClient.Delete method. func (client *ApplicationsClient) Delete(ctx context.Context, applicationName string, options *ApplicationsClientDeleteOptions) (ApplicationsClientDeleteResponse, error) { var err error @@ -115,7 +117,7 @@ func (client *ApplicationsClient) Delete(ctx context.Context, applicationName st if err != nil { return ApplicationsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return ApplicationsClientDeleteResponse{}, err } @@ -141,11 +143,11 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, appli return req, nil } -// Get - Gets the properties of an Application. +// Get - Get a ApplicationResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - applicationName - The name of the application. +// - applicationName - The application name // - options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. func (client *ApplicationsClient) Get(ctx context.Context, applicationName string, options *ApplicationsClientGetOptions) (ApplicationsClientGetResponse, error) { var err error @@ -193,7 +195,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic return result, nil } -// NewListByScopePager - List all applications in the given scope. +// NewListByScopePager - List ApplicationResource resources by Scope // // Generated from API version 2022-03-15-privatepreview // - options - ApplicationsClientListByScopeOptions contains the optional parameters for the ApplicationsClient.NewListByScopePager @@ -244,22 +246,22 @@ func (client *ApplicationsClient) listByScopeCreateRequest(ctx context.Context, // listByScopeHandleResponse handles the ListByScope response. func (client *ApplicationsClient) listByScopeHandleResponse(resp *http.Response) (ApplicationsClientListByScopeResponse, error) { result := ApplicationsClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationResourceList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationResourceListResult); err != nil { return ApplicationsClientListByScopeResponse{}, err } return result, nil } -// Update - Update the properties of an existing Application. +// Update - Update a ApplicationResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - applicationName - The name of the application. -// - applicationResource - application details +// - applicationName - The application name +// - properties - The resource properties to be updated. // - options - ApplicationsClientUpdateOptions contains the optional parameters for the ApplicationsClient.Update method. -func (client *ApplicationsClient) Update(ctx context.Context, applicationName string, applicationResource ApplicationResource, options *ApplicationsClientUpdateOptions) (ApplicationsClientUpdateResponse, error) { +func (client *ApplicationsClient) Update(ctx context.Context, applicationName string, properties ApplicationResourceUpdate, options *ApplicationsClientUpdateOptions) (ApplicationsClientUpdateResponse, error) { var err error - req, err := client.updateCreateRequest(ctx, applicationName, applicationResource, options) + req, err := client.updateCreateRequest(ctx, applicationName, properties, options) if err != nil { return ApplicationsClientUpdateResponse{}, err } @@ -267,7 +269,7 @@ func (client *ApplicationsClient) Update(ctx context.Context, applicationName st if err != nil { return ApplicationsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) return ApplicationsClientUpdateResponse{}, err } @@ -276,7 +278,7 @@ func (client *ApplicationsClient) Update(ctx context.Context, applicationName st } // updateCreateRequest creates the Update request. -func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, applicationName string, applicationResource ApplicationResource, options *ApplicationsClientUpdateOptions) (*policy.Request, error) { +func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, applicationName string, properties ApplicationResourceUpdate, options *ApplicationsClientUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/applications/{applicationName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if applicationName == "" { @@ -291,7 +293,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, appli reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, applicationResource); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_client_factory.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_client_factory.go index e5b97e5df2..c47bbe49a7 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_client_factory.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_client_factory.go @@ -22,7 +22,9 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { @@ -66,6 +68,11 @@ func (c *ClientFactory) NewHTTPRoutesClient() *HTTPRoutesClient { return subClient } +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewSecretStoresClient() *SecretStoresClient { subClient, _ := NewSecretStoresClient(c.rootScope, c.credential, c.options) return subClient diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go index fa36ac05ca..5ec139eee6 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go @@ -12,21 +12,56 @@ const ( moduleVersion = "v0.0.1" ) -// CertType - Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate -type CertType string +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string const ( - CertTypeCertificate CertType = "certificate" - CertTypePrivatekey CertType = "privatekey" - CertTypePublickey CertType = "publickey" + ActionTypeInternal ActionType = "Internal" ) -// PossibleCertTypeValues returns the possible values for the CertType const type. -func PossibleCertTypeValues() []CertType { - return []CertType{ - CertTypeCertificate, - CertTypePrivatekey, - CertTypePublickey, +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + +// CertificateFormats - Represents certificate formats +type CertificateFormats string + +const ( + // CertificateFormatsPem - PEM Certificate format + CertificateFormatsPem CertificateFormats = "pem" + // CertificateFormatsPfx - PFX Certificate format + CertificateFormatsPfx CertificateFormats = "pfx" +) + +// PossibleCertificateFormatsValues returns the possible values for the CertificateFormats const type. +func PossibleCertificateFormatsValues() []CertificateFormats { + return []CertificateFormats{ + CertificateFormatsPem, + CertificateFormatsPfx, + } +} + +// CertificateTypes - Represents certificate types +type CertificateTypes string + +const ( + // CertificateTypesCertificate - Certificate type + CertificateTypesCertificate CertificateTypes = "certificate" + // CertificateTypesPrivatekey - Private Key type + CertificateTypesPrivatekey CertificateTypes = "privatekey" + // CertificateTypesPublickey - Public Key type + CertificateTypesPublickey CertificateTypes = "publickey" +) + +// PossibleCertificateTypesValues returns the possible values for the CertificateTypes const type. +func PossibleCertificateTypesValues() []CertificateTypes { + return []CertificateTypes{ + CertificateTypesCertificate, + CertificateTypesPrivatekey, + CertificateTypesPublickey, } } @@ -50,45 +85,46 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// Encoding - Encoding format. Default utf-8 -type Encoding string +// DaprSidecarExtensionProtocol - The Dapr sidecar extension protocol +type DaprSidecarExtensionProtocol string const ( - EncodingBase64 Encoding = "base64" - EncodingHex Encoding = "hex" - EncodingUTF8 Encoding = "utf-8" + // DaprSidecarExtensionProtocolGrpc - gRPC protocol + DaprSidecarExtensionProtocolGrpc DaprSidecarExtensionProtocol = "grpc" + // DaprSidecarExtensionProtocolHTTP - HTTP protocol + DaprSidecarExtensionProtocolHTTP DaprSidecarExtensionProtocol = "http" ) -// PossibleEncodingValues returns the possible values for the Encoding const type. -func PossibleEncodingValues() []Encoding { - return []Encoding{ - EncodingBase64, - EncodingHex, - EncodingUTF8, +// PossibleDaprSidecarExtensionProtocolValues returns the possible values for the DaprSidecarExtensionProtocol const type. +func PossibleDaprSidecarExtensionProtocolValues() []DaprSidecarExtensionProtocol { + return []DaprSidecarExtensionProtocol{ + DaprSidecarExtensionProtocolGrpc, + DaprSidecarExtensionProtocolHTTP, } } -// Format - Certificate format. Default pem -type Format string +// IAMKind - The kind of IAM provider to configure +type IAMKind string const ( - FormatPem Format = "pem" - FormatPfx Format = "pfx" + // IAMKindAzure - Azure Active Directory + IAMKindAzure IAMKind = "azure" ) -// PossibleFormatValues returns the possible values for the Format const type. -func PossibleFormatValues() []Format { - return []Format{ - FormatPem, - FormatPfx, +// PossibleIAMKindValues returns the possible values for the IAMKind const type. +func PossibleIAMKindValues() []IAMKind { + return []IAMKind{ + IAMKindAzure, } } -// IdentitySettingKind - Configuration for supported external identity providers +// IdentitySettingKind - IdentitySettingKind is the kind of supported external identity setting type IdentitySettingKind string const ( + // IdentitySettingKindAzureComWorkload - azure ad workload identity IdentitySettingKindAzureComWorkload IdentitySettingKind = "azure.com.workload" + // IdentitySettingKindUndefined - undefined identity IdentitySettingKindUndefined IdentitySettingKind = "undefined" ) @@ -100,25 +136,13 @@ func PossibleIdentitySettingKindValues() []IdentitySettingKind { } } -// Kind - The kind of IAM provider to configure -type Kind string - -const ( - KindAzure Kind = "azure" -) - -// PossibleKindValues returns the possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{ - KindAzure, - } -} - -// ManagedStore - Backing store for the ephemeral volume +// ManagedStore - The managed store for the ephemeral volume type ManagedStore string const ( + // ManagedStoreDisk - Disk store ManagedStoreDisk ManagedStore = "disk" + // ManagedStoreMemory - Memory store ManagedStoreMemory ManagedStore = "memory" ) @@ -130,36 +154,60 @@ func PossibleManagedStoreValues() []ManagedStore { } } -// Protocol - Protocol in use by the port -type Protocol string +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string const ( - ProtocolGrpc Protocol = "grpc" - ProtocolHTTP Protocol = "http" - ProtocolTCP Protocol = "TCP" - ProtocolUDP Protocol = "UDP" + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" ) -// PossibleProtocolValues returns the possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ - ProtocolGrpc, - ProtocolHTTP, - ProtocolTCP, - ProtocolUDP, +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, } } -// ProvisioningState - Provisioning state of the resource at the time the operation was called. +// PortProtocol - The protocol in use by the port +type PortProtocol string + +const ( + // PortProtocolTCP - TCP protocol + PortProtocolTCP PortProtocol = "TCP" + // PortProtocolUDP - UDP protocol + PortProtocolUDP PortProtocol = "UDP" +) + +// PossiblePortProtocolValues returns the possible values for the PortProtocol const type. +func PossiblePortProtocolValues() []PortProtocol { + return []PortProtocol{ + PortProtocolTCP, + PortProtocolUDP, + } +} + +// ProvisioningState - Provisioning state of the portable resource at the time the operation was called type ProvisioningState string const ( + // ProvisioningStateAccepted - The resource create request has been accepted ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - The resource is being deleted ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - The resource is being provisioned ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded - Resource has been created. ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - The resource is updating ProvisioningStateUpdating ProvisioningState = "Updating" ) @@ -182,7 +230,9 @@ func PossibleProvisioningStateValues() []ProvisioningState { type ResourceProvisioning string const ( + // ResourceProvisioningManual - The resource lifecycle will be managed by the user ResourceProvisioningManual ResourceProvisioning = "manual" + // ResourceProvisioningRecipe - The resource lifecycle will be managed by Radius ResourceProvisioningRecipe ResourceProvisioning = "recipe" ) @@ -194,11 +244,13 @@ func PossibleResourceProvisioningValues() []ResourceProvisioning { } } -// SecretStoreDataType - The type of secret store data +// SecretStoreDataType - The type of SecretStore data type SecretStoreDataType string const ( + // SecretStoreDataTypeCertificate - Certificate secret data type SecretStoreDataTypeCertificate SecretStoreDataType = "certificate" + // SecretStoreDataTypeGeneric - Generic secret data type SecretStoreDataTypeGeneric SecretStoreDataType = "generic" ) @@ -210,11 +262,13 @@ func PossibleSecretStoreDataTypeValues() []SecretStoreDataType { } } -// SecretValueEncoding - The encoding of value +// SecretValueEncoding - The type of SecretValue Encoding type SecretValueEncoding string const ( + // SecretValueEncodingBase64 - The base64-encoded secret value SecretValueEncodingBase64 SecretValueEncoding = "base64" + // SecretValueEncodingRaw - The raw secret value SecretValueEncodingRaw SecretValueEncoding = "raw" ) @@ -226,27 +280,46 @@ func PossibleSecretValueEncodingValues() []SecretValueEncoding { } } -// TLSMinVersion - TLS minimum protocol version (defaults to 1.2). +// TLSMinVersion - Tls Minimum versions for Gateway resource. type TLSMinVersion string const ( - TLSMinVersionOne2 TLSMinVersion = "1.2" - TLSMinVersionOne3 TLSMinVersion = "1.3" + // TLSMinVersionTls12 - TLS Version 1.2 + TLSMinVersionTls12 TLSMinVersion = "1.2" + // TLSMinVersionTls13 - TLS Version 1.3 + TLSMinVersionTls13 TLSMinVersion = "1.3" ) // PossibleTLSMinVersionValues returns the possible values for the TLSMinVersion const type. func PossibleTLSMinVersionValues() []TLSMinVersion { return []TLSMinVersion{ - TLSMinVersionOne2, - TLSMinVersionOne3, + TLSMinVersionTls12, + TLSMinVersionTls13, } } -// VolumePermission - Container read/write access to the volume +// Versions - Supported API versions for the Applications.Core resource provider. +type Versions string + +const ( + // VersionsV20220315Privatepreview - 2022-03-15-privatepreview + VersionsV20220315Privatepreview Versions = "2022-03-15-privatepreview" +) + +// PossibleVersionsValues returns the possible values for the Versions const type. +func PossibleVersionsValues() []Versions { + return []Versions{ + VersionsV20220315Privatepreview, + } +} + +// VolumePermission - The persistent volume permission type VolumePermission string const ( + // VolumePermissionRead - Read only VolumePermissionRead VolumePermission = "read" + // VolumePermissionWrite - Read and write VolumePermissionWrite VolumePermission = "write" ) @@ -258,3 +331,24 @@ func PossibleVolumePermissionValues() []VolumePermission { } } +// VolumeSecretEncodings - Represents secret encodings +type VolumeSecretEncodings string + +const ( + // VolumeSecretEncodingsBase64 - Base64 encoding + VolumeSecretEncodingsBase64 VolumeSecretEncodings = "base64" + // VolumeSecretEncodingsHex - Hex encoding + VolumeSecretEncodingsHex VolumeSecretEncodings = "hex" + // VolumeSecretEncodingsUTF8 - UTF-8 encoding + VolumeSecretEncodingsUTF8 VolumeSecretEncodings = "utf-8" +) + +// PossibleVolumeSecretEncodingsValues returns the possible values for the VolumeSecretEncodings const type. +func PossibleVolumeSecretEncodingsValues() []VolumeSecretEncodings { + return []VolumeSecretEncodings{ + VolumeSecretEncodingsBase64, + VolumeSecretEncodingsHex, + VolumeSecretEncodingsUTF8, + } +} + diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_containers_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_containers_client.go index b2139fc21a..48d784f8a9 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_containers_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_containers_client.go @@ -27,7 +27,9 @@ type ContainersClient struct { } // NewContainersClient creates a new instance of ContainersClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainersClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainersClient, error) { @@ -42,34 +44,52 @@ func NewContainersClient(rootScope string, credential azcore.TokenCredential, op return client, nil } -// CreateOrUpdate - Create or update a Container. +// BeginCreateOrUpdate - Create a ContainerResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - containerName - The name of the conatiner. -// - containerResource - containers details -// - options - ContainersClientCreateOrUpdateOptions contains the optional parameters for the ContainersClient.CreateOrUpdate +// - containerName - Container name +// - resource - Resource create parameters. +// - options - ContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainersClient.BeginCreateOrUpdate // method. -func (client *ContainersClient) CreateOrUpdate(ctx context.Context, containerName string, containerResource ContainerResource, options *ContainersClientCreateOrUpdateOptions) (ContainersClientCreateOrUpdateResponse, error) { +func (client *ContainersClient) BeginCreateOrUpdate(ctx context.Context, containerName string, resource ContainerResource, options *ContainersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, containerName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ContainersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a ContainerResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *ContainersClient) createOrUpdate(ctx context.Context, containerName string, resource ContainerResource, options *ContainersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, containerName, containerResource, options) + req, err := client.createOrUpdateCreateRequest(ctx, containerName, resource, options) if err != nil { - return ContainersClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return ContainersClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return ContainersClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContainersClient) createOrUpdateCreateRequest(ctx context.Context, containerName string, containerResource ContainerResource, options *ContainersClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContainersClient) createOrUpdateCreateRequest(ctx context.Context, containerName string, resource ContainerResource, options *ContainersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/containers/{containerName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if containerName == "" { @@ -84,46 +104,56 @@ func (client *ContainersClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, containerResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ContainersClient) createOrUpdateHandleResponse(resp *http.Response) (ContainersClientCreateOrUpdateResponse, error) { - result := ContainersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ContainerResource); err != nil { - return ContainersClientCreateOrUpdateResponse{}, err +// BeginDelete - Delete a ContainerResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - containerName - Container name +// - options - ContainersClientBeginDeleteOptions contains the optional parameters for the ContainersClient.BeginDelete method. +func (client *ContainersClient) BeginDelete(ctx context.Context, containerName string, options *ContainersClientBeginDeleteOptions) (*runtime.Poller[ContainersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, containerName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ContainersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Delete a Container. +// Delete - Delete a ContainerResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - containerName - The name of the conatiner. -// - options - ContainersClientDeleteOptions contains the optional parameters for the ContainersClient.Delete method. -func (client *ContainersClient) Delete(ctx context.Context, containerName string, options *ContainersClientDeleteOptions) (ContainersClientDeleteResponse, error) { +func (client *ContainersClient) deleteOperation(ctx context.Context, containerName string, options *ContainersClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, containerName, options) if err != nil { - return ContainersClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return ContainersClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return ContainersClientDeleteResponse{}, err + return nil, err } - return ContainersClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *ContainersClient) deleteCreateRequest(ctx context.Context, containerName string, options *ContainersClientDeleteOptions) (*policy.Request, error) { +func (client *ContainersClient) deleteCreateRequest(ctx context.Context, containerName string, options *ContainersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/containers/{containerName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if containerName == "" { @@ -141,11 +171,11 @@ func (client *ContainersClient) deleteCreateRequest(ctx context.Context, contain return req, nil } -// Get - Gets the properties of an Container. +// Get - Get a ContainerResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - containerName - The name of the conatiner. +// - containerName - Container name // - options - ContainersClientGetOptions contains the optional parameters for the ContainersClient.Get method. func (client *ContainersClient) Get(ctx context.Context, containerName string, options *ContainersClientGetOptions) (ContainersClientGetResponse, error) { var err error @@ -193,7 +223,7 @@ func (client *ContainersClient) getHandleResponse(resp *http.Response) (Containe return result, nil } -// NewListByScopePager - List all containers in the given scope. +// NewListByScopePager - List ContainerResource resources by Scope // // Generated from API version 2022-03-15-privatepreview // - options - ContainersClientListByScopeOptions contains the optional parameters for the ContainersClient.NewListByScopePager @@ -244,39 +274,57 @@ func (client *ContainersClient) listByScopeCreateRequest(ctx context.Context, op // listByScopeHandleResponse handles the ListByScope response. func (client *ContainersClient) listByScopeHandleResponse(resp *http.Response) (ContainersClientListByScopeResponse, error) { result := ContainersClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ContainerResourceList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerResourceListResult); err != nil { return ContainersClientListByScopeResponse{}, err } return result, nil } -// Update - Update the properties of an existing Container. +// BeginUpdate - Update a ContainerResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - containerName - The name of the conatiner. -// - containersResource - Container details -// - options - ContainersClientUpdateOptions contains the optional parameters for the ContainersClient.Update method. -func (client *ContainersClient) Update(ctx context.Context, containerName string, containersResource ContainerResource, options *ContainersClientUpdateOptions) (ContainersClientUpdateResponse, error) { +// - containerName - Container name +// - properties - The resource properties to be updated. +// - options - ContainersClientBeginUpdateOptions contains the optional parameters for the ContainersClient.BeginUpdate method. +func (client *ContainersClient) BeginUpdate(ctx context.Context, containerName string, properties ContainerResourceUpdate, options *ContainersClientBeginUpdateOptions) (*runtime.Poller[ContainersClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, containerName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainersClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ContainersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update a ContainerResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *ContainersClient) update(ctx context.Context, containerName string, properties ContainerResourceUpdate, options *ContainersClientBeginUpdateOptions) (*http.Response, error) { var err error - req, err := client.updateCreateRequest(ctx, containerName, containersResource, options) + req, err := client.updateCreateRequest(ctx, containerName, properties, options) if err != nil { - return ContainersClientUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return ContainersClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return ContainersClientUpdateResponse{}, err + return nil, err } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // updateCreateRequest creates the Update request. -func (client *ContainersClient) updateCreateRequest(ctx context.Context, containerName string, containersResource ContainerResource, options *ContainersClientUpdateOptions) (*policy.Request, error) { +func (client *ContainersClient) updateCreateRequest(ctx context.Context, containerName string, properties ContainerResourceUpdate, options *ContainersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/containers/{containerName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if containerName == "" { @@ -291,18 +339,9 @@ func (client *ContainersClient) updateCreateRequest(ctx context.Context, contain reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, containersResource); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil } -// updateHandleResponse handles the Update response. -func (client *ContainersClient) updateHandleResponse(resp *http.Response) (ContainersClientUpdateResponse, error) { - result := ContainersClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ContainerResource); err != nil { - return ContainersClientUpdateResponse{}, err - } - return result, nil -} - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_environments_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_environments_client.go index 78fae339a9..e04f55a18c 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_environments_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_environments_client.go @@ -27,7 +27,9 @@ type EnvironmentsClient struct { } // NewEnvironmentsClient creates a new instance of EnvironmentsClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewEnvironmentsClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentsClient, error) { @@ -42,17 +44,17 @@ func NewEnvironmentsClient(rootScope string, credential azcore.TokenCredential, return client, nil } -// CreateOrUpdate - Create or update an Environment. +// CreateOrUpdate - Create a EnvironmentResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - environmentName - The name of the environment -// - environmentResource - environment details +// - environmentName - environment name +// - resource - Resource create parameters. // - options - EnvironmentsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.CreateOrUpdate // method. -func (client *EnvironmentsClient) CreateOrUpdate(ctx context.Context, environmentName string, environmentResource EnvironmentResource, options *EnvironmentsClientCreateOrUpdateOptions) (EnvironmentsClientCreateOrUpdateResponse, error) { +func (client *EnvironmentsClient) CreateOrUpdate(ctx context.Context, environmentName string, resource EnvironmentResource, options *EnvironmentsClientCreateOrUpdateOptions) (EnvironmentsClientCreateOrUpdateResponse, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, environmentName, environmentResource, options) + req, err := client.createOrUpdateCreateRequest(ctx, environmentName, resource, options) if err != nil { return EnvironmentsClientCreateOrUpdateResponse{}, err } @@ -69,7 +71,7 @@ func (client *EnvironmentsClient) CreateOrUpdate(ctx context.Context, environmen } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *EnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, environmentName string, environmentResource EnvironmentResource, options *EnvironmentsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *EnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, environmentName string, resource EnvironmentResource, options *EnvironmentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/environments/{environmentName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if environmentName == "" { @@ -84,7 +86,7 @@ func (client *EnvironmentsClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, environmentResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil @@ -99,11 +101,11 @@ func (client *EnvironmentsClient) createOrUpdateHandleResponse(resp *http.Respon return result, nil } -// Delete - Delete an Environment. +// Delete - Delete a EnvironmentResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - environmentName - The name of the environment +// - environmentName - environment name // - options - EnvironmentsClientDeleteOptions contains the optional parameters for the EnvironmentsClient.Delete method. func (client *EnvironmentsClient) Delete(ctx context.Context, environmentName string, options *EnvironmentsClientDeleteOptions) (EnvironmentsClientDeleteResponse, error) { var err error @@ -115,7 +117,7 @@ func (client *EnvironmentsClient) Delete(ctx context.Context, environmentName st if err != nil { return EnvironmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return EnvironmentsClientDeleteResponse{}, err } @@ -141,11 +143,11 @@ func (client *EnvironmentsClient) deleteCreateRequest(ctx context.Context, envir return req, nil } -// Get - Gets the properties of an Environment. +// Get - Get a EnvironmentResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - environmentName - The name of the environment +// - environmentName - environment name // - options - EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method. func (client *EnvironmentsClient) Get(ctx context.Context, environmentName string, options *EnvironmentsClientGetOptions) (EnvironmentsClientGetResponse, error) { var err error @@ -193,35 +195,35 @@ func (client *EnvironmentsClient) getHandleResponse(resp *http.Response) (Enviro return result, nil } -// GetRecipeMetadata - Gets recipe metadata including parameters and any constraints on the parameters. +// GetMetadata - Gets recipe metadata including parameters and any constraints on the parameters. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - environmentName - The name of the environment -// - recipeParameter - Recipe parameters. -// - options - EnvironmentsClientGetRecipeMetadataOptions contains the optional parameters for the EnvironmentsClient.GetRecipeMetadata +// - environmentName - environment name +// - body - The content of the action request +// - options - EnvironmentsClientGetMetadataOptions contains the optional parameters for the EnvironmentsClient.GetMetadata // method. -func (client *EnvironmentsClient) GetRecipeMetadata(ctx context.Context, environmentName string, recipeParameter Recipe, options *EnvironmentsClientGetRecipeMetadataOptions) (EnvironmentsClientGetRecipeMetadataResponse, error) { +func (client *EnvironmentsClient) GetMetadata(ctx context.Context, environmentName string, body RecipeGetMetadata, options *EnvironmentsClientGetMetadataOptions) (EnvironmentsClientGetMetadataResponse, error) { var err error - req, err := client.getRecipeMetadataCreateRequest(ctx, environmentName, recipeParameter, options) + req, err := client.getMetadataCreateRequest(ctx, environmentName, body, options) if err != nil { - return EnvironmentsClientGetRecipeMetadataResponse{}, err + return EnvironmentsClientGetMetadataResponse{}, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return EnvironmentsClientGetRecipeMetadataResponse{}, err + return EnvironmentsClientGetMetadataResponse{}, err } if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) - return EnvironmentsClientGetRecipeMetadataResponse{}, err + return EnvironmentsClientGetMetadataResponse{}, err } - resp, err := client.getRecipeMetadataHandleResponse(httpResp) + resp, err := client.getMetadataHandleResponse(httpResp) return resp, err } -// getRecipeMetadataCreateRequest creates the GetRecipeMetadata request. -func (client *EnvironmentsClient) getRecipeMetadataCreateRequest(ctx context.Context, environmentName string, recipeParameter Recipe, options *EnvironmentsClientGetRecipeMetadataOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/environments/{environmentName}/getmetadata" +// getMetadataCreateRequest creates the GetMetadata request. +func (client *EnvironmentsClient) getMetadataCreateRequest(ctx context.Context, environmentName string, body RecipeGetMetadata, options *EnvironmentsClientGetMetadataOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Core/environments/{environmentName}/getMetadata" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if environmentName == "" { return nil, errors.New("parameter environmentName cannot be empty") @@ -235,22 +237,22 @@ func (client *EnvironmentsClient) getRecipeMetadataCreateRequest(ctx context.Con reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, recipeParameter); err != nil { + if err := runtime.MarshalAsJSON(req, body); err != nil { return nil, err } return req, nil } -// getRecipeMetadataHandleResponse handles the GetRecipeMetadata response. -func (client *EnvironmentsClient) getRecipeMetadataHandleResponse(resp *http.Response) (EnvironmentsClientGetRecipeMetadataResponse, error) { - result := EnvironmentsClientGetRecipeMetadataResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RecipeMetadataProperties); err != nil { - return EnvironmentsClientGetRecipeMetadataResponse{}, err +// getMetadataHandleResponse handles the GetMetadata response. +func (client *EnvironmentsClient) getMetadataHandleResponse(resp *http.Response) (EnvironmentsClientGetMetadataResponse, error) { + result := EnvironmentsClientGetMetadataResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RecipeGetMetadataResponse); err != nil { + return EnvironmentsClientGetMetadataResponse{}, err } return result, nil } -// NewListByScopePager - List all environments in a scope. +// NewListByScopePager - List EnvironmentResource resources by Scope // // Generated from API version 2022-03-15-privatepreview // - options - EnvironmentsClientListByScopeOptions contains the optional parameters for the EnvironmentsClient.NewListByScopePager @@ -301,22 +303,22 @@ func (client *EnvironmentsClient) listByScopeCreateRequest(ctx context.Context, // listByScopeHandleResponse handles the ListByScope response. func (client *EnvironmentsClient) listByScopeHandleResponse(resp *http.Response) (EnvironmentsClientListByScopeResponse, error) { result := EnvironmentsClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentResourceList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.EnvironmentResourceListResult); err != nil { return EnvironmentsClientListByScopeResponse{}, err } return result, nil } -// Update - Update the properties of an existing Environment. +// Update - Update a EnvironmentResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - environmentName - The name of the environment -// - environmentResource - environment details +// - environmentName - environment name +// - properties - The resource properties to be updated. // - options - EnvironmentsClientUpdateOptions contains the optional parameters for the EnvironmentsClient.Update method. -func (client *EnvironmentsClient) Update(ctx context.Context, environmentName string, environmentResource EnvironmentResource, options *EnvironmentsClientUpdateOptions) (EnvironmentsClientUpdateResponse, error) { +func (client *EnvironmentsClient) Update(ctx context.Context, environmentName string, properties EnvironmentResourceUpdate, options *EnvironmentsClientUpdateOptions) (EnvironmentsClientUpdateResponse, error) { var err error - req, err := client.updateCreateRequest(ctx, environmentName, environmentResource, options) + req, err := client.updateCreateRequest(ctx, environmentName, properties, options) if err != nil { return EnvironmentsClientUpdateResponse{}, err } @@ -324,7 +326,7 @@ func (client *EnvironmentsClient) Update(ctx context.Context, environmentName st if err != nil { return EnvironmentsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(httpResp, http.StatusOK) { err = runtime.NewResponseError(httpResp) return EnvironmentsClientUpdateResponse{}, err } @@ -333,7 +335,7 @@ func (client *EnvironmentsClient) Update(ctx context.Context, environmentName st } // updateCreateRequest creates the Update request. -func (client *EnvironmentsClient) updateCreateRequest(ctx context.Context, environmentName string, environmentResource EnvironmentResource, options *EnvironmentsClientUpdateOptions) (*policy.Request, error) { +func (client *EnvironmentsClient) updateCreateRequest(ctx context.Context, environmentName string, properties EnvironmentResourceUpdate, options *EnvironmentsClientUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/environments/{environmentName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if environmentName == "" { @@ -348,7 +350,7 @@ func (client *EnvironmentsClient) updateCreateRequest(ctx context.Context, envir reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, environmentResource); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go index 208b89749e..d0fadd17a1 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go @@ -27,7 +27,9 @@ type ExtendersClient struct { } // NewExtendersClient creates a new instance of ExtendersClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewExtendersClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtendersClient, error) { @@ -42,34 +44,52 @@ func NewExtendersClient(rootScope string, credential azcore.TokenCredential, opt return client, nil } -// CreateOrUpdate - Creates or updates a Extender portable resource. +// BeginCreateOrUpdate - Create a ExtenderResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender portable resource. -// - extenderParameters - Extender create parameters. -// - options - ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate +// - extenderName - The name of the ExtenderResource link resource +// - resource - Resource create parameters. +// - options - ExtendersClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.BeginCreateOrUpdate // method. -func (client *ExtendersClient) CreateOrUpdate(ctx context.Context, extenderName string, extenderParameters ExtenderResource, options *ExtendersClientCreateOrUpdateOptions) (ExtendersClientCreateOrUpdateResponse, error) { +func (client *ExtendersClient) BeginCreateOrUpdate(ctx context.Context, extenderName string, resource ExtenderResource, options *ExtendersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExtendersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, extenderName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtendersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ExtendersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a ExtenderResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *ExtendersClient) createOrUpdate(ctx context.Context, extenderName string, resource ExtenderResource, options *ExtendersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, extenderName, extenderParameters, options) + req, err := client.createOrUpdateCreateRequest(ctx, extenderName, resource, options) if err != nil { - return ExtendersClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return ExtendersClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return ExtendersClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, extenderName string, extenderParameters ExtenderResource, options *ExtendersClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, extenderName string, resource ExtenderResource, options *ExtendersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/extenders/{extenderName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if extenderName == "" { @@ -84,46 +104,56 @@ func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extenderParameters); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ExtendersClient) createOrUpdateHandleResponse(resp *http.Response) (ExtendersClientCreateOrUpdateResponse, error) { - result := ExtendersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderResource); err != nil { - return ExtendersClientCreateOrUpdateResponse{}, err +// BeginDelete - Delete a ExtenderResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - extenderName - The name of the ExtenderResource link resource +// - options - ExtendersClientBeginDeleteOptions contains the optional parameters for the ExtendersClient.BeginDelete method. +func (client *ExtendersClient) BeginDelete(ctx context.Context, extenderName string, options *ExtendersClientBeginDeleteOptions) (*runtime.Poller[ExtendersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, extenderName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtendersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ExtendersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Deletes an existing Extender portable resource. +// Delete - Delete a ExtenderResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender portable resource. -// - options - ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. -func (client *ExtendersClient) Delete(ctx context.Context, extenderName string, options *ExtendersClientDeleteOptions) (ExtendersClientDeleteResponse, error) { +func (client *ExtendersClient) deleteOperation(ctx context.Context, extenderName string, options *ExtendersClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, extenderName, options) if err != nil { - return ExtendersClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return ExtendersClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return ExtendersClientDeleteResponse{}, err + return nil, err } - return ExtendersClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extenderName string, options *ExtendersClientDeleteOptions) (*policy.Request, error) { +func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extenderName string, options *ExtendersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/extenders/{extenderName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if extenderName == "" { @@ -141,11 +171,11 @@ func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extender return req, nil } -// Get - Retrieves information about a Extender portable resource. +// Get - Get a ExtenderResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender portable resource. +// - extenderName - The name of the ExtenderResource link resource // - options - ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. func (client *ExtendersClient) Get(ctx context.Context, extenderName string, options *ExtendersClientGetOptions) (ExtendersClientGetResponse, error) { var err error @@ -193,41 +223,41 @@ func (client *ExtendersClient) getHandleResponse(resp *http.Response) (Extenders return result, nil } -// NewListByRootScopePager - Lists information about all Extender portable resources in the given root scope. +// NewListByScopePager - List ExtenderResource resources by Scope // // Generated from API version 2022-03-15-privatepreview -// - options - ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.NewListByRootScopePager +// - options - ExtendersClientListByScopeOptions contains the optional parameters for the ExtendersClient.NewListByScopePager // method. -func (client *ExtendersClient) NewListByRootScopePager(options *ExtendersClientListByRootScopeOptions) (*runtime.Pager[ExtendersClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[ExtendersClientListByRootScopeResponse]{ - More: func(page ExtendersClientListByRootScopeResponse) bool { +func (client *ExtendersClient) NewListByScopePager(options *ExtendersClientListByScopeOptions) (*runtime.Pager[ExtendersClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[ExtendersClientListByScopeResponse]{ + More: func(page ExtendersClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ExtendersClientListByRootScopeResponse) (ExtendersClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *ExtendersClientListByScopeResponse) (ExtendersClientListByScopeResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) + req, err = client.listByScopeCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return ExtendersClientListByRootScopeResponse{}, err + return ExtendersClientListByScopeResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return ExtendersClientListByRootScopeResponse{}, err + return ExtendersClientListByScopeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtendersClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return ExtendersClientListByScopeResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listByScopeHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *ExtendersClient) listByRootScopeCreateRequest(ctx context.Context, options *ExtendersClientListByRootScopeOptions) (*policy.Request, error) { +// listByScopeCreateRequest creates the ListByScope request. +func (client *ExtendersClient) listByScopeCreateRequest(ctx context.Context, options *ExtendersClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/extenders" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -241,24 +271,25 @@ func (client *ExtendersClient) listByRootScopeCreateRequest(ctx context.Context, return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *ExtendersClient) listByRootScopeHandleResponse(resp *http.Response) (ExtendersClientListByRootScopeResponse, error) { - result := ExtendersClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderList); err != nil { - return ExtendersClientListByRootScopeResponse{}, err +// listByScopeHandleResponse handles the ListByScope response. +func (client *ExtendersClient) listByScopeHandleResponse(resp *http.Response) (ExtendersClientListByScopeResponse, error) { + result := ExtendersClientListByScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderResourceListResult); err != nil { + return ExtendersClientListByScopeResponse{}, err } return result, nil } -// ListSecrets - Lists secrets values for the specified Extender portable resource. +// ListSecrets - Lists secrets values for the specified Extender resource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender portable resource. +// - extenderName - The name of the ExtenderResource link resource +// - body - The content of the action request // - options - ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. -func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName string, options *ExtendersClientListSecretsOptions) (ExtendersClientListSecretsResponse, error) { +func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName string, body map[string]any, options *ExtendersClientListSecretsOptions) (ExtendersClientListSecretsResponse, error) { var err error - req, err := client.listSecretsCreateRequest(ctx, extenderName, options) + req, err := client.listSecretsCreateRequest(ctx, extenderName, body, options) if err != nil { return ExtendersClientListSecretsResponse{}, err } @@ -275,7 +306,7 @@ func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName str } // listSecretsCreateRequest creates the ListSecrets request. -func (client *ExtendersClient) listSecretsCreateRequest(ctx context.Context, extenderName string, options *ExtendersClientListSecretsOptions) (*policy.Request, error) { +func (client *ExtendersClient) listSecretsCreateRequest(ctx context.Context, extenderName string, body map[string]any, options *ExtendersClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/extenders/{extenderName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if extenderName == "" { @@ -290,15 +321,83 @@ func (client *ExtendersClient) listSecretsCreateRequest(ctx context.Context, ext reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err +} 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.Value); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.Object); err != nil { return ExtendersClientListSecretsResponse{}, err } return result, nil } +// BeginUpdate - Update a ExtenderResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - extenderName - The name of the ExtenderResource link resource +// - properties - The resource properties to be updated. +// - options - ExtendersClientBeginUpdateOptions contains the optional parameters for the ExtendersClient.BeginUpdate method. +func (client *ExtendersClient) BeginUpdate(ctx context.Context, extenderName string, properties ExtenderResourceUpdate, options *ExtendersClientBeginUpdateOptions) (*runtime.Poller[ExtendersClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, extenderName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtendersClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ExtendersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update a ExtenderResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *ExtendersClient) update(ctx context.Context, extenderName string, properties ExtenderResourceUpdate, options *ExtendersClientBeginUpdateOptions) (*http.Response, error) { + var err error + req, err := client.updateCreateRequest(ctx, extenderName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *ExtendersClient) updateCreateRequest(ctx context.Context, extenderName string, properties ExtenderResourceUpdate, options *ExtendersClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Core/extenders/{extenderName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if extenderName == "" { + return nil, errors.New("parameter extenderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil +} + diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_gateways_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_gateways_client.go index 16c62a59ff..07f36a6364 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_gateways_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_gateways_client.go @@ -27,7 +27,9 @@ type GatewaysClient struct { } // NewGatewaysClient creates a new instance of GatewaysClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGatewaysClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewaysClient, error) { @@ -42,33 +44,51 @@ func NewGatewaysClient(rootScope string, credential azcore.TokenCredential, opti return client, nil } -// CreateOrUpdate - Create or update a Gateway. +// BeginCreate - Create a GatewayResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - gatewayName - The name of the Gateway. -// - gatewayResource - Gateway details -// - options - GatewaysClientCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.CreateOrUpdate method. -func (client *GatewaysClient) CreateOrUpdate(ctx context.Context, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientCreateOrUpdateOptions) (GatewaysClientCreateOrUpdateResponse, error) { +// - gatewayName - Gateway name +// - resource - Resource create parameters. +// - options - GatewaysClientBeginCreateOptions contains the optional parameters for the GatewaysClient.BeginCreate method. +func (client *GatewaysClient) BeginCreate(ctx context.Context, gatewayName string, resource GatewayResource, options *GatewaysClientBeginCreateOptions) (*runtime.Poller[GatewaysClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, gatewayName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientCreateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Create - Create a GatewayResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *GatewaysClient) create(ctx context.Context, gatewayName string, resource GatewayResource, options *GatewaysClientBeginCreateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, gatewayName, gatewayResource, options) + req, err := client.createCreateRequest(ctx, gatewayName, resource, options) if err != nil { - return GatewaysClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return GatewaysClientCreateOrUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return GatewaysClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientCreateOrUpdateOptions) (*policy.Request, error) { +// createCreateRequest creates the Create request. +func (client *GatewaysClient) createCreateRequest(ctx context.Context, gatewayName string, resource GatewayResource, options *GatewaysClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if gatewayName == "" { @@ -83,46 +103,122 @@ func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, g reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, gatewayResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *GatewaysClient) createOrUpdateHandleResponse(resp *http.Response) (GatewaysClientCreateOrUpdateResponse, error) { - result := GatewaysClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResource); err != nil { - return GatewaysClientCreateOrUpdateResponse{}, err +// BeginCreateOrUpdate - Update a GatewayResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - gatewayName - Gateway name +// - properties - The resource properties to be updated. +// - options - GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate +// method. +func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, gatewayName string, properties GatewayResourceUpdate, options *GatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, gatewayName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Delete a Gateway. +// CreateOrUpdate - Update a GatewayResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *GatewaysClient) createOrUpdate(ctx context.Context, gatewayName string, properties GatewayResourceUpdate, options *GatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, gatewayName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, gatewayName string, properties GatewayResourceUpdate, options *GatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil +} + +// BeginDelete - Delete a GatewayResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - gatewayName - The name of the Gateway. -// - options - GatewaysClientDeleteOptions contains the optional parameters for the GatewaysClient.Delete method. -func (client *GatewaysClient) Delete(ctx context.Context, gatewayName string, options *GatewaysClientDeleteOptions) (GatewaysClientDeleteResponse, error) { +// - gatewayName - Gateway name +// - options - GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +func (client *GatewaysClient) BeginDelete(ctx context.Context, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*runtime.Poller[GatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, gatewayName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a GatewayResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *GatewaysClient) deleteOperation(ctx context.Context, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, gatewayName, options) if err != nil { - return GatewaysClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return GatewaysClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return GatewaysClientDeleteResponse{}, err + return nil, err } - return GatewaysClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, gatewayName string, options *GatewaysClientDeleteOptions) (*policy.Request, error) { +func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if gatewayName == "" { @@ -140,11 +236,11 @@ func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, gatewayNa return req, nil } -// Get - Gets the properties of a Gateway. +// Get - Get a GatewayResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - gatewayName - The name of the Gateway. +// - gatewayName - Gateway name // - options - GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. func (client *GatewaysClient) Get(ctx context.Context, gatewayName string, options *GatewaysClientGetOptions) (GatewaysClientGetResponse, error) { var err error @@ -192,7 +288,7 @@ func (client *GatewaysClient) getHandleResponse(resp *http.Response) (GatewaysCl return result, nil } -// NewListByScopePager - List all Gateways in the given scope. +// NewListByScopePager - List GatewayResource resources by Scope // // Generated from API version 2022-03-15-privatepreview // - options - GatewaysClientListByScopeOptions contains the optional parameters for the GatewaysClient.NewListByScopePager @@ -243,65 +339,9 @@ func (client *GatewaysClient) listByScopeCreateRequest(ctx context.Context, opti // listByScopeHandleResponse handles the ListByScope response. func (client *GatewaysClient) listByScopeHandleResponse(resp *http.Response) (GatewaysClientListByScopeResponse, error) { result := GatewaysClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResourceList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResourceListResult); err != nil { return GatewaysClientListByScopeResponse{}, err } return result, nil } -// Update - Update the properties of an existing Gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - gatewayName - The name of the Gateway. -// - gatewayResource - Gateway details -// - options - GatewaysClientUpdateOptions contains the optional parameters for the GatewaysClient.Update method. -func (client *GatewaysClient) Update(ctx context.Context, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientUpdateOptions) (GatewaysClientUpdateResponse, error) { - var err error - req, err := client.updateCreateRequest(ctx, gatewayName, gatewayResource, options) - if err != nil { - return GatewaysClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GatewaysClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return GatewaysClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *GatewaysClient) updateCreateRequest(ctx context.Context, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if gatewayName == "" { - return nil, errors.New("parameter gatewayName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, gatewayResource); err != nil { - return nil, err -} - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *GatewaysClient) updateHandleResponse(resp *http.Response) (GatewaysClientUpdateResponse, error) { - result := GatewaysClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResource); err != nil { - return GatewaysClientUpdateResponse{}, err - } - return result, nil -} - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_httproutes_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_httproutes_client.go index 900ad9daf9..490655e8d3 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_httproutes_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_httproutes_client.go @@ -27,7 +27,9 @@ type HTTPRoutesClient struct { } // NewHTTPRoutesClient creates a new instance of HTTPRoutesClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewHTTPRoutesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HTTPRoutesClient, error) { @@ -42,34 +44,52 @@ func NewHTTPRoutesClient(rootScope string, credential azcore.TokenCredential, op return client, nil } -// CreateOrUpdate - Create or update an HTTP Route. +// BeginCreateOrUpdate - Create a HttpRouteResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - httpRouteName - The name of the HTTP Route. -// - httpRouteResource - HTTP Route details -// - options - HTTPRoutesClientCreateOrUpdateOptions contains the optional parameters for the HTTPRoutesClient.CreateOrUpdate +// - httpRouteName - HTTPRoute name +// - resource - Resource create parameters. +// - options - HTTPRoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginCreateOrUpdate // method. -func (client *HTTPRoutesClient) CreateOrUpdate(ctx context.Context, httpRouteName string, httpRouteResource HTTPRouteResource, options *HTTPRoutesClientCreateOrUpdateOptions) (HTTPRoutesClientCreateOrUpdateResponse, error) { +func (client *HTTPRoutesClient) BeginCreateOrUpdate(ctx context.Context, httpRouteName string, resource HTTPRouteResource, options *HTTPRoutesClientBeginCreateOrUpdateOptions) (*runtime.Poller[HTTPRoutesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, httpRouteName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HTTPRoutesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[HTTPRoutesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a HttpRouteResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *HTTPRoutesClient) createOrUpdate(ctx context.Context, httpRouteName string, resource HTTPRouteResource, options *HTTPRoutesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, httpRouteName, httpRouteResource, options) + req, err := client.createOrUpdateCreateRequest(ctx, httpRouteName, resource, options) if err != nil { - return HTTPRoutesClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return HTTPRoutesClientCreateOrUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return HTTPRoutesClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *HTTPRoutesClient) createOrUpdateCreateRequest(ctx context.Context, httpRouteName string, httpRouteResource HTTPRouteResource, options *HTTPRoutesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *HTTPRoutesClient) createOrUpdateCreateRequest(ctx context.Context, httpRouteName string, resource HTTPRouteResource, options *HTTPRoutesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if httpRouteName == "" { @@ -84,46 +104,56 @@ func (client *HTTPRoutesClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, httpRouteResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *HTTPRoutesClient) createOrUpdateHandleResponse(resp *http.Response) (HTTPRoutesClientCreateOrUpdateResponse, error) { - result := HTTPRoutesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HTTPRouteResource); err != nil { - return HTTPRoutesClientCreateOrUpdateResponse{}, err +// BeginDelete - Delete a HttpRouteResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - httpRouteName - HTTPRoute name +// - options - HTTPRoutesClientBeginDeleteOptions contains the optional parameters for the HTTPRoutesClient.BeginDelete method. +func (client *HTTPRoutesClient) BeginDelete(ctx context.Context, httpRouteName string, options *HTTPRoutesClientBeginDeleteOptions) (*runtime.Poller[HTTPRoutesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, httpRouteName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HTTPRoutesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[HTTPRoutesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Delete an HTTP Route. +// Delete - Delete a HttpRouteResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - httpRouteName - The name of the HTTP Route. -// - options - HTTPRoutesClientDeleteOptions contains the optional parameters for the HTTPRoutesClient.Delete method. -func (client *HTTPRoutesClient) Delete(ctx context.Context, httpRouteName string, options *HTTPRoutesClientDeleteOptions) (HTTPRoutesClientDeleteResponse, error) { +func (client *HTTPRoutesClient) deleteOperation(ctx context.Context, httpRouteName string, options *HTTPRoutesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, httpRouteName, options) if err != nil { - return HTTPRoutesClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return HTTPRoutesClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return HTTPRoutesClientDeleteResponse{}, err + return nil, err } - return HTTPRoutesClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *HTTPRoutesClient) deleteCreateRequest(ctx context.Context, httpRouteName string, options *HTTPRoutesClientDeleteOptions) (*policy.Request, error) { +func (client *HTTPRoutesClient) deleteCreateRequest(ctx context.Context, httpRouteName string, options *HTTPRoutesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if httpRouteName == "" { @@ -141,11 +171,11 @@ func (client *HTTPRoutesClient) deleteCreateRequest(ctx context.Context, httpRou return req, nil } -// Get - Gets the properties of an HTTP Route. +// Get - Get a HttpRouteResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - httpRouteName - The name of the HTTP Route. +// - httpRouteName - HTTPRoute name // - options - HTTPRoutesClientGetOptions contains the optional parameters for the HTTPRoutesClient.Get method. func (client *HTTPRoutesClient) Get(ctx context.Context, httpRouteName string, options *HTTPRoutesClientGetOptions) (HTTPRoutesClientGetResponse, error) { var err error @@ -193,7 +223,7 @@ func (client *HTTPRoutesClient) getHandleResponse(resp *http.Response) (HTTPRout return result, nil } -// NewListByScopePager - List all HTTP Routes in the given scope. +// NewListByScopePager - List HttpRouteResource resources by Scope // // Generated from API version 2022-03-15-privatepreview // - options - HTTPRoutesClientListByScopeOptions contains the optional parameters for the HTTPRoutesClient.NewListByScopePager @@ -244,39 +274,57 @@ func (client *HTTPRoutesClient) listByScopeCreateRequest(ctx context.Context, op // listByScopeHandleResponse handles the ListByScope response. func (client *HTTPRoutesClient) listByScopeHandleResponse(resp *http.Response) (HTTPRoutesClientListByScopeResponse, error) { result := HTTPRoutesClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HTTPRouteResourceList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.HTTPRouteResourceListResult); err != nil { return HTTPRoutesClientListByScopeResponse{}, err } return result, nil } -// Update - Update the properties of an existing HTTP Route. +// BeginUpdate - Update a HttpRouteResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - httpRouteName - HTTPRoute name +// - properties - The resource properties to be updated. +// - options - HTTPRoutesClientBeginUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginUpdate method. +func (client *HTTPRoutesClient) BeginUpdate(ctx context.Context, httpRouteName string, properties HTTPRouteResourceUpdate, options *HTTPRoutesClientBeginUpdateOptions) (*runtime.Poller[HTTPRoutesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, httpRouteName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[HTTPRoutesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[HTTPRoutesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update a HttpRouteResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - httpRouteName - The name of the HTTP Route. -// - httpRouteResource - HTTP Route details -// - options - HTTPRoutesClientUpdateOptions contains the optional parameters for the HTTPRoutesClient.Update method. -func (client *HTTPRoutesClient) Update(ctx context.Context, httpRouteName string, httpRouteResource HTTPRouteResource, options *HTTPRoutesClientUpdateOptions) (HTTPRoutesClientUpdateResponse, error) { +func (client *HTTPRoutesClient) update(ctx context.Context, httpRouteName string, properties HTTPRouteResourceUpdate, options *HTTPRoutesClientBeginUpdateOptions) (*http.Response, error) { var err error - req, err := client.updateCreateRequest(ctx, httpRouteName, httpRouteResource, options) + req, err := client.updateCreateRequest(ctx, httpRouteName, properties, options) if err != nil { - return HTTPRoutesClientUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return HTTPRoutesClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return HTTPRoutesClientUpdateResponse{}, err + return nil, err } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // updateCreateRequest creates the Update request. -func (client *HTTPRoutesClient) updateCreateRequest(ctx context.Context, httpRouteName string, httpRouteResource HTTPRouteResource, options *HTTPRoutesClientUpdateOptions) (*policy.Request, error) { +func (client *HTTPRoutesClient) updateCreateRequest(ctx context.Context, httpRouteName string, properties HTTPRouteResourceUpdate, options *HTTPRoutesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if httpRouteName == "" { @@ -291,18 +339,9 @@ func (client *HTTPRoutesClient) updateCreateRequest(ctx context.Context, httpRou reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, httpRouteResource); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil } -// updateHandleResponse handles the Update response. -func (client *HTTPRoutesClient) updateHandleResponse(resp *http.Response) (HTTPRoutesClientUpdateResponse, error) { - result := HTTPRoutesClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HTTPRouteResource); err != nil { - return HTTPRoutesClientUpdateResponse{}, err - } - return result, nil -} - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go index b8b508f9e8..aa60fb38c2 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go @@ -7,26 +7,6 @@ package v20220315privatepreview -// ApplicationExtensionClassification provides polymorphic access to related types. -// Call the interface's GetApplicationExtension() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ApplicationExtension, *ApplicationKubernetesMetadataExtension, *ApplicationKubernetesNamespaceExtension -type ApplicationExtensionClassification interface { - ExtensionClassification - // GetApplicationExtension returns the ApplicationExtension content of the underlying type. - GetApplicationExtension() *ApplicationExtension -} - -// ContainerExtensionClassification provides polymorphic access to related types. -// Call the interface's GetContainerExtension() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ContainerExtension, *ContainerKubernetesMetadataExtension, *DaprSidecarExtension, *ManualScalingExtension -type ContainerExtensionClassification interface { - ExtensionClassification - // GetContainerExtension returns the ContainerExtension content of the underlying type. - GetContainerExtension() *ContainerExtension -} - // EnvironmentComputeClassification provides polymorphic access to related types. // Call the interface's GetEnvironmentCompute() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -36,30 +16,19 @@ type EnvironmentComputeClassification interface { GetEnvironmentCompute() *EnvironmentCompute } -// EnvironmentExtensionClassification provides polymorphic access to related types. -// Call the interface's GetEnvironmentExtension() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EnvironmentExtension, *EnvironmentKubernetesMetadataExtension -type EnvironmentExtensionClassification interface { - ExtensionClassification - // GetEnvironmentExtension returns the EnvironmentExtension content of the underlying type. - GetEnvironmentExtension() *EnvironmentExtension -} - -// EnvironmentRecipePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetEnvironmentRecipeProperties() method to access the common type. +// EnvironmentComputeUpdateClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentComputeUpdate() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *BicepRecipeProperties, *EnvironmentRecipeProperties, *TerraformRecipeProperties -type EnvironmentRecipePropertiesClassification interface { - // GetEnvironmentRecipeProperties returns the EnvironmentRecipeProperties content of the underlying type. - GetEnvironmentRecipeProperties() *EnvironmentRecipeProperties +// - *EnvironmentComputeUpdate, *KubernetesComputeUpdate +type EnvironmentComputeUpdateClassification interface { + // GetEnvironmentComputeUpdate returns the EnvironmentComputeUpdate content of the underlying type. + GetEnvironmentComputeUpdate() *EnvironmentComputeUpdate } // ExtensionClassification provides polymorphic access to related types. // Call the interface's GetExtension() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *ApplicationExtension, *ApplicationKubernetesNamespaceExtension, *ContainerExtension, *ContainerKubernetesMetadataExtension, -// - *DaprSidecarExtension, *EnvironmentExtension, *Extension, *ManualScalingExtension +// - *DaprSidecarExtension, *Extension, *KubernetesMetadataExtension, *KubernetesNamespaceExtension, *ManualScalingExtension type ExtensionClassification interface { // GetExtension returns the Extension content of the underlying type. GetExtension() *Extension @@ -74,6 +43,24 @@ type HealthProbePropertiesClassification interface { GetHealthProbeProperties() *HealthProbeProperties } +// RecipePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetRecipeProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BicepRecipeProperties, *RecipeProperties, *TerraformRecipeProperties +type RecipePropertiesClassification interface { + // GetRecipeProperties returns the RecipeProperties content of the underlying type. + GetRecipeProperties() *RecipeProperties +} + +// RecipePropertiesUpdateClassification provides polymorphic access to related types. +// Call the interface's GetRecipePropertiesUpdate() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BicepRecipePropertiesUpdate, *RecipePropertiesUpdate, *TerraformRecipePropertiesUpdate +type RecipePropertiesUpdateClassification interface { + // GetRecipePropertiesUpdate returns the RecipePropertiesUpdate content of the underlying type. + GetRecipePropertiesUpdate() *RecipePropertiesUpdate +} + // VolumeClassification provides polymorphic access to related types. // Call the interface's GetVolume() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -92,3 +79,12 @@ type VolumePropertiesClassification interface { GetVolumeProperties() *VolumeProperties } +// VolumeUpdateClassification provides polymorphic access to related types. +// Call the interface's GetVolumeUpdate() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EphemeralVolumeUpdate, *PersistentVolumeUpdate, *VolumeUpdate +type VolumeUpdateClassification interface { + // GetVolumeUpdate returns the VolumeUpdate content of the underlying type. + GetVolumeUpdate() *VolumeUpdate +} + diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index 09aa7bf296..9aa4fb52ec 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -9,92 +9,27 @@ package v20220315privatepreview import "time" -type ApplicationExtension struct { - // REQUIRED; Specifies the extensions of a resource. - Kind *string -} - -// GetApplicationExtension implements the ApplicationExtensionClassification interface for type ApplicationExtension. -func (a *ApplicationExtension) GetApplicationExtension() *ApplicationExtension { return a } - -// GetExtension implements the ExtensionClassification interface for type ApplicationExtension. -func (a *ApplicationExtension) GetExtension() *Extension { - return &Extension{ - Kind: a.Kind, - } -} - -// ApplicationKubernetesMetadataExtension - Specifies the metadata that should be applied to Kubernetes resources created -// by all Containers in this Application. -type ApplicationKubernetesMetadataExtension struct { - // REQUIRED; Specifies the extensions of a resource. - Kind *string - - // Annotations to be applied to the Kubernetes resources output by the resource - Annotations map[string]*string - - // Labels to be applied to the Kubernetes resources output by the resource - Labels map[string]*string -} - -// GetApplicationExtension implements the ApplicationExtensionClassification interface for type ApplicationKubernetesMetadataExtension. -func (a *ApplicationKubernetesMetadataExtension) GetApplicationExtension() *ApplicationExtension { - return &ApplicationExtension{ - Kind: a.Kind, - } -} - -// GetExtension implements the ExtensionClassification interface for type ApplicationKubernetesMetadataExtension. -func (a *ApplicationKubernetesMetadataExtension) GetExtension() *Extension { - return &Extension{ - Kind: a.Kind, - } -} - -// ApplicationKubernetesNamespaceExtension - Specifies application-scoped namespace. -type ApplicationKubernetesNamespaceExtension struct { - // REQUIRED; Specifies the extensions of a resource. - Kind *string - - // REQUIRED; The Kubernetes namespace to use for this application. - Namespace *string -} - -// GetApplicationExtension implements the ApplicationExtensionClassification interface for type ApplicationKubernetesNamespaceExtension. -func (a *ApplicationKubernetesNamespaceExtension) GetApplicationExtension() *ApplicationExtension { - return &ApplicationExtension{ - Kind: a.Kind, - } -} - -// GetExtension implements the ExtensionClassification interface for type ApplicationKubernetesNamespaceExtension. -func (a *ApplicationKubernetesNamespaceExtension) GetExtension() *Extension { - return &Extension{ - Kind: a.Kind, - } -} - // ApplicationProperties - Application properties type ApplicationProperties struct { - // REQUIRED; The resource id of the environment linked to application. + // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string - // Extensions spec of the resource - Extensions []ApplicationExtensionClassification + // The application extension. + Extensions []ExtensionClassification - // READ-ONLY; Provisioning state of the application at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; Status of a resource. Status *ResourceStatus } -// ApplicationResource - Radius Application. +// ApplicationResource - Radius Application resource type ApplicationResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; Application properties + // The resource-specific properties for this resource. Properties *ApplicationProperties // Resource tags. @@ -106,27 +41,52 @@ type ApplicationResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ApplicationResourceList - The list of applications. -type ApplicationResourceList struct { - // The link used to get the next page of applications list. +// ApplicationResourceListResult - The response of a ApplicationResource list operation. +type ApplicationResourceListResult struct { + // REQUIRED; The ApplicationResource items on this page + Value []*ApplicationResource + + // The link to the next page of items NextLink *string +} - // The list of applications. - Value []*ApplicationResource +// ApplicationResourceUpdate - The type used for update operations of the ApplicationResource. +type ApplicationResourceUpdate struct { + // The updatable properties of the ApplicationResource. + Properties *ApplicationResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// ApplicationResourceUpdateProperties - The updatable properties of the ApplicationResource. +type ApplicationResourceUpdateProperties struct { + // The compute resource used by application environment. + Compute EnvironmentComputeUpdateClassification + + // The environment extension. + Extensions []ExtensionClassification + + // Cloud providers configuration for the environment. + Providers *ProvidersUpdate + + // Specifies Recipes linked to the Environment. + Recipes map[string]map[string]RecipePropertiesUpdateClassification } +// AzureKeyVaultVolumeProperties - Represents Azure Key Vault Volume properties type AzureKeyVaultVolumeProperties struct { - // REQUIRED; Specifies the resource id of the application + // REQUIRED; Fully qualified resource ID for the application that the portable resource is consumed by Application *string - // REQUIRED; The volume kind + // REQUIRED; Discriminator property for VolumeProperties. Kind *string // REQUIRED; The ID of the keyvault to use for this volume resource @@ -135,7 +95,7 @@ type AzureKeyVaultVolumeProperties struct { // The KeyVault certificates that this volume exposes Certificates map[string]*CertificateObjectProperties - // The resource id of the environment linked to the resource + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) Environment *string // The KeyVault keys that this volume exposes @@ -144,10 +104,10 @@ type AzureKeyVaultVolumeProperties struct { // The KeyVault secrets that this volume exposes Secrets map[string]*SecretObjectProperties - // READ-ONLY; Provisioning state of the Volume at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; Status of a resource. Status *ResourceStatus } @@ -162,21 +122,9 @@ func (a *AzureKeyVaultVolumeProperties) GetVolumeProperties() *VolumeProperties } } -// BasicResourceProperties - Basic properties of a Radius resource. -type BasicResourceProperties struct { - // REQUIRED; Specifies the resource id of the application - Application *string - - // The resource id of the environment linked to the resource - Environment *string - - // READ-ONLY; Status of the resource - Status *ResourceStatus -} - -// BicepRecipeProperties - Properties of a Recipe linked to an Environment. +// BicepRecipeProperties - Represents Bicep recipe properties. type BicepRecipeProperties struct { - // REQUIRED; Format of the template provided by the recipe. Allowed values: bicep, terraform. + // REQUIRED; Discriminator property for RecipeProperties. TemplateKind *string // REQUIRED; Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. @@ -186,45 +134,82 @@ type BicepRecipeProperties struct { Parameters map[string]any } -// GetEnvironmentRecipeProperties implements the EnvironmentRecipePropertiesClassification interface for type BicepRecipeProperties. -func (b *BicepRecipeProperties) GetEnvironmentRecipeProperties() *EnvironmentRecipeProperties { - return &EnvironmentRecipeProperties{ +// GetRecipeProperties implements the RecipePropertiesClassification interface for type BicepRecipeProperties. +func (b *BicepRecipeProperties) GetRecipeProperties() *RecipeProperties { + return &RecipeProperties{ + Parameters: b.Parameters, + TemplateKind: b.TemplateKind, + TemplatePath: b.TemplatePath, + } +} + +// BicepRecipePropertiesUpdate - Represents Bicep recipe properties. +type BicepRecipePropertiesUpdate struct { + // REQUIRED; Discriminator property for RecipeProperties. + TemplateKind *string + + // Key/value parameters to pass to the recipe template at deployment + Parameters map[string]any + + // Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. + TemplatePath *string +} + +// GetRecipePropertiesUpdate implements the RecipePropertiesUpdateClassification interface for type BicepRecipePropertiesUpdate. +func (b *BicepRecipePropertiesUpdate) GetRecipePropertiesUpdate() *RecipePropertiesUpdate { + return &RecipePropertiesUpdate{ Parameters: b.Parameters, TemplateKind: b.TemplateKind, TemplatePath: b.TemplatePath, } } +// CertificateObjectProperties - Represents certificate object properties type CertificateObjectProperties struct { // REQUIRED; The name of the certificate Name *string - // File name when written to disk. + // File name when written to disk Alias *string // Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate - CertType *CertType + CertType *CertificateTypes // Encoding format. Default utf-8 - Encoding *Encoding + Encoding *VolumeSecretEncodings // Certificate format. Default pem - Format *Format + Format *CertificateFormats // Certificate version Version *string } +// ConnectionProperties - Connection Properties type ConnectionProperties struct { // REQUIRED; The source of the connection Source *string + + // default environment variable override DisableDefaultEnvVars *bool - // The properties of IAM + // iam properties Iam *IamProperties } -// Container - Definition of a container. +// ConnectionPropertiesUpdate - Connection Properties +type ConnectionPropertiesUpdate struct { + // default environment variable override + DisableDefaultEnvVars *bool + + // iam properties + Iam *IamPropertiesUpdate + + // The source of the connection + Source *string +} + +// Container - Definition of a container type Container struct { // REQUIRED; The registry and image to download and run in your container Image *string @@ -235,119 +220,96 @@ type Container struct { // Entrypoint array. Overrides the container image's ENTRYPOINT Command []*string - // Dictionary of + // environment Env map[string]*string - // Properties for readiness/liveness probe + // liveness probe properties LivenessProbe HealthProbePropertiesClassification - // Dictionary of - Ports map[string]*ContainerPort + // container ports + Ports map[string]*ContainerPortProperties - // Properties for readiness/liveness probe + // readiness probe properties ReadinessProbe HealthProbePropertiesClassification - // Dictionary of + // container volumes Volumes map[string]VolumeClassification // Working directory for the container WorkingDir *string } -type ContainerExtension struct { - // REQUIRED; Specifies the extensions of a resource. - Kind *string -} - -// GetContainerExtension implements the ContainerExtensionClassification interface for type ContainerExtension. -func (c *ContainerExtension) GetContainerExtension() *ContainerExtension { return c } - -// GetExtension implements the ExtensionClassification interface for type ContainerExtension. -func (c *ContainerExtension) GetExtension() *Extension { - return &Extension{ - Kind: c.Kind, - } -} - -// ContainerKubernetesMetadataExtension - Specifies the metadata that should be applied to Kubernetes resources created for -// the Container resource -type ContainerKubernetesMetadataExtension struct { - // REQUIRED; Specifies the extensions of a resource. - Kind *string +// ContainerPortProperties - Specifies a listening port for the container +type ContainerPortProperties struct { + // REQUIRED; The listening port number + ContainerPort *int32 - // Annotations to be applied to the Kubernetes resources output by the resource - Annotations map[string]*string + // Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired + Port *int32 - // Labels to be applied to the Kubernetes resources output by the resource - Labels map[string]*string -} + // Protocol in use by the port + Protocol *PortProtocol -// GetContainerExtension implements the ContainerExtensionClassification interface for type ContainerKubernetesMetadataExtension. -func (c *ContainerKubernetesMetadataExtension) GetContainerExtension() *ContainerExtension { - return &ContainerExtension{ - Kind: c.Kind, - } -} + // Specifies a route provided by this port + Provides *string -// GetExtension implements the ExtensionClassification interface for type ContainerKubernetesMetadataExtension. -func (c *ContainerKubernetesMetadataExtension) GetExtension() *Extension { - return &Extension{ - Kind: c.Kind, - } + // Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults +// to 'http' or 'https' depending on the port value + Scheme *string } -// ContainerPort - Specifies a listening port for the container -type ContainerPort struct { - // REQUIRED; The listening port number +// ContainerPortPropertiesUpdate - Specifies a listening port for the container +type ContainerPortPropertiesUpdate struct { + // The listening port number ContainerPort *int32 - // Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired. + // Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired Port *int32 // Protocol in use by the port - Protocol *Protocol + Protocol *PortProtocol // Specifies a route provided by this port Provides *string // Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults -// to 'http' or 'https' depending on the port value. +// to 'http' or 'https' depending on the port value Scheme *string } // ContainerProperties - Container properties type ContainerProperties struct { - // REQUIRED; Specifies the resource id of the application + // REQUIRED; Fully qualified resource ID for the application that the portable resource is consumed by Application *string // REQUIRED; Definition of a container. Container *Container - // Dictionary of + // Specifies a connection to another resource. Connections map[string]*ConnectionProperties - // The resource id of the environment linked to the resource + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) Environment *string // Extensions spec of the resource - Extensions []ContainerExtensionClassification + Extensions []ExtensionClassification // Configuration for supported external identity providers Identity *IdentitySettings - // READ-ONLY; Gets the status of the container at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; Status of a resource. Status *ResourceStatus } -// ContainerResource - Container +// ContainerResource - Concrete tracked resource types can be created by aliasing this type using a specific property type. type ContainerResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; Container properties + // The resource-specific properties for this resource. Properties *ContainerProperties // Resource tags. @@ -359,20 +321,80 @@ type ContainerResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ContainerResourceList - The list of containers. -type ContainerResourceList struct { - // The link used to get the next page of containers list. +// ContainerResourceListResult - The response of a ContainerResource list operation. +type ContainerResourceListResult struct { + // REQUIRED; The ContainerResource items on this page + Value []*ContainerResource + + // The link to the next page of items NextLink *string +} - // The list of containers. - Value []*ContainerResource +// ContainerResourceUpdate - The type used for update operations of the ContainerResource. +type ContainerResourceUpdate struct { + // The updatable properties of the ContainerResource. + Properties *ContainerResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// ContainerResourceUpdateProperties - The updatable properties of the ContainerResource. +type ContainerResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by + Application *string + + // Specifies a connection to another resource. + Connections map[string]*ConnectionPropertiesUpdate + + // Definition of a container. + Container *ContainerUpdate + + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) + Environment *string + + // Extensions spec of the resource + Extensions []ExtensionClassification + + // Configuration for supported external identity providers + Identity *IdentitySettingsUpdate +} + +// ContainerUpdate - Definition of a container +type ContainerUpdate struct { + // Arguments to the entrypoint. Overrides the container image's CMD + Args []*string + + // Entrypoint array. Overrides the container image's ENTRYPOINT + Command []*string + + // environment + Env map[string]*string + + // The registry and image to download and run in your container + Image *string + + // liveness probe properties + LivenessProbe HealthProbePropertiesClassification + + // container ports + Ports map[string]*ContainerPortPropertiesUpdate + + // readiness probe properties + ReadinessProbe HealthProbePropertiesClassification + + // container volumes + Volumes map[string]VolumeUpdateClassification + + // Working directory for the container + WorkingDir *string } // DaprSidecarExtension - Specifies the resource should have a Dapr sidecar injected @@ -380,7 +402,7 @@ type DaprSidecarExtension struct { // REQUIRED; The Dapr appId. Specifies the identifier used by Dapr for service invocation. AppID *string - // REQUIRED; Specifies the extensions of a resource. + // REQUIRED; Discriminator property for Extension. Kind *string // The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. @@ -390,14 +412,7 @@ type DaprSidecarExtension struct { Config *string // Specifies the Dapr app-protocol to use for the resource. - Protocol *Protocol -} - -// GetContainerExtension implements the ContainerExtensionClassification interface for type DaprSidecarExtension. -func (d *DaprSidecarExtension) GetContainerExtension() *ContainerExtension { - return &ContainerExtension{ - Kind: d.Kind, - } + Protocol *DaprSidecarExtensionProtocol } // GetExtension implements the ExtensionClassification interface for type DaprSidecarExtension. @@ -407,9 +422,9 @@ func (d *DaprSidecarExtension) GetExtension() *Extension { } } -// EnvironmentCompute - Compute resource used by application environment resource. +// EnvironmentCompute - Represents backing compute resource type EnvironmentCompute struct { - // REQUIRED; Type of compute resource. + // REQUIRED; Discriminator property for EnvironmentCompute. Kind *string // Configuration for supported external identity providers @@ -422,87 +437,45 @@ type EnvironmentCompute struct { // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { return e } -type EnvironmentExtension struct { - // REQUIRED; Specifies the extensions of a resource. - Kind *string -} - -// GetEnvironmentExtension implements the EnvironmentExtensionClassification interface for type EnvironmentExtension. -func (e *EnvironmentExtension) GetEnvironmentExtension() *EnvironmentExtension { return e } - -// GetExtension implements the ExtensionClassification interface for type EnvironmentExtension. -func (e *EnvironmentExtension) GetExtension() *Extension { - return &Extension{ - Kind: e.Kind, - } -} - -// EnvironmentKubernetesMetadataExtension - Specifies the metadata that should be applied to Kubernetes resources created -// by all Containers in this Environment. -type EnvironmentKubernetesMetadataExtension struct { - // REQUIRED; Specifies the extensions of a resource. +// EnvironmentComputeUpdate - Represents backing compute resource +type EnvironmentComputeUpdate struct { + // REQUIRED; Discriminator property for EnvironmentCompute. Kind *string - // Annotations to be applied to the Kubernetes resources output by the resource - Annotations map[string]*string - - // Labels to be applied to the Kubernetes resources output by the resource - Labels map[string]*string -} + // Configuration for supported external identity providers + Identity *IdentitySettingsUpdate -// GetEnvironmentExtension implements the EnvironmentExtensionClassification interface for type EnvironmentKubernetesMetadataExtension. -func (e *EnvironmentKubernetesMetadataExtension) GetEnvironmentExtension() *EnvironmentExtension { - return &EnvironmentExtension{ - Kind: e.Kind, - } + // The resource id of the compute resource for application environment. + ResourceID *string } -// GetExtension implements the ExtensionClassification interface for type EnvironmentKubernetesMetadataExtension. -func (e *EnvironmentKubernetesMetadataExtension) GetExtension() *Extension { - return &Extension{ - Kind: e.Kind, - } -} +// GetEnvironmentComputeUpdate implements the EnvironmentComputeUpdateClassification interface for type EnvironmentComputeUpdate. +func (e *EnvironmentComputeUpdate) GetEnvironmentComputeUpdate() *EnvironmentComputeUpdate { return e } -// EnvironmentProperties - Application environment properties +// EnvironmentProperties - Environment properties type EnvironmentProperties struct { - // REQUIRED; Compute resource used by application environment resource. + // REQUIRED; The compute resource used by application environment. Compute EnvironmentComputeClassification - // Extensions spec of the resource - Extensions []EnvironmentExtensionClassification + // The environment extension. + Extensions []ExtensionClassification // Cloud providers configuration for the environment. Providers *Providers // Specifies Recipes linked to the Environment. - Recipes map[string]map[string]EnvironmentRecipePropertiesClassification + Recipes map[string]map[string]RecipePropertiesClassification - // READ-ONLY; Provisioning state of the environment at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState } -// EnvironmentRecipeProperties - Properties of a Recipe linked to an Environment. -type EnvironmentRecipeProperties struct { - // REQUIRED; Format of the template provided by the recipe. Allowed values: bicep, terraform. - TemplateKind *string - - // REQUIRED; Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. - TemplatePath *string - - // Key/value parameters to pass to the recipe template at deployment - Parameters map[string]any -} - -// GetEnvironmentRecipeProperties implements the EnvironmentRecipePropertiesClassification interface for type EnvironmentRecipeProperties. -func (e *EnvironmentRecipeProperties) GetEnvironmentRecipeProperties() *EnvironmentRecipeProperties { return e } - -// EnvironmentResource - Application environment. +// EnvironmentResource - The environment resource type EnvironmentResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; Application environment properties + // The resource-specific properties for this resource. Properties *EnvironmentProperties // Resource tags. @@ -514,31 +487,55 @@ type EnvironmentResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// EnvironmentResourceList - The list of environments. -type EnvironmentResourceList struct { - // The link used to get the next page of environments list. +// EnvironmentResourceListResult - The response of a EnvironmentResource list operation. +type EnvironmentResourceListResult struct { + // REQUIRED; The EnvironmentResource items on this page + Value []*EnvironmentResource + + // The link to the next page of items NextLink *string +} - // The list of environments. - Value []*EnvironmentResource +// EnvironmentResourceUpdate - The type used for update operations of the EnvironmentResource. +type EnvironmentResourceUpdate struct { + // The updatable properties of the EnvironmentResource. + Properties *EnvironmentResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// EnvironmentResourceUpdateProperties - The updatable properties of the EnvironmentResource. +type EnvironmentResourceUpdateProperties struct { + // The compute resource used by application environment. + Compute EnvironmentComputeUpdateClassification + + // The environment extension. + Extensions []ExtensionClassification + + // Cloud providers configuration for the environment. + Providers *ProvidersUpdate + + // Specifies Recipes linked to the Environment. + Recipes map[string]map[string]RecipePropertiesUpdateClassification } // EphemeralVolume - Specifies an ephemeral volume for a container type EphemeralVolume struct { - // REQUIRED; The Volume kind + // REQUIRED; Discriminator property for Volume. Kind *string // REQUIRED; Backing store for the ephemeral volume ManagedStore *ManagedStore - // The path where the volume is mounted + // REQUIRED; The path where the volume is mounted MountPath *string } @@ -550,6 +547,26 @@ func (e *EphemeralVolume) GetVolume() *Volume { } } +// EphemeralVolumeUpdate - Specifies an ephemeral volume for a container +type EphemeralVolumeUpdate struct { + // REQUIRED; Discriminator property for Volume. + Kind *string + + // Backing store for the ephemeral volume + ManagedStore *ManagedStore + + // The path where the volume is mounted + MountPath *string +} + +// GetVolumeUpdate implements the VolumeUpdateClassification interface for type EphemeralVolumeUpdate. +func (e *EphemeralVolumeUpdate) GetVolumeUpdate() *VolumeUpdate { + return &VolumeUpdate{ + Kind: e.Kind, + MountPath: e.MountPath, + } +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -589,7 +606,7 @@ type ExecHealthProbeProperties struct { // REQUIRED; Command to execute to probe readiness/liveness Command *string - // REQUIRED; The HealthProbeProperties kind + // REQUIRED; Discriminator property for HealthProbeProperties. Kind *string // Threshold number of times the probe fails after which a failure would be reported @@ -616,48 +633,39 @@ func (e *ExecHealthProbeProperties) GetHealthProbeProperties() *HealthProbePrope } } -// ExtenderList - Object that includes an array of Extender and a possible portable resource for next set. -type ExtenderList struct { - // The link used to fetch the next page of Extender list. - NextLink *string - - // List of Extender portable resources. - Value []*ExtenderResource -} - -// ExtenderProperties - Extender portable resource properties. +// ExtenderProperties - ExtenderResource link properties type ExtenderProperties struct { - // REQUIRED; The resource id of the environment linked to the resource + // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string // OPTIONAL; Contains additional key/value pairs not defined in the schema. AdditionalProperties map[string]any - // Specifies the resource id of the application + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string - // The recipe used to automatically deploy underlying infrastructure for the Extender portable resource. - Recipe *ResourceRecipe + // The recipe used to automatically deploy underlying infrastructure for the extender link + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. ResourceProvisioning *ResourceProvisioning - // The secret values for the given Extender portable resource. + // The secrets for referenced resource Secrets map[string]any - // READ-ONLY; Provisioning state of the Extender portable resource at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of a Portable resource. + // READ-ONLY; Status of a resource. Status *ResourceStatus } -// ExtenderResource - Extender portable resource. +// ExtenderResource link type ExtenderResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; Extender portable resource properties. + // The resource-specific properties for this resource. Properties *ExtenderProperties // Resource tags. @@ -669,82 +677,105 @@ type ExtenderResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// Extension of a resource. +// ExtenderResourceListResult - The response of a ExtenderResource list operation. +type ExtenderResourceListResult struct { + // REQUIRED; The ExtenderResource items on this page + Value []*ExtenderResource + + // The link to the next page of items + NextLink *string +} + +// ExtenderResourceUpdate - The type used for update operations of the ExtenderResource. +type ExtenderResourceUpdate struct { + // The updatable properties of the ExtenderResource. + Properties *ExtenderResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// ExtenderResourceUpdateProperties - The updatable properties of the ExtenderResource. +type ExtenderResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string + + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string + + // The recipe used to automatically deploy underlying infrastructure for the extender link + Recipe *RecipeUpdate + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning + + // The secrets for referenced resource + Secrets map[string]any +} + +// Extension of a environment/application resource. type Extension struct { - // REQUIRED; Specifies the extensions of a resource. + // REQUIRED; Discriminator property for Extension. Kind *string } // GetExtension implements the ExtensionClassification interface for type Extension. func (e *Extension) GetExtension() *Extension { return e } +// GatewayHostname - Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io. +type GatewayHostname struct { + // Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both +// are defined. + FullyQualifiedHostname *string + + // Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' +// and will be overridden if both are defined. + Prefix *string +} + // GatewayProperties - Gateway properties type GatewayProperties struct { - // REQUIRED; Specifies the resource id of the application + // REQUIRED; Fully qualified resource ID for the application that the portable resource is consumed by Application *string // REQUIRED; Routes attached to this Gateway Routes []*GatewayRoute - // The resource id of the environment linked to the resource + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) Environment *string // Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io. - Hostname *GatewayPropertiesHostname + Hostname *GatewayHostname // Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet). Internal *bool // TLS configuration for the Gateway. - TLS *GatewayPropertiesTLS + TLS *GatewayTLS - // READ-ONLY; Provisioning state of the Gateway at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; Status of a resource. Status *ResourceStatus - // READ-ONLY; URL of the gateway resource. Readonly. + // READ-ONLY; URL of the gateway resource. Readonly URL *string } -// GatewayPropertiesHostname - Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: -// mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io. -type GatewayPropertiesHostname struct { - // Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both -// are defined. - FullyQualifiedHostname *string - - // Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' -// and will be overridden if both are defined. - Prefix *string -} - -// GatewayPropertiesTLS - TLS configuration for the Gateway. -type GatewayPropertiesTLS struct { - // Declares which Kubernetes TLS secret will be used. - CertificateFrom *string - - // TLS minimum protocol version (defaults to 1.2). - MinimumProtocolVersion *TLSMinVersion - - // If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption. - SSLPassthrough *bool -} - -// GatewayResource - Gateway Resource that specifies how traffic is exposed to the application. +// GatewayResource - Concrete tracked resource types can be created by aliasing this type using a specific property type. type GatewayResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; Gateway properties + // The resource-specific properties for this resource. Properties *GatewayProperties // Resource tags. @@ -756,22 +787,53 @@ type GatewayResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GatewayResourceListResult - The response of a GatewayResource list operation. +type GatewayResourceListResult struct { + // REQUIRED; The GatewayResource items on this page + Value []*GatewayResource + + // The link to the next page of items + NextLink *string +} + +// GatewayResourceUpdate - The type used for update operations of the GatewayResource. +type GatewayResourceUpdate struct { + // The updatable properties of the GatewayResource. + Properties *GatewayResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// GatewayResourceUpdateProperties - The updatable properties of the GatewayResource. +type GatewayResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by + Application *string + + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) + Environment *string + + // Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io. + Hostname *GatewayHostname - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} + // Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet). + Internal *bool -// GatewayResourceList - The list of Gateways. -type GatewayResourceList struct { - // The link used to get the next page of Gateways list. - NextLink *string + // Routes attached to this Gateway + Routes []*GatewayRoute - // The list of Gateways. - Value []*GatewayResource + // TLS configuration for the Gateway. + TLS *GatewayTLS } +// GatewayRoute - Route attached to Gateway type GatewayRoute struct { // The HttpRoute to route to. Ex - myserviceroute.id. Destination *string @@ -784,12 +846,24 @@ type GatewayRoute struct { ReplacePrefix *string } +// GatewayTLS - TLS configuration definition for Gateway resource. +type GatewayTLS struct { + // The resource id for the secret containing the TLS certificate and key for the gateway. + CertificateFrom *string + + // TLS minimum protocol version (defaults to 1.2). + MinimumProtocolVersion *TLSMinVersion + + // If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption. + SSLPassthrough *bool +} + // HTTPGetHealthProbeProperties - Specifies the properties for readiness/liveness probe using HTTP Get type HTTPGetHealthProbeProperties struct { // REQUIRED; The listening port number ContainerPort *int32 - // REQUIRED; The HealthProbeProperties kind + // REQUIRED; Discriminator property for HealthProbeProperties. Kind *string // REQUIRED; The route to make the HTTP request on @@ -822,12 +896,12 @@ func (h *HTTPGetHealthProbeProperties) GetHealthProbeProperties() *HealthProbePr } } -// HTTPRouteProperties - HTTP Route properties +// HTTPRouteProperties - HTTPRoute properties type HTTPRouteProperties struct { - // REQUIRED; Specifies the resource id of the application + // REQUIRED; Fully qualified resource ID for the application that the portable resource is consumed by Application *string - // The resource id of the environment linked to the resource + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) Environment *string // The internal hostname accepting traffic for the HTTP Route. Readonly. @@ -836,25 +910,25 @@ type HTTPRouteProperties struct { // The port number for the HTTP Route. Defaults to 80. Readonly. Port *int32 - // The scheme used for traffic. Readonly. - Scheme *string - - // A stable URL that that can be used to route traffic to a resource. Readonly. - URL *string - - // READ-ONLY; Provisioning state of the HTTP Route at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; The scheme used for traffic. Readonly. + Scheme *string + + // READ-ONLY; Status of a resource. Status *ResourceStatus + + // READ-ONLY; A stable URL that that can be used to route traffic to a resource. Readonly. + URL *string } -// HTTPRouteResource - Radius HTTP Route Resource. +// HTTPRouteResource - Radius HTTPRoute Resource. type HTTPRouteResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; HTTP Route properties + // The resource-specific properties for this resource. Properties *HTTPRouteProperties // Resource tags. @@ -866,25 +940,49 @@ type HTTPRouteResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// HTTPRouteResourceList - The list of HTTP Routes. -type HTTPRouteResourceList struct { - // The link used to get the next page of HTTP Routes list. +// HTTPRouteResourceListResult - The response of a HttpRouteResource list operation. +type HTTPRouteResourceListResult struct { + // REQUIRED; The HttpRouteResource items on this page + Value []*HTTPRouteResource + + // The link to the next page of items NextLink *string +} - // The list of HTTP Route. - Value []*HTTPRouteResource +// HTTPRouteResourceUpdate - The type used for update operations of the HttpRouteResource. +type HTTPRouteResourceUpdate struct { + // The updatable properties of the HttpRouteResource. + Properties *HTTPRouteResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// HTTPRouteResourceUpdateProperties - The updatable properties of the HttpRouteResource. +type HTTPRouteResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by + Application *string + + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) + Environment *string + + // The internal hostname accepting traffic for the HTTP Route. Readonly. + Hostname *string + + // The port number for the HTTP Route. Defaults to 80. Readonly. + Port *int32 } // HealthProbeProperties - Properties for readiness/liveness probe type HealthProbeProperties struct { - // REQUIRED; The HealthProbeProperties kind + // REQUIRED; Discriminator property for HealthProbeProperties. Kind *string // Threshold number of times the probe fails after which a failure would be reported @@ -903,17 +1001,39 @@ type HealthProbeProperties struct { // GetHealthProbeProperties implements the HealthProbePropertiesClassification interface for type HealthProbeProperties. func (h *HealthProbeProperties) GetHealthProbeProperties() *HealthProbeProperties { return h } -// IamProperties - The properties of IAM +// IamProperties - IAM properties type IamProperties struct { // REQUIRED; The kind of IAM provider to configure - Kind *Kind + Kind *IAMKind + + // RBAC permissions to be assigned on the source resource + Roles []*string +} + +// IamPropertiesUpdate - IAM properties +type IamPropertiesUpdate struct { + // The kind of IAM provider to configure + Kind *IAMKind // RBAC permissions to be assigned on the source resource Roles []*string } +// IdentitySettings is the external identity setting. type IdentitySettings struct { - // REQUIRED; Configuration for supported external identity providers + // REQUIRED; kind of identity setting + Kind *IdentitySettingKind + + // The URI for your compute platform's OIDC issuer + OidcIssuer *string + + // The resource ID of the provisioned identity + Resource *string +} + +// IdentitySettingsUpdate - IdentitySettings is the external identity setting. +type IdentitySettingsUpdate struct { + // kind of identity setting Kind *IdentitySettingKind // The URI for your compute platform's OIDC issuer @@ -923,20 +1043,21 @@ type IdentitySettings struct { Resource *string } +// KeyObjectProperties - Represents key object properties type KeyObjectProperties struct { // REQUIRED; The name of the key Name *string - // File name when written to disk. + // File name when written to disk Alias *string // Key version Version *string } -// KubernetesCompute - Specifies the properties for Kubernetes compute environment +// KubernetesCompute - The Kubernetes compute configuration type KubernetesCompute struct { - // REQUIRED; Type of compute resource. + // REQUIRED; Discriminator property for EnvironmentCompute. Kind *string // REQUIRED; The namespace to use for the environment. @@ -958,22 +1079,74 @@ func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { } } -// ManualScalingExtension - ManualScaling Extension -type ManualScalingExtension struct { - // REQUIRED; Specifies the extensions of a resource. +// KubernetesComputeUpdate - The Kubernetes compute configuration +type KubernetesComputeUpdate struct { + // REQUIRED; Discriminator property for EnvironmentCompute. Kind *string - // Replica count. - Replicas *int32 + // Configuration for supported external identity providers + Identity *IdentitySettingsUpdate + + // The namespace to use for the environment. + Namespace *string + + // The resource id of the compute resource for application environment. + ResourceID *string } -// GetContainerExtension implements the ContainerExtensionClassification interface for type ManualScalingExtension. -func (m *ManualScalingExtension) GetContainerExtension() *ContainerExtension { - return &ContainerExtension{ - Kind: m.Kind, +// GetEnvironmentComputeUpdate implements the EnvironmentComputeUpdateClassification interface for type KubernetesComputeUpdate. +func (k *KubernetesComputeUpdate) GetEnvironmentComputeUpdate() *EnvironmentComputeUpdate { + return &EnvironmentComputeUpdate{ + Identity: k.Identity, + Kind: k.Kind, + ResourceID: k.ResourceID, + } +} + +// KubernetesMetadataExtension - Kubernetes metadata extension of a environment/application resource. +type KubernetesMetadataExtension struct { + // REQUIRED; Annotations to be applied to the Kubernetes resources output by the resource + Annotations map[string]*string + + // REQUIRED; Discriminator property for Extension. + Kind *string + + // REQUIRED; Labels to be applied to the Kubernetes resources output by the resource + Labels map[string]*string +} + +// GetExtension implements the ExtensionClassification interface for type KubernetesMetadataExtension. +func (k *KubernetesMetadataExtension) GetExtension() *Extension { + return &Extension{ + Kind: k.Kind, + } +} + +// KubernetesNamespaceExtension - Kubernetes namespace extension of a environment/application resource. +type KubernetesNamespaceExtension struct { + // REQUIRED; Discriminator property for Extension. + Kind *string + + // REQUIRED; The namespace of the application environment. + Namespace *string +} + +// GetExtension implements the ExtensionClassification interface for type KubernetesNamespaceExtension. +func (k *KubernetesNamespaceExtension) GetExtension() *Extension { + return &Extension{ + Kind: k.Kind, } } +// ManualScalingExtension - ManualScaling Extension +type ManualScalingExtension struct { + // REQUIRED; Discriminator property for Extension. + Kind *string + + // REQUIRED; Replica count. + Replicas *int32 +} + // GetExtension implements the ExtensionClassification interface for type ManualScalingExtension. func (m *ManualScalingExtension) GetExtension() *Extension { return &Extension{ @@ -981,17 +1154,80 @@ func (m *ManualScalingExtension) GetExtension() *Extension { } } +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Localized display information for this particular operation. + Display *OperationDisplay + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane +// operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", +// "Microsoft.Compute/virtualMachines/capture/action" + Name *string + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" + Origin *Origin +} + +// OperationDisplay - Localized display information for this particular operation. +type OperationDisplay struct { + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string + + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual +// Machine", "Restart Virtual Machine". + Operation *string + + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft +// Compute". + Provider *string + + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job +// Schedule Collections". + Resource *string +} + +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation +} + +// OutputResource - Properties of an output resource. +type OutputResource struct { + // The UCP resource ID of the underlying resource. + ID *string + + // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency +// relationship. LocalIDs do not have any particular format or meaning beyond +// being compared to determine dependency relationships. + LocalID *string + + // Determines whether Radius manages the lifecycle of the underlying resource. + RadiusManaged *bool +} + // PersistentVolume - Specifies a persistent volume for a container type PersistentVolume struct { - // REQUIRED; The Volume kind + // REQUIRED; Discriminator property for Volume. Kind *string + // REQUIRED; The path where the volume is mounted + MountPath *string + // REQUIRED; The source of the volume Source *string - // The path where the volume is mounted - MountPath *string - // Container read/write access to the volume Permission *VolumePermission } @@ -1004,62 +1240,142 @@ func (p *PersistentVolume) GetVolume() *Volume { } } -// PortableResourceBasicProperties - Basic properties of a Portable resource. -type PortableResourceBasicProperties struct { - // REQUIRED; The resource id of the environment linked to the resource - Environment *string +// PersistentVolumeUpdate - Specifies a persistent volume for a container +type PersistentVolumeUpdate struct { + // REQUIRED; Discriminator property for Volume. + Kind *string - // Specifies the resource id of the application - Application *string + // The path where the volume is mounted + MountPath *string - // READ-ONLY; Status of a Portable resource. - Status *ResourceStatus + // Container read/write access to the volume + Permission *VolumePermission + + // The source of the volume + Source *string +} + +// GetVolumeUpdate implements the VolumeUpdateClassification interface for type PersistentVolumeUpdate. +func (p *PersistentVolumeUpdate) GetVolumeUpdate() *VolumeUpdate { + return &VolumeUpdate{ + Kind: p.Kind, + MountPath: p.MountPath, + } } -// Providers - Cloud providers configuration +// Providers - The Cloud providers configuration type Providers struct { - // AWS cloud provider configuration + // The AWS cloud provider configuration Aws *ProvidersAws - // Azure cloud provider configuration + // The Azure cloud provider configuration Azure *ProvidersAzure } -// ProvidersAws - AWS cloud provider configuration +// ProvidersAws - The AWS cloud provider definition type ProvidersAws struct { + // REQUIRED; Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2' + Scope *string +} + +// ProvidersAwsUpdate - The AWS cloud provider definition +type ProvidersAwsUpdate struct { // Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2' Scope *string } -// ProvidersAzure - Azure cloud provider configuration +// ProvidersAzure - The Azure cloud provider definition type ProvidersAzure struct { + // REQUIRED; Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup' + Scope *string +} + +// ProvidersAzureUpdate - The Azure cloud provider definition +type ProvidersAzureUpdate struct { // Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup' Scope *string } -// Recipe properties. +// ProvidersUpdate - The Cloud providers configuration +type ProvidersUpdate struct { + // The AWS cloud provider configuration + Aws *ProvidersAwsUpdate + + // The Azure cloud provider configuration + Azure *ProvidersAzureUpdate +} + +// Recipe - The recipe used to automatically deploy underlying infrastructure for a link type Recipe struct { - // Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases' + // REQUIRED; The name of the recipe within the environment to use + Name *string + + // Key/value parameters to pass into the recipe at deployment + Parameters map[string]any +} + +// RecipeGetMetadata - Represents the request body of the getmetadata action. +type RecipeGetMetadata struct { + // REQUIRED; Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases' LinkType *string - // Name of the recipe registered to the environment. + // REQUIRED; The name of the recipe registered to the environment Name *string } -// RecipeMetadataProperties - Properties of a Recipe linked to an Environment. -type RecipeMetadataProperties struct { +// RecipeGetMetadataResponse - The properties of a Recipe linked to an Environment. +type RecipeGetMetadataResponse struct { + // REQUIRED; The key/value parameters to pass to the recipe template at deployment. + Parameters map[string]any + + // REQUIRED; The format of the template provided by the recipe. Allowed values: bicep, terraform. + TemplateKind *string + + // REQUIRED; The path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. + TemplatePath *string + + // REQUIRED; The version of the template to deploy. For Terraform recipes using a module registry this is required, but must +// be omitted for other module sources. + TemplateVersion *string +} + +// RecipeProperties - Format of the template provided by the recipe. Allowed values: bicep, terraform. +type RecipeProperties struct { + // REQUIRED; Discriminator property for RecipeProperties. + TemplateKind *string + + // REQUIRED; Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. + TemplatePath *string + // Key/value parameters to pass to the recipe template at deployment Parameters map[string]any +} + +// GetRecipeProperties implements the RecipePropertiesClassification interface for type RecipeProperties. +func (r *RecipeProperties) GetRecipeProperties() *RecipeProperties { return r } - // Format of the template provided by the recipe. Allowed values: bicep, terraform. +// RecipePropertiesUpdate - Format of the template provided by the recipe. Allowed values: bicep, terraform. +type RecipePropertiesUpdate struct { + // REQUIRED; Discriminator property for RecipeProperties. TemplateKind *string + // Key/value parameters to pass to the recipe template at deployment + Parameters map[string]any + // Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. TemplatePath *string +} - // Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted -// for other module sources. - TemplateVersion *string +// GetRecipePropertiesUpdate implements the RecipePropertiesUpdateClassification interface for type RecipePropertiesUpdate. +func (r *RecipePropertiesUpdate) GetRecipePropertiesUpdate() *RecipePropertiesUpdate { return r } + +// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a link +type RecipeUpdate struct { + // The name of the recipe within the environment to use + Name *string + + // Key/value parameters to pass into the recipe at deployment + Parameters map[string]any } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources @@ -1070,57 +1386,55 @@ type Resource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ResourceRecipe - The recipe used to automatically deploy underlying infrastructure for a portable resource. -type ResourceRecipe struct { - // REQUIRED; The name of the recipe within the environment to use. - Name *string - - // Key/value parameters to pass into the recipe at deployment. - Parameters map[string]any -} - // ResourceStatus - Status of a resource. type ResourceStatus struct { - // Compute resource used by application environment resource. + // The compute resource associated with the resource. Compute EnvironmentComputeClassification - OutputResources []map[string]any + + // Properties of an output resource + OutputResources []*OutputResource } +// SecretObjectProperties - Represents secret object properties type SecretObjectProperties struct { // REQUIRED; The name of the secret Name *string - // File name when written to disk. + // File name when written to disk Alias *string // Encoding format. Default utf-8 - Encoding *Encoding + Encoding *VolumeSecretEncodings - // Secret version + // secret version Version *string } // SecretStoreListSecretsResult - The list of secrets type SecretStoreListSecretsResult struct { - // An object to represent key-value type secrets + // REQUIRED; An object to represent key-value type secrets Data map[string]*SecretValueProperties - // The type of secret store data + // REQUIRED; The type of secret store data Type *SecretStoreDataType } +// SecretStoreProperties - The properties of SecretStore type SecretStoreProperties struct { - // REQUIRED; Specifies the resource id of the application + // REQUIRED; Fully qualified resource ID for the application that the portable resource is consumed by Application *string // REQUIRED; An object to represent key-value type secrets Data map[string]*SecretValueProperties - // The resource id of the environment linked to the resource + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) Environment *string // The resource id of external secret store. @@ -1129,19 +1443,19 @@ type SecretStoreProperties struct { // The type of secret store data Type *SecretStoreDataType - // READ-ONLY; Provisioning state of the SecretStore at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; Status of a resource. Status *ResourceStatus } -// SecretStoreResource - Radius SecretStore Resource. +// SecretStoreResource - Concrete tracked resource types can be created by aliasing this type using a specific property type. type SecretStoreResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED; The resource-specific properties for this resource. + // The resource-specific properties for this resource. Properties *SecretStoreProperties // Resource tags. @@ -1153,22 +1467,50 @@ type SecretStoreResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// SecretStoreResourceList - The list of SecretStores. -type SecretStoreResourceList struct { - // The link used to get the next page of SecretStores list. +// SecretStoreResourceListResult - The response of a SecretStoreResource list operation. +type SecretStoreResourceListResult struct { + // REQUIRED; The SecretStoreResource items on this page + Value []*SecretStoreResource + + // The link to the next page of items NextLink *string +} - // The list of SecretStore. - Value []*SecretStoreResource +// SecretStoreResourceUpdate - The type used for update operations of the SecretStoreResource. +type SecretStoreResourceUpdate struct { + // The updatable properties of the SecretStoreResource. + Properties *SecretStoreResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// SecretStoreResourceUpdateProperties - The updatable properties of the SecretStoreResource. +type SecretStoreResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by + Application *string + + // An object to represent key-value type secrets + Data map[string]*SecretValueProperties + + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) + Environment *string + + // The resource id of external secret store. + Resource *string + + // The type of secret store data + Type *SecretStoreDataType } +// SecretValueProperties - The properties of SecretValue type SecretValueProperties struct { // The encoding of value Encoding *SecretValueEncoding @@ -1206,7 +1548,7 @@ type TCPHealthProbeProperties struct { // REQUIRED; The listening port number ContainerPort *int32 - // REQUIRED; The HealthProbeProperties kind + // REQUIRED; Discriminator property for HealthProbeProperties. Kind *string // Threshold number of times the probe fails after which a failure would be reported @@ -1233,25 +1575,50 @@ func (t *TCPHealthProbeProperties) GetHealthProbeProperties() *HealthProbeProper } } -// TerraformRecipeProperties - Properties of a Recipe linked to an Environment. +// TerraformRecipeProperties - Represents Terraform recipe properties. type TerraformRecipeProperties struct { - // REQUIRED; Format of the template provided by the recipe. Allowed values: bicep, terraform. + // REQUIRED; Discriminator property for RecipeProperties. TemplateKind *string // REQUIRED; Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. TemplatePath *string + // REQUIRED; Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be +// omitted for other module sources. + TemplateVersion *string + + // Key/value parameters to pass to the recipe template at deployment + Parameters map[string]any +} + +// GetRecipeProperties implements the RecipePropertiesClassification interface for type TerraformRecipeProperties. +func (t *TerraformRecipeProperties) GetRecipeProperties() *RecipeProperties { + return &RecipeProperties{ + Parameters: t.Parameters, + TemplateKind: t.TemplateKind, + TemplatePath: t.TemplatePath, + } +} + +// TerraformRecipePropertiesUpdate - Represents Terraform recipe properties. +type TerraformRecipePropertiesUpdate struct { + // REQUIRED; Discriminator property for RecipeProperties. + TemplateKind *string + // Key/value parameters to pass to the recipe template at deployment Parameters map[string]any + // Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. + TemplatePath *string + // Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted // for other module sources. TemplateVersion *string } -// GetEnvironmentRecipeProperties implements the EnvironmentRecipePropertiesClassification interface for type TerraformRecipeProperties. -func (t *TerraformRecipeProperties) GetEnvironmentRecipeProperties() *EnvironmentRecipeProperties { - return &EnvironmentRecipeProperties{ +// GetRecipePropertiesUpdate implements the RecipePropertiesUpdateClassification interface for type TerraformRecipePropertiesUpdate. +func (t *TerraformRecipePropertiesUpdate) GetRecipePropertiesUpdate() *RecipePropertiesUpdate { + return &RecipePropertiesUpdate{ Parameters: t.Parameters, TemplateKind: t.TemplateKind, TemplatePath: t.TemplatePath, @@ -1273,10 +1640,14 @@ type TrackedResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } +// ValueFromProperties - The Secret value source properties type ValueFromProperties struct { // REQUIRED; The name of the referenced secret. Name *string @@ -1287,42 +1658,43 @@ type ValueFromProperties struct { // Volume - Specifies a volume for a container type Volume struct { - // REQUIRED; The Volume kind + // REQUIRED; Discriminator property for Volume. Kind *string - // The path where the volume is mounted + // REQUIRED; The path where the volume is mounted MountPath *string } // GetVolume implements the VolumeClassification interface for type Volume. func (v *Volume) GetVolume() *Volume { return v } +// VolumeProperties - Volume properties type VolumeProperties struct { - // REQUIRED; Specifies the resource id of the application + // REQUIRED; Fully qualified resource ID for the application that the portable resource is consumed by Application *string - // REQUIRED; The volume kind + // REQUIRED; Discriminator property for VolumeProperties. Kind *string - // The resource id of the environment linked to the resource + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) Environment *string - // READ-ONLY; Provisioning state of the Volume at the time the operation was called. + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState - // READ-ONLY; Status of the resource + // READ-ONLY; Status of a resource. Status *ResourceStatus } // GetVolumeProperties implements the VolumePropertiesClassification interface for type VolumeProperties. func (v *VolumeProperties) GetVolumeProperties() *VolumeProperties { return v } -// VolumeResource - Radius Volume Resource. +// VolumeResource - Radius Volume resource. type VolumeResource struct { // REQUIRED; The geo-location where the resource lives Location *string - // REQUIRED + // The resource-specific properties for this resource. Properties VolumePropertiesClassification // Resource tags. @@ -1334,19 +1706,49 @@ type VolumeResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// VolumeResourceList - The list of Volumes. -type VolumeResourceList struct { - // The link used to get the next page of Volumes list. +// VolumeResourceListResult - The response of a VolumeResource list operation. +type VolumeResourceListResult struct { + // REQUIRED; The VolumeResource items on this page + Value []*VolumeResource + + // The link to the next page of items NextLink *string +} - // The list of Volume. - Value []*VolumeResource +// VolumeResourceUpdate - The type used for update operations of the VolumeResource. +type VolumeResourceUpdate struct { + // The updatable properties of the VolumeResource. + Properties *VolumeResourceUpdateProperties + + // Resource tags. + Tags map[string]*string +} + +// VolumeResourceUpdateProperties - The updatable properties of the VolumeResource. +type VolumeResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by + Application *string + + // Fully qualified resource ID for the environment that the portable resource is linked to (if applicable) + Environment *string +} + +// VolumeUpdate - Specifies a volume for a container +type VolumeUpdate struct { + // REQUIRED; Discriminator property for Volume. + Kind *string + + // The path where the volume is mounted + MountPath *string } +// GetVolumeUpdate implements the VolumeUpdateClassification interface for type VolumeUpdate. +func (v *VolumeUpdate) GetVolumeUpdate() *VolumeUpdate { return v } + diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index 945e5e0880..1c24d958d6 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -14,99 +14,6 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type ApplicationExtension. -func (a ApplicationExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["kind"] = "ApplicationExtension" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationExtension. -func (a *ApplicationExtension) 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) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ApplicationKubernetesMetadataExtension. -func (a ApplicationKubernetesMetadataExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "annotations", a.Annotations) - objectMap["kind"] = "kubernetesMetadata" - populate(objectMap, "labels", a.Labels) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationKubernetesMetadataExtension. -func (a *ApplicationKubernetesMetadataExtension) 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 "annotations": - err = unpopulate(val, "Annotations", &a.Annotations) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &a.Labels) - 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 ApplicationKubernetesNamespaceExtension. -func (a ApplicationKubernetesNamespaceExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["kind"] = "kubernetesNamespace" - populate(objectMap, "namespace", a.Namespace) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationKubernetesNamespaceExtension. -func (a *ApplicationKubernetesNamespaceExtension) 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 "namespace": - err = unpopulate(val, "Namespace", &a.Namespace) - 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 ApplicationProperties. func (a ApplicationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -130,7 +37,7 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Environment", &a.Environment) delete(rawMsg, key) case "extensions": - a.Extensions, err = unmarshalApplicationExtensionClassificationArray(val) + a.Extensions, err = unmarshalExtensionClassificationArray(val) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) @@ -197,16 +104,16 @@ func (a *ApplicationResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceList. -func (a ApplicationResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceListResult. +func (a ApplicationResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceList. -func (a *ApplicationResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceListResult. +func (a *ApplicationResourceListResult) 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) @@ -228,6 +135,87 @@ func (a *ApplicationResourceList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ApplicationResourceUpdate. +func (a ApplicationResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceUpdate. +func (a *ApplicationResourceUpdate) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 ApplicationResourceUpdateProperties. +func (a ApplicationResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "compute", a.Compute) + populate(objectMap, "extensions", a.Extensions) + populate(objectMap, "providers", a.Providers) + populate(objectMap, "recipes", a.Recipes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationResourceUpdateProperties. +func (a *ApplicationResourceUpdateProperties) 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 "compute": + a.Compute, err = unmarshalEnvironmentComputeUpdateClassification(val) + delete(rawMsg, key) + case "extensions": + a.Extensions, err = unmarshalExtensionClassificationArray(val) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &a.Providers) + delete(rawMsg, key) + case "recipes": + var recipesRaw map[string]json.RawMessage + if err = json.Unmarshal(val, &recipesRaw); err != nil { + return err + } + recipes := map[string]map[string]RecipePropertiesUpdateClassification{} + for k1, v1 := range recipesRaw { + recipes[k1], err = unmarshalRecipePropertiesUpdateClassificationMap(v1) + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + a.Recipes = recipes + 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 AzureKeyVaultVolumeProperties. func (a AzureKeyVaultVolumeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -287,17 +275,17 @@ func (a *AzureKeyVaultVolumeProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. -func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BicepRecipeProperties. +func (b BicepRecipeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "application", b.Application) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) + populate(objectMap, "parameters", b.Parameters) + objectMap["templateKind"] = "bicep" + populate(objectMap, "templatePath", b.TemplatePath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicResourceProperties. -func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BicepRecipeProperties. +func (b *BicepRecipeProperties) 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", b, err) @@ -305,14 +293,14 @@ func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) + case "parameters": + err = unpopulate(val, "Parameters", &b.Parameters) delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) + case "templateKind": + err = unpopulate(val, "TemplateKind", &b.TemplateKind) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) + case "templatePath": + err = unpopulate(val, "TemplatePath", &b.TemplatePath) delete(rawMsg, key) } if err != nil { @@ -322,8 +310,8 @@ func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BicepRecipeProperties. -func (b BicepRecipeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BicepRecipePropertiesUpdate. +func (b BicepRecipePropertiesUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "parameters", b.Parameters) objectMap["templateKind"] = "bicep" @@ -331,8 +319,8 @@ func (b BicepRecipeProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BicepRecipeProperties. -func (b *BicepRecipeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BicepRecipePropertiesUpdate. +func (b *BicepRecipePropertiesUpdate) 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", b, err) @@ -439,6 +427,41 @@ func (c *ConnectionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ConnectionPropertiesUpdate. +func (c ConnectionPropertiesUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableDefaultEnvVars", c.DisableDefaultEnvVars) + populate(objectMap, "iam", c.Iam) + populate(objectMap, "source", c.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionPropertiesUpdate. +func (c *ConnectionPropertiesUpdate) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "disableDefaultEnvVars": + err = unpopulate(val, "DisableDefaultEnvVars", &c.DisableDefaultEnvVars) + delete(rawMsg, key) + case "iam": + err = unpopulate(val, "Iam", &c.Iam) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Container. func (c Container) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -498,15 +521,19 @@ func (c *Container) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerExtension. -func (c ContainerExtension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerPortProperties. +func (c ContainerPortProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = "ContainerExtension" + populate(objectMap, "containerPort", c.ContainerPort) + populate(objectMap, "port", c.Port) + populate(objectMap, "protocol", c.Protocol) + populate(objectMap, "provides", c.Provides) + populate(objectMap, "scheme", c.Scheme) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerExtension. -func (c *ContainerExtension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPortProperties. +func (c *ContainerPortProperties) 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", c, err) @@ -514,43 +541,20 @@ func (c *ContainerExtension) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "kind": - err = unpopulate(val, "Kind", &c.Kind) + case "containerPort": + err = unpopulate(val, "ContainerPort", &c.ContainerPort) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContainerKubernetesMetadataExtension. -func (c ContainerKubernetesMetadataExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "annotations", c.Annotations) - objectMap["kind"] = "kubernetesMetadata" - populate(objectMap, "labels", c.Labels) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerKubernetesMetadataExtension. -func (c *ContainerKubernetesMetadataExtension) 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", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "annotations": - err = unpopulate(val, "Annotations", &c.Annotations) + case "port": + err = unpopulate(val, "Port", &c.Port) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &c.Kind) + case "protocol": + err = unpopulate(val, "Protocol", &c.Protocol) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &c.Labels) + case "provides": + err = unpopulate(val, "Provides", &c.Provides) + delete(rawMsg, key) + case "scheme": + err = unpopulate(val, "Scheme", &c.Scheme) delete(rawMsg, key) } if err != nil { @@ -560,8 +564,8 @@ func (c *ContainerKubernetesMetadataExtension) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerPort. -func (c ContainerPort) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerPortPropertiesUpdate. +func (c ContainerPortPropertiesUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "containerPort", c.ContainerPort) populate(objectMap, "port", c.Port) @@ -571,8 +575,8 @@ func (c ContainerPort) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPort. -func (c *ContainerPort) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerPortPropertiesUpdate. +func (c *ContainerPortPropertiesUpdate) 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", c, err) @@ -639,7 +643,7 @@ func (c *ContainerProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Environment", &c.Environment) delete(rawMsg, key) case "extensions": - c.Extensions, err = unmarshalContainerExtensionClassificationArray(val) + c.Extensions, err = unmarshalExtensionClassificationArray(val) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &c.Identity) @@ -709,16 +713,16 @@ func (c *ContainerResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerResourceList. -func (c ContainerResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerResourceListResult. +func (c ContainerResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceList. -func (c *ContainerResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceListResult. +func (c *ContainerResourceListResult) 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", c, err) @@ -740,93 +744,197 @@ func (c *ContainerResourceList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSidecarExtension. -func (d DaprSidecarExtension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerResourceUpdate. +func (c ContainerResourceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appId", d.AppID) - populate(objectMap, "appPort", d.AppPort) - populate(objectMap, "config", d.Config) - objectMap["kind"] = "daprSidecar" - populate(objectMap, "protocol", d.Protocol) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSidecarExtension. -func (d *DaprSidecarExtension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceUpdate. +func (c *ContainerResourceUpdate) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "appId": - err = unpopulate(val, "AppID", &d.AppID) - delete(rawMsg, key) - case "appPort": - err = unpopulate(val, "AppPort", &d.AppPort) - delete(rawMsg, key) - case "config": - err = unpopulate(val, "Config", &d.Config) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &d.Kind) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &d.Protocol) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. -func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerResourceUpdateProperties. +func (c ContainerResourceUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", e.Identity) - objectMap["kind"] = e.Kind - populate(objectMap, "resourceId", e.ResourceID) + populate(objectMap, "application", c.Application) + populate(objectMap, "connections", c.Connections) + populate(objectMap, "container", c.Container) + populate(objectMap, "environment", c.Environment) + populate(objectMap, "extensions", c.Extensions) + populate(objectMap, "identity", c.Identity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentCompute. -func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResourceUpdateProperties. +func (c *ContainerResourceUpdateProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { + case "application": + err = unpopulate(val, "Application", &c.Application) + delete(rawMsg, key) + case "connections": + err = unpopulate(val, "Connections", &c.Connections) + delete(rawMsg, key) + case "container": + err = unpopulate(val, "Container", &c.Container) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &c.Environment) + delete(rawMsg, key) + case "extensions": + c.Extensions, err = unmarshalExtensionClassificationArray(val) + delete(rawMsg, key) case "identity": - err = unpopulate(val, "Identity", &e.Identity) + err = unpopulate(val, "Identity", &c.Identity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerUpdate. +func (c ContainerUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "args", c.Args) + populate(objectMap, "command", c.Command) + populate(objectMap, "env", c.Env) + populate(objectMap, "image", c.Image) + populate(objectMap, "livenessProbe", c.LivenessProbe) + populate(objectMap, "ports", c.Ports) + populate(objectMap, "readinessProbe", c.ReadinessProbe) + populate(objectMap, "volumes", c.Volumes) + populate(objectMap, "workingDir", c.WorkingDir) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerUpdate. +func (c *ContainerUpdate) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "args": + err = unpopulate(val, "Args", &c.Args) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &c.Command) + delete(rawMsg, key) + case "env": + err = unpopulate(val, "Env", &c.Env) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &c.Image) + delete(rawMsg, key) + case "livenessProbe": + c.LivenessProbe, err = unmarshalHealthProbePropertiesClassification(val) + delete(rawMsg, key) + case "ports": + err = unpopulate(val, "Ports", &c.Ports) + delete(rawMsg, key) + case "readinessProbe": + c.ReadinessProbe, err = unmarshalHealthProbePropertiesClassification(val) + delete(rawMsg, key) + case "volumes": + c.Volumes, err = unmarshalVolumeUpdateClassificationMap(val) + delete(rawMsg, key) + case "workingDir": + err = unpopulate(val, "WorkingDir", &c.WorkingDir) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DaprSidecarExtension. +func (d DaprSidecarExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appId", d.AppID) + populate(objectMap, "appPort", d.AppPort) + populate(objectMap, "config", d.Config) + objectMap["kind"] = "daprSidecar" + populate(objectMap, "protocol", d.Protocol) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSidecarExtension. +func (d *DaprSidecarExtension) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "appId": + err = unpopulate(val, "AppID", &d.AppID) + delete(rawMsg, key) + case "appPort": + err = unpopulate(val, "AppPort", &d.AppPort) + delete(rawMsg, key) + case "config": + err = unpopulate(val, "Config", &d.Config) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &e.Kind) + err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &e.ResourceID) + case "protocol": + err = unpopulate(val, "Protocol", &d.Protocol) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentExtension. -func (e EnvironmentExtension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. +func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = "EnvironmentExtension" + populate(objectMap, "identity", e.Identity) + objectMap["kind"] = e.Kind + populate(objectMap, "resourceId", e.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentExtension. -func (e *EnvironmentExtension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentCompute. +func (e *EnvironmentCompute) 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) @@ -834,9 +942,15 @@ func (e *EnvironmentExtension) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &e.Kind) delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -845,17 +959,17 @@ func (e *EnvironmentExtension) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentKubernetesMetadataExtension. -func (e EnvironmentKubernetesMetadataExtension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentComputeUpdate. +func (e EnvironmentComputeUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "annotations", e.Annotations) - objectMap["kind"] = "kubernetesMetadata" - populate(objectMap, "labels", e.Labels) + populate(objectMap, "identity", e.Identity) + objectMap["kind"] = e.Kind + populate(objectMap, "resourceId", e.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentKubernetesMetadataExtension. -func (e *EnvironmentKubernetesMetadataExtension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentComputeUpdate. +func (e *EnvironmentComputeUpdate) 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) @@ -863,14 +977,14 @@ func (e *EnvironmentKubernetesMetadataExtension) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "annotations": - err = unpopulate(val, "Annotations", &e.Annotations) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &e.Kind) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &e.Labels) + case "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) delete(rawMsg, key) } if err != nil { @@ -904,7 +1018,7 @@ func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error { e.Compute, err = unmarshalEnvironmentComputeClassification(val) delete(rawMsg, key) case "extensions": - e.Extensions, err = unmarshalEnvironmentExtensionClassificationArray(val) + e.Extensions, err = unmarshalExtensionClassificationArray(val) delete(rawMsg, key) case "providers": err = unpopulate(val, "Providers", &e.Providers) @@ -917,9 +1031,9 @@ func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error { if err = json.Unmarshal(val, &recipesRaw); err != nil { return err } - recipes := map[string]map[string]EnvironmentRecipePropertiesClassification{} + recipes := map[string]map[string]RecipePropertiesClassification{} for k1, v1 := range recipesRaw { - recipes[k1], err = unmarshalEnvironmentRecipePropertiesClassificationMap(v1) + recipes[k1], err = unmarshalRecipePropertiesClassificationMap(v1) if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } @@ -934,41 +1048,6 @@ func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentRecipeProperties. -func (e EnvironmentRecipeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "parameters", e.Parameters) - objectMap["templateKind"] = e.TemplateKind - populate(objectMap, "templatePath", e.TemplatePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentRecipeProperties. -func (e *EnvironmentRecipeProperties) 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 "parameters": - err = unpopulate(val, "Parameters", &e.Parameters) - delete(rawMsg, key) - case "templateKind": - err = unpopulate(val, "TemplateKind", &e.TemplateKind) - delete(rawMsg, key) - case "templatePath": - err = unpopulate(val, "TemplatePath", &e.TemplatePath) - 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 EnvironmentResource. func (e EnvironmentResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1020,16 +1099,16 @@ func (e *EnvironmentResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentResourceList. -func (e EnvironmentResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentResourceListResult. +func (e EnvironmentResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentResourceList. -func (e *EnvironmentResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentResourceListResult. +func (e *EnvironmentResourceListResult) 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) @@ -1051,17 +1130,16 @@ func (e *EnvironmentResourceList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EphemeralVolume. -func (e EphemeralVolume) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentResourceUpdate. +func (e EnvironmentResourceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = "ephemeral" - populate(objectMap, "managedStore", e.ManagedStore) - populate(objectMap, "mountPath", e.MountPath) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EphemeralVolume. -func (e *EphemeralVolume) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentResourceUpdate. +func (e *EnvironmentResourceUpdate) 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) @@ -1069,14 +1147,11 @@ func (e *EphemeralVolume) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "managedStore": - err = unpopulate(val, "ManagedStore", &e.ManagedStore) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "mountPath": - err = unpopulate(val, "MountPath", &e.MountPath) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) } if err != nil { @@ -1086,16 +1161,18 @@ func (e *EphemeralVolume) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentResourceUpdateProperties. +func (e EnvironmentResourceUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) + populate(objectMap, "compute", e.Compute) + populate(objectMap, "extensions", e.Extensions) + populate(objectMap, "providers", e.Providers) + populate(objectMap, "recipes", e.Recipes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentResourceUpdateProperties. +func (e *EnvironmentResourceUpdateProperties) 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) @@ -1103,11 +1180,28 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "info": - err = unpopulate(val, "Info", &e.Info) + case "compute": + e.Compute, err = unmarshalEnvironmentComputeUpdateClassification(val) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "extensions": + e.Extensions, err = unmarshalExtensionClassificationArray(val) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &e.Providers) + delete(rawMsg, key) + case "recipes": + var recipesRaw map[string]json.RawMessage + if err = json.Unmarshal(val, &recipesRaw); err != nil { + return err + } + recipes := map[string]map[string]RecipePropertiesUpdateClassification{} + for k1, v1 := range recipesRaw { + recipes[k1], err = unmarshalRecipePropertiesUpdateClassificationMap(v1) + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + e.Recipes = recipes delete(rawMsg, key) } if err != nil { @@ -1117,19 +1211,17 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EphemeralVolume. +func (e EphemeralVolume) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + objectMap["kind"] = "ephemeral" + populate(objectMap, "managedStore", e.ManagedStore) + populate(objectMap, "mountPath", e.MountPath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. -func (e *ErrorDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EphemeralVolume. +func (e *EphemeralVolume) 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) @@ -1137,11 +1229,114 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "managedStore": + err = unpopulate(val, "ManagedStore", &e.ManagedStore) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &e.MountPath) + 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 EphemeralVolumeUpdate. +func (e EphemeralVolumeUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = "ephemeral" + populate(objectMap, "managedStore", e.ManagedStore) + populate(objectMap, "mountPath", e.MountPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EphemeralVolumeUpdate. +func (e *EphemeralVolumeUpdate) 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 "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "managedStore": + err = unpopulate(val, "ManagedStore", &e.ManagedStore) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &e.MountPath) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) @@ -1234,37 +1429,6 @@ func (e *ExecHealthProbeProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtenderList. -func (e ExtenderList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderList. -func (e *ExtenderList) 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 "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - 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) @@ -1382,15 +1546,16 @@ func (e *ExtenderResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Extension. -func (e Extension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtenderResourceListResult. +func (e ExtenderResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = e.Kind + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. -func (e *Extension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderResourceListResult. +func (e *ExtenderResourceListResult) 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) @@ -1398,8 +1563,11 @@ func (e *Extension) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "kind": - err = unpopulate(val, "Kind", &e.Kind) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { @@ -1409,146 +1577,117 @@ func (e *Extension) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayProperties. -func (g GatewayProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtenderResourceUpdate. +func (e ExtenderResourceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "application", g.Application) - populate(objectMap, "environment", g.Environment) - populate(objectMap, "hostname", g.Hostname) - populate(objectMap, "internal", g.Internal) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "routes", g.Routes) - populate(objectMap, "status", g.Status) - populate(objectMap, "tls", g.TLS) - populate(objectMap, "url", g.URL) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "tags", e.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayProperties. -func (g *GatewayProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderResourceUpdate. +func (e *ExtenderResourceUpdate) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "application": - err = unpopulate(val, "Application", &g.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &g.Environment) - delete(rawMsg, key) - case "hostname": - err = unpopulate(val, "Hostname", &g.Hostname) - delete(rawMsg, key) - case "internal": - err = unpopulate(val, "Internal", &g.Internal) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &g.Routes) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &g.Status) - delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &g.TLS) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &g.URL) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayPropertiesHostname. -func (g GatewayPropertiesHostname) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtenderResourceUpdateProperties. +func (e ExtenderResourceUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fullyQualifiedHostname", g.FullyQualifiedHostname) - populate(objectMap, "prefix", g.Prefix) + populate(objectMap, "application", e.Application) + populate(objectMap, "environment", e.Environment) + populate(objectMap, "recipe", e.Recipe) + populate(objectMap, "resourceProvisioning", e.ResourceProvisioning) + populate(objectMap, "secrets", e.Secrets) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayPropertiesHostname. -func (g *GatewayPropertiesHostname) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderResourceUpdateProperties. +func (e *ExtenderResourceUpdateProperties) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "fullyQualifiedHostname": - err = unpopulate(val, "FullyQualifiedHostname", &g.FullyQualifiedHostname) + case "application": + err = unpopulate(val, "Application", &e.Application) delete(rawMsg, key) - case "prefix": - err = unpopulate(val, "Prefix", &g.Prefix) + case "environment": + err = unpopulate(val, "Environment", &e.Environment) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &e.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &e.ResourceProvisioning) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &e.Secrets) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayPropertiesTLS. -func (g GatewayPropertiesTLS) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Extension. +func (e Extension) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificateFrom", g.CertificateFrom) - populate(objectMap, "minimumProtocolVersion", g.MinimumProtocolVersion) - populate(objectMap, "sslPassthrough", g.SSLPassthrough) + objectMap["kind"] = e.Kind return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayPropertiesTLS. -func (g *GatewayPropertiesTLS) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. +func (e *Extension) 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", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "certificateFrom": - err = unpopulate(val, "CertificateFrom", &g.CertificateFrom) - delete(rawMsg, key) - case "minimumProtocolVersion": - err = unpopulate(val, "MinimumProtocolVersion", &g.MinimumProtocolVersion) - delete(rawMsg, key) - case "sslPassthrough": - err = unpopulate(val, "SSLPassthrough", &g.SSLPassthrough) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayResource. -func (g GatewayResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayHostname. +func (g GatewayHostname) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "systemData", g.SystemData) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) + populate(objectMap, "fullyQualifiedHostname", g.FullyQualifiedHostname) + populate(objectMap, "prefix", g.Prefix) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResource. -func (g *GatewayResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostname. +func (g *GatewayHostname) 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", g, err) @@ -1556,8 +1695,103 @@ func (g *GatewayResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) + case "fullyQualifiedHostname": + err = unpopulate(val, "FullyQualifiedHostname", &g.FullyQualifiedHostname) + delete(rawMsg, key) + case "prefix": + err = unpopulate(val, "Prefix", &g.Prefix) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayProperties. +func (g GatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "application", g.Application) + populate(objectMap, "environment", g.Environment) + populate(objectMap, "hostname", g.Hostname) + populate(objectMap, "internal", g.Internal) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "routes", g.Routes) + populate(objectMap, "status", g.Status) + populate(objectMap, "tls", g.TLS) + populate(objectMap, "url", g.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayProperties. +func (g *GatewayProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &g.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &g.Environment) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &g.Hostname) + delete(rawMsg, key) + case "internal": + err = unpopulate(val, "Internal", &g.Internal) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &g.Routes) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &g.Status) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &g.TLS) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &g.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayResource. +func (g GatewayResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResource. +func (g *GatewayResource) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &g.Location) @@ -1585,16 +1819,16 @@ func (g *GatewayResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayResourceList. -func (g GatewayResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceListResult. +func (g GatewayResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", g.NextLink) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceList. -func (g *GatewayResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceListResult. +func (g *GatewayResourceListResult) 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", g, err) @@ -1616,6 +1850,84 @@ func (g *GatewayResourceList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceUpdate. +func (g GatewayResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceUpdate. +func (g *GatewayResourceUpdate) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceUpdateProperties. +func (g GatewayResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "application", g.Application) + populate(objectMap, "environment", g.Environment) + populate(objectMap, "hostname", g.Hostname) + populate(objectMap, "internal", g.Internal) + populate(objectMap, "routes", g.Routes) + populate(objectMap, "tls", g.TLS) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceUpdateProperties. +func (g *GatewayResourceUpdateProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &g.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &g.Environment) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &g.Hostname) + delete(rawMsg, key) + case "internal": + err = unpopulate(val, "Internal", &g.Internal) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &g.Routes) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &g.TLS) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GatewayRoute. func (g GatewayRoute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1651,6 +1963,41 @@ func (g *GatewayRoute) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayTLS. +func (g GatewayTLS) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateFrom", g.CertificateFrom) + populate(objectMap, "minimumProtocolVersion", g.MinimumProtocolVersion) + populate(objectMap, "sslPassthrough", g.SSLPassthrough) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTLS. +func (g *GatewayTLS) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateFrom": + err = unpopulate(val, "CertificateFrom", &g.CertificateFrom) + delete(rawMsg, key) + case "minimumProtocolVersion": + err = unpopulate(val, "MinimumProtocolVersion", &g.MinimumProtocolVersion) + delete(rawMsg, key) + case "sslPassthrough": + err = unpopulate(val, "SSLPassthrough", &g.SSLPassthrough) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type HTTPGetHealthProbeProperties. func (h HTTPGetHealthProbeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1812,16 +2159,16 @@ func (h *HTTPRouteResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceList. -func (h HTTPRouteResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceListResult. +func (h HTTPRouteResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", h.NextLink) populate(objectMap, "value", h.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceList. -func (h *HTTPRouteResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceListResult. +func (h *HTTPRouteResourceListResult) 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", h, err) @@ -1843,19 +2190,16 @@ func (h *HTTPRouteResourceList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type HealthProbeProperties. -func (h HealthProbeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceUpdate. +func (h HTTPRouteResourceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failureThreshold", h.FailureThreshold) - populate(objectMap, "initialDelaySeconds", h.InitialDelaySeconds) - objectMap["kind"] = h.Kind - populate(objectMap, "periodSeconds", h.PeriodSeconds) - populate(objectMap, "timeoutSeconds", h.TimeoutSeconds) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "tags", h.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HealthProbeProperties. -func (h *HealthProbeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceUpdate. +func (h *HTTPRouteResourceUpdate) 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", h, err) @@ -1863,20 +2207,11 @@ func (h *HealthProbeProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "failureThreshold": - err = unpopulate(val, "FailureThreshold", &h.FailureThreshold) - delete(rawMsg, key) - case "initialDelaySeconds": - err = unpopulate(val, "InitialDelaySeconds", &h.InitialDelaySeconds) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &h.Kind) - delete(rawMsg, key) - case "periodSeconds": - err = unpopulate(val, "PeriodSeconds", &h.PeriodSeconds) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) delete(rawMsg, key) - case "timeoutSeconds": - err = unpopulate(val, "TimeoutSeconds", &h.TimeoutSeconds) + case "tags": + err = unpopulate(val, "Tags", &h.Tags) delete(rawMsg, key) } if err != nil { @@ -1886,39 +2221,152 @@ func (h *HealthProbeProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type IamProperties. -func (i IamProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPRouteResourceUpdateProperties. +func (h HTTPRouteResourceUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "kind", i.Kind) - populate(objectMap, "roles", i.Roles) + populate(objectMap, "application", h.Application) + populate(objectMap, "environment", h.Environment) + populate(objectMap, "hostname", h.Hostname) + populate(objectMap, "port", h.Port) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IamProperties. -func (i *IamProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRouteResourceUpdateProperties. +func (h *HTTPRouteResourceUpdateProperties) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "kind": - err = unpopulate(val, "Kind", &i.Kind) + case "application": + err = unpopulate(val, "Application", &h.Application) delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &i.Roles) + case "environment": + err = unpopulate(val, "Environment", &h.Environment) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &h.Hostname) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &h.Port) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. -func (i IdentitySettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HealthProbeProperties. +func (h HealthProbeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failureThreshold", h.FailureThreshold) + populate(objectMap, "initialDelaySeconds", h.InitialDelaySeconds) + objectMap["kind"] = h.Kind + populate(objectMap, "periodSeconds", h.PeriodSeconds) + populate(objectMap, "timeoutSeconds", h.TimeoutSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthProbeProperties. +func (h *HealthProbeProperties) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &h.FailureThreshold) + delete(rawMsg, key) + case "initialDelaySeconds": + err = unpopulate(val, "InitialDelaySeconds", &h.InitialDelaySeconds) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &h.Kind) + delete(rawMsg, key) + case "periodSeconds": + err = unpopulate(val, "PeriodSeconds", &h.PeriodSeconds) + delete(rawMsg, key) + case "timeoutSeconds": + err = unpopulate(val, "TimeoutSeconds", &h.TimeoutSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IamProperties. +func (i IamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "roles", i.Roles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IamProperties. +func (i *IamProperties) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "roles": + err = unpopulate(val, "Roles", &i.Roles) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IamPropertiesUpdate. +func (i IamPropertiesUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "roles", i.Roles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IamPropertiesUpdate. +func (i *IamPropertiesUpdate) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "roles": + err = unpopulate(val, "Roles", &i.Roles) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. +func (i IdentitySettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "kind", i.Kind) populate(objectMap, "oidcIssuer", i.OidcIssuer) @@ -1952,6 +2400,41 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IdentitySettingsUpdate. +func (i IdentitySettingsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "oidcIssuer", i.OidcIssuer) + populate(objectMap, "resource", i.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentitySettingsUpdate. +func (i *IdentitySettingsUpdate) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "oidcIssuer": + err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &i.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type KeyObjectProperties. func (k KeyObjectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2026,6 +2509,111 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type KubernetesComputeUpdate. +func (k KubernetesComputeUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", k.Identity) + objectMap["kind"] = "kubernetes" + populate(objectMap, "namespace", k.Namespace) + populate(objectMap, "resourceId", k.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesComputeUpdate. +func (k *KubernetesComputeUpdate) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &k.Namespace) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &k.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesMetadataExtension. +func (k KubernetesMetadataExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotations", k.Annotations) + objectMap["kind"] = "kubernetesMetadata" + populate(objectMap, "labels", k.Labels) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesMetadataExtension. +func (k *KubernetesMetadataExtension) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotations": + err = unpopulate(val, "Annotations", &k.Annotations) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &k.Labels) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesNamespaceExtension. +func (k KubernetesNamespaceExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = "kubernetesNamespace" + populate(objectMap, "namespace", k.Namespace) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesNamespaceExtension. +func (k *KubernetesNamespaceExtension) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &k.Namespace) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManualScalingExtension. func (m ManualScalingExtension) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2057,6 +2645,154 @@ func (m *ManualScalingExtension) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutputResource. +func (o OutputResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "localId", o.LocalID) + populate(objectMap, "radiusManaged", o.RadiusManaged) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputResource. +func (o *OutputResource) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "localId": + err = unpopulate(val, "LocalID", &o.LocalID) + delete(rawMsg, key) + case "radiusManaged": + err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PersistentVolume. func (p PersistentVolume) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2096,17 +2832,18 @@ func (p *PersistentVolume) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortableResourceBasicProperties. -func (p PortableResourceBasicProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PersistentVolumeUpdate. +func (p PersistentVolumeUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "application", p.Application) - populate(objectMap, "environment", p.Environment) - populate(objectMap, "status", p.Status) + objectMap["kind"] = "persistent" + populate(objectMap, "mountPath", p.MountPath) + populate(objectMap, "permission", p.Permission) + populate(objectMap, "source", p.Source) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortableResourceBasicProperties. -func (p *PortableResourceBasicProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PersistentVolumeUpdate. +func (p *PersistentVolumeUpdate) 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", p, err) @@ -2114,14 +2851,17 @@ func (p *PortableResourceBasicProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "application": - err = unpopulate(val, "Application", &p.Application) + case "kind": + err = unpopulate(val, "Kind", &p.Kind) delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &p.Environment) + case "mountPath": + err = unpopulate(val, "MountPath", &p.MountPath) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "permission": + err = unpopulate(val, "Permission", &p.Permission) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &p.Source) delete(rawMsg, key) } if err != nil { @@ -2189,6 +2929,33 @@ func (p *ProvidersAws) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProvidersAwsUpdate. +func (p ProvidersAwsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scope", p.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvidersAwsUpdate. +func (p *ProvidersAwsUpdate) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ProvidersAzure. func (p ProvidersAzure) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2196,36 +2963,196 @@ func (p ProvidersAzure) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProvidersAzure. -func (p *ProvidersAzure) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvidersAzure. +func (p *ProvidersAzure) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvidersAzureUpdate. +func (p ProvidersAzureUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scope", p.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvidersAzureUpdate. +func (p *ProvidersAzureUpdate) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvidersUpdate. +func (p ProvidersUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aws", p.Aws) + populate(objectMap, "azure", p.Azure) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvidersUpdate. +func (p *ProvidersUpdate) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aws": + err = unpopulate(val, "Aws", &p.Aws) + delete(rawMsg, key) + case "azure": + err = unpopulate(val, "Azure", &p.Azure) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Recipe. +func (r Recipe) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", r.Name) + populate(objectMap, "parameters", r.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Recipe. +func (r *Recipe) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecipeGetMetadata. +func (r RecipeGetMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "linkType", r.LinkType) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeGetMetadata. +func (r *RecipeGetMetadata) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "linkType": + err = unpopulate(val, "LinkType", &r.LinkType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecipeGetMetadataResponse. +func (r RecipeGetMetadataResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parameters", r.Parameters) + populate(objectMap, "templateKind", r.TemplateKind) + populate(objectMap, "templatePath", r.TemplatePath) + populate(objectMap, "templateVersion", r.TemplateVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeGetMetadataResponse. +func (r *RecipeGetMetadataResponse) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "scope": - err = unpopulate(val, "Scope", &p.Scope) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) + delete(rawMsg, key) + case "templateKind": + err = unpopulate(val, "TemplateKind", &r.TemplateKind) + delete(rawMsg, key) + case "templatePath": + err = unpopulate(val, "TemplatePath", &r.TemplatePath) + delete(rawMsg, key) + case "templateVersion": + err = unpopulate(val, "TemplateVersion", &r.TemplateVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Recipe. -func (r Recipe) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipeProperties. +func (r RecipeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "linkType", r.LinkType) - populate(objectMap, "name", r.Name) + populate(objectMap, "parameters", r.Parameters) + objectMap["templateKind"] = r.TemplateKind + populate(objectMap, "templatePath", r.TemplatePath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Recipe. -func (r *Recipe) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeProperties. +func (r *RecipeProperties) 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", r, err) @@ -2233,11 +3160,14 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "linkType": - err = unpopulate(val, "LinkType", &r.LinkType) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "templateKind": + err = unpopulate(val, "TemplateKind", &r.TemplateKind) + delete(rawMsg, key) + case "templatePath": + err = unpopulate(val, "TemplatePath", &r.TemplatePath) delete(rawMsg, key) } if err != nil { @@ -2247,18 +3177,17 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipeMetadataProperties. -func (r RecipeMetadataProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipePropertiesUpdate. +func (r RecipePropertiesUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "parameters", r.Parameters) - populate(objectMap, "templateKind", r.TemplateKind) + objectMap["templateKind"] = r.TemplateKind populate(objectMap, "templatePath", r.TemplatePath) - populate(objectMap, "templateVersion", r.TemplateVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeMetadataProperties. -func (r *RecipeMetadataProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipePropertiesUpdate. +func (r *RecipePropertiesUpdate) 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", r, err) @@ -2275,9 +3204,6 @@ func (r *RecipeMetadataProperties) UnmarshalJSON(data []byte) error { case "templatePath": err = unpopulate(val, "TemplatePath", &r.TemplatePath) delete(rawMsg, key) - case "templateVersion": - err = unpopulate(val, "TemplateVersion", &r.TemplateVersion) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -2286,17 +3212,16 @@ func (r *RecipeMetadataProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. +func (r RecipeUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) + populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeUpdate. +func (r *RecipeUpdate) 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", r, err) @@ -2304,14 +3229,11 @@ func (r *Resource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) delete(rawMsg, key) } if err != nil { @@ -2321,16 +3243,18 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ResourceRecipe. -func (r ResourceRecipe) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) - populate(objectMap, "parameters", r.Parameters) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRecipe. -func (r *ResourceRecipe) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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", r, err) @@ -2338,11 +3262,17 @@ func (r *ResourceRecipe) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &r.Parameters) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { @@ -2555,16 +3485,16 @@ func (s *SecretStoreResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecretStoreResourceList. -func (s SecretStoreResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecretStoreResourceListResult. +func (s SecretStoreResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretStoreResourceList. -func (s *SecretStoreResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretStoreResourceListResult. +func (s *SecretStoreResourceListResult) 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", s, err) @@ -2586,6 +3516,80 @@ func (s *SecretStoreResourceList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SecretStoreResourceUpdate. +func (s SecretStoreResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretStoreResourceUpdate. +func (s *SecretStoreResourceUpdate) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecretStoreResourceUpdateProperties. +func (s SecretStoreResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "application", s.Application) + populate(objectMap, "data", s.Data) + populate(objectMap, "environment", s.Environment) + populate(objectMap, "resource", s.Resource) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretStoreResourceUpdateProperties. +func (s *SecretStoreResourceUpdateProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &s.Application) + delete(rawMsg, key) + case "data": + err = unpopulate(val, "Data", &s.Data) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &s.Environment) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &s.Resource) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SecretValueProperties. func (s SecretValueProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2754,12 +3758,52 @@ func (t *TerraformRecipeProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TerraformRecipePropertiesUpdate. +func (t TerraformRecipePropertiesUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parameters", t.Parameters) + objectMap["templateKind"] = "terraform" + populate(objectMap, "templatePath", t.TemplatePath) + populate(objectMap, "templateVersion", t.TemplateVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TerraformRecipePropertiesUpdate. +func (t *TerraformRecipePropertiesUpdate) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "parameters": + err = unpopulate(val, "Parameters", &t.Parameters) + delete(rawMsg, key) + case "templateKind": + err = unpopulate(val, "TemplateKind", &t.TemplateKind) + delete(rawMsg, key) + case "templatePath": + err = unpopulate(val, "TemplatePath", &t.TemplatePath) + delete(rawMsg, key) + case "templateVersion": + err = unpopulate(val, "TemplateVersion", &t.TemplateVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) @@ -2783,6 +3827,9 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) @@ -2953,16 +4000,16 @@ func (v *VolumeResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VolumeResourceList. -func (v VolumeResourceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type VolumeResourceListResult. +func (v VolumeResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceList. -func (v *VolumeResourceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceListResult. +func (v *VolumeResourceListResult) 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", v, err) @@ -2984,6 +4031,99 @@ func (v *VolumeResourceList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VolumeResourceUpdate. +func (v VolumeResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceUpdate. +func (v *VolumeResourceUpdate) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeResourceUpdateProperties. +func (v VolumeResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "application", v.Application) + populate(objectMap, "environment", v.Environment) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeResourceUpdateProperties. +func (v *VolumeResourceUpdateProperties) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &v.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &v.Environment) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VolumeUpdate. +func (v VolumeUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["kind"] = v.Kind + populate(objectMap, "mountPath", v.MountPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeUpdate. +func (v *VolumeUpdate) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &v.Kind) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &v.MountPath) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_operations_client.go new file mode 100644 index 0000000000..45332310ab --- /dev/null +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -0,0 +1,93 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + internal *arm.Client +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - List the operations for the provider +// +// Generated from API version 2022-03-15-privatepreview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Applications.Core/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} + diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_options.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_options.go index ec32fcc126..fe4b6ee5df 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_options.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_options.go @@ -32,14 +32,23 @@ type ApplicationsClientUpdateOptions struct { // placeholder for future optional parameters } -// ContainersClientCreateOrUpdateOptions contains the optional parameters for the ContainersClient.CreateOrUpdate method. -type ContainersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// ContainersClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainersClient.BeginCreateOrUpdate +// method. +type ContainersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// ContainersClientDeleteOptions contains the optional parameters for the ContainersClient.Delete method. -type ContainersClientDeleteOptions struct { - // placeholder for future optional parameters +// ContainersClientBeginDeleteOptions contains the optional parameters for the ContainersClient.BeginDelete method. +type ContainersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainersClientBeginUpdateOptions contains the optional parameters for the ContainersClient.BeginUpdate method. +type ContainersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // ContainersClientGetOptions contains the optional parameters for the ContainersClient.Get method. @@ -52,11 +61,6 @@ type ContainersClientListByScopeOptions struct { // placeholder for future optional parameters } -// ContainersClientUpdateOptions contains the optional parameters for the ContainersClient.Update method. -type ContainersClientUpdateOptions struct { - // placeholder for future optional parameters -} - // EnvironmentsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.CreateOrUpdate method. type EnvironmentsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -67,14 +71,13 @@ type EnvironmentsClientDeleteOptions struct { // placeholder for future optional parameters } -// EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method. -type EnvironmentsClientGetOptions struct { +// EnvironmentsClientGetMetadataOptions contains the optional parameters for the EnvironmentsClient.GetMetadata method. +type EnvironmentsClientGetMetadataOptions struct { // placeholder for future optional parameters } -// EnvironmentsClientGetRecipeMetadataOptions contains the optional parameters for the EnvironmentsClient.GetRecipeMetadata -// method. -type EnvironmentsClientGetRecipeMetadataOptions struct { +// EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method. +type EnvironmentsClientGetOptions struct { // placeholder for future optional parameters } @@ -88,14 +91,23 @@ type EnvironmentsClientUpdateOptions struct { // placeholder for future optional parameters } -// ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate method. -type ExtendersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// ExtendersClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.BeginCreateOrUpdate +// method. +type ExtendersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. -type ExtendersClientDeleteOptions struct { - // placeholder for future optional parameters +// ExtendersClientBeginDeleteOptions contains the optional parameters for the ExtendersClient.BeginDelete method. +type ExtendersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtendersClientBeginUpdateOptions contains the optional parameters for the ExtendersClient.BeginUpdate method. +type ExtendersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. @@ -103,9 +115,8 @@ type ExtendersClientGetOptions struct { // placeholder for future optional parameters } -// ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.NewListByRootScopePager -// method. -type ExtendersClientListByRootScopeOptions struct { +// ExtendersClientListByScopeOptions contains the optional parameters for the ExtendersClient.NewListByScopePager method. +type ExtendersClientListByScopeOptions struct { // placeholder for future optional parameters } @@ -114,14 +125,22 @@ type ExtendersClientListSecretsOptions struct { // placeholder for future optional parameters } -// GatewaysClientCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.CreateOrUpdate method. -type GatewaysClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// GatewaysClientBeginCreateOptions contains the optional parameters for the GatewaysClient.BeginCreate method. +type GatewaysClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// GatewaysClientDeleteOptions contains the optional parameters for the GatewaysClient.Delete method. -type GatewaysClientDeleteOptions struct { - // placeholder for future optional parameters +// GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate method. +type GatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +type GatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. @@ -134,19 +153,23 @@ type GatewaysClientListByScopeOptions struct { // placeholder for future optional parameters } -// GatewaysClientUpdateOptions contains the optional parameters for the GatewaysClient.Update method. -type GatewaysClientUpdateOptions struct { - // placeholder for future optional parameters +// HTTPRoutesClientBeginCreateOrUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginCreateOrUpdate +// method. +type HTTPRoutesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// HTTPRoutesClientCreateOrUpdateOptions contains the optional parameters for the HTTPRoutesClient.CreateOrUpdate method. -type HTTPRoutesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// HTTPRoutesClientBeginDeleteOptions contains the optional parameters for the HTTPRoutesClient.BeginDelete method. +type HTTPRoutesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// HTTPRoutesClientDeleteOptions contains the optional parameters for the HTTPRoutesClient.Delete method. -type HTTPRoutesClientDeleteOptions struct { - // placeholder for future optional parameters +// HTTPRoutesClientBeginUpdateOptions contains the optional parameters for the HTTPRoutesClient.BeginUpdate method. +type HTTPRoutesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // HTTPRoutesClientGetOptions contains the optional parameters for the HTTPRoutesClient.Get method. @@ -159,19 +182,28 @@ type HTTPRoutesClientListByScopeOptions struct { // placeholder for future optional parameters } -// HTTPRoutesClientUpdateOptions contains the optional parameters for the HTTPRoutesClient.Update method. -type HTTPRoutesClientUpdateOptions struct { +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { // placeholder for future optional parameters } -// SecretStoresClientCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.CreateOrUpdate method. -type SecretStoresClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate +// method. +type SecretStoresClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// SecretStoresClientDeleteOptions contains the optional parameters for the SecretStoresClient.Delete method. -type SecretStoresClientDeleteOptions struct { - // placeholder for future optional parameters +// SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete method. +type SecretStoresClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate method. +type SecretStoresClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. @@ -179,8 +211,8 @@ type SecretStoresClientGetOptions struct { // placeholder for future optional parameters } -// SecretStoresClientListOptions contains the optional parameters for the SecretStoresClient.NewListPager method. -type SecretStoresClientListOptions struct { +// SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.NewListByScopePager method. +type SecretStoresClientListByScopeOptions struct { // placeholder for future optional parameters } @@ -189,19 +221,22 @@ type SecretStoresClientListSecretsOptions struct { // placeholder for future optional parameters } -// SecretStoresClientUpdateOptions contains the optional parameters for the SecretStoresClient.Update method. -type SecretStoresClientUpdateOptions struct { - // placeholder for future optional parameters +// VolumesClientBeginCreateOrUpdateOptions contains the optional parameters for the VolumesClient.BeginCreateOrUpdate method. +type VolumesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// VolumesClientCreateOrUpdateOptions contains the optional parameters for the VolumesClient.CreateOrUpdate method. -type VolumesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. +type VolumesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// VolumesClientDeleteOptions contains the optional parameters for the VolumesClient.Delete method. -type VolumesClientDeleteOptions struct { - // placeholder for future optional parameters +// VolumesClientBeginUpdateOptions contains the optional parameters for the VolumesClient.BeginUpdate method. +type VolumesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. @@ -214,8 +249,3 @@ type VolumesClientListByScopeOptions struct { // placeholder for future optional parameters } -// VolumesClientUpdateOptions contains the optional parameters for the VolumesClient.Update method. -type VolumesClientUpdateOptions struct { - // placeholder for future optional parameters -} - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index 65aeef0538..0f1bfbebd1 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -9,7 +9,7 @@ package v20220315privatepreview import "encoding/json" -func unmarshalApplicationExtensionClassification(rawMsg json.RawMessage) (ApplicationExtensionClassification, error) { +func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (EnvironmentComputeClassification, error) { if rawMsg == nil { return nil, nil } @@ -17,14 +17,12 @@ func unmarshalApplicationExtensionClassification(rawMsg json.RawMessage) (Applic if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b ApplicationExtensionClassification + var b EnvironmentComputeClassification switch m["kind"] { - case "kubernetesMetadata": - b = &ApplicationKubernetesMetadataExtension{} - case "kubernetesNamespace": - b = &ApplicationKubernetesNamespaceExtension{} + case "kubernetes": + b = &KubernetesCompute{} default: - b = &ApplicationExtension{} + b = &EnvironmentCompute{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -32,26 +30,28 @@ func unmarshalApplicationExtensionClassification(rawMsg json.RawMessage) (Applic return b, nil } -func unmarshalApplicationExtensionClassificationArray(rawMsg json.RawMessage) ([]ApplicationExtensionClassification, error) { +func unmarshalEnvironmentComputeUpdateClassification(rawMsg json.RawMessage) (EnvironmentComputeUpdateClassification, error) { if rawMsg == nil { return nil, nil } - var rawMessages []json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - fArray := make([]ApplicationExtensionClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalApplicationExtensionClassification(rawMessage) - if err != nil { - return nil, err - } - fArray[index] = f + var b EnvironmentComputeUpdateClassification + switch m["kind"] { + case "kubernetes": + b = &KubernetesComputeUpdate{} + default: + b = &EnvironmentComputeUpdate{} } - return fArray, nil + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } -func unmarshalContainerExtensionClassification(rawMsg json.RawMessage) (ContainerExtensionClassification, error) { +func unmarshalExtensionClassification(rawMsg json.RawMessage) (ExtensionClassification, error) { if rawMsg == nil { return nil, nil } @@ -59,16 +59,18 @@ func unmarshalContainerExtensionClassification(rawMsg json.RawMessage) (Containe if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b ContainerExtensionClassification + var b ExtensionClassification switch m["kind"] { case "daprSidecar": b = &DaprSidecarExtension{} case "kubernetesMetadata": - b = &ContainerKubernetesMetadataExtension{} + b = &KubernetesMetadataExtension{} + case "kubernetesNamespace": + b = &KubernetesNamespaceExtension{} case "manualScaling": b = &ManualScalingExtension{} default: - b = &ContainerExtension{} + b = &Extension{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -76,7 +78,7 @@ func unmarshalContainerExtensionClassification(rawMsg json.RawMessage) (Containe return b, nil } -func unmarshalContainerExtensionClassificationArray(rawMsg json.RawMessage) ([]ContainerExtensionClassification, error) { +func unmarshalExtensionClassificationArray(rawMsg json.RawMessage) ([]ExtensionClassification, error) { if rawMsg == nil { return nil, nil } @@ -84,9 +86,9 @@ func unmarshalContainerExtensionClassificationArray(rawMsg json.RawMessage) ([]C if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { return nil, err } - fArray := make([]ContainerExtensionClassification, len(rawMessages)) + fArray := make([]ExtensionClassification, len(rawMessages)) for index, rawMessage := range rawMessages { - f, err := unmarshalContainerExtensionClassification(rawMessage) + f, err := unmarshalExtensionClassification(rawMessage) if err != nil { return nil, err } @@ -95,7 +97,7 @@ func unmarshalContainerExtensionClassificationArray(rawMsg json.RawMessage) ([]C return fArray, nil } -func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (EnvironmentComputeClassification, error) { +func unmarshalHealthProbePropertiesClassification(rawMsg json.RawMessage) (HealthProbePropertiesClassification, error) { if rawMsg == nil { return nil, nil } @@ -103,12 +105,16 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b EnvironmentComputeClassification + var b HealthProbePropertiesClassification switch m["kind"] { - case "kubernetes": - b = &KubernetesCompute{} + case "exec": + b = &ExecHealthProbeProperties{} + case "httpGet": + b = &HTTPGetHealthProbeProperties{} + case "tcp": + b = &TCPHealthProbeProperties{} default: - b = &EnvironmentCompute{} + b = &HealthProbeProperties{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -116,7 +122,7 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm return b, nil } -func unmarshalEnvironmentExtensionClassification(rawMsg json.RawMessage) (EnvironmentExtensionClassification, error) { +func unmarshalRecipePropertiesClassification(rawMsg json.RawMessage) (RecipePropertiesClassification, error) { if rawMsg == nil { return nil, nil } @@ -124,12 +130,14 @@ func unmarshalEnvironmentExtensionClassification(rawMsg json.RawMessage) (Enviro if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b EnvironmentExtensionClassification - switch m["kind"] { - case "kubernetesMetadata": - b = &EnvironmentKubernetesMetadataExtension{} + var b RecipePropertiesClassification + switch m["templateKind"] { + case "bicep": + b = &BicepRecipeProperties{} + case "terraform": + b = &TerraformRecipeProperties{} default: - b = &EnvironmentExtension{} + b = &RecipeProperties{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -137,26 +145,26 @@ func unmarshalEnvironmentExtensionClassification(rawMsg json.RawMessage) (Enviro return b, nil } -func unmarshalEnvironmentExtensionClassificationArray(rawMsg json.RawMessage) ([]EnvironmentExtensionClassification, error) { +func unmarshalRecipePropertiesClassificationMap(rawMsg json.RawMessage) (map[string]RecipePropertiesClassification, error) { if rawMsg == nil { return nil, nil } - var rawMessages []json.RawMessage + var rawMessages map[string]json.RawMessage if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { return nil, err } - fArray := make([]EnvironmentExtensionClassification, len(rawMessages)) - for index, rawMessage := range rawMessages { - f, err := unmarshalEnvironmentExtensionClassification(rawMessage) + fMap := make(map[string]RecipePropertiesClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalRecipePropertiesClassification(rawMessage) if err != nil { return nil, err } - fArray[index] = f + fMap[key] = f } - return fArray, nil + return fMap, nil } -func unmarshalEnvironmentRecipePropertiesClassification(rawMsg json.RawMessage) (EnvironmentRecipePropertiesClassification, error) { +func unmarshalRecipePropertiesUpdateClassification(rawMsg json.RawMessage) (RecipePropertiesUpdateClassification, error) { if rawMsg == nil { return nil, nil } @@ -164,14 +172,14 @@ func unmarshalEnvironmentRecipePropertiesClassification(rawMsg json.RawMessage) if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b EnvironmentRecipePropertiesClassification + var b RecipePropertiesUpdateClassification switch m["templateKind"] { case "bicep": - b = &BicepRecipeProperties{} + b = &BicepRecipePropertiesUpdate{} case "terraform": - b = &TerraformRecipeProperties{} + b = &TerraformRecipePropertiesUpdate{} default: - b = &EnvironmentRecipeProperties{} + b = &RecipePropertiesUpdate{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -179,7 +187,7 @@ func unmarshalEnvironmentRecipePropertiesClassification(rawMsg json.RawMessage) return b, nil } -func unmarshalEnvironmentRecipePropertiesClassificationMap(rawMsg json.RawMessage) (map[string]EnvironmentRecipePropertiesClassification, error) { +func unmarshalRecipePropertiesUpdateClassificationMap(rawMsg json.RawMessage) (map[string]RecipePropertiesUpdateClassification, error) { if rawMsg == nil { return nil, nil } @@ -187,9 +195,9 @@ func unmarshalEnvironmentRecipePropertiesClassificationMap(rawMsg json.RawMessag if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { return nil, err } - fMap := make(map[string]EnvironmentRecipePropertiesClassification, len(rawMessages)) + fMap := make(map[string]RecipePropertiesUpdateClassification, len(rawMessages)) for key, rawMessage := range rawMessages { - f, err := unmarshalEnvironmentRecipePropertiesClassification(rawMessage) + f, err := unmarshalRecipePropertiesUpdateClassification(rawMessage) if err != nil { return nil, err } @@ -198,31 +206,6 @@ func unmarshalEnvironmentRecipePropertiesClassificationMap(rawMsg json.RawMessag return fMap, nil } -func unmarshalHealthProbePropertiesClassification(rawMsg json.RawMessage) (HealthProbePropertiesClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b HealthProbePropertiesClassification - switch m["kind"] { - case "exec": - b = &ExecHealthProbeProperties{} - case "httpGet": - b = &HTTPGetHealthProbeProperties{} - case "tcp": - b = &TCPHealthProbeProperties{} - default: - b = &HealthProbeProperties{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - func unmarshalVolumeClassification(rawMsg json.RawMessage) (VolumeClassification, error) { if rawMsg == nil { return nil, nil @@ -286,3 +269,45 @@ func unmarshalVolumePropertiesClassification(rawMsg json.RawMessage) (VolumeProp return b, nil } +func unmarshalVolumeUpdateClassification(rawMsg json.RawMessage) (VolumeUpdateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b VolumeUpdateClassification + switch m["kind"] { + case "ephemeral": + b = &EphemeralVolumeUpdate{} + case "persistent": + b = &PersistentVolumeUpdate{} + default: + b = &VolumeUpdate{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalVolumeUpdateClassificationMap(rawMsg json.RawMessage) (map[string]VolumeUpdateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages map[string]json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fMap := make(map[string]VolumeUpdateClassification, len(rawMessages)) + for key, rawMessage := range rawMessages { + f, err := unmarshalVolumeUpdateClassification(rawMessage) + if err != nil { + return nil, err + } + fMap[key] = f + } + return fMap, nil +} + diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go index 366f1e4285..83534c474f 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go @@ -9,7 +9,7 @@ package v20220315privatepreview // ApplicationsClientCreateOrUpdateResponse contains the response from method ApplicationsClient.CreateOrUpdate. type ApplicationsClientCreateOrUpdateResponse struct { - // Radius Application. + // Radius Application resource ApplicationResource } @@ -20,54 +20,54 @@ type ApplicationsClientDeleteResponse struct { // ApplicationsClientGetResponse contains the response from method ApplicationsClient.Get. type ApplicationsClientGetResponse struct { - // Radius Application. + // Radius Application resource ApplicationResource } // ApplicationsClientListByScopeResponse contains the response from method ApplicationsClient.NewListByScopePager. type ApplicationsClientListByScopeResponse struct { - // The list of applications. - ApplicationResourceList + // The response of a ApplicationResource list operation. + ApplicationResourceListResult } // ApplicationsClientUpdateResponse contains the response from method ApplicationsClient.Update. type ApplicationsClientUpdateResponse struct { - // Radius Application. + // Radius Application resource ApplicationResource } -// ContainersClientCreateOrUpdateResponse contains the response from method ContainersClient.CreateOrUpdate. +// ContainersClientCreateOrUpdateResponse contains the response from method ContainersClient.BeginCreateOrUpdate. type ContainersClientCreateOrUpdateResponse struct { - // Container + // Concrete tracked resource types can be created by aliasing this type using a specific property type. ContainerResource } -// ContainersClientDeleteResponse contains the response from method ContainersClient.Delete. +// ContainersClientDeleteResponse contains the response from method ContainersClient.BeginDelete. type ContainersClientDeleteResponse struct { // placeholder for future response values } // ContainersClientGetResponse contains the response from method ContainersClient.Get. type ContainersClientGetResponse struct { - // Container + // Concrete tracked resource types can be created by aliasing this type using a specific property type. ContainerResource } // ContainersClientListByScopeResponse contains the response from method ContainersClient.NewListByScopePager. type ContainersClientListByScopeResponse struct { - // The list of containers. - ContainerResourceList + // The response of a ContainerResource list operation. + ContainerResourceListResult } -// ContainersClientUpdateResponse contains the response from method ContainersClient.Update. +// ContainersClientUpdateResponse contains the response from method ContainersClient.BeginUpdate. type ContainersClientUpdateResponse struct { - // Container + // Concrete tracked resource types can be created by aliasing this type using a specific property type. ContainerResource } // EnvironmentsClientCreateOrUpdateResponse contains the response from method EnvironmentsClient.CreateOrUpdate. type EnvironmentsClientCreateOrUpdateResponse struct { - // Application environment. + // The environment resource EnvironmentResource } @@ -76,138 +76,150 @@ type EnvironmentsClientDeleteResponse struct { // placeholder for future response values } -// EnvironmentsClientGetRecipeMetadataResponse contains the response from method EnvironmentsClient.GetRecipeMetadata. -type EnvironmentsClientGetRecipeMetadataResponse struct { - // Properties of a Recipe linked to an Environment. - RecipeMetadataProperties +// EnvironmentsClientGetMetadataResponse contains the response from method EnvironmentsClient.GetMetadata. +type EnvironmentsClientGetMetadataResponse struct { + // The properties of a Recipe linked to an Environment. + RecipeGetMetadataResponse } // EnvironmentsClientGetResponse contains the response from method EnvironmentsClient.Get. type EnvironmentsClientGetResponse struct { - // Application environment. + // The environment resource EnvironmentResource } // EnvironmentsClientListByScopeResponse contains the response from method EnvironmentsClient.NewListByScopePager. type EnvironmentsClientListByScopeResponse struct { - // The list of environments. - EnvironmentResourceList + // The response of a EnvironmentResource list operation. + EnvironmentResourceListResult } // EnvironmentsClientUpdateResponse contains the response from method EnvironmentsClient.Update. type EnvironmentsClientUpdateResponse struct { - // Application environment. + // The environment resource EnvironmentResource } -// ExtendersClientCreateOrUpdateResponse contains the response from method ExtendersClient.CreateOrUpdate. +// ExtendersClientCreateOrUpdateResponse contains the response from method ExtendersClient.BeginCreateOrUpdate. type ExtendersClientCreateOrUpdateResponse struct { - // Extender portable resource. + // ExtenderResource link ExtenderResource } -// ExtendersClientDeleteResponse contains the response from method ExtendersClient.Delete. +// ExtendersClientDeleteResponse contains the response from method ExtendersClient.BeginDelete. type ExtendersClientDeleteResponse struct { // placeholder for future response values } // ExtendersClientGetResponse contains the response from method ExtendersClient.Get. type ExtendersClientGetResponse struct { - // Extender portable resource. + // ExtenderResource link ExtenderResource } -// ExtendersClientListByRootScopeResponse contains the response from method ExtendersClient.NewListByRootScopePager. -type ExtendersClientListByRootScopeResponse struct { - // Object that includes an array of Extender and a possible portable resource for next set. - ExtenderList +// ExtendersClientListByScopeResponse contains the response from method ExtendersClient.NewListByScopePager. +type ExtendersClientListByScopeResponse struct { + // The response of a ExtenderResource list operation. + ExtenderResourceListResult } // ExtendersClientListSecretsResponse contains the response from method ExtendersClient.ListSecrets. type ExtendersClientListSecretsResponse struct { - // The secret values for the given Extender portable resource. - Value map[string]any + // Any object + Object map[string]any } -// GatewaysClientCreateOrUpdateResponse contains the response from method GatewaysClient.CreateOrUpdate. +// ExtendersClientUpdateResponse contains the response from method ExtendersClient.BeginUpdate. +type ExtendersClientUpdateResponse struct { + // ExtenderResource link + ExtenderResource +} + +// GatewaysClientCreateOrUpdateResponse contains the response from method GatewaysClient.BeginCreateOrUpdate. type GatewaysClientCreateOrUpdateResponse struct { - // Gateway Resource that specifies how traffic is exposed to the application. + // Concrete tracked resource types can be created by aliasing this type using a specific property type. + GatewayResource +} + +// GatewaysClientCreateResponse contains the response from method GatewaysClient.BeginCreate. +type GatewaysClientCreateResponse struct { + // Concrete tracked resource types can be created by aliasing this type using a specific property type. GatewayResource } -// GatewaysClientDeleteResponse contains the response from method GatewaysClient.Delete. +// GatewaysClientDeleteResponse contains the response from method GatewaysClient.BeginDelete. type GatewaysClientDeleteResponse struct { // placeholder for future response values } // GatewaysClientGetResponse contains the response from method GatewaysClient.Get. type GatewaysClientGetResponse struct { - // Gateway Resource that specifies how traffic is exposed to the application. + // Concrete tracked resource types can be created by aliasing this type using a specific property type. GatewayResource } // GatewaysClientListByScopeResponse contains the response from method GatewaysClient.NewListByScopePager. type GatewaysClientListByScopeResponse struct { - // The list of Gateways. - GatewayResourceList + // The response of a GatewayResource list operation. + GatewayResourceListResult } -// GatewaysClientUpdateResponse contains the response from method GatewaysClient.Update. -type GatewaysClientUpdateResponse struct { - // Gateway Resource that specifies how traffic is exposed to the application. - GatewayResource -} - -// HTTPRoutesClientCreateOrUpdateResponse contains the response from method HTTPRoutesClient.CreateOrUpdate. +// HTTPRoutesClientCreateOrUpdateResponse contains the response from method HTTPRoutesClient.BeginCreateOrUpdate. type HTTPRoutesClientCreateOrUpdateResponse struct { - // Radius HTTP Route Resource. + // Radius HTTPRoute Resource. HTTPRouteResource } -// HTTPRoutesClientDeleteResponse contains the response from method HTTPRoutesClient.Delete. +// HTTPRoutesClientDeleteResponse contains the response from method HTTPRoutesClient.BeginDelete. type HTTPRoutesClientDeleteResponse struct { // placeholder for future response values } // HTTPRoutesClientGetResponse contains the response from method HTTPRoutesClient.Get. type HTTPRoutesClientGetResponse struct { - // Radius HTTP Route Resource. + // Radius HTTPRoute Resource. HTTPRouteResource } // HTTPRoutesClientListByScopeResponse contains the response from method HTTPRoutesClient.NewListByScopePager. type HTTPRoutesClientListByScopeResponse struct { - // The list of HTTP Routes. - HTTPRouteResourceList + // The response of a HttpRouteResource list operation. + HTTPRouteResourceListResult } -// HTTPRoutesClientUpdateResponse contains the response from method HTTPRoutesClient.Update. +// HTTPRoutesClientUpdateResponse contains the response from method HTTPRoutesClient.BeginUpdate. type HTTPRoutesClientUpdateResponse struct { - // Radius HTTP Route Resource. + // Radius HTTPRoute Resource. HTTPRouteResource } -// SecretStoresClientCreateOrUpdateResponse contains the response from method SecretStoresClient.CreateOrUpdate. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. +type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult +} + +// SecretStoresClientCreateOrUpdateResponse contains the response from method SecretStoresClient.BeginCreateOrUpdate. type SecretStoresClientCreateOrUpdateResponse struct { - // Radius SecretStore Resource. + // Concrete tracked resource types can be created by aliasing this type using a specific property type. SecretStoreResource } -// SecretStoresClientDeleteResponse contains the response from method SecretStoresClient.Delete. +// SecretStoresClientDeleteResponse contains the response from method SecretStoresClient.BeginDelete. type SecretStoresClientDeleteResponse struct { // placeholder for future response values } // SecretStoresClientGetResponse contains the response from method SecretStoresClient.Get. type SecretStoresClientGetResponse struct { - // Radius SecretStore Resource. + // Concrete tracked resource types can be created by aliasing this type using a specific property type. SecretStoreResource } -// SecretStoresClientListResponse contains the response from method SecretStoresClient.NewListPager. -type SecretStoresClientListResponse struct { - // The list of SecretStores. - SecretStoreResourceList +// SecretStoresClientListByScopeResponse contains the response from method SecretStoresClient.NewListByScopePager. +type SecretStoresClientListByScopeResponse struct { + // The response of a SecretStoreResource list operation. + SecretStoreResourceListResult } // SecretStoresClientListSecretsResponse contains the response from method SecretStoresClient.ListSecrets. @@ -216,38 +228,38 @@ type SecretStoresClientListSecretsResponse struct { SecretStoreListSecretsResult } -// SecretStoresClientUpdateResponse contains the response from method SecretStoresClient.Update. +// SecretStoresClientUpdateResponse contains the response from method SecretStoresClient.BeginUpdate. type SecretStoresClientUpdateResponse struct { - // Radius SecretStore Resource. + // Concrete tracked resource types can be created by aliasing this type using a specific property type. SecretStoreResource } -// VolumesClientCreateOrUpdateResponse contains the response from method VolumesClient.CreateOrUpdate. +// VolumesClientCreateOrUpdateResponse contains the response from method VolumesClient.BeginCreateOrUpdate. type VolumesClientCreateOrUpdateResponse struct { - // Radius Volume Resource. + // Radius Volume resource. VolumeResource } -// VolumesClientDeleteResponse contains the response from method VolumesClient.Delete. +// VolumesClientDeleteResponse contains the response from method VolumesClient.BeginDelete. type VolumesClientDeleteResponse struct { // placeholder for future response values } // VolumesClientGetResponse contains the response from method VolumesClient.Get. type VolumesClientGetResponse struct { - // Radius Volume Resource. + // Radius Volume resource. VolumeResource } // VolumesClientListByScopeResponse contains the response from method VolumesClient.NewListByScopePager. type VolumesClientListByScopeResponse struct { - // The list of Volumes. - VolumeResourceList + // The response of a VolumeResource list operation. + VolumeResourceListResult } -// VolumesClientUpdateResponse contains the response from method VolumesClient.Update. +// VolumesClientUpdateResponse contains the response from method VolumesClient.BeginUpdate. type VolumesClientUpdateResponse struct { - // Radius Volume Resource. + // Radius Volume resource. VolumeResource } diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_secretstores_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_secretstores_client.go index f26ec8333b..6131dcbcdc 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_secretstores_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_secretstores_client.go @@ -27,7 +27,9 @@ type SecretStoresClient struct { } // NewSecretStoresClient creates a new instance of SecretStoresClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSecretStoresClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretStoresClient, error) { @@ -42,34 +44,52 @@ func NewSecretStoresClient(rootScope string, credential azcore.TokenCredential, return client, nil } -// CreateOrUpdate - Create or update a secret store. +// BeginCreateOrUpdate - Create a SecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - secretStoreName - The name of the secret store. -// - secretStoreResource - SecretStore details -// - options - SecretStoresClientCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.CreateOrUpdate +// - secretStoreName - SecretStore name +// - resource - Resource create parameters. +// - options - SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate // method. -func (client *SecretStoresClient) CreateOrUpdate(ctx context.Context, secretStoreName string, secretStoreResource SecretStoreResource, options *SecretStoresClientCreateOrUpdateOptions) (SecretStoresClientCreateOrUpdateResponse, error) { +func (client *SecretStoresClient) BeginCreateOrUpdate(ctx context.Context, secretStoreName string, resource SecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecretStoresClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, secretStoreName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretStoresClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SecretStoresClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a SecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *SecretStoresClient) createOrUpdate(ctx context.Context, secretStoreName string, resource SecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, secretStoreName, secretStoreResource, options) + req, err := client.createOrUpdateCreateRequest(ctx, secretStoreName, resource, options) if err != nil { - return SecretStoresClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return SecretStoresClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return SecretStoresClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SecretStoresClient) createOrUpdateCreateRequest(ctx context.Context, secretStoreName string, secretStoreResource SecretStoreResource, options *SecretStoresClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SecretStoresClient) createOrUpdateCreateRequest(ctx context.Context, secretStoreName string, resource SecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if secretStoreName == "" { @@ -84,46 +104,57 @@ func (client *SecretStoresClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, secretStoreResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *SecretStoresClient) createOrUpdateHandleResponse(resp *http.Response) (SecretStoresClientCreateOrUpdateResponse, error) { - result := SecretStoresClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecretStoreResource); err != nil { - return SecretStoresClientCreateOrUpdateResponse{}, err +// BeginDelete - Delete a SecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - secretStoreName - SecretStore name +// - options - SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete +// method. +func (client *SecretStoresClient) BeginDelete(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*runtime.Poller[SecretStoresClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, secretStoreName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretStoresClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SecretStoresClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Delete a secret store. +// Delete - Delete a SecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - secretStoreName - The name of the secret store. -// - options - SecretStoresClientDeleteOptions contains the optional parameters for the SecretStoresClient.Delete method. -func (client *SecretStoresClient) Delete(ctx context.Context, secretStoreName string, options *SecretStoresClientDeleteOptions) (SecretStoresClientDeleteResponse, error) { +func (client *SecretStoresClient) deleteOperation(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, secretStoreName, options) if err != nil { - return SecretStoresClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return SecretStoresClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return SecretStoresClientDeleteResponse{}, err + return nil, err } - return SecretStoresClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *SecretStoresClient) deleteCreateRequest(ctx context.Context, secretStoreName string, options *SecretStoresClientDeleteOptions) (*policy.Request, error) { +func (client *SecretStoresClient) deleteCreateRequest(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if secretStoreName == "" { @@ -141,11 +172,11 @@ func (client *SecretStoresClient) deleteCreateRequest(ctx context.Context, secre return req, nil } -// Get - Gets the properties of a secret store. +// Get - Get a SecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - secretStoreName - The name of the secret store. +// - secretStoreName - SecretStore name // - options - SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. func (client *SecretStoresClient) Get(ctx context.Context, secretStoreName string, options *SecretStoresClientGetOptions) (SecretStoresClientGetResponse, error) { var err error @@ -193,40 +224,41 @@ func (client *SecretStoresClient) getHandleResponse(resp *http.Response) (Secret return result, nil } -// NewListPager - List all secret stores in the given scope. +// NewListByScopePager - List SecretStoreResource resources by Scope // // Generated from API version 2022-03-15-privatepreview -// - options - SecretStoresClientListOptions contains the optional parameters for the SecretStoresClient.NewListPager method. -func (client *SecretStoresClient) NewListPager(options *SecretStoresClientListOptions) (*runtime.Pager[SecretStoresClientListResponse]) { - return runtime.NewPager(runtime.PagingHandler[SecretStoresClientListResponse]{ - More: func(page SecretStoresClientListResponse) bool { +// - options - SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.NewListByScopePager +// method. +func (client *SecretStoresClient) NewListByScopePager(options *SecretStoresClientListByScopeOptions) (*runtime.Pager[SecretStoresClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[SecretStoresClientListByScopeResponse]{ + More: func(page SecretStoresClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *SecretStoresClientListResponse) (SecretStoresClientListResponse, error) { + Fetcher: func(ctx context.Context, page *SecretStoresClientListByScopeResponse) (SecretStoresClientListByScopeResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listCreateRequest(ctx, options) + req, err = client.listByScopeCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return SecretStoresClientListResponse{}, err + return SecretStoresClientListByScopeResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return SecretStoresClientListResponse{}, err + return SecretStoresClientListByScopeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecretStoresClientListResponse{}, runtime.NewResponseError(resp) + return SecretStoresClientListByScopeResponse{}, runtime.NewResponseError(resp) } - return client.listHandleResponse(resp) + return client.listByScopeHandleResponse(resp) }, }) } -// listCreateRequest creates the List request. -func (client *SecretStoresClient) listCreateRequest(ctx context.Context, options *SecretStoresClientListOptions) (*policy.Request, error) { +// listByScopeCreateRequest creates the ListByScope request. +func (client *SecretStoresClient) listByScopeCreateRequest(ctx context.Context, options *SecretStoresClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/secretStores" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -240,11 +272,11 @@ func (client *SecretStoresClient) listCreateRequest(ctx context.Context, options return req, nil } -// listHandleResponse handles the List response. -func (client *SecretStoresClient) listHandleResponse(resp *http.Response) (SecretStoresClientListResponse, error) { - result := SecretStoresClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecretStoreResourceList); err != nil { - return SecretStoresClientListResponse{}, err +// listByScopeHandleResponse handles the ListByScope response. +func (client *SecretStoresClient) listByScopeHandleResponse(resp *http.Response) (SecretStoresClientListByScopeResponse, error) { + result := SecretStoresClientListByScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecretStoreResourceListResult); err != nil { + return SecretStoresClientListByScopeResponse{}, err } return result, nil } @@ -253,12 +285,13 @@ func (client *SecretStoresClient) listHandleResponse(resp *http.Response) (Secre // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - secretStoreName - The name of the secret store. +// - secretStoreName - SecretStore name +// - body - The content of the action request // - options - SecretStoresClientListSecretsOptions contains the optional parameters for the SecretStoresClient.ListSecrets // method. -func (client *SecretStoresClient) ListSecrets(ctx context.Context, secretStoreName string, options *SecretStoresClientListSecretsOptions) (SecretStoresClientListSecretsResponse, error) { +func (client *SecretStoresClient) ListSecrets(ctx context.Context, secretStoreName string, body map[string]any, options *SecretStoresClientListSecretsOptions) (SecretStoresClientListSecretsResponse, error) { var err error - req, err := client.listSecretsCreateRequest(ctx, secretStoreName, options) + req, err := client.listSecretsCreateRequest(ctx, secretStoreName, body, options) if err != nil { return SecretStoresClientListSecretsResponse{}, err } @@ -275,7 +308,7 @@ func (client *SecretStoresClient) ListSecrets(ctx context.Context, secretStoreNa } // listSecretsCreateRequest creates the ListSecrets request. -func (client *SecretStoresClient) listSecretsCreateRequest(ctx context.Context, secretStoreName string, options *SecretStoresClientListSecretsOptions) (*policy.Request, error) { +func (client *SecretStoresClient) listSecretsCreateRequest(ctx context.Context, secretStoreName string, body map[string]any, options *SecretStoresClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if secretStoreName == "" { @@ -290,6 +323,9 @@ func (client *SecretStoresClient) listSecretsCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err +} return req, nil } @@ -302,33 +338,52 @@ func (client *SecretStoresClient) listSecretsHandleResponse(resp *http.Response) return result, nil } -// Update - Update the properties of an existing secret store. +// BeginUpdate - Update a SecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - secretStoreName - SecretStore name +// - properties - The resource properties to be updated. +// - options - SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate +// method. +func (client *SecretStoresClient) BeginUpdate(ctx context.Context, secretStoreName string, properties SecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*runtime.Poller[SecretStoresClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, secretStoreName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretStoresClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[SecretStoresClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update a SecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - secretStoreName - The name of the secret store. -// - secretStoreResource - SecretStore details -// - options - SecretStoresClientUpdateOptions contains the optional parameters for the SecretStoresClient.Update method. -func (client *SecretStoresClient) Update(ctx context.Context, secretStoreName string, secretStoreResource SecretStoreResource, options *SecretStoresClientUpdateOptions) (SecretStoresClientUpdateResponse, error) { +func (client *SecretStoresClient) update(ctx context.Context, secretStoreName string, properties SecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*http.Response, error) { var err error - req, err := client.updateCreateRequest(ctx, secretStoreName, secretStoreResource, options) + req, err := client.updateCreateRequest(ctx, secretStoreName, properties, options) if err != nil { - return SecretStoresClientUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return SecretStoresClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return SecretStoresClientUpdateResponse{}, err + return nil, err } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // updateCreateRequest creates the Update request. -func (client *SecretStoresClient) updateCreateRequest(ctx context.Context, secretStoreName string, secretStoreResource SecretStoreResource, options *SecretStoresClientUpdateOptions) (*policy.Request, error) { +func (client *SecretStoresClient) updateCreateRequest(ctx context.Context, secretStoreName string, properties SecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if secretStoreName == "" { @@ -343,18 +398,9 @@ func (client *SecretStoresClient) updateCreateRequest(ctx context.Context, secre reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, secretStoreResource); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil } -// updateHandleResponse handles the Update response. -func (client *SecretStoresClient) updateHandleResponse(resp *http.Response) (SecretStoresClientUpdateResponse, error) { - result := SecretStoresClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SecretStoreResource); err != nil { - return SecretStoresClientUpdateResponse{}, err - } - return result, nil -} - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_volumes_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_volumes_client.go index 9d8a497c58..77c0c7ba68 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_volumes_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_volumes_client.go @@ -27,7 +27,9 @@ type VolumesClient struct { } // NewVolumesClient creates a new instance of VolumesClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID} +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewVolumesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VolumesClient, error) { @@ -42,33 +44,52 @@ func NewVolumesClient(rootScope string, credential azcore.TokenCredential, optio return client, nil } -// CreateOrUpdate - Create or update an Volume. +// BeginCreateOrUpdate - Create a VolumeResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - volumeName - The name of the Volume. -// - volumeResource - Volume details -// - options - VolumesClientCreateOrUpdateOptions contains the optional parameters for the VolumesClient.CreateOrUpdate method. -func (client *VolumesClient) CreateOrUpdate(ctx context.Context, volumeName string, volumeResource VolumeResource, options *VolumesClientCreateOrUpdateOptions) (VolumesClientCreateOrUpdateResponse, error) { +// - volumeName - Volume name +// - resource - Resource create parameters. +// - options - VolumesClientBeginCreateOrUpdateOptions contains the optional parameters for the VolumesClient.BeginCreateOrUpdate +// method. +func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, volumeName string, resource VolumeResource, options *VolumesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VolumesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, volumeName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[VolumesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a VolumeResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +func (client *VolumesClient) createOrUpdate(ctx context.Context, volumeName string, resource VolumeResource, options *VolumesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error - req, err := client.createOrUpdateCreateRequest(ctx, volumeName, volumeResource, options) + req, err := client.createOrUpdateCreateRequest(ctx, volumeName, resource, options) if err != nil { - return VolumesClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return VolumesClientCreateOrUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return VolumesClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, volumeName string, volumeResource VolumeResource, options *VolumesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, volumeName string, resource VolumeResource, options *VolumesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/volumes/{volumeName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if volumeName == "" { @@ -83,46 +104,56 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, vo reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, volumeResource); err != nil { + if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *VolumesClient) createOrUpdateHandleResponse(resp *http.Response) (VolumesClientCreateOrUpdateResponse, error) { - result := VolumesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VolumeResource); err != nil { - return VolumesClientCreateOrUpdateResponse{}, err +// BeginDelete - Delete a VolumeResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - volumeName - Volume name +// - options - VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. +func (client *VolumesClient) BeginDelete(ctx context.Context, volumeName string, options *VolumesClientBeginDeleteOptions) (*runtime.Poller[VolumesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, volumeName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[VolumesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Delete an Volume. +// Delete - Delete a VolumeResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - volumeName - The name of the Volume. -// - options - VolumesClientDeleteOptions contains the optional parameters for the VolumesClient.Delete method. -func (client *VolumesClient) Delete(ctx context.Context, volumeName string, options *VolumesClientDeleteOptions) (VolumesClientDeleteResponse, error) { +func (client *VolumesClient) deleteOperation(ctx context.Context, volumeName string, options *VolumesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, volumeName, options) if err != nil { - return VolumesClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return VolumesClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return VolumesClientDeleteResponse{}, err + return nil, err } - return VolumesClientDeleteResponse{}, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *VolumesClient) deleteCreateRequest(ctx context.Context, volumeName string, options *VolumesClientDeleteOptions) (*policy.Request, error) { +func (client *VolumesClient) deleteCreateRequest(ctx context.Context, volumeName string, options *VolumesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/volumes/{volumeName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if volumeName == "" { @@ -140,11 +171,11 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, volumeName return req, nil } -// Get - Gets the properties of an Volume. +// Get - Get a VolumeResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - volumeName - The name of the Volume. +// - volumeName - Volume name // - options - VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. func (client *VolumesClient) Get(ctx context.Context, volumeName string, options *VolumesClientGetOptions) (VolumesClientGetResponse, error) { var err error @@ -192,7 +223,7 @@ func (client *VolumesClient) getHandleResponse(resp *http.Response) (VolumesClie return result, nil } -// NewListByScopePager - List all volumes in the given scope. +// NewListByScopePager - List VolumeResource resources by Scope // // Generated from API version 2022-03-15-privatepreview // - options - VolumesClientListByScopeOptions contains the optional parameters for the VolumesClient.NewListByScopePager method. @@ -242,39 +273,57 @@ func (client *VolumesClient) listByScopeCreateRequest(ctx context.Context, optio // listByScopeHandleResponse handles the ListByScope response. func (client *VolumesClient) listByScopeHandleResponse(resp *http.Response) (VolumesClientListByScopeResponse, error) { result := VolumesClientListByScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VolumeResourceList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.VolumeResourceListResult); err != nil { return VolumesClientListByScopeResponse{}, err } return result, nil } -// Update - Update the properties of an existing Volume. +// BeginUpdate - Update a VolumeResource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-03-15-privatepreview +// - volumeName - Volume name +// - properties - The resource properties to be updated. +// - options - VolumesClientBeginUpdateOptions contains the optional parameters for the VolumesClient.BeginUpdate method. +func (client *VolumesClient) BeginUpdate(ctx context.Context, volumeName string, properties VolumeResourceUpdate, options *VolumesClientBeginUpdateOptions) (*runtime.Poller[VolumesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, volumeName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[VolumesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update a VolumeResource // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - volumeName - The name of the Volume. -// - volumeResource - Volume details -// - options - VolumesClientUpdateOptions contains the optional parameters for the VolumesClient.Update method. -func (client *VolumesClient) Update(ctx context.Context, volumeName string, volumeResource VolumeResource, options *VolumesClientUpdateOptions) (VolumesClientUpdateResponse, error) { +func (client *VolumesClient) update(ctx context.Context, volumeName string, properties VolumeResourceUpdate, options *VolumesClientBeginUpdateOptions) (*http.Response, error) { var err error - req, err := client.updateCreateRequest(ctx, volumeName, volumeResource, options) + req, err := client.updateCreateRequest(ctx, volumeName, properties, options) if err != nil { - return VolumesClientUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return VolumesClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) - return VolumesClientUpdateResponse{}, err + return nil, err } - resp, err := client.updateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // updateCreateRequest creates the Update request. -func (client *VolumesClient) updateCreateRequest(ctx context.Context, volumeName string, volumeResource VolumeResource, options *VolumesClientUpdateOptions) (*policy.Request, error) { +func (client *VolumesClient) updateCreateRequest(ctx context.Context, volumeName string, properties VolumeResourceUpdate, options *VolumesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Core/volumes/{volumeName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if volumeName == "" { @@ -289,18 +338,9 @@ func (client *VolumesClient) updateCreateRequest(ctx context.Context, volumeName reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, volumeResource); err != nil { + if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } return req, nil } -// updateHandleResponse handles the Update response. -func (client *VolumesClient) updateHandleResponse(resp *http.Response) (VolumesClientUpdateResponse, error) { - result := VolumesClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.VolumeResource); err != nil { - return VolumesClientUpdateResponse{}, err - } - return result, nil -} - diff --git a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go index 48bf952318..c881d2a39b 100644 --- a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go +++ b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go @@ -28,7 +28,7 @@ import ( func EnvironmentRecipePropertiesDataModelToVersioned(model *datamodel.EnvironmentRecipeProperties, version string) (v1.VersionedModelInterface, error) { switch version { case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RecipeMetadataProperties{} + versioned := &v20220315privatepreview.RecipeGetMetadataResponse{} if err := versioned.ConvertFrom(model); err != nil { return nil, err } @@ -43,7 +43,7 @@ func EnvironmentRecipePropertiesDataModelToVersioned(model *datamodel.Environmen func RecipeDataModelFromVersioned(content []byte, version string) (*datamodel.Recipe, error) { switch version { case v20220315privatepreview.Version: - am := &v20220315privatepreview.Recipe{} + am := &v20220315privatepreview.RecipeGetMetadata{} if err := json.Unmarshal(content, am); err != nil { return nil, err } diff --git a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go index 4ea201d3f1..39fb8c2c0f 100644 --- a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go +++ b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go @@ -39,7 +39,7 @@ func TestEnvironmentRecipePropertiesDataModelToVersioned(t *testing.T) { { "../../api/v20220315privatepreview/testdata/environmentrecipepropertiesdatamodel.json", "2022-03-15-privatepreview", - &v20220315privatepreview.RecipeMetadataProperties{}, + &v20220315privatepreview.RecipeGetMetadataResponse{}, nil, }, // TODO: add new conversion tests. diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go index cf32f0a6f9..7a2e16a7fb 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go @@ -67,7 +67,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { _ = resp.Apply(ctx, w, req) require.Equal(t, 200, w.Result().StatusCode) - actualOutput := &v20220315privatepreview.RecipeMetadataProperties{} + actualOutput := &v20220315privatepreview.RecipeGetMetadataResponse{} _ = json.Unmarshal(w.Body.Bytes(), actualOutput) require.Equal(t, expectedOutput, actualOutput) }) diff --git a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go index 2b9d2aef64..e34ab716e7 100644 --- a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go +++ b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go @@ -44,9 +44,9 @@ func getTestModels20220315privatepreview() (*v20220315privatepreview.Environment return envInput, envDataModel, expectedOutput } -func getTestModelsGetRecipeMetadata20220315privatepreview() (*v20220315privatepreview.Recipe, *datamodel.Environment, *v20220315privatepreview.RecipeMetadataProperties) { +func getTestModelsGetRecipeMetadata20220315privatepreview() (*v20220315privatepreview.RecipeGetMetadata, *datamodel.Environment, *v20220315privatepreview.RecipeGetMetadataResponse) { rawInput := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_input.json") - envInput := &v20220315privatepreview.Recipe{} + envInput := &v20220315privatepreview.RecipeGetMetadata{} _ = json.Unmarshal(rawInput, envInput) rawExistingDataModel := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_datamodel.json") @@ -54,15 +54,15 @@ func getTestModelsGetRecipeMetadata20220315privatepreview() (*v20220315privatepr _ = json.Unmarshal(rawExistingDataModel, envExistingDataModel) rawExpectedOutput := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_output.json") - expectedOutput := &v20220315privatepreview.RecipeMetadataProperties{} + expectedOutput := &v20220315privatepreview.RecipeGetMetadataResponse{} _ = json.Unmarshal(rawExpectedOutput, expectedOutput) return envInput, envExistingDataModel, expectedOutput } -func getTestModelsGetRecipeMetadataForNonExistingRecipe20220315privatepreview() (*v20220315privatepreview.Recipe, *datamodel.Environment) { +func getTestModelsGetRecipeMetadataForNonExistingRecipe20220315privatepreview() (*v20220315privatepreview.RecipeGetMetadata, *datamodel.Environment) { rawInput := testutil.ReadFixture("environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json") - envInput := &v20220315privatepreview.Recipe{} + envInput := &v20220315privatepreview.RecipeGetMetadata{} _ = json.Unmarshal(rawInput, envInput) rawExistingDataModel := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_datamodel.json") diff --git a/pkg/recipes/configloader/environment.go b/pkg/recipes/configloader/environment.go index 4493d98060..1c05b420eb 100644 --- a/pkg/recipes/configloader/environment.go +++ b/pkg/recipes/configloader/environment.go @@ -139,10 +139,10 @@ func getRecipeDefinition(environment *v20220315privatepreview.EnvironmentResourc definition := &recipes.EnvironmentDefinition{ Name: recipeName, - Driver: *found.GetEnvironmentRecipeProperties().TemplateKind, + Driver: *found.GetRecipeProperties().TemplateKind, ResourceType: resource.Type(), - Parameters: found.GetEnvironmentRecipeProperties().Parameters, - TemplatePath: *found.GetEnvironmentRecipeProperties().TemplatePath, + Parameters: found.GetRecipeProperties().Parameters, + TemplatePath: *found.GetRecipeProperties().TemplatePath, } switch c := found.(type) { case *v20220315privatepreview.TerraformRecipeProperties: diff --git a/pkg/recipes/configloader/environment_test.go b/pkg/recipes/configloader/environment_test.go index 93889e899d..60a2be8f17 100644 --- a/pkg/recipes/configloader/environment_test.go +++ b/pkg/recipes/configloader/environment_test.go @@ -220,7 +220,7 @@ func TestGetRecipeDefinition(t *testing.T) { Scope: to.Ptr(azureScope), }, }, - Recipes: map[string]map[string]model.EnvironmentRecipePropertiesClassification{ + Recipes: map[string]map[string]model.RecipePropertiesClassification{ "Applications.Link/mongoDatabases": { recipeName: &model.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/applications.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/applications.json deleted file mode 100644 index 602fbfc561..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/applications.json +++ /dev/null @@ -1,412 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core Application Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/applications": { - "get": { - "description": "List all applications in the given scope.", - "operationId": "Applications_ListByScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusApplicationsListByScope": { - "$ref": "./examples/ApplicationsListByScope.json" - } - }, - "tags": [ - "Applications" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - - ], - "responses": { - "200": { - "description": "Application details.", - "schema": { - "$ref": "#/definitions/ApplicationResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/applications/{applicationName}": { - "get": { - "description": "Gets the properties of an Application.", - "operationId": "Applications_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusApplicationsGet": { - "$ref": "./examples/ApplicationsGet.json" - } - }, - "tags": [ - "Applications" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "#/parameters/ApplicationNameParameter" - } - ], - "responses": { - "200": { - "description": "Application details.", - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update an Application.", - "operationId": "Applications_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusApplicationsPut": { - "$ref": "./examples/ApplicationsPut.json" - } - }, - "tags": [ - "Applications" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ApplicationNameParameter" - }, - { - "name": "ApplicationResource", - "description": "application details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing Application.", - "operationId": "Applications_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusApplicationsPatch": { - "$ref": "./examples/ApplicationsPatch.json" - } - }, - "tags": [ - "Applications" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ApplicationNameParameter" - }, - { - "name": "ApplicationResource", - "description": "application details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/ApplicationResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete an Application.", - "operationId": "Applications_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusApplicationsDelete": { - "$ref": "./examples/ApplicationsDelete.json" - } - }, - "tags": [ - "Applications" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ApplicationNameParameter" - } - ], - "responses": { - "200": { - "description": "The application was successfully deleted." - }, - "202": { - "description": "The application will be deleted asynchronously." - }, - "204": { - "description": "The application does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "ApplicationResourceList": { - "description": "The list of applications.", - "type": "object", - "properties": { - "value": { - "description": "The list of applications.", - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of applications list.", - "type": "string" - } - } - }, - "ApplicationResource": { - "description": "Radius Application.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ApplicationProperties" - } - } - }, - "ApplicationExtension": { - "allOf": [ - { - "$ref": "global.json#/definitions/Extension" - } - ] - }, - "ApplicationKubernetesNamespaceExtension": { - "description": "Specifies application-scoped namespace.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ApplicationExtension" - } - ], - "properties": { - "namespace": { - "type": "string", - "description": "The Kubernetes namespace to use for this application." - } - }, - "required": [ - "namespace" - ], - "x-ms-discriminator-value": "kubernetesNamespace" - }, - "ApplicationKubernetesMetadataExtension": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ApplicationExtension" - } - ], - "description": "Specifies the metadata that should be applied to Kubernetes resources created by all Containers in this Application.", - "properties": { - "annotations": { - "description": "Annotations to be applied to the Kubernetes resources output by the resource", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "Labels to be applied to the Kubernetes resources output by the resource", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false, - "x-ms-discriminator-value": "kubernetesMetadata" - }, - "ApplicationProperties": { - "description": "Application properties", - "type": "object", - "required": [ - "environment" - ], - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the application at the time the operation was called." - }, - "environment": { - "description": "The resource id of the environment linked to application.", - "type": "string" - }, - "extensions": { - "type": "array", - "items": { - "$ref": "#/definitions/ApplicationExtension" - }, - "description": "Extensions spec of the resource" - }, - "status": { - "$ref": "global.json#/definitions/ResourceStatus", - "description": "Status of the resource", - "readOnly": true - } - } - } - }, - "parameters": { - "ApplicationNameParameter": { - "name": "applicationName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the application.", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/containers.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/containers.json deleted file mode 100644 index 277821d494..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/containers.json +++ /dev/null @@ -1,787 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core Container Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/containers": { - "get": { - "description": "List all containers in the given scope.", - "operationId": "Containers_ListByScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ContainersListByScope": { - "$ref": "./examples/ContainersListByScope.json" - } - }, - "tags": [ - "Containers" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "List of Container resources", - "schema": { - "$ref": "#/definitions/ContainerResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/containers/{containerName}": { - "get": { - "description": "Gets the properties of an Container.", - "operationId": "Containers_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ContainersGet": { - "$ref": "./examples/ContainersGet.json" - } - }, - "tags": [ - "Containers" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ContainerNameParameter" - } - ], - "responses": { - "200": { - "description": "Container details.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update a Container.", - "operationId": "Containers_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ContainersPut": { - "$ref": "./examples/ContainersPut.json" - } - }, - "tags": [ - "Containers" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ContainerNameParameter" - }, - { - "name": "ContainerResource", - "description": "containers details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ContainerResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing Container.", - "operationId": "Containers_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ContainersPatch": { - "$ref": "./examples/ContainersPatch.json" - } - }, - "tags": [ - "Containers" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ContainerNameParameter" - }, - { - "name": "ContainersResource", - "description": "Container details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ContainerResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/ContainerResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete a Container.", - "operationId": "Containers_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ContainersDelete": { - "$ref": "./examples/ContainersDelete.json" - } - }, - "tags": [ - "Containers" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/ContainerNameParameter" - } - ], - "responses": { - "200": { - "description": "The container was successfully deleted." - }, - "202": { - "description": "The container will be deleted asynchronously." - }, - "204": { - "description": "The container does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "ContainerResourceList": { - "description": "The list of containers.", - "type": "object", - "properties": { - "value": { - "description": "The list of containers.", - "type": "array", - "items": { - "$ref": "#/definitions/ContainerResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of containers list.", - "type": "string" - } - } - }, - "ContainerResource": { - "description": "Container", - "type": "object", - "x-ms-azure-resource": true, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ContainerProperties" - } - } - }, - "IamProperties": { - "description": "The properties of IAM", - "type": "object", - "properties": { - "kind": { - "description": "The kind of IAM provider to configure", - "type": "string", - "enum": [ - "azure" - ], - "x-ms-enum": { - "name": "Kind", - "modelAsString": true - } - }, - "roles": { - "description": "RBAC permissions to be assigned on the source resource", - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "kind" - ] - }, - "ConnectionProperties": { - "properties": { - "source": { - "description": "The source of the connection", - "type": "string" - }, - "disableDefaultEnvVars": { - "default": false, - "type": "boolean" - }, - "iam": { - "$ref": "#/definitions/IamProperties" - } - }, - "required": [ - "source" - ] - }, - "ContainerPort": { - "description": "Specifies a listening port for the container", - "type": "object", - "additionalProperties": false, - "required": [ - "containerPort" - ], - "properties": { - "containerPort": { - "description": "The listening port number", - "type": "integer" - }, - "protocol": { - "description": "Protocol in use by the port", - "type": "string", - "enum": [ - "TCP", - "UDP" - ], - "x-ms-enum": { - "name": "Protocol", - "modelAsString": true - } - }, - "provides": { - "description": "Specifies a route provided by this port", - "type": "string" - }, - "scheme": { - "description": "Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value.", - "type": "string" - }, - "port": { - "description": "Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired.", - "type": "integer" - } - } - }, - "HealthProbeProperties": { - "description": "Properties for readiness/liveness probe", - "type": "object", - "discriminator": "kind", - "properties": { - "kind": { - "description": "The HealthProbeProperties kind", - "type": "string" - }, - "initialDelaySeconds": { - "description": "Initial delay in seconds before probing for readiness/liveness", - "type": "number" - }, - "failureThreshold": { - "description": "Threshold number of times the probe fails after which a failure would be reported", - "type": "number" - }, - "periodSeconds": { - "description": "Interval for the readiness/liveness probe in seconds", - "type": "number" - }, - "timeoutSeconds": { - "description": "Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds", - "type": "number" - } - }, - "required": [ - "kind" - ] - }, - "HttpGetHealthProbeProperties": { - "description": "Specifies the properties for readiness/liveness probe using HTTP Get", - "allOf": [ - { - "$ref": "#/definitions/HealthProbeProperties" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "containerPort": { - "description": "The listening port number", - "type": "integer" - }, - "path": { - "description": "The route to make the HTTP request on", - "type": "string" - }, - "headers": { - "description": "Custom HTTP headers to add to the get request", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": [ - "kind", - "containerPort", - "path" - ], - "x-ms-discriminator-value": "httpGet" - }, - "TcpHealthProbeProperties": { - "description": "Specifies the properties for readiness/liveness probe using TCP", - "allOf": [ - { - "$ref": "#/definitions/HealthProbeProperties" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "containerPort": { - "description": "The listening port number", - "type": "integer" - } - }, - "required": [ - "kind", - "containerPort" - ], - "x-ms-discriminator-value": "tcp" - }, - "ExecHealthProbeProperties": { - "description": "Specifies the properties for readiness/liveness probe using an executable", - "allOf": [ - { - "$ref": "#/definitions/HealthProbeProperties" - } - ], - "type": "object", - "additionalProperties": false, - "properties": { - "command": { - "description": "Command to execute to probe readiness/liveness", - "type": "string" - } - }, - "required": [ - "kind", - "command" - ], - "x-ms-discriminator-value": "exec" - }, - "Volume": { - "description": "Specifies a volume for a container", - "discriminator": "kind", - "properties": { - "kind": { - "description": "The Volume kind", - "type": "string" - }, - "mountPath": { - "description": "The path where the volume is mounted", - "type": "string" - } - }, - "required": [ - "kind" - ], - "type": "object" - }, - "EphemeralVolume": { - "description": "Specifies an ephemeral volume for a container", - "allOf": [ - { - "$ref": "#/definitions/Volume" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "mountPath", - "kind", - "managedStore" - ], - "properties": { - "managedStore": { - "description": "Backing store for the ephemeral volume", - "type": "string", - "enum": [ - "memory", - "disk" - ], - "x-ms-enum": { - "name": "ManagedStore", - "modelAsString": true - } - } - }, - "x-ms-discriminator-value": "ephemeral" - }, - "PersistentVolume": { - "description": "Specifies a persistent volume for a container", - "allOf": [ - { - "$ref": "#/definitions/Volume" - } - ], - "type": "object", - "additionalProperties": false, - "required": [ - "mountPath", - "kind", - "source" - ], - "properties": { - "permission": { - "description": "Container read/write access to the volume", - "type": "string", - "enum": [ - "read", - "write" - ], - "x-ms-enum": { - "name": "VolumePermission", - "modelAsString": true - } - }, - "source": { - "description": "The source of the volume", - "type": "string" - } - }, - "x-ms-discriminator-value": "persistent" - }, - "Container": { - "description": "Definition of a container.", - "type": "object", - "required": [ - "image" - ], - "properties": { - "image": { - "description": "The registry and image to download and run in your container", - "type": "string" - }, - "env": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "ports": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ContainerPort" - } - }, - "readinessProbe": { - "$ref": "#/definitions/HealthProbeProperties" - }, - "livenessProbe": { - "$ref": "#/definitions/HealthProbeProperties" - }, - "volumes": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Volume" - } - }, - "command": { - "description": "Entrypoint array. Overrides the container image's ENTRYPOINT", - "type": "array", - "items": { - "type": "string" - } - }, - "args": { - "description": "Arguments to the entrypoint. Overrides the container image's CMD", - "type": "array", - "items": { - "type": "string" - } - }, - "workingDir": { - "description": "Working directory for the container", - "type": "string" - } - } - }, - "ContainerExtension": { - "allOf": [ - { - "$ref": "global.json#/definitions/Extension" - } - ] - }, - "ManualScalingExtension": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ContainerExtension" - } - ], - "description": "ManualScaling Extension", - "properties": { - "replicas": { - "description": "Replica count.", - "type": "integer" - } - }, - "additionalProperties": false, - "x-ms-discriminator-value": "manualScaling" - }, - "DaprSidecarExtension": { - "allOf": [ - { - "$ref": "#/definitions/ContainerExtension" - } - ], - "type": "object", - "description": "Specifies the resource should have a Dapr sidecar injected", - "required": [ - "appId" - ], - "properties": { - "appPort": { - "description": "The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. ", - "type": "integer" - }, - "appId": { - "description": "The Dapr appId. Specifies the identifier used by Dapr for service invocation.", - "type": "string" - }, - "config": { - "description": "Specifies the Dapr configuration to use for the resource.", - "type": "string" - }, - "protocol": { - "description": "Specifies the Dapr app-protocol to use for the resource.", - "type": "string", - "enum": [ - "http", - "grpc" - ], - "x-ms-enum": { - "name": "Protocol", - "modelAsString": true - } - } - }, - "additionalProperties": false, - "x-ms-discriminator-value": "daprSidecar" - }, - "ContainerKubernetesMetadataExtension": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/ContainerExtension" - } - ], - "description": "Specifies the metadata that should be applied to Kubernetes resources created for the Container resource", - "properties": { - "annotations": { - "description": "Annotations to be applied to the Kubernetes resources output by the resource", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "Labels to be applied to the Kubernetes resources output by the resource", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false, - "x-ms-discriminator-value": "kubernetesMetadata" - }, - "ContainerProperties": { - "allOf": [ - { - "$ref": "global.json#/definitions/BasicResourceProperties" - } - ], - "description": "Container properties", - "type": "object", - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Gets the status of the container at the time the operation was called." - }, - "connections": { - "additionalProperties": { - "$ref": "#/definitions/ConnectionProperties", - "description": "Specifies a connection to another resource." - }, - "type": "object" - }, - "container": { - "$ref": "#/definitions/Container", - "description": "Definition of a container." - }, - "identity": { - "description": "Configuration for supported external identity providers", - "$ref": "global.json#/definitions/IdentitySettings" - }, - "extensions": { - "type": "array", - "items": { - "$ref": "#/definitions/ContainerExtension" - }, - "description": "Extensions spec of the resource" - } - }, - "required": [ - "application", - "container" - ] - } - }, - "parameters": { - "ContainerNameParameter": { - "name": "containerName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the conatiner.", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json deleted file mode 100644 index 155f37af7c..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/environments.json +++ /dev/null @@ -1,593 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core Environment Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/environments": { - "get": { - "description": "List all environments in a scope.", - "operationId": "Environments_ListByScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusEnvironmentsListByScope": { - "$ref": "./examples/EnvironmentsListByScope.json" - } - }, - "tags": [ - "Environments" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "Environment details.", - "schema": { - "$ref": "#/definitions/EnvironmentResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/environments/{environmentName}": { - "get": { - "description": "Gets the properties of an Environment.", - "operationId": "Environments_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusEnvironmentsGet": { - "$ref": "./examples/EnvironmentsGetEnv0.json" - } - }, - "tags": [ - "Environments" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/EnvironmentNameParameter" - } - ], - "responses": { - "200": { - "description": "Environment details.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update an Environment.", - "operationId": "Environments_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusEnvironmentsPut": { - "$ref": "./examples/EnvironmentsPutEnv0.json" - } - }, - "tags": [ - "Environments" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/EnvironmentNameParameter" - }, - { - "name": "EnvironmentResource", - "description": "environment details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing Environment.", - "operationId": "Environments_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusEnvironmentsPatch": { - "$ref": "./examples/EnvironmentsPatchEnv0.json" - } - }, - "tags": [ - "Environments" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/EnvironmentNameParameter" - }, - { - "name": "EnvironmentResource", - "description": "environment details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete an Environment.", - "operationId": "Environments_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusEnvironmentsDelete": { - "$ref": "./examples/EnvironmentsDeleteEnv0.json" - } - }, - "tags": [ - "Environments" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/EnvironmentNameParameter" - } - ], - "responses": { - "200": { - "description": "The environment was successfully deleted." - }, - "202": { - "description": "The environment will be deleted asynchronously." - }, - "204": { - "description": "The environment does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Core/environments/{environmentName}/getmetadata": { - "post": { - "description": "Gets recipe metadata including parameters and any constraints on the parameters.", - "operationId": "Environments_GetRecipeMetadata", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusEnvironmentsGetRecipeMetadata": { - "$ref": "./examples/EnvironmentsGetRecipeMetadata.json" - } - }, - "tags": [ - "Environments" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/EnvironmentNameParameter" - }, - { - "name": "RecipeParameter", - "in": "body", - "required": true, - "description": "Recipe parameters.", - "schema": { - "$ref": "#/definitions/Recipe" - } - } - ], - "responses": { - "200": { - "description": "Recipe metadata including parameters and any constraints on the parameters.", - "schema": { - "$ref": "#/definitions/RecipeMetadataProperties" - } - }, - "default": { - "description": "Error response describing the reason for operation failure", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "EnvironmentResourceList": { - "description": "The list of environments.", - "type": "object", - "properties": { - "value": { - "description": "The list of environments.", - "type": "array", - "items": { - "$ref": "#/definitions/EnvironmentResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of environments list.", - "type": "string" - } - } - }, - "EnvironmentResource": { - "description": "Application environment.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/EnvironmentProperties" - } - } - }, - "EnvironmentExtension": { - "allOf": [ - { - "$ref": "global.json#/definitions/Extension" - } - ] - }, - "EnvironmentKubernetesMetadataExtension": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/EnvironmentExtension" - } - ], - "description": "Specifies the metadata that should be applied to Kubernetes resources created by all Containers in this Environment.", - "properties": { - "annotations": { - "description": "Annotations to be applied to the Kubernetes resources output by the resource", - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "labels": { - "description": "Labels to be applied to the Kubernetes resources output by the resource", - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "additionalProperties": false, - "x-ms-discriminator-value": "kubernetesMetadata" - }, - "EnvironmentProperties": { - "description": "Application environment properties", - "type": "object", - "required": [ - "compute" - ], - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the environment at the time the operation was called." - }, - "compute": { - "$ref": "global.json#/definitions/EnvironmentCompute" - }, - "providers": { - "$ref": "#/definitions/Providers", - "description": "Cloud providers configuration for the environment." - }, - "recipes": { - "description": "Specifies Recipes linked to the Environment.", - "additionalProperties": { - "additionalProperties": { - "$ref": "#/definitions/EnvironmentRecipeProperties" - } - }, - "type": "object", - "example": [ - { - "Applications.Link/mongoDatabases": { - "default":{ - "templateKind": "bicep", - "templatePath":"br:sampleregistry.azureacr.io/radius/recipes/mongodb", - "parameters":{ - "port":6060 - } - } - } - } - ] - }, - "extensions": { - "type": "array", - "items": { - "$ref": "#/definitions/EnvironmentExtension" - }, - "description": "Extensions spec of the resource" - } - } - }, - "Providers": { - "description": "Cloud providers configuration", - "properties": { - "azure": { - "type": "object", - "description": "Azure cloud provider configuration", - "properties": { - "scope": { - "type": "string", - "description": "Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'" - } - } - }, - "aws": { - "type": "object", - "description": "AWS cloud provider configuration", - "properties": { - "scope": { - "type": "string", - "description": "Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'" - } - } - } - } - }, - "TerraformRecipeProperties":{ - "additionalProperties": false, - "description": "Properties of a Recipe linked to an Environment.", - "allOf": [ - { - "$ref": "#/definitions/EnvironmentRecipeProperties" - } - ], - "properties": { - "templateVersion": { - "description": "Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources.", - "type": "string" - } - }, - "type": "object", - "x-ms-discriminator-value": "terraform" - }, - "BicepRecipeProperties":{ - "additionalProperties": false, - "description": "Properties of a Recipe linked to an Environment.", - "allOf": [ - { - "$ref": "#/definitions/EnvironmentRecipeProperties" - } - ], - "properties": {}, - "type": "object", - "x-ms-discriminator-value": "bicep" - }, - "EnvironmentRecipeProperties": { - "description": "Properties of a Recipe linked to an Environment.", - "discriminator": "templateKind", - "properties": { - "templateKind": { - "description": "Format of the template provided by the recipe. Allowed values: bicep, terraform.", - "type": "string" - }, - "templatePath": { - "description": "Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported.", - "type": "string" - }, - "parameters": { - "description": "Key/value parameters to pass to the recipe template at deployment", - "type": "object", - "example": [ - { - "port": 6060 - } - ] - } - }, - "required": [ - "templateKind", - "templatePath" - ] - }, - "Recipe":{ - "description": "Recipe properties.", - "properties": { - "linkType": { - "description": "Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases'", - "type": "string" - }, - "name":{ - "description": "Name of the recipe registered to the environment.", - "type": "string" - } - } - }, - "RecipeMetadataProperties": { - "description": "Properties of a Recipe linked to an Environment.", - "properties": { - "templateKind": { - "description": "Format of the template provided by the recipe. Allowed values: bicep, terraform.", - "type": "string" - }, - "templatePath": { - "description": "Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported.", - "type": "string" - }, - "templateVersion": { - "description": "Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources.", - "type": "string" - }, - "parameters": { - "description": "Key/value parameters to pass to the recipe template at deployment", - "type": "object", - "example": [ - { - "port": 6060 - } - ] - } - } - } - }, - "parameters": { - "EnvironmentNameParameter": { - "name": "environmentName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the environment", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - }, - "RecipeNameParameter": { - "name": "recipeName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the recipe", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsListByScope.json deleted file mode 100644 index 5b528294ab..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsListByScope.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "name": "app0", - "type": "Applications.Core/applications", - "properties": { - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/app1", - "name": "app1", - "type": "Applications.Core/applications", - "properties": { - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/applications?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsPut.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_CreateOrUpdate.json similarity index 71% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsPut.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_CreateOrUpdate.json index d50d58cb20..14c050a927 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsPut.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_CreateOrUpdate.json @@ -1,12 +1,14 @@ { + "operationId": "Applications_CreateOrUpdate", + "title": "Create or update an application resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "applicationName": "app0", "api-version": "2022-03-15-privatepreview", "ApplicationResource": { "location": "West US", "properties": { - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "extensions": [ { "kind": "kubernetesMetadata", @@ -30,12 +32,12 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "name": "app0", "type": "Applications.Core/applications", "properties": { "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "extensions": [ { "kind": "kubernetesMetadata", diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Delete.json similarity index 52% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsDelete.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Delete.json index e11f322006..fb1d0bce84 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "Applications_Delete", + "title": "Delete an application resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "applicationName": "app0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Get.json similarity index 67% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsGet.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Get.json index cb3f938dfd..ff352ff388 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Get.json @@ -1,18 +1,20 @@ { + "operationId": "Applications_Get", + "title": "Get an application resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "applicationName": "app0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "name": "app0", "type": "Applications.Core/applications", "properties": { "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "extensions": [ { "kind": "kubernetesMetadata", diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_List.json similarity index 55% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsList.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_List.json index 46f95ae0b2..a043784e0d 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsList.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_List.json @@ -1,7 +1,8 @@ { + "operationId": "Applications_ListByScope", + "title": "Get applications by resource group", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", - "resourceGroupName": "testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -9,12 +10,12 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "name": "app0", "type": "Applications.Core/applications", "properties": { "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "extensions": [ { "kind": "kubernetesMetadata", @@ -35,16 +36,16 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/app1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/app1", "name": "app1", "type": "Applications.Core/applications", "properties": { "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1" + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1" } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/applications?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_ListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_ListByScope.json new file mode 100644 index 0000000000..0367e5fb54 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "Applications_ListByScope", + "title": "Get applications by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "name": "app0", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/app1", + "name": "app1", + "type": "Applications.Core/applications", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/applications?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Update.json similarity index 71% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsPatch.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Update.json index d50d58cb20..b4dc7bc7d5 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ApplicationsPatch.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Applications_Update.json @@ -1,12 +1,14 @@ { + "operationId": "Applications_Update", + "title": "Update (Patch) an application resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "applicationName": "app0", "api-version": "2022-03-15-privatepreview", "ApplicationResource": { "location": "West US", "properties": { - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "extensions": [ { "kind": "kubernetesMetadata", @@ -30,12 +32,12 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "name": "app0", "type": "Applications.Core/applications", "properties": { "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "extensions": [ { "kind": "kubernetesMetadata", diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersDelete.json deleted file mode 100644 index 0c05b42c66..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "containerName": "app0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersGet.json deleted file mode 100644 index c87ecec53a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersGet.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "containerName": "container0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersList.json deleted file mode 100644 index 4d3350e6f7..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersList.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container1", - "name": "container1", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app1", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - }, - "extensions": [ - { - "kind": "manualScaling", - "replicas": 2 - }, - { - "kind": "daprSidecar", - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http" - }, - { - "kind": "kubernetesMetadata", - "annotations": { - "prometheus.io/scrape": "true", - "prometheus.io/port": "80" - }, - "labels": { - "foo/bar/team": "credit", - "foo/bar/contact": "radiususer" - } - } - ] - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersListByScope.json deleted file mode 100644 index 4176c79b19..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersListByScope.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - }, - "extensions": [ - { - "kind": "manualScaling", - "replicas": 2 - }, - { - "kind": "daprSidecar", - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http", - "provides": "provides", - "port": 443, - "scheme": "https" - }, - { - "kind": "kubernetesMetadata", - "annotations": { - "prometheus.io/scrape": "true", - "prometheus.io/port": "80" - }, - "labels": { - "foo/bar/team": "credit", - "foo/bar/contact": "radiususer" - } - } - ] - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container1", - "name": "container1", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app1", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPatch.json deleted file mode 100644 index 8378d06485..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPatch.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "containerName": "container0", - "api-version": "2022-03-15-privatepreview", - "ContainerResource": { - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - }, - "extensions": [ - { - "kind": "manualScaling", - "replicas": 2 - }, - { - "kind": "daprSidecar", - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http" - }, - { - "kind": "kubernetesMetadata", - "annotations": { - "prometheus.io/scrape": "true", - "prometheus.io/port": "80" - }, - "labels": { - "foo/bar/team": "credit", - "foo/bar/contact": "radiususer" - } - } - ] - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPut.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPut.json deleted file mode 100644 index 27d06cd251..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ContainersPut.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "containerName": "app0", - "api-version": "2022-03-15-privatepreview", - "ContainerResource": { - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json index bfcecc926c..e565785399 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate.json @@ -2,12 +2,12 @@ "operationId": "Containers_CreateOrUpdate", "title": "Create or update an container resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "containerName": "app0", "api-version": "2022-03-15-privatepreview", "ContainerResource": { "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "connections": { "inventory": { "kind": "dapr.io/InvokeHttp", @@ -31,12 +31,12 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", "name": "container0", "type": "Applications.Core/containers", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "connections": { "inventory": { "kind": "dapr.io/InvokeHttp", diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json index fc81d08572..9a9bf28c14 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Delete.json @@ -2,7 +2,7 @@ "operationId": "Containers_Delete", "title": "Delete an container resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "containerName": "app0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json index 174df5b10d..371b16c101 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_Get.json @@ -2,19 +2,19 @@ "operationId": "Containers_Get", "title": "Get an container resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "containerName": "container0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", "name": "container0", "type": "Applications.Core/containers", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "connections": { "inventory": { "kind": "dapr.io/InvokeHttp", diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json index de9317f83c..a19eab3370 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_List.json @@ -2,7 +2,7 @@ "operationId": "Containers_ListByScope", "title": "List containers at resource group", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -10,12 +10,12 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", "name": "container0", "type": "Applications.Core/containers", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "connections": { "inventory": { "kind": "dapr.io/InvokeHttp", @@ -41,12 +41,12 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container1", "name": "container1", "type": "Applications.Core/containers", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app1", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app1", "connections": { "inventory": { "kind": "dapr.io/InvokeHttp", @@ -96,7 +96,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json index fbff32bcb0..48084fdec0 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_ListByScope.json @@ -1,106 +1,106 @@ { - "operationId": "Containers_ListByScope", - "title": "List containers at root scope", - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container0", - "name": "container0", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - }, - "extensions": [ - { - "kind": "manualScaling", - "replicas": 2 - }, - { - "kind": "daprSidecar", - "appId": "app-id", - "appPort": 80, - "config": "config", - "protocol": "http", - "provides": "provides", - "port": 443, - "scheme": "https" - }, - { - "kind": "kubernetesMetadata", - "annotations": { - "prometheus.io/scrape": "true", - "prometheus.io/port": "80" - }, - "labels": { - "foo/bar/team": "credit", - "foo/bar/contact": "radiususer" - } - } - ] - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/containers/container1", - "name": "container1", - "type": "Applications.Core/containers", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app1", - "connections": { - "inventory": { - "kind": "dapr.io/InvokeHttp", - "source": "inventory_route_id" - } - }, - "container": { - "image": "radius.azurecr.io/webapptutorial-todoapp", - "command": [ - "/bin/sh" - ], - "args": [ - "-c", - "while true; do echo hello; sleep 10;done" - ], - "workingDir": "/app" - }, - "identity": { - "kind": "azure.com.workload", - "oidcIssuer": "https://oidcissuer/oidc", - "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" - } - } - } + "operationId": "Containers_ListByScope", + "title": "List containers at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http", + "provides": "provides", + "port": 443, + "scheme": "https" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ] + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container1", + "name": "container1", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app1", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } } - } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/containers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } } + } } \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsPutEnv0.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json similarity index 90% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsPutEnv0.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json index 1302d136df..8fa30b4e24 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsPutEnv0.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json @@ -1,6 +1,8 @@ { + "operationId": "Environments_CreateOrUpdate", + "title": "Create or Update an environment resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "environmentName": "env0", "api-version": "2022-03-15-privatepreview", "EnvironmentResource": { @@ -42,7 +44,7 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "name": "env0", "type": "Applications.Core/environments", "properties": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsDeleteEnv0.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_DeleteEnv0.json similarity index 52% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsDeleteEnv0.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_DeleteEnv0.json index f3088c0e5d..3f57144f67 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsDeleteEnv0.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_DeleteEnv0.json @@ -1,6 +1,8 @@ { + "operationId": "Environments_Delete", + "title": "Delete an environment resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "environmentName": "env0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsGetEnv0.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json similarity index 86% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsGetEnv0.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json index f75ec6cf44..cf12255d83 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsGetEnv0.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json @@ -1,13 +1,15 @@ { + "operationId": "Environments_Get", + "title": "Get an environment resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "environmentName": "env0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "name": "env0", "type": "Applications.Core/environments", "properties": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsGetRecipeMetadata.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json similarity index 79% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsGetRecipeMetadata.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json index 1d66725b36..9cc8e2155c 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsGetRecipeMetadata.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json @@ -1,6 +1,8 @@ { + "operationId": "Environments_GetMetadata", + "title": "Get recipe metadata from environment", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "environmentName": "env0", "recipeName": "mongotest" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json similarity index 85% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsList.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json index cd17fc3ef4..33606a3b17 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsList.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json @@ -1,6 +1,8 @@ { + "operationId": "Environments_ListByScope", + "title": "Get environments by resource group", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,7 +10,7 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "name": "env0", "type": "Applications.Core/environments", "properties": { @@ -65,7 +67,7 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "name": "env0", "type": "Applications.Core/environments", "properties": { @@ -87,7 +89,7 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", "name": "env1", "type": "Applications.Core/environments", "properties": { @@ -116,7 +118,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Radius/environments?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_ListByScope.json similarity index 79% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsListByScope.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_ListByScope.json index 8ab94f2129..cc9fe2cf6d 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsListByScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_ListByScope.json @@ -1,6 +1,8 @@ { + "operationId": "Environments_ListByScope", + "title": "Get environments by rootScope", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "/planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,7 +10,7 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "name": "env0", "type": "Applications.Core/environments", "properties": { @@ -38,7 +40,7 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", "name": "env1", "type": "Applications.Core/environments", "properties": { @@ -56,7 +58,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/environments?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/environments?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsPatchEnv0.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json similarity index 89% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsPatchEnv0.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json index ec6b8c27b4..b34faeafaf 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/EnvironmentsPatchEnv0.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json @@ -1,6 +1,8 @@ { + "operationId": "Environments_Update", + "title": "Update an environment resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "environmentName": "env0", "api-version": "2022-03-15-privatepreview", "EnvironmentResource": { @@ -29,7 +31,7 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "name": "env0", "type": "Applications.Core/environments", "properties": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json deleted file mode 100644 index 67c09ee3ea..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "extenderName": "extender0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersGet.json deleted file mode 100644 index b322a59318..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersGet.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview", - "extenderName": "extender0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersList.json deleted file mode 100644 index a26917e573..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersList.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json deleted file mode 100644 index ae7c86cf65..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/extenders?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json deleted file mode 100644 index 56abae506a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "testGroup", - "api-version": "2022-03-15-privatepreview", - "extenderName": "extender0" - }, - "responses": { - "200": { - "body": { - "accountSid": "sid", - "authToken:": "token" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json deleted file mode 100644 index 9b2ad183a7..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPatch.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "extenderName": "extender0", - "api-version": "2022-03-15-privatepreview", - "ExtenderParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", - "name": "extender1", - "type": "Applications.Core/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - } - } -} - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json deleted file mode 100644 index 135e006028..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "extenderName": "extender0", - "api-version": "2022-03-15-privatepreview", - "ExtenderParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "s3" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", - "name": "extender0", - "type": "Applications.Core/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "s3" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", - "name": "extender1", - "type": "Applications.Core/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "s3" - } - } - } - } - } -} - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPut.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdate.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPut.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdate.json index 58d94658b1..36a863f2f1 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/ExtendersPut.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdate.json @@ -1,4 +1,6 @@ { + "operationId": "Extenders_CreateOrUpdate", + "title": "Create or Update an extender resource", "parameters": { "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", "extenderName": "extender0", @@ -6,8 +8,8 @@ "ExtenderParameters": { "location": "West US", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "secrets": { "accountSid": "sid", "authToken:": "token" @@ -19,14 +21,14 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", "name": "extender0", "type": "Applications.Core/extenders", "location": "West US", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "fromNumber": "222-222-2222", "secrets": { "accountSid": "sid", @@ -38,14 +40,14 @@ }, "201": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", "name": "extender1", "type": "Applications.Core/extenders", "location": "West US", "properties": { "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "fromNumber": "222-222-2222", "secrets": { "accountSid": "sid", diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdateWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdateWithRecipe.json new file mode 100644 index 0000000000..f7b994db37 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_CreateOrUpdateWithRecipe.json @@ -0,0 +1,54 @@ +{ + "operationId": "Extenders_CreateOrUpdate", + "title": "Create or Update an extender resource with recipe", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview", + "ExtenderParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "s3" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "s3" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "name": "extender1", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "s3" + } + } + } + } + } +} + \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Delete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Delete.json new file mode 100644 index 0000000000..f8241d9c17 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "Extenders_Delete", + "title": "Delete an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Get.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Get.json new file mode 100644 index 0000000000..a6883eaa24 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Get.json @@ -0,0 +1,31 @@ +{ + "operationId": "Extenders_Get", + "title": "Get an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2022-03-15-privatepreview", + "extenderName": "extender0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_List.json new file mode 100644 index 0000000000..544a601a76 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_List.json @@ -0,0 +1,34 @@ +{ + "operationId": "Extenders_ListByScope", + "title": "List extender resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListByRootScope.json new file mode 100644 index 0000000000..29aaa22970 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListByRootScope.json @@ -0,0 +1,34 @@ +{ + "operationId": "Extenders_ListByScope", + "title": "List extender resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/extenders?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListSecrets.json new file mode 100644 index 0000000000..3ba02d58b5 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_ListSecrets.json @@ -0,0 +1,19 @@ +{ + "operationId": "Extenders_ListSecrets", + "title": "List the secrets from extender resources", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testGroup", + "api-version": "2022-03-15-privatepreview", + "extenderName": "extender0" + }, + "responses": { + "200": { + "body": { + "accountSid": "sid", + "authToken:": "token" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Update.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Update.json new file mode 100644 index 0000000000..ebdcfcd21a --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Extenders_Update.json @@ -0,0 +1,61 @@ +{ + "operationId": "Extenders_Update", + "title": "Update an extender resource", + "parameters": { + "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "extenderName": "extender0", + "api-version": "2022-03-15-privatepreview", + "ExtenderParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender0", + "name": "extender0", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/extenders/extender1", + "name": "extender1", + "type": "Applications.Core/extenders", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "fromNumber": "222-222-2222", + "secrets": { + "accountSid": "sid", + "authToken:": "token" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPatch.json deleted file mode 100644 index 6660ffe845..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPatch.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "gatewayName": "gateway0", - "api-version": "2022-03-15-privatepreview", - "GatewayResource": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "routes":[ - { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" - } - ], - "tls":{ - "sslPassthrough": true, - "hostname": "myapp.radapp.dev", - "minimumProtocolVersion": "1.2", - "certificateFrom": "myapp-tls-cert" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", - "name": "gateway0", - "type": "Applications.Core/gateways", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "routes":[ - { - "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" - } - ], - "tls":{ - "sslPassthrough": false, - "hostname": "myapp.radapp.dev", - "minimumProtocolVersion": "1.2", - "certificateFrom": "myapp-tls-cert" - } - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPut.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_CreateOrUpdate.json similarity index 68% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPut.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_CreateOrUpdate.json index b1d360ae90..cecb497c19 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysPut.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_CreateOrUpdate.json @@ -1,12 +1,14 @@ { + "operationId": "Gateways_CreateOrUpdate", + "title": "Create or update a gateway resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "gatewayName": "gateway0", "api-version": "2022-03-15-privatepreview", "GatewayResource": { "location": "West US", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" @@ -24,12 +26,12 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", "name": "gateway0", "type": "Applications.Core/gateways", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_Delete.json similarity index 54% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysDelete.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_Delete.json index 3b9646feec..10c4503eb1 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "Gateways_Delete", + "title": "Delete an gateway resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "gatewayName": "gateway0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_Get.json similarity index 65% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysGet.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_Get.json index b66a02685f..e71430e547 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_Get.json @@ -1,18 +1,20 @@ { + "operationId": "Gateways_Get", + "title": "Get an gateway resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "gatewayName": "gateway0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", "name": "gateway0", "type": "Applications.Core/gateways", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_List.json similarity index 58% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysList.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_List.json index 2e3a615a8a..35f79c6018 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysList.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_List.json @@ -1,6 +1,8 @@ { + "operationId": "Gateways_ListByScope", + "title": "List gateway resources", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,12 +10,12 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", "name": "gateway0", "type": "Applications.Core/gateways", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte" @@ -28,7 +30,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/gateways?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_ListByScope.json similarity index 64% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysListByScope.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_ListByScope.json index ee04c8dcc4..7e69b93d1f 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/GatewaysListByScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Gateways_ListByScope.json @@ -1,6 +1,8 @@ { + "operationId": "Gateways_ListByScope", + "title": "List gateway resources by rootScope", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "/planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,12 +10,12 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway0", "name": "gateway0", "type": "Applications.Core/gateways", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-front-rte", @@ -29,12 +31,12 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/gateways/gateway1", "name": "gateway1", "type": "Applications.Core/gateways", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "routes":[ { "destination": "/planes/radius/local/resourcegroups/myawsenv/providers/applications.core/httproutes/gtwy-back-rte", @@ -50,7 +52,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/gateways?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/gateways?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesGet.json deleted file mode 100644 index 3a63fc6cda..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesGet.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "httpRouteName": "route0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesList.json deleted file mode 100644 index 2239bd3bb7..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesList.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", - "name": "route1", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/httproutes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesListByScope.json deleted file mode 100644 index 8430d0f784..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesListByScope.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-00000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", - "name": "route0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", - "name": "route1", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/httproutes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPatch.json deleted file mode 100644 index c5d2030a89..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPatch.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2022-03-15-privatepreview", - "HttpRouteResource": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", - "name": "routes0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPut.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPut.json deleted file mode 100644 index c5d2030a89..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesPut.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "httpRouteName": "route0", - "api-version": "2022-03-15-privatepreview", - "HttpRouteResource": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", - "name": "routes0", - "type": "Applications.Core/httpRoutes", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_CreateOrUpdate.json new file mode 100644 index 0000000000..41f0d24102 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_CreateOrUpdate.json @@ -0,0 +1,28 @@ +{ + "operationId": "HttpRoutes_CreateOrUpdate", + "title": "Create or Update httpRoutes resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "httpRouteName": "route0", + "api-version": "2022-03-15-privatepreview", + "HttpRouteResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", + "name": "routes0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Delete.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesDelete.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Delete.json index be8d9efee4..0a2aa56541 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutesDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "HttpRoutes_Delete", + "title": "Delete a httpRoutes resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "httpRouteName": "route0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Get.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Get.json new file mode 100644 index 0000000000..e9e2411461 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "HttpRoutes_Get", + "title": "Get a httpRoutes resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "httpRouteName": "route0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_List.json new file mode 100644 index 0000000000..134bef7b10 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "HttpRoutes_ListByScope", + "title": "List httpRoutes resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", + "name": "route1", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httproutes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_ListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_ListByScope.json new file mode 100644 index 0000000000..cd929b0da1 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "HttpRoutes_ListByScope", + "title": "List httpRoutes resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route0", + "name": "route0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/route1", + "name": "route1", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/httproutes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Update.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Update.json new file mode 100644 index 0000000000..46cd2cf074 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/HttpRoutes_Update.json @@ -0,0 +1,28 @@ +{ + "operationId": "HttpRoutes_Update", + "title": "Update a httpRoutes resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "httpRouteName": "route0", + "api-version": "2022-03-15-privatepreview", + "HttpRouteResource": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/httpRoutes/routes0", + "name": "routes0", + "type": "Applications.Core/httpRoutes", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/OperationsList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Operations_List.json similarity index 98% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/OperationsList.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Operations_List.json index 10424001db..d5a1aaa939 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/OperationsList.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Operations_List.json @@ -1,4 +1,6 @@ { + "operationId": "Operations_List", + "title": "Get the operations for the Applications.Core resource provider", "parameters": { "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPutValue.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json similarity index 69% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPutValue.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json index 524252ed86..8350409c65 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPutValue.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json @@ -1,12 +1,14 @@ { + "operationId": "SecretStores_CreateOrUpdate", + "title": "Create or Update a secret store resource with azure keyvault", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "secretStoreName": "secretazkv", "api-version": "2022-03-15-privatepreview", "SecretStoreResource": { "location": "global", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { @@ -25,13 +27,13 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", "name": "secretazkv", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdateValueFrom.json similarity index 73% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPatch.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdateValueFrom.json index 35eb4fb756..470379feb9 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPatch.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdateValueFrom.json @@ -1,12 +1,14 @@ { + "operationId": "SecretStores_CreateOrUpdate", + "title": "Create or Update a secret store resource with valueFrom", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "secretStoreName": "secretazkv", "api-version": "2022-03-15-privatepreview", "SecretStoreResource": { "location": "global", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { @@ -29,13 +31,13 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", "name": "secretazkv", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json similarity index 52% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesDelete.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json index 532ff2273b..2511b39056 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "SecretStores_Update", + "title": "Update a secret store resource", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json similarity index 56% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json index 439447b5d6..4ed53c64f2 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json @@ -1,19 +1,21 @@ { + "operationId": "SecretStores_Get", + "title": "Get a secret store", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "secretStoreName": "secret0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secret0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secret0", "name": "secret0", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresGet_AzureKeyVault.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Get_AzureKeyVault.json similarity index 69% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresGet_AzureKeyVault.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Get_AzureKeyVault.json index e13bfa3e92..635c47fbfb 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresGet_AzureKeyVault.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Get_AzureKeyVault.json @@ -1,19 +1,21 @@ { + "operationId": "SecretStores_Get", + "title": "Get a secret store for Azure Keyvault", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "secretStoreName": "secretazkv" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", "name": "secretazkv", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_List.json similarity index 61% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresList.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_List.json index 38427308dc..3e66a39aba 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresList.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_List.json @@ -1,6 +1,8 @@ { + "operationId": "SecretStores_ListByScope", + "title": "List secret stores", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,13 +10,13 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secret0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secret0", "name": "secret0", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { @@ -25,13 +27,13 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", "name": "secretazkv", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { @@ -51,7 +53,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/secretStores?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_ListSecrets.json similarity index 69% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresListSecrets.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_ListSecrets.json index 00c01112fe..b5e9ed9e71 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresListSecrets.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_ListSecrets.json @@ -1,6 +1,8 @@ { + "operationId": "SecretStores_ListSecrets", + "title": "List secret stores", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "secretStoreName": "secret0" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPutValueFrom.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json similarity index 73% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPutValueFrom.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json index 35eb4fb756..c04faeab9e 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresPutValueFrom.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json @@ -1,12 +1,14 @@ { + "operationId": "SecretStores_Update", + "title": "Update a secret store", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "secretStoreName": "secretazkv", "api-version": "2022-03-15-privatepreview", "SecretStoreResource": { "location": "global", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { @@ -29,13 +31,13 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/secretStores/secretazkv", "name": "secretazkv", "type": "Applications.Core/secretStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "type": "certificate", "data": { "tls.crt": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesPatch.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_CreateOrUpdate.json similarity index 72% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesPatch.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_CreateOrUpdate.json index 04112d8b07..db34af3074 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesPatch.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_CreateOrUpdate.json @@ -1,24 +1,26 @@ { + "operationId": "Volumes_CreateOrUpdate", + "title": "Create or update a volume", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2022-03-15-privatepreview", "HttpRouteResource": { "location": "West US", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" } } }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/routes0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/routes0", "name": "keyvault0", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Delete.json similarity index 56% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Delete.json index 532ff2273b..ec812ffa7e 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "Volumes_Delete", + "title": "Delete a volume", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesGet.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Get.json similarity index 76% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesGet.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Get.json index a386c24315..5d3c065c62 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Get.json @@ -1,18 +1,20 @@ { + "operationId": "Volumes_Get", + "title": "Get a volume", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "volumeName": "keyvault0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", "name": "keyvault0", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesList.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_List.json similarity index 76% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesList.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_List.json index 692d7063b8..f52dc9ae53 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesList.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_List.json @@ -1,18 +1,20 @@ { + "operationId": "Volumes_ListByScope", + "title": "List volumes by resource group", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { "200": { "body": { "value": [{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", "name": "keyvault0", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { @@ -49,12 +51,12 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault1", "name": "keyvault1", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { @@ -91,7 +93,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/volumes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesListByScope.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_ListByScope.json similarity index 76% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesListByScope.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_ListByScope.json index 64725dad52..4d14bacbc3 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesListByScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_ListByScope.json @@ -1,6 +1,8 @@ { + "operationId": "Volumes_ListByScope", + "title": "List volumes by rootScope", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-00000000000", + "rootScope": "/planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,12 +10,12 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault0", "name": "keyvault0", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { @@ -50,12 +52,12 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/keyvault1", "name": "keyvault1", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { @@ -92,7 +94,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Core/volumes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Core/volumes?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesPut.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Update.json similarity index 72% rename from swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesPut.json rename to swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Update.json index 04112d8b07..413bb773d3 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/VolumesPut.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Volumes_Update.json @@ -1,24 +1,26 @@ { + "operationId": "Volumes_Update", + "title": "Update a volume", "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "volumeName": "keyvault0", "api-version": "2022-03-15-privatepreview", "HttpRouteResource": { "location": "West US", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" } } }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/volumes/routes0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/volumes/routes0", "name": "keyvault0", "type": "Applications.Core/volumes", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", "kind": "azure.com.keyvault", "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.KeyVault/vaults/vault0", "secrets": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/extenders.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/extenders.json deleted file mode 100644 index 4334a692c0..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/extenders.json +++ /dev/null @@ -1,406 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST APIs for Applications.Core/extenders.", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/extenders": { - "get": { - "description": "Lists information about all Extender portable resources in the given root scope.", - "operationId": "Extenders_ListByRootScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersListByRootScope": { - "$ref": "./examples/ExtendersListByRootScope.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "List of Extender portable resources.", - "schema": { - "$ref": "#/definitions/ExtenderList" - } - }, - "default": { - "description": "Error response describing the reason for operation failure.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/extenders/{extenderName}": { - "get": { - "description": "Retrieves information about a Extender portable resource.", - "operationId": "Extenders_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersGet": { - "$ref": "./examples/ExtendersGet.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - } - ], - "responses": { - "200": { - "description": "Extender portable resource.", - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "default": { - "description": "Error response describing the reason for operation failure.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Creates or updates a Extender portable resource.", - "operationId": "Extenders_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersPut": { - "$ref": "./examples/ExtendersPut.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - }, - { - "name": "ExtenderParameters", - "description": "Extender create parameters.", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - } - ], - "responses": { - "200": { - "description": "The request was successful; response contains the Extender portable resource.", - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "201": { - "description": "The request was successful, resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "default": { - "description": "Error response describing the reason for operation failure.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Deletes an existing Extender portable resource.", - "operationId": "Extenders_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersDelete": { - "$ref": "./examples/ExtendersDelete.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - } - ], - "responses": { - "200": { - "description": "The Extender portable resource was successfully deleted." - }, - "202": { - "description": "The Extender portable resource will be deleted asynchronously." - }, - "204": { - "description": "The Extender portable resource does not exist." - }, - "default": { - "description": "Error response describing the reason for operation failure.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Core/extenders/{extenderName}/listSecrets": { - "post": { - "description": "Lists secrets values for the specified Extender portable resource.", - "operationId": "Extenders_listSecrets", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersGet": { - "$ref": "./examples/ExtendersListSecrets.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - } - ], - "responses": { - "200": { - "description": "Extender secrets.", - "schema": { - "$ref": "#/definitions/ExtenderListSecretsResult" - } - }, - "default": { - "description": "Error response describing the reason for operation failure.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "ResourceRecipe": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the recipe within the environment to use." - }, - "parameters": { - "$ref": "global.json#/definitions/Parameters", - "description": "Key/value parameters to pass into the recipe at deployment." - } - }, - "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource.", - "required": [ - "name" - ] - }, - "ResourceProvisioning": { - "type": "string", - "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", - "enum": [ - "recipe", - "manual" - ], - "x-ms-enum": { - "name": "ResourceProvisioning", - "modelAsString": true - } - }, - "ExtenderList": { - "description": "Object that includes an array of Extender and a possible portable resource for next set.", - "type": "object", - "properties": { - "value": { - "description": "List of Extender portable resources.", - "type": "array", - "items": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "nextLink": { - "description": "The link used to fetch the next page of Extender list.", - "type": "string" - } - } - }, - "ExtenderResource": { - "description": "Extender portable resource.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExtenderProperties" - } - } - }, - "ExtenderListSecretsResult": { - "description": "The secret values for the given Extender portable resource.", - "$ref": "#/definitions/ExtenderSecrets" - }, - "ExtenderSecrets": { - "description": "The secret values for the given Extender portable resource.", - "additionalProperties": true, - "properties": {} - }, - "ExtenderProperties": { - "description": "Extender portable resource properties.", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/PortableResourceBasicProperties" - } - ], - "additionalProperties": true, - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the Extender portable resource at the time the operation was called." - }, - "secrets": { - "additionalProperties": true, - "$ref": "#/definitions/ExtenderSecrets" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "recipe": { - "$ref": "#/definitions/ResourceRecipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Extender portable resource." - } - }, - "required": [ - "environment" - ] - }, - "PortableResourceBasicProperties": { - "type": "object", - "properties": { - "status": { - "$ref": "global.json#/definitions/ResourceStatus", - "description": "Status of a Portable resource.", - "readOnly": true - }, - "environment": { - "type": "string", - "description": "The resource id of the environment linked to the resource" - }, - "application": { - "$ref": "global.json#/definitions/Application" - } - }, - "description": "Basic properties of a Portable resource.", - "required": [ - "environment" - ] - } - }, - "parameters": { - "ExtenderNameParameter": { - "description": "The name of the Extender portable resource.", - "name": "extenderName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/gateways.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/gateways.json deleted file mode 100644 index b5b95442fa..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/gateways.json +++ /dev/null @@ -1,431 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core Gateway Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/gateways": { - "get": { - "description": "List all Gateways in the given scope.", - "operationId": "Gateways_ListByScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusGatewaysListByScope": { - "$ref": "./examples/GatewaysListByScope.json" - } - }, - "tags": [ - "Gateways" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "Gateway details.", - "schema": { - "$ref": "#/definitions/GatewayResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}": { - "get": { - "description": "Gets the properties of a Gateway.", - "operationId": "Gateways_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusGatewaysGet": { - "$ref": "./examples/GatewaysGet.json" - } - }, - "tags": [ - "Gateways" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/GatewayNameParameter" - } - ], - "responses": { - "200": { - "description": "Gateway details.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update a Gateway.", - "operationId": "Gateways_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusGatewaysPut": { - "$ref": "./examples/GatewaysPut.json" - } - }, - "tags": [ - "Gateways" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/GatewayNameParameter" - }, - { - "name": "GatewayResource", - "description": "Gateway details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GatewayResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "204": { - "description": "The Gateway does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing Gateway.", - "operationId": "Gateways_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusGatewaysPatch": { - "$ref": "./examples/GatewaysPatch.json" - } - }, - "tags": [ - "Gateways" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/GatewayNameParameter" - }, - { - "name": "GatewayResource", - "description": "Gateway details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/GatewayResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/GatewayResource" - } - }, - "204": { - "description": "The Gateway does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete a Gateway.", - "operationId": "Gateways_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusGatewaysDelete": { - "$ref": "./examples/GatewaysDelete.json" - } - }, - "tags": [ - "Gateways" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/GatewayNameParameter" - } - ], - "responses": { - "200": { - "description": "The Gateway was successfully deleted." - }, - "202": { - "description": "The Gateway will be deleted asynchronously." - }, - "204": { - "description": "The Gateway does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "GatewayResourceList": { - "description": "The list of Gateways.", - "type": "object", - "properties": { - "value": { - "description": "The list of Gateways.", - "type": "array", - "items": { - "$ref": "#/definitions/GatewayResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of Gateways list.", - "type": "string" - } - } - }, - "GatewayResource": { - "description": "Gateway Resource that specifies how traffic is exposed to the application.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/GatewayProperties" - } - } - }, - "GatewayProperties": { - "description": "Gateway properties", - "type": "object", - "allOf": [ - { - "$ref": "global.json#/definitions/BasicResourceProperties" - } - ], - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the Gateway at the time the operation was called." - }, - "internal": { - "description": "Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", - "type": "boolean" - }, - "hostname": { - "type": "object", - "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io.", - "properties": { - "prefix": { - "description": "Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined.", - "type": "string" - }, - "fullyQualifiedHostname": { - "description": "Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined.", - "type": "string" - } - }, - "additionalProperties": false - }, - "tls": { - "type": "object", - "description": "TLS configuration for the Gateway.", - "properties": { - "sslPassthrough": { - "description": "If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption.", - "type": "boolean" - }, - "minimumProtocolVersion": { - "description": "TLS minimum protocol version (defaults to 1.2).", - "type": "string", - "enum": [ - "1.2", - "1.3" - ], - "default": "1.2", - "x-ms-enum": { - "name": "TlsMinVersion", - "modelAsString": false - } - }, - "certificateFrom": { - "description": "Declares which Kubernetes TLS secret will be used.", - "type": "string" - } - } - }, - "routes": { - "type": "array", - "minItems": 1, - "description": "Routes attached to this Gateway", - "items": { - "$ref": "#/definitions/GatewayRoute" - } - }, - "url": { - "type": "string", - "readOnly": true, - "description": "URL of the gateway resource. Readonly." - } - }, - "required": [ - "application", - "routes" - ] - }, - "GatewayRoute": { - "type": "object", - "additionalProperties": false, - "properties": { - "path": { - "description": "The path to match the incoming request path on. Ex - /myservice.", - "type": "string" - }, - "destination": { - "description": "The HttpRoute to route to. Ex - myserviceroute.id.", - "type": "string" - }, - "replacePrefix": { - "description": "Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'", - "type": "string" - } - } - } - }, - "parameters": { - "GatewayNameParameter": { - "name": "gatewayName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Gateway.", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/global.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/global.json deleted file mode 100644 index 83a0e0933d..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/global.json +++ /dev/null @@ -1,242 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "definitions": { - "ProvisioningState": { - "readOnly": true, - "type": "string", - "description": "Provisioning state of the resource at the time the operation was called.", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Accepted", - "Updating", - "Deleting", - "Provisioning" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "Application": { - "description": "Specifies the resource id of the application", - "type": "string" - }, - "Parameters": { - "type": "object", - "properties": {}, - "description": "Key/value parameters to pass into the recipe at deployment" - }, - "BasicResourceProperties": { - "description": "Basic properties of a Radius resource.", - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of the resource", - "readOnly": true - }, - "environment": { - "description": "The resource id of the environment linked to the resource", - "type": "string" - }, - "application": { - "$ref": "#/definitions/Application" - } - }, - "required": [ - "application" - ] - }, - "ResourceStatus": { - "description": "Status of a resource.", - "type": "object", - "properties": { - "compute": { - "$ref": "#/definitions/EnvironmentCompute" - }, - "outputResources": { - "type": "array", - "items": { - "$ref": "#/definitions/OutputResource" - } - } - } - }, - "EnvironmentCompute": { - "description": "Compute resource used by application environment resource.", - "type": "object", - "discriminator": "kind", - "properties": { - "kind": { - "type": "string", - "description": "Type of compute resource." - }, - "resourceId": { - "type": "string", - "description": "The resource id of the compute resource for application environment." - }, - "identity": { - "description": "Configuration for supported external identity providers", - "$ref": "global.json#/definitions/IdentitySettings" - } - }, - "required": [ - "kind" - ] - }, - "KubernetesCompute": { - "description": "Specifies the properties for Kubernetes compute environment", - "allOf": [ - { - "$ref": "#/definitions/EnvironmentCompute" - } - ], - "type": "object", - "properties": { - "namespace": { - "type": "string", - "description": "The namespace to use for the environment." - } - }, - "required": [ - "namespace" - ], - "x-ms-discriminator-value": "kubernetes" - }, - "OutputResource": { - "description": "Properties of an output resource.", - "type": "object", - "properties": {} - }, - "IdentitySettings": { - "properties": { - "kind": { - "description": "Configuration for supported external identity providers", - "type": "string", - "enum": [ - "undefined", - "azure.com.workload" - ], - "default": "azure.com.workload", - "x-ms-enum": { - "name": "IdentitySettingKind", - "modelAsString": false - } - }, - "oidcIssuer": { - "description": "The URI for your compute platform's OIDC issuer", - "type": "string" - }, - "resource": { - "description": "The resource ID of the provisioned identity", - "type": "string" - } - }, - "required": [ - "kind" - ], - "type": "object" - }, - "Extension": { - "description": "Extension of a resource.", - "discriminator": "kind", - "properties": { - "kind": { - "description": "Specifies the extensions of a resource.", - "type": "string" - } - }, - "required": [ - "kind" - ], - "type": "object" - } - }, - "parameters": { - "RootScopeParameter": { - "name": "rootScope", - "in": "path", - "required": true, - "type": "string", - "description": "The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupID}", - "minLength": 1, - "x-ms-skip-url-encoding": true - } - }, - "paths": { - "/providers/Applications.Core/operations": { - "get": { - "tags": [ - "Operations" - ], - "description": "Lists the available API operations.", - "operationId": "Operations_List", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusOperationsList": { - "$ref": "./examples/OperationsList.json" - } - }, - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Operation details.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/httpRoutes.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/httpRoutes.json deleted file mode 100644 index 48e75e10f1..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/httpRoutes.json +++ /dev/null @@ -1,369 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core HTTPRoute Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/httpRoutes": { - "get": { - "description": "List all HTTP Routes in the given scope.", - "operationId": "HttpRoutes_ListByScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusHttpRoutesListByScope": { - "$ref": "./examples/HttpRoutesListByScope.json" - } - }, - "tags": [ - "HttpRoutes" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "HTTP Route details.", - "schema": { - "$ref": "#/definitions/HttpRouteResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}": { - "get": { - "description": "Gets the properties of an HTTP Route.", - "operationId": "HttpRoutes_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusHttpRoutesGet": { - "$ref": "./examples/HttpRoutesGet.json" - } - }, - "tags": [ - "HttpRoutes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/HttpRouteNameParameter" - } - ], - "responses": { - "200": { - "description": "HTTP Route details.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update an HTTP Route.", - "operationId": "HttpRoutes_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusHttpRoutesPut": { - "$ref": "./examples/HttpRoutesPut.json" - } - }, - "tags": [ - "HttpRoutes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/HttpRouteNameParameter" - }, - { - "name": "HttpRouteResource", - "description": "HTTP Route details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "204": { - "description": "The HTTP Route does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing HTTP Route.", - "operationId": "HttpRoutes_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusHttpRoutesPatch": { - "$ref": "./examples/HttpRoutesPatch.json" - } - }, - "tags": [ - "HttpRoutes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/HttpRouteNameParameter" - }, - { - "name": "HttpRouteResource", - "description": "HTTP Route details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "204": { - "description": "The HTTP Route does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete an HTTP Route.", - "operationId": "HttpRoutes_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusHttpRoutesDelete": { - "$ref": "./examples/HttpRoutesDelete.json" - } - }, - "tags": [ - "HttpRoutes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/HttpRouteNameParameter" - } - ], - "responses": { - "200": { - "description": "The HTTP Route was successfully deleted." - }, - "202": { - "description": "The HTTP Route will be deleted asynchronously." - }, - "204": { - "description": "The HTTP Route does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "HttpRouteResourceList": { - "description": "The list of HTTP Routes.", - "type": "object", - "properties": { - "value": { - "description": "The list of HTTP Route.", - "type": "array", - "items": { - "$ref": "#/definitions/HttpRouteResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of HTTP Routes list.", - "type": "string" - } - } - }, - "HttpRouteResource": { - "description": "Radius HTTP Route Resource.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/HttpRouteProperties" - } - } - }, - "HttpRouteProperties": { - "description": "HTTP Route properties", - "type": "object", - "allOf": [ - { - "$ref": "global.json#/definitions/BasicResourceProperties" - } - ], - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the HTTP Route at the time the operation was called." - }, - "hostname": { - "description": "The internal hostname accepting traffic for the HTTP Route. Readonly.", - "type": "string" - }, - "port": { - "description": "The port number for the HTTP Route. Defaults to 80. Readonly.", - "type": "integer" - }, - "scheme": { - "description": "The scheme used for traffic. Readonly.", - "type": "string" - }, - "url": { - "description": "A stable URL that that can be used to route traffic to a resource. Readonly.", - "type": "string" - } - }, - "required": [ - "application" - ] - } - }, - "parameters": { - "HttpRouteNameParameter": { - "name": "httpRouteName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the HTTP Route.", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json new file mode 100644 index 0000000000..0b82131ed2 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -0,0 +1,5153 @@ +{ + "swagger": "2.0", + "info": { + "title": "Applications.Core Management APIs", + "version": "2022-03-15-privatepreview", + "description": "REST API for Applications.Core", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "Environments" + }, + { + "name": "Applications" + }, + { + "name": "Containers" + }, + { + "name": "Gateways" + }, + { + "name": "HttpRoutes" + }, + { + "name": "SecretStores" + }, + { + "name": "Volumes" + }, + { + "name": "Extenders" + } + ], + "paths": { + "/{rootScope}/providers/Applications.Core/applications": { + "get": { + "operationId": "Applications_ListByScope", + "tags": [ + "Applications" + ], + "description": "List ApplicationResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ApplicationResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get applications by resource group": { + "$ref": "./examples/Applications_List.json" + }, + "Get applications by rootScope": { + "$ref": "./examples/Applications_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/applications/{applicationName}": { + "get": { + "operationId": "Applications_Get", + "tags": [ + "Applications" + ], + "description": "Get a ApplicationResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "applicationName", + "in": "path", + "description": "The application name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ApplicationResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an application resource": { + "$ref": "./examples/Applications_Get.json" + } + } + }, + "put": { + "operationId": "Applications_CreateOrUpdate", + "tags": [ + "Applications" + ], + "description": "Create a ApplicationResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "applicationName", + "in": "path", + "description": "The application name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/ApplicationResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'ApplicationResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/ApplicationResource" + } + }, + "201": { + "description": "Resource 'ApplicationResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/ApplicationResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update an application resource": { + "$ref": "./examples/Applications_CreateOrUpdate.json" + } + } + }, + "patch": { + "operationId": "Applications_Update", + "tags": [ + "Applications" + ], + "description": "Update a ApplicationResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "applicationName", + "in": "path", + "description": "The application name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/ApplicationResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ApplicationResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update (Patch) an application resource": { + "$ref": "./examples/Applications_Update.json" + } + } + }, + "delete": { + "operationId": "Applications_Delete", + "tags": [ + "Applications" + ], + "description": "Delete a ApplicationResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "applicationName", + "in": "path", + "description": "The application name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete an application resource": { + "$ref": "./examples/Applications_Delete.json" + } + } + } + }, + "/{rootScope}/providers/Applications.Core/containers": { + "get": { + "operationId": "Containers_ListByScope", + "tags": [ + "Containers" + ], + "description": "List ContainerResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ContainerResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List containers at resource group": { + "$ref": "./examples/Containers_List.json" + }, + "List containers at root scope": { + "$ref": "./examples/Containers_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/containers/{containerName}": { + "get": { + "operationId": "Containers_Get", + "tags": [ + "Containers" + ], + "description": "Get a ContainerResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "containerName", + "in": "path", + "description": "Container name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ContainerResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an container resource": { + "$ref": "./examples/Containers_Get.json" + } + } + }, + "put": { + "operationId": "Containers_CreateOrUpdate", + "tags": [ + "Containers" + ], + "description": "Create a ContainerResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "containerName", + "in": "path", + "description": "Container name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/ContainerResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'ContainerResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/ContainerResource" + } + }, + "201": { + "description": "Resource 'ContainerResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/ContainerResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update an container resource": { + "$ref": "./examples/Containers_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Containers_Update", + "tags": [ + "Containers" + ], + "description": "Update a ContainerResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "containerName", + "in": "path", + "description": "Container name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/ContainerResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ContainerResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "Containers_Delete", + "tags": [ + "Containers" + ], + "description": "Delete a ContainerResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "containerName", + "in": "path", + "description": "Container name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete an container resource": { + "$ref": "./examples/Containers_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Core/environments": { + "get": { + "operationId": "Environments_ListByScope", + "tags": [ + "Environments" + ], + "description": "List EnvironmentResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/EnvironmentResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get environments by resource group": { + "$ref": "./examples/Environments_List.json" + }, + "Get environments by rootScope": { + "$ref": "./examples/Environments_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/environments/{environmentName}": { + "get": { + "operationId": "Environments_Get", + "tags": [ + "Environments" + ], + "description": "Get a EnvironmentResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "environment name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an environment resource": { + "$ref": "./examples/Environments_GetEnv0.json" + } + } + }, + "put": { + "operationId": "Environments_CreateOrUpdate", + "tags": [ + "Environments" + ], + "description": "Create a EnvironmentResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "environment name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'EnvironmentResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "201": { + "description": "Resource 'EnvironmentResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update an environment resource": { + "$ref": "./examples/Environments_CreateOrUpdate.json" + } + } + }, + "patch": { + "operationId": "Environments_Update", + "tags": [ + "Environments" + ], + "description": "Update a EnvironmentResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "environment name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/EnvironmentResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update an environment resource": { + "$ref": "./examples/Environments_PatchEnv0.json" + } + } + }, + "delete": { + "operationId": "Environments_Delete", + "tags": [ + "Environments" + ], + "description": "Delete a EnvironmentResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "environment name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete an environment resource": { + "$ref": "./examples/Environments_DeleteEnv0.json" + } + } + } + }, + "/{rootScope}/providers/Applications.Core/environments/{environmentName}/getMetadata": { + "post": { + "operationId": "Environments_GetMetadata", + "tags": [ + "Environments" + ], + "description": "Gets recipe metadata including parameters and any constraints on the parameters.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "environment name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "$ref": "#/definitions/RecipeGetMetadata" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/RecipeGetMetadataResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get recipe metadata from environment": { + "$ref": "./examples/Environments_GetRecipeMetadata.json" + } + } + } + }, + "/{rootScope}/providers/Applications.Core/extenders": { + "get": { + "operationId": "Extenders_ListByScope", + "tags": [ + "Extenders" + ], + "description": "List ExtenderResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ExtenderResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List extender resources by resource group": { + "$ref": "./examples/Extenders_List.json" + }, + "List extender resources by rootScope": { + "$ref": "./examples/Extenders_ListByRootScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/extenders/{extenderName}": { + "get": { + "operationId": "Extenders_Get", + "tags": [ + "Extenders" + ], + "description": "Get a ExtenderResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "extenderName", + "in": "path", + "description": "The name of the ExtenderResource link resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ExtenderResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an extender resource": { + "$ref": "./examples/Extenders_Get.json" + } + } + }, + "put": { + "operationId": "Extenders_CreateOrUpdate", + "tags": [ + "Extenders" + ], + "description": "Create a ExtenderResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "extenderName", + "in": "path", + "description": "The name of the ExtenderResource link resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/ExtenderResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'ExtenderResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/ExtenderResource" + } + }, + "201": { + "description": "Resource 'ExtenderResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/ExtenderResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update an extender resource": { + "$ref": "./examples/Extenders_CreateOrUpdate.json" + }, + "Create or Update an extender resource with recipe": { + "$ref": "./examples/Extenders_CreateOrUpdateWithRecipe.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Extenders_Update", + "tags": [ + "Extenders" + ], + "description": "Update a ExtenderResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "extenderName", + "in": "path", + "description": "The name of the ExtenderResource link resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/ExtenderResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ExtenderResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update an extender resource": { + "$ref": "./examples/Extenders_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "Extenders_Delete", + "tags": [ + "Extenders" + ], + "description": "Delete a ExtenderResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "extenderName", + "in": "path", + "description": "The name of the ExtenderResource link resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete an extender resource": { + "$ref": "./examples/Extenders_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Core/extenders/{extenderName}/listSecrets": { + "post": { + "operationId": "Extenders_ListSecrets", + "tags": [ + "Extenders" + ], + "description": "Lists secrets values for the specified Extender resource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "extenderName", + "in": "path", + "description": "The name of the ExtenderResource link resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ExtenderListSecretResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List the secrets from extender resources": { + "$ref": "./examples/Extenders_ListSecrets.json" + } + } + } + }, + "/{rootScope}/providers/Applications.Core/gateways": { + "get": { + "operationId": "Gateways_ListByScope", + "tags": [ + "Gateways" + ], + "description": "List GatewayResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/GatewayResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List gateway resources": { + "$ref": "./examples/Gateways_List.json" + }, + "List gateway resources by rootScope": { + "$ref": "./examples/Gateways_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/gateways/{gatewayName}": { + "get": { + "operationId": "Gateways_Get", + "tags": [ + "Gateways" + ], + "description": "Get a GatewayResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "gatewayName", + "in": "path", + "description": "Gateway name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/GatewayResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get an gateway resource": { + "$ref": "./examples/Gateways_Get.json" + } + } + }, + "put": { + "operationId": "Gateways_Create", + "tags": [ + "Gateways" + ], + "description": "Create a GatewayResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "gatewayName", + "in": "path", + "description": "Gateway name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/GatewayResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'GatewayResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/GatewayResource" + } + }, + "201": { + "description": "Resource 'GatewayResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/GatewayResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Gateways_CreateOrUpdate", + "tags": [ + "Gateways" + ], + "description": "Update a GatewayResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "gatewayName", + "in": "path", + "description": "Gateway name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/GatewayResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/GatewayResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a gateway resource": { + "$ref": "./examples/Gateways_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "Gateways_Delete", + "tags": [ + "Gateways" + ], + "description": "Delete a GatewayResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "gatewayName", + "in": "path", + "description": "Gateway name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete an gateway resource": { + "$ref": "./examples/Gateways_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Core/httpRoutes": { + "get": { + "operationId": "HttpRoutes_ListByScope", + "tags": [ + "HttpRoutes" + ], + "description": "List HttpRouteResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/HttpRouteResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List httpRoutes resources by resource group": { + "$ref": "./examples/HttpRoutes_List.json" + }, + "List httpRoutes resources by rootScope": { + "$ref": "./examples/HttpRoutes_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/httpRoutes/{httpRouteName}": { + "get": { + "operationId": "HttpRoutes_Get", + "tags": [ + "HttpRoutes" + ], + "description": "Get a HttpRouteResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "httpRouteName", + "in": "path", + "description": "HTTPRoute name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/HttpRouteResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a httpRoutes resource": { + "$ref": "./examples/HttpRoutes_Get.json" + } + } + }, + "put": { + "operationId": "HttpRoutes_CreateOrUpdate", + "tags": [ + "HttpRoutes" + ], + "description": "Create a HttpRouteResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "httpRouteName", + "in": "path", + "description": "HTTPRoute name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/HttpRouteResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'HttpRouteResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/HttpRouteResource" + } + }, + "201": { + "description": "Resource 'HttpRouteResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/HttpRouteResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update httpRoutes resources": { + "$ref": "./examples/HttpRoutes_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "HttpRoutes_Update", + "tags": [ + "HttpRoutes" + ], + "description": "Update a HttpRouteResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "httpRouteName", + "in": "path", + "description": "HTTPRoute name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/HttpRouteResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/HttpRouteResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update a httpRoutes resource": { + "$ref": "./examples/HttpRoutes_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "HttpRoutes_Delete", + "tags": [ + "HttpRoutes" + ], + "description": "Delete a HttpRouteResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "httpRouteName", + "in": "path", + "description": "HTTPRoute name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a httpRoutes resource": { + "$ref": "./examples/HttpRoutes_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Core/secretStores": { + "get": { + "operationId": "SecretStores_ListByScope", + "tags": [ + "SecretStores" + ], + "description": "List SecretStoreResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/SecretStoreResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List secret stores": { + "$ref": "./examples/SecretStores_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}": { + "get": { + "operationId": "SecretStores_Get", + "tags": [ + "SecretStores" + ], + "description": "Get a SecretStoreResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "secretStoreName", + "in": "path", + "description": "SecretStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/SecretStoreResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a secret store": { + "$ref": "./examples/SecretStores_Get.json" + }, + "Get a secret store for Azure Keyvault": { + "$ref": "./examples/SecretStores_Get_AzureKeyVault.json" + } + } + }, + "put": { + "operationId": "SecretStores_CreateOrUpdate", + "tags": [ + "SecretStores" + ], + "description": "Create a SecretStoreResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "secretStoreName", + "in": "path", + "description": "SecretStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/SecretStoreResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'SecretStoreResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/SecretStoreResource" + } + }, + "201": { + "description": "Resource 'SecretStoreResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/SecretStoreResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update a secret store resource with azure keyvault": { + "$ref": "./examples/SecretStores_CreateOrUpdate.json" + }, + "Create or Update a secret store resource with valueFrom": { + "$ref": "./examples/SecretStores_CreateOrUpdateValueFrom.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "SecretStores_Update", + "tags": [ + "SecretStores" + ], + "description": "Update a SecretStoreResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "secretStoreName", + "in": "path", + "description": "SecretStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/SecretStoreResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/SecretStoreResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update a secret store resource": { + "$ref": "./examples/SecretStores_Delete.json" + }, + "Update a secret store": { + "$ref": "./examples/SecretStores_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "SecretStores_Delete", + "tags": [ + "SecretStores" + ], + "description": "Delete a SecretStoreResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "secretStoreName", + "in": "path", + "description": "SecretStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}/listSecrets": { + "post": { + "operationId": "SecretStores_ListSecrets", + "tags": [ + "SecretStores" + ], + "description": "List the secrets of a secret stores.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "secretStoreName", + "in": "path", + "description": "SecretStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/SecretStoreListSecretsResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List secret stores": { + "$ref": "./examples/SecretStores_ListSecrets.json" + } + } + } + }, + "/{rootScope}/providers/Applications.Core/volumes": { + "get": { + "operationId": "Volumes_ListByScope", + "tags": [ + "Volumes" + ], + "description": "List VolumeResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/VolumeResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List volumes by resource group": { + "$ref": "./examples/Volumes_List.json" + }, + "List volumes by rootScope": { + "$ref": "./examples/Volumes_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Core/volumes/{volumeName}": { + "get": { + "operationId": "Volumes_Get", + "tags": [ + "Volumes" + ], + "description": "Get a VolumeResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "volumeName", + "in": "path", + "description": "Volume name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/VolumeResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a volume": { + "$ref": "./examples/Volumes_Get.json" + } + } + }, + "put": { + "operationId": "Volumes_CreateOrUpdate", + "tags": [ + "Volumes" + ], + "description": "Create a VolumeResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "volumeName", + "in": "path", + "description": "Volume name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/VolumeResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'VolumeResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/VolumeResource" + } + }, + "201": { + "description": "Resource 'VolumeResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/VolumeResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a volume": { + "$ref": "./examples/Volumes_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Volumes_Update", + "tags": [ + "Volumes" + ], + "description": "Update a VolumeResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "volumeName", + "in": "path", + "description": "Volume name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/VolumeResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/VolumeResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update a volume": { + "$ref": "./examples/Volumes_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "Volumes_Delete", + "tags": [ + "Volumes" + ], + "description": "Delete a VolumeResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "volumeName", + "in": "path", + "description": "Volume name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a volume": { + "$ref": "./examples/Volumes_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/providers/Applications.Core/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get the operations for the Applications.Core resource provider": { + "$ref": "./examples/Operations_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "ApplicationProperties": { + "type": "object", + "description": "Application properties", + "properties": { + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "extensions": { + "type": "array", + "description": "The application extension.", + "items": { + "$ref": "#/definitions/Extension" + }, + "x-ms-identifiers": [] + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + } + }, + "required": [ + "environment" + ] + }, + "ApplicationResource": { + "type": "object", + "description": "Radius Application resource", + "properties": { + "properties": { + "$ref": "#/definitions/ApplicationProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "ApplicationResourceListResult": { + "type": "object", + "description": "The response of a ApplicationResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The ApplicationResource items on this page", + "items": { + "$ref": "#/definitions/ApplicationResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "ApplicationResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the ApplicationResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/ApplicationResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "ApplicationResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the ApplicationResource.", + "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentComputeUpdate", + "description": "The compute resource used by application environment." + }, + "providers": { + "$ref": "#/definitions/ProvidersUpdate", + "description": "Cloud providers configuration for the environment." + }, + "recipes": { + "type": "object", + "description": "Specifies Recipes linked to the Environment.", + "additionalProperties": { + "additionalProperties": { + "$ref": "#/definitions/RecipePropertiesUpdate" + }, + "type": "object" + } + }, + "extensions": { + "type": "array", + "description": "The environment extension.", + "items": { + "$ref": "#/definitions/Extension" + }, + "x-ms-identifiers": [] + } + } + }, + "AzureKeyVaultVolumeProperties": { + "type": "object", + "description": "Represents Azure Key Vault Volume properties", + "properties": { + "certificates": { + "type": "object", + "description": "The KeyVault certificates that this volume exposes", + "additionalProperties": { + "$ref": "#/definitions/CertificateObjectProperties" + } + }, + "keys": { + "type": "object", + "description": "The KeyVault keys that this volume exposes", + "additionalProperties": { + "$ref": "#/definitions/KeyObjectProperties" + } + }, + "resource": { + "type": "string", + "description": "The ID of the keyvault to use for this volume resource" + }, + "secrets": { + "type": "object", + "description": "The KeyVault secrets that this volume exposes", + "additionalProperties": { + "$ref": "#/definitions/SecretObjectProperties" + } + } + }, + "required": [ + "resource" + ], + "allOf": [ + { + "$ref": "#/definitions/VolumeProperties" + } + ], + "x-ms-discriminator-value": "azure.com.keyvault" + }, + "BicepRecipeProperties": { + "type": "object", + "description": "Represents Bicep recipe properties.", + "properties": {}, + "allOf": [ + { + "$ref": "#/definitions/RecipeProperties" + } + ], + "x-ms-discriminator-value": "bicep" + }, + "BicepRecipePropertiesUpdate": { + "type": "object", + "description": "Represents Bicep recipe properties.", + "properties": {}, + "allOf": [ + { + "$ref": "#/definitions/RecipePropertiesUpdate" + } + ], + "x-ms-discriminator-value": "bicep" + }, + "CertificateFormats": { + "type": "string", + "description": "Represents certificate formats", + "enum": [ + "pem", + "pfx" + ], + "x-ms-enum": { + "name": "CertificateFormats", + "modelAsString": true, + "values": [ + { + "name": "pem", + "value": "pem", + "description": "PEM Certificate format" + }, + { + "name": "pfx", + "value": "pfx", + "description": "PFX Certificate format" + } + ] + } + }, + "CertificateObjectProperties": { + "type": "object", + "description": "Represents certificate object properties", + "properties": { + "alias": { + "type": "string", + "description": "File name when written to disk" + }, + "encoding": { + "$ref": "#/definitions/VolumeSecretEncodings", + "description": "Encoding format. Default utf-8", + "default": "utf-8" + }, + "format": { + "$ref": "#/definitions/CertificateFormats", + "description": "Certificate format. Default pem", + "default": "pem" + }, + "name": { + "type": "string", + "description": "The name of the certificate" + }, + "certType": { + "$ref": "#/definitions/CertificateTypes", + "description": "Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate" + }, + "version": { + "type": "string", + "description": "Certificate version" + } + }, + "required": [ + "name" + ] + }, + "CertificateTypes": { + "type": "string", + "description": "Represents certificate types", + "enum": [ + "certificate", + "privatekey", + "publickey" + ], + "x-ms-enum": { + "name": "CertificateTypes", + "modelAsString": true, + "values": [ + { + "name": "certificate", + "value": "certificate", + "description": "Certificate type" + }, + { + "name": "privatekey", + "value": "privatekey", + "description": "Private Key type" + }, + { + "name": "publickey", + "value": "publickey", + "description": "Public Key type" + } + ] + } + }, + "ConnectionProperties": { + "type": "object", + "description": "Connection Properties", + "properties": { + "source": { + "type": "string", + "description": "The source of the connection" + }, + "disableDefaultEnvVars": { + "type": "boolean", + "description": "default environment variable override", + "default": false + }, + "iam": { + "$ref": "#/definitions/IamProperties", + "description": "iam properties" + } + }, + "required": [ + "source" + ] + }, + "ConnectionPropertiesUpdate": { + "type": "object", + "description": "Connection Properties", + "properties": { + "source": { + "type": "string", + "description": "The source of the connection" + }, + "disableDefaultEnvVars": { + "type": "boolean", + "description": "default environment variable override", + "default": false + }, + "iam": { + "$ref": "#/definitions/IamPropertiesUpdate", + "description": "iam properties" + } + } + }, + "Container": { + "type": "object", + "description": "Definition of a container", + "properties": { + "image": { + "type": "string", + "description": "The registry and image to download and run in your container" + }, + "env": { + "type": "object", + "description": "environment", + "additionalProperties": { + "type": "string" + } + }, + "ports": { + "type": "object", + "description": "container ports", + "additionalProperties": { + "$ref": "#/definitions/ContainerPortProperties" + } + }, + "readinessProbe": { + "$ref": "#/definitions/HealthProbeProperties", + "description": "readiness probe properties" + }, + "livenessProbe": { + "$ref": "#/definitions/HealthProbeProperties", + "description": "liveness probe properties" + }, + "volumes": { + "type": "object", + "description": "container volumes", + "additionalProperties": { + "$ref": "#/definitions/Volume" + } + }, + "command": { + "type": "array", + "description": "Entrypoint array. Overrides the container image's ENTRYPOINT", + "items": { + "type": "string" + } + }, + "args": { + "type": "array", + "description": "Arguments to the entrypoint. Overrides the container image's CMD", + "items": { + "type": "string" + } + }, + "workingDir": { + "type": "string", + "description": "Working directory for the container" + } + }, + "required": [ + "image" + ] + }, + "ContainerPortProperties": { + "type": "object", + "description": "Specifies a listening port for the container", + "properties": { + "containerPort": { + "type": "integer", + "format": "int32", + "description": "The listening port number" + }, + "protocol": { + "$ref": "#/definitions/PortProtocol", + "description": "Protocol in use by the port" + }, + "provides": { + "type": "string", + "description": "Specifies a route provided by this port" + }, + "scheme": { + "type": "string", + "description": "Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired" + } + }, + "required": [ + "containerPort" + ] + }, + "ContainerPortPropertiesUpdate": { + "type": "object", + "description": "Specifies a listening port for the container", + "properties": { + "containerPort": { + "type": "integer", + "format": "int32", + "description": "The listening port number" + }, + "protocol": { + "$ref": "#/definitions/PortProtocol", + "description": "Protocol in use by the port" + }, + "provides": { + "type": "string", + "description": "Specifies a route provided by this port" + }, + "scheme": { + "type": "string", + "description": "Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired" + } + } + }, + "ContainerProperties": { + "type": "object", + "description": "Container properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "container": { + "$ref": "#/definitions/Container", + "description": "Definition of a container." + }, + "connections": { + "type": "object", + "description": "Specifies a connection to another resource.", + "additionalProperties": { + "$ref": "#/definitions/ConnectionProperties" + } + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" + }, + "extensions": { + "type": "array", + "description": "Extensions spec of the resource", + "items": { + "$ref": "#/definitions/Extension" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "application", + "container" + ] + }, + "ContainerResource": { + "type": "object", + "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", + "properties": { + "properties": { + "$ref": "#/definitions/ContainerProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "ContainerResourceListResult": { + "type": "object", + "description": "The response of a ContainerResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The ContainerResource items on this page", + "items": { + "$ref": "#/definitions/ContainerResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "ContainerResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the ContainerResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/ContainerResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "ContainerResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the ContainerResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "container": { + "$ref": "#/definitions/ContainerUpdate", + "description": "Definition of a container." + }, + "connections": { + "type": "object", + "description": "Specifies a connection to another resource.", + "additionalProperties": { + "$ref": "#/definitions/ConnectionPropertiesUpdate" + } + }, + "identity": { + "$ref": "#/definitions/IdentitySettingsUpdate", + "description": "Configuration for supported external identity providers" + }, + "extensions": { + "type": "array", + "description": "Extensions spec of the resource", + "items": { + "$ref": "#/definitions/Extension" + }, + "x-ms-identifiers": [] + } + } + }, + "ContainerUpdate": { + "type": "object", + "description": "Definition of a container", + "properties": { + "image": { + "type": "string", + "description": "The registry and image to download and run in your container" + }, + "env": { + "type": "object", + "description": "environment", + "additionalProperties": { + "type": "string" + } + }, + "ports": { + "type": "object", + "description": "container ports", + "additionalProperties": { + "$ref": "#/definitions/ContainerPortPropertiesUpdate" + } + }, + "readinessProbe": { + "$ref": "#/definitions/HealthProbeProperties", + "description": "readiness probe properties" + }, + "livenessProbe": { + "$ref": "#/definitions/HealthProbeProperties", + "description": "liveness probe properties" + }, + "volumes": { + "type": "object", + "description": "container volumes", + "additionalProperties": { + "$ref": "#/definitions/VolumeUpdate" + } + }, + "command": { + "type": "array", + "description": "Entrypoint array. Overrides the container image's ENTRYPOINT", + "items": { + "type": "string" + } + }, + "args": { + "type": "array", + "description": "Arguments to the entrypoint. Overrides the container image's CMD", + "items": { + "type": "string" + } + }, + "workingDir": { + "type": "string", + "description": "Working directory for the container" + } + } + }, + "DaprSidecarExtension": { + "type": "object", + "description": "Specifies the resource should have a Dapr sidecar injected", + "properties": { + "appPort": { + "type": "integer", + "format": "int32", + "description": "The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar. " + }, + "appId": { + "type": "string", + "description": "The Dapr appId. Specifies the identifier used by Dapr for service invocation." + }, + "config": { + "type": "string", + "description": "Specifies the Dapr configuration to use for the resource." + }, + "protocol": { + "$ref": "#/definitions/DaprSidecarExtensionProtocol", + "description": "Specifies the Dapr app-protocol to use for the resource." + } + }, + "required": [ + "appId" + ], + "allOf": [ + { + "$ref": "#/definitions/Extension" + } + ], + "x-ms-discriminator-value": "daprSidecar" + }, + "DaprSidecarExtensionProtocol": { + "type": "string", + "description": "The Dapr sidecar extension protocol", + "enum": [ + "http", + "grpc" + ], + "x-ms-enum": { + "name": "DaprSidecarExtensionProtocol", + "modelAsString": true, + "values": [ + { + "name": "http", + "value": "http", + "description": "HTTP protocol" + }, + { + "name": "grpc", + "value": "grpc", + "description": "gRPC protocol" + } + ] + } + }, + "EnvironmentCompute": { + "type": "object", + "description": "Represents backing compute resource", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "EnvironmentComputeUpdate": { + "type": "object", + "description": "Represents backing compute resource", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettingsUpdate", + "description": "Configuration for supported external identity providers" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "EnvironmentProperties": { + "type": "object", + "description": "Environment properties", + "properties": { + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource used by application environment." + }, + "providers": { + "$ref": "#/definitions/Providers", + "description": "Cloud providers configuration for the environment." + }, + "recipes": { + "type": "object", + "description": "Specifies Recipes linked to the Environment.", + "additionalProperties": { + "additionalProperties": { + "$ref": "#/definitions/RecipeProperties" + }, + "type": "object" + } + }, + "extensions": { + "type": "array", + "description": "The environment extension.", + "items": { + "$ref": "#/definitions/Extension" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "compute" + ] + }, + "EnvironmentResource": { + "type": "object", + "description": "The environment resource", + "properties": { + "properties": { + "$ref": "#/definitions/EnvironmentProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "EnvironmentResourceListResult": { + "type": "object", + "description": "The response of a EnvironmentResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The EnvironmentResource items on this page", + "items": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "EnvironmentResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the EnvironmentResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/EnvironmentResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "EnvironmentResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the EnvironmentResource.", + "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentComputeUpdate", + "description": "The compute resource used by application environment." + }, + "providers": { + "$ref": "#/definitions/ProvidersUpdate", + "description": "Cloud providers configuration for the environment." + }, + "recipes": { + "type": "object", + "description": "Specifies Recipes linked to the Environment.", + "additionalProperties": { + "additionalProperties": { + "$ref": "#/definitions/RecipePropertiesUpdate" + }, + "type": "object" + } + }, + "extensions": { + "type": "array", + "description": "The environment extension.", + "items": { + "$ref": "#/definitions/Extension" + }, + "x-ms-identifiers": [] + } + } + }, + "EphemeralVolume": { + "type": "object", + "description": "Specifies an ephemeral volume for a container", + "properties": { + "managedStore": { + "$ref": "#/definitions/ManagedStore", + "description": "Backing store for the ephemeral volume" + } + }, + "required": [ + "managedStore" + ], + "allOf": [ + { + "$ref": "#/definitions/Volume" + } + ], + "x-ms-discriminator-value": "ephemeral" + }, + "EphemeralVolumeUpdate": { + "type": "object", + "description": "Specifies an ephemeral volume for a container", + "properties": { + "managedStore": { + "$ref": "#/definitions/ManagedStore", + "description": "Backing store for the ephemeral volume" + } + }, + "allOf": [ + { + "$ref": "#/definitions/VolumeUpdate" + } + ], + "x-ms-discriminator-value": "ephemeral" + }, + "ExecHealthProbeProperties": { + "type": "object", + "description": "Specifies the properties for readiness/liveness probe using an executable", + "properties": { + "command": { + "type": "string", + "description": "Command to execute to probe readiness/liveness" + } + }, + "required": [ + "command" + ], + "allOf": [ + { + "$ref": "#/definitions/HealthProbeProperties" + } + ], + "x-ms-discriminator-value": "exec" + }, + "ExtenderListSecretResponse": { + "type": "object", + "description": "Response for list secrets API call", + "properties": {} + }, + "ExtenderProperties": { + "type": "object", + "description": "ExtenderResource link properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "secrets": { + "type": "object", + "description": "The secrets for referenced resource", + "properties": {} + }, + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the extender link" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + }, + "required": [ + "environment" + ], + "additionalProperties": true, + "allOf": [ + { + "type": "object", + "additionalProperties": true + } + ] + }, + "ExtenderResource": { + "type": "object", + "description": "ExtenderResource link", + "properties": { + "properties": { + "$ref": "#/definitions/ExtenderProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "ExtenderResourceListResult": { + "type": "object", + "description": "The response of a ExtenderResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The ExtenderResource items on this page", + "items": { + "$ref": "#/definitions/ExtenderResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "ExtenderResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the ExtenderResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/ExtenderResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "ExtenderResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the ExtenderResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "secrets": { + "type": "object", + "description": "The secrets for referenced resource", + "properties": {} + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the extender link" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, + "Extension": { + "type": "object", + "description": "Extension of a environment/application resource.", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for Extension." + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "GatewayHostname": { + "type": "object", + "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io.", + "properties": { + "prefix": { + "type": "string", + "description": "Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined." + }, + "fullyQualifiedHostname": { + "type": "string", + "description": "Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined." + } + } + }, + "GatewayProperties": { + "type": "object", + "description": "Gateway properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "internal": { + "type": "boolean", + "description": "Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", + "default": false + }, + "hostname": { + "$ref": "#/definitions/GatewayHostname", + "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io." + }, + "routes": { + "type": "array", + "description": "Routes attached to this Gateway", + "items": { + "$ref": "#/definitions/GatewayRoute" + }, + "x-ms-identifiers": [] + }, + "tls": { + "$ref": "#/definitions/GatewayTls", + "description": "TLS configuration for the Gateway." + }, + "url": { + "type": "string", + "description": "URL of the gateway resource. Readonly", + "readOnly": true + } + }, + "required": [ + "application", + "routes" + ] + }, + "GatewayResource": { + "type": "object", + "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", + "properties": { + "properties": { + "$ref": "#/definitions/GatewayProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "GatewayResourceListResult": { + "type": "object", + "description": "The response of a GatewayResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The GatewayResource items on this page", + "items": { + "$ref": "#/definitions/GatewayResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "GatewayResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the GatewayResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/GatewayResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "GatewayResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the GatewayResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "internal": { + "type": "boolean", + "description": "Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet).", + "default": false + }, + "hostname": { + "$ref": "#/definitions/GatewayHostname", + "description": "Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io." + }, + "routes": { + "type": "array", + "description": "Routes attached to this Gateway", + "items": { + "$ref": "#/definitions/GatewayRoute" + }, + "x-ms-identifiers": [] + }, + "tls": { + "$ref": "#/definitions/GatewayTls", + "description": "TLS configuration for the Gateway." + } + } + }, + "GatewayRoute": { + "type": "object", + "description": "Route attached to Gateway", + "properties": { + "path": { + "type": "string", + "description": "The path to match the incoming request path on. Ex - /myservice." + }, + "destination": { + "type": "string", + "description": "The HttpRoute to route to. Ex - myserviceroute.id." + }, + "replacePrefix": { + "type": "string", + "description": "Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'" + } + } + }, + "GatewayTls": { + "type": "object", + "description": "TLS configuration definition for Gateway resource.", + "properties": { + "sslPassthrough": { + "type": "boolean", + "description": "If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption.", + "default": false + }, + "minimumProtocolVersion": { + "$ref": "#/definitions/TlsMinVersion", + "description": "TLS minimum protocol version (defaults to 1.2).", + "default": "1.2" + }, + "certificateFrom": { + "type": "string", + "description": "The resource id for the secret containing the TLS certificate and key for the gateway." + } + } + }, + "HealthProbeProperties": { + "type": "object", + "description": "Properties for readiness/liveness probe", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for HealthProbeProperties." + }, + "initialDelaySeconds": { + "type": "number", + "format": "float", + "description": "Initial delay in seconds before probing for readiness/liveness" + }, + "failureThreshold": { + "type": "number", + "format": "float", + "description": "Threshold number of times the probe fails after which a failure would be reported" + }, + "periodSeconds": { + "type": "number", + "format": "float", + "description": "Interval for the readiness/liveness probe in seconds" + }, + "timeoutSeconds": { + "type": "number", + "format": "float", + "description": "Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds", + "default": 5 + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "HttpGetHealthProbeProperties": { + "type": "object", + "description": "Specifies the properties for readiness/liveness probe using HTTP Get", + "properties": { + "containerPort": { + "type": "integer", + "format": "int32", + "description": "The listening port number" + }, + "path": { + "type": "string", + "description": "The route to make the HTTP request on" + }, + "headers": { + "type": "object", + "description": "Custom HTTP headers to add to the get request", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "containerPort", + "path" + ], + "allOf": [ + { + "$ref": "#/definitions/HealthProbeProperties" + } + ], + "x-ms-discriminator-value": "httpGet" + }, + "HttpRouteProperties": { + "type": "object", + "description": "HTTPRoute properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "hostname": { + "type": "string", + "description": "The internal hostname accepting traffic for the HTTP Route. Readonly." + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port number for the HTTP Route. Defaults to 80. Readonly." + }, + "scheme": { + "type": "string", + "description": "The scheme used for traffic. Readonly.", + "readOnly": true + }, + "url": { + "type": "string", + "description": "A stable URL that that can be used to route traffic to a resource. Readonly.", + "readOnly": true + } + }, + "required": [ + "application" + ] + }, + "HttpRouteResource": { + "type": "object", + "description": "Radius HTTPRoute Resource.", + "properties": { + "properties": { + "$ref": "#/definitions/HttpRouteProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "HttpRouteResourceListResult": { + "type": "object", + "description": "The response of a HttpRouteResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The HttpRouteResource items on this page", + "items": { + "$ref": "#/definitions/HttpRouteResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "HttpRouteResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the HttpRouteResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/HttpRouteResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "HttpRouteResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the HttpRouteResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "hostname": { + "type": "string", + "description": "The internal hostname accepting traffic for the HTTP Route. Readonly." + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port number for the HTTP Route. Defaults to 80. Readonly." + } + } + }, + "IAMKind": { + "type": "string", + "description": "The kind of IAM provider to configure", + "enum": [ + "azure" + ], + "x-ms-enum": { + "name": "IAMKind", + "modelAsString": true, + "values": [ + { + "name": "azure", + "value": "azure", + "description": "Azure Active Directory" + } + ] + } + }, + "IamProperties": { + "type": "object", + "description": "IAM properties", + "properties": { + "kind": { + "$ref": "#/definitions/IAMKind", + "description": "The kind of IAM provider to configure" + }, + "roles": { + "type": "array", + "description": "RBAC permissions to be assigned on the source resource", + "items": { + "type": "string" + } + } + }, + "required": [ + "kind" + ] + }, + "IamPropertiesUpdate": { + "type": "object", + "description": "IAM properties", + "properties": { + "kind": { + "$ref": "#/definitions/IAMKind", + "description": "The kind of IAM provider to configure" + }, + "roles": { + "type": "array", + "description": "RBAC permissions to be assigned on the source resource", + "items": { + "type": "string" + } + } + } + }, + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { + "type": "object", + "description": "IdentitySettings is the external identity setting.", + "properties": { + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" + }, + "oidcIssuer": { + "type": "string", + "description": "The URI for your compute platform's OIDC issuer" + }, + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" + } + }, + "required": [ + "kind" + ] + }, + "IdentitySettingsUpdate": { + "type": "object", + "description": "IdentitySettings is the external identity setting.", + "properties": { + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" + }, + "oidcIssuer": { + "type": "string", + "description": "The URI for your compute platform's OIDC issuer" + }, + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" + } + } + }, + "KeyObjectProperties": { + "type": "object", + "description": "Represents key object properties", + "properties": { + "alias": { + "type": "string", + "description": "File name when written to disk" + }, + "name": { + "type": "string", + "description": "The name of the key" + }, + "version": { + "type": "string", + "description": "Key version" + } + }, + "required": [ + "name" + ] + }, + "KubernetesCompute": { + "type": "object", + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, + "KubernetesComputeUpdate": { + "type": "object", + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EnvironmentComputeUpdate" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, + "KubernetesMetadataExtension": { + "type": "object", + "description": "Kubernetes metadata extension of a environment/application resource.", + "properties": { + "annotations": { + "type": "object", + "description": "Annotations to be applied to the Kubernetes resources output by the resource", + "additionalProperties": { + "type": "string" + } + }, + "labels": { + "type": "object", + "description": "Labels to be applied to the Kubernetes resources output by the resource", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "annotations", + "labels" + ], + "allOf": [ + { + "$ref": "#/definitions/Extension" + } + ], + "x-ms-discriminator-value": "kubernetesMetadata" + }, + "KubernetesNamespaceExtension": { + "type": "object", + "description": "Kubernetes namespace extension of a environment/application resource.", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace of the application environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/Extension" + } + ], + "x-ms-discriminator-value": "kubernetesNamespace" + }, + "ManagedStore": { + "type": "string", + "description": "The managed store for the ephemeral volume", + "enum": [ + "memory", + "disk" + ], + "x-ms-enum": { + "name": "ManagedStore", + "modelAsString": true, + "values": [ + { + "name": "memory", + "value": "memory", + "description": "Memory store" + }, + { + "name": "disk", + "value": "disk", + "description": "Disk store" + } + ] + } + }, + "ManualScalingExtension": { + "type": "object", + "description": "ManualScaling Extension", + "properties": { + "replicas": { + "type": "integer", + "format": "int32", + "description": "Replica count." + } + }, + "required": [ + "replicas" + ], + "allOf": [ + { + "$ref": "#/definitions/Extension" + } + ], + "x-ms-discriminator-value": "manualScaling" + }, + "OutputResource": { + "type": "object", + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } + }, + "PersistentVolume": { + "type": "object", + "description": "Specifies a persistent volume for a container", + "properties": { + "permission": { + "$ref": "#/definitions/VolumePermission", + "description": "Container read/write access to the volume" + }, + "source": { + "type": "string", + "description": "The source of the volume" + } + }, + "required": [ + "source" + ], + "allOf": [ + { + "$ref": "#/definitions/Volume" + } + ], + "x-ms-discriminator-value": "persistent" + }, + "PersistentVolumeUpdate": { + "type": "object", + "description": "Specifies a persistent volume for a container", + "properties": { + "permission": { + "$ref": "#/definitions/VolumePermission", + "description": "Container read/write access to the volume" + }, + "source": { + "type": "string", + "description": "The source of the volume" + } + }, + "allOf": [ + { + "$ref": "#/definitions/VolumeUpdate" + } + ], + "x-ms-discriminator-value": "persistent" + }, + "PortProtocol": { + "type": "string", + "description": "The protocol in use by the port", + "enum": [ + "TCP", + "UDP" + ], + "x-ms-enum": { + "name": "PortProtocol", + "modelAsString": true, + "values": [ + { + "name": "TCP", + "value": "TCP", + "description": "TCP protocol" + }, + { + "name": "UDP", + "value": "UDP", + "description": "UDP protocol" + } + ] + } + }, + "Providers": { + "type": "object", + "description": "The Cloud providers configuration", + "properties": { + "azure": { + "$ref": "#/definitions/ProvidersAzure", + "description": "The Azure cloud provider configuration" + }, + "aws": { + "$ref": "#/definitions/ProvidersAws", + "description": "The AWS cloud provider configuration" + } + } + }, + "ProvidersAws": { + "type": "object", + "description": "The AWS cloud provider definition", + "properties": { + "scope": { + "type": "string", + "description": "Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'" + } + }, + "required": [ + "scope" + ] + }, + "ProvidersAwsUpdate": { + "type": "object", + "description": "The AWS cloud provider definition", + "properties": { + "scope": { + "type": "string", + "description": "Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'" + } + } + }, + "ProvidersAzure": { + "type": "object", + "description": "The Azure cloud provider definition", + "properties": { + "scope": { + "type": "string", + "description": "Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'" + } + }, + "required": [ + "scope" + ] + }, + "ProvidersAzureUpdate": { + "type": "object", + "description": "The Azure cloud provider definition", + "properties": { + "scope": { + "type": "string", + "description": "Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'" + } + } + }, + "ProvidersUpdate": { + "type": "object", + "description": "The Cloud providers configuration", + "properties": { + "azure": { + "$ref": "#/definitions/ProvidersAzureUpdate", + "description": "The Azure cloud provider configuration" + }, + "aws": { + "$ref": "#/definitions/ProvidersAwsUpdate", + "description": "The AWS cloud provider configuration" + } + } + }, + "ProvisioningState": { + "type": "string", + "description": "Provisioning state of the portable resource at the time the operation was called", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Provisioning", + "Updating", + "Deleting", + "Accepted" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true + }, + "Recipe": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + }, + "required": [ + "name" + ] + }, + "RecipeGetMetadata": { + "type": "object", + "description": "Represents the request body of the getmetadata action.", + "properties": { + "linkType": { + "type": "string", + "description": "Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases'" + }, + "name": { + "type": "string", + "description": "The name of the recipe registered to the environment" + } + }, + "required": [ + "linkType", + "name" + ] + }, + "RecipeGetMetadataResponse": { + "type": "object", + "description": "The properties of a Recipe linked to an Environment.", + "properties": { + "templateKind": { + "type": "string", + "description": "The format of the template provided by the recipe. Allowed values: bicep, terraform." + }, + "templatePath": { + "type": "string", + "description": "The path to the template provided by the recipe. Currently only link to Azure Container Registry is supported." + }, + "templateVersion": { + "type": "string", + "description": "The version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources." + }, + "parameters": { + "type": "object", + "description": "The key/value parameters to pass to the recipe template at deployment.", + "properties": {} + } + }, + "required": [ + "templateKind", + "templatePath", + "templateVersion", + "parameters" + ] + }, + "RecipeProperties": { + "type": "object", + "description": "Format of the template provided by the recipe. Allowed values: bicep, terraform.", + "properties": { + "templateKind": { + "type": "string", + "description": "Discriminator property for RecipeProperties." + }, + "templatePath": { + "type": "string", + "description": "Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported." + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass to the recipe template at deployment", + "properties": {} + } + }, + "discriminator": "templateKind", + "required": [ + "templateKind", + "templatePath" + ] + }, + "RecipePropertiesUpdate": { + "type": "object", + "description": "Format of the template provided by the recipe. Allowed values: bicep, terraform.", + "properties": { + "templateKind": { + "type": "string", + "description": "Discriminator property for RecipeProperties." + }, + "templatePath": { + "type": "string", + "description": "Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported." + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass to the recipe template at deployment", + "properties": {} + } + }, + "discriminator": "templateKind", + "required": [ + "templateKind" + ] + }, + "RecipeUpdate": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + } + }, + "ResourceProvisioning": { + "type": "string", + "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", + "enum": [ + "recipe", + "manual" + ], + "x-ms-enum": { + "name": "ResourceProvisioning", + "modelAsString": true, + "values": [ + { + "name": "recipe", + "value": "recipe", + "description": "The resource lifecycle will be managed by Radius" + }, + { + "name": "manual", + "value": "manual", + "description": "The resource lifecycle will be managed by the user" + } + ] + } + }, + "ResourceStatus": { + "type": "object", + "description": "Status of a resource.", + "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, + "outputResources": { + "type": "array", + "description": "Properties of an output resource", + "items": { + "$ref": "#/definitions/OutputResource" + }, + "x-ms-identifiers": [] + } + } + }, + "SecretObjectProperties": { + "type": "object", + "description": "Represents secret object properties", + "properties": { + "alias": { + "type": "string", + "description": "File name when written to disk" + }, + "encoding": { + "$ref": "#/definitions/VolumeSecretEncodings", + "description": "Encoding format. Default utf-8", + "default": "utf-8" + }, + "name": { + "type": "string", + "description": "The name of the secret" + }, + "version": { + "type": "string", + "description": "secret version" + } + }, + "required": [ + "name" + ] + }, + "SecretStoreDataType": { + "type": "string", + "description": "The type of SecretStore data", + "enum": [ + "generic", + "certificate" + ], + "x-ms-enum": { + "name": "SecretStoreDataType", + "modelAsString": true, + "values": [ + { + "name": "generic", + "value": "generic", + "description": "Generic secret data type" + }, + { + "name": "certificate", + "value": "certificate", + "description": "Certificate secret data type" + } + ] + } + }, + "SecretStoreListSecretsResult": { + "type": "object", + "description": "The list of secrets", + "properties": { + "type": { + "$ref": "#/definitions/SecretStoreDataType", + "description": "The type of secret store data" + }, + "data": { + "type": "object", + "description": "An object to represent key-value type secrets", + "additionalProperties": { + "$ref": "#/definitions/SecretValueProperties" + } + } + }, + "required": [ + "type", + "data" + ] + }, + "SecretStoreProperties": { + "type": "object", + "description": "The properties of SecretStore", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "type": { + "$ref": "#/definitions/SecretStoreDataType", + "description": "The type of secret store data", + "default": "generic" + }, + "data": { + "type": "object", + "description": "An object to represent key-value type secrets", + "additionalProperties": { + "$ref": "#/definitions/SecretValueProperties" + } + }, + "resource": { + "type": "string", + "description": "The resource id of external secret store." + } + }, + "required": [ + "application", + "data" + ] + }, + "SecretStoreResource": { + "type": "object", + "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", + "properties": { + "properties": { + "$ref": "#/definitions/SecretStoreProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "SecretStoreResourceListResult": { + "type": "object", + "description": "The response of a SecretStoreResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The SecretStoreResource items on this page", + "items": { + "$ref": "#/definitions/SecretStoreResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "SecretStoreResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the SecretStoreResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/SecretStoreResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "SecretStoreResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the SecretStoreResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "type": { + "$ref": "#/definitions/SecretStoreDataType", + "description": "The type of secret store data", + "default": "generic" + }, + "data": { + "type": "object", + "description": "An object to represent key-value type secrets", + "additionalProperties": { + "$ref": "#/definitions/SecretValueProperties" + } + }, + "resource": { + "type": "string", + "description": "The resource id of external secret store." + } + } + }, + "SecretValueEncoding": { + "type": "string", + "description": "The type of SecretValue Encoding", + "enum": [ + "raw", + "base64" + ], + "x-ms-enum": { + "name": "SecretValueEncoding", + "modelAsString": true, + "values": [ + { + "name": "raw", + "value": "raw", + "description": "The raw secret value" + }, + { + "name": "base64", + "value": "base64", + "description": "The base64-encoded secret value" + } + ] + } + }, + "SecretValueProperties": { + "type": "object", + "description": "The properties of SecretValue", + "properties": { + "encoding": { + "$ref": "#/definitions/SecretValueEncoding", + "description": "The encoding of value", + "default": "raw" + }, + "value": { + "type": "string", + "format": "password", + "description": "The value of secret.", + "x-ms-secret": true + }, + "valueFrom": { + "$ref": "#/definitions/ValueFromProperties", + "description": "The referenced secret in properties.resource" + } + } + }, + "TcpHealthProbeProperties": { + "type": "object", + "description": "Specifies the properties for readiness/liveness probe using TCP", + "properties": { + "containerPort": { + "type": "integer", + "format": "int32", + "description": "The listening port number" + } + }, + "required": [ + "containerPort" + ], + "allOf": [ + { + "$ref": "#/definitions/HealthProbeProperties" + } + ], + "x-ms-discriminator-value": "tcp" + }, + "TerraformRecipeProperties": { + "type": "object", + "description": "Represents Terraform recipe properties.", + "properties": { + "templateVersion": { + "type": "string", + "description": "Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources." + } + }, + "required": [ + "templateVersion" + ], + "allOf": [ + { + "$ref": "#/definitions/RecipeProperties" + } + ], + "x-ms-discriminator-value": "terraform" + }, + "TerraformRecipePropertiesUpdate": { + "type": "object", + "description": "Represents Terraform recipe properties.", + "properties": { + "templateVersion": { + "type": "string", + "description": "Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources." + } + }, + "allOf": [ + { + "$ref": "#/definitions/RecipePropertiesUpdate" + } + ], + "x-ms-discriminator-value": "terraform" + }, + "TlsMinVersion": { + "type": "string", + "description": "Tls Minimum versions for Gateway resource.", + "enum": [ + "1.2", + "1.3" + ], + "x-ms-enum": { + "name": "TlsMinVersion", + "modelAsString": true, + "values": [ + { + "name": "tls12", + "value": "1.2", + "description": "TLS Version 1.2" + }, + { + "name": "tls13", + "value": "1.3", + "description": "TLS Version 1.3" + } + ] + } + }, + "ValueFromProperties": { + "type": "object", + "description": "The Secret value source properties", + "properties": { + "name": { + "type": "string", + "description": "The name of the referenced secret." + }, + "version": { + "type": "string", + "description": "The version of the referenced secret." + } + }, + "required": [ + "name" + ] + }, + "Versions": { + "type": "string", + "description": "Supported API versions for the Applications.Core resource provider.", + "enum": [ + "2022-03-15-privatepreview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_03_15_privatepreview", + "value": "2022-03-15-privatepreview", + "description": "2022-03-15-privatepreview" + } + ] + } + }, + "Volume": { + "type": "object", + "description": "Specifies a volume for a container", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for Volume." + }, + "mountPath": { + "type": "string", + "description": "The path where the volume is mounted" + } + }, + "discriminator": "kind", + "required": [ + "kind", + "mountPath" + ] + }, + "VolumePermission": { + "type": "string", + "description": "The persistent volume permission", + "enum": [ + "read", + "write" + ], + "x-ms-enum": { + "name": "VolumePermission", + "modelAsString": true, + "values": [ + { + "name": "read", + "value": "read", + "description": "Read only" + }, + { + "name": "write", + "value": "write", + "description": "Read and write" + } + ] + } + }, + "VolumeProperties": { + "type": "object", + "description": "Volume properties", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for VolumeProperties." + }, + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + } + }, + "discriminator": "kind", + "required": [ + "kind", + "application" + ] + }, + "VolumeResource": { + "type": "object", + "description": "Radius Volume resource.", + "properties": { + "properties": { + "$ref": "#/definitions/VolumeProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "VolumeResourceListResult": { + "type": "object", + "description": "The response of a VolumeResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The VolumeResource items on this page", + "items": { + "$ref": "#/definitions/VolumeResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "VolumeResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the VolumeResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/VolumeResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "VolumeResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the VolumeResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + } + } + }, + "VolumeSecretEncodings": { + "type": "string", + "description": "Represents secret encodings", + "enum": [ + "utf-8", + "hex", + "base64" + ], + "x-ms-enum": { + "name": "VolumeSecretEncodings", + "modelAsString": true, + "values": [ + { + "name": "utf8", + "value": "utf-8", + "description": "UTF-8 encoding" + }, + { + "name": "hex", + "value": "hex", + "description": "Hex encoding" + }, + { + "name": "base64", + "value": "base64", + "description": "Base64 encoding" + } + ] + } + }, + "VolumeUpdate": { + "type": "object", + "description": "Specifies a volume for a container", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for Volume." + }, + "mountPath": { + "type": "string", + "description": "The path where the volume is mounted" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + } + }, + "parameters": { + "RootScopeParameter": { + "name": "rootScope", + "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/secretstores.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/secretstores.json deleted file mode 100644 index 35125aca3b..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/secretstores.json +++ /dev/null @@ -1,483 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core Persistent SecretStore Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/secretStores": { - "get": { - "description": "List all secret stores in the given scope.", - "operationId": "SecretStores_List", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusSecretStoresList": { - "$ref": "./examples/SecretStoresList.json" - } - }, - "tags": [ - "SecretStores" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "SecretStores list.", - "schema": { - "$ref": "#/definitions/SecretStoreResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}": { - "get": { - "description": "Gets the properties of a secret store.", - "operationId": "SecretStores_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusSecretStoresGet": { - "$ref": "./examples/SecretStoresGet.json" - }, - "RadiusSecretStoresAzureKeyVaultGet": { - "$ref": "./examples/SecretStoresGet_AzureKeyVault.json" - } - }, - "tags": [ - "SecretStores" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SecretStoreNameParameter" - } - ], - "responses": { - "200": { - "description": "SecretStore details.", - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update a secret store.", - "operationId": "SecretStores_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusSecretStoresPutValueFrom": { - "$ref": "./examples/SecretStoresPutValueFrom.json" - }, - "RadiusSecretStoresPutValue": { - "$ref": "./examples/SecretStoresPutValue.json" - } - }, - "tags": [ - "SecretStores" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SecretStoreNameParameter" - }, - { - "name": "SecretStoreResource", - "description": "SecretStore details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing secret store.", - "operationId": "SecretStores_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusSecretStoresPatch": { - "$ref": "./examples/SecretStoresPatch.json" - } - }, - "tags": [ - "SecretStores" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SecretStoreNameParameter" - }, - { - "name": "SecretStoreResource", - "description": "SecretStore details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/SecretStoreResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete a secret store.", - "operationId": "SecretStores_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusSecretStoresDelete": { - "$ref": "./examples/SecretStoresDelete.json" - } - }, - "tags": [ - "SecretStores" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SecretStoreNameParameter" - } - ], - "responses": { - "200": { - "description": "The SecretStore was successfully deleted." - }, - "202": { - "description": "The SecretStore will be deleted asynchronously." - }, - "204": { - "description": "The SecretStore does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Core/secretStores/{secretStoreName}/listSecrets": { - "post": { - "description": "List the secrets of a secret stores.", - "operationId": "SecretStores_ListSecrets", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusSecretStoresPostListSecret": { - "$ref": "./examples/SecretStoresListSecrets.json" - } - }, - "tags": [ - "SecretStores" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SecretStoreNameParameter" - } - ], - "responses": { - "200": { - "description": "The list of secret values in this secret store", - "schema": { - "$ref": "#/definitions/SecretStoreListSecretsResult" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "SecretStoreResourceList": { - "description": "The list of SecretStores.", - "type": "object", - "properties": { - "value": { - "description": "The list of SecretStore.", - "type": "array", - "items": { - "$ref": "#/definitions/SecretStoreResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of SecretStores list.", - "type": "string" - } - } - }, - "SecretStoreResource": { - "description": "Radius SecretStore Resource.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "$ref": "#/definitions/SecretStoreProperties" - } - } - }, - "SecretStoreDataType": { - "description": "The type of secret store data", - "type": "string", - "enum": [ - "generic", - "certificate" - ], - "default": "generic", - "x-ms-enum": { - "name": "SecretStoreDataType", - "modelAsString": false - } - }, - "SecretStoreProperties": { - "allOf": [ - { - "$ref": "global.json#/definitions/BasicResourceProperties" - } - ], - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the SecretStore at the time the operation was called." - }, - "type": { - "description": "The type of secret store data", - "$ref": "#/definitions/SecretStoreDataType" - }, - "data": { - "description": "An object to represent key-value type secrets", - "additionalProperties": { - "$ref": "#/definitions/SecretValueProperties" - }, - "type": "object" - }, - "resource": { - "description": "The resource id of external secret store.", - "type": "string" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "SecretStoreListSecretsResult": { - "description": "The list of secrets", - "properties": { - "type": { - "description": "The type of secret store data", - "$ref": "#/definitions/SecretStoreDataType" - }, - "data": { - "description": "An object to represent key-value type secrets", - "additionalProperties": { - "$ref": "#/definitions/SecretValueProperties" - }, - "type": "object" - } - }, - "type": "object" - }, - "SecretValueProperties": { - "properties": { - "encoding": { - "description": "The encoding of value", - "type": "string", - "enum": [ - "raw", - "base64" - ], - "default": "raw", - "x-ms-enum": { - "name": "SecretValueEncoding", - "modelAsString": false - } - }, - "value": { - "description": "The value of secret.", - "type": "string", - "x-ms-secret": true - }, - "valueFrom": { - "description": "The referenced secret in properties.resource", - "$ref": "#/definitions/ValueFromProperties" - } - }, - "type": "object" - }, - "ValueFromProperties": { - "properties": { - "name": { - "description": "The name of the referenced secret.", - "type": "string" - }, - "version": { - "description": "The version of the referenced secret.", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - } - }, - "parameters": { - "SecretStoreNameParameter": { - "name": "secretStoreName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the secret store.", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/volumes.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/volumes.json deleted file mode 100644 index c09559c169..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/volumes.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Core Management APIs", - "description": "REST API for Applications.Core Persistent Volume Resource", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Core/volumes": { - "get": { - "description": "List all volumes in the given scope.", - "operationId": "Volumes_ListByScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusVolumesListByScope": { - "$ref": "./examples/VolumesListByScope.json" - } - }, - "tags": [ - "Volumes" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "global.json#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "Volumes details.", - "schema": { - "$ref": "#/definitions/VolumeResourceList" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Core/volumes/{volumeName}": { - "get": { - "description": "Gets the properties of an Volume.", - "operationId": "Volumes_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusVolumesGet": { - "$ref": "./examples/VolumesGet.json" - } - }, - "tags": [ - "Volumes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/VolumeNameParameter" - } - ], - "responses": { - "200": { - "description": "Volume details.", - "schema": { - "$ref": "#/definitions/VolumeResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Create or update an Volume.", - "operationId": "Volumes_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusVolumesPut": { - "$ref": "./examples/VolumesPut.json" - } - }, - "tags": [ - "Volumes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/VolumeNameParameter" - }, - { - "name": "VolumeResource", - "description": "Volume details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/VolumeResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/VolumeResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/VolumeResource" - } - }, - "204": { - "description": "The Volume does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "patch": { - "description": "Update the properties of an existing Volume.", - "operationId": "Volumes_Update", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusVolumesPatch": { - "$ref": "./examples/VolumesPatch.json" - } - }, - "tags": [ - "Volumes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/VolumeNameParameter" - }, - { - "name": "VolumeResource", - "description": "Volume details", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/VolumeResource" - } - } - ], - "responses": { - "200": { - "description": "The resource was updated successfully.", - "schema": { - "$ref": "#/definitions/VolumeResource" - } - }, - "201": { - "description": "The resource will be updated asynchronously.", - "schema": { - "$ref": "#/definitions/VolumeResource" - } - }, - "204": { - "description": "The Volume does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Delete an Volume.", - "operationId": "Volumes_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "RadiusVolumesDelete": { - "$ref": "./examples/VolumesDelete.json" - } - }, - "tags": [ - "Volumes" - ], - "parameters": [ - { - "$ref": "global.json#/parameters/RootScopeParameter" - }, - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/VolumeNameParameter" - } - ], - "responses": { - "200": { - "description": "The Volume was successfully deleted." - }, - "202": { - "description": "The Volume will be deleted asynchronously." - }, - "204": { - "description": "The Volume does not exist." - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "VolumeResourceList": { - "description": "The list of Volumes.", - "type": "object", - "properties": { - "value": { - "description": "The list of Volume.", - "type": "array", - "items": { - "$ref": "#/definitions/VolumeResource" - } - }, - "nextLink": { - "description": "The link used to get the next page of Volumes list.", - "type": "string" - } - } - }, - "VolumeResource": { - "description": "Radius Volume Resource.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/VolumeProperties" - } - } - }, - "VolumeProperties": { - "allOf": [ - { - "$ref": "global.json#/definitions/BasicResourceProperties" - } - ], - "discriminator": "kind", - "properties": { - "kind": { - "description": "The volume kind", - "type": "string" - }, - "provisioningState": { - "readOnly": true, - "$ref": "global.json#/definitions/ProvisioningState", - "description": "Provisioning state of the Volume at the time the operation was called." - } - }, - "required": [ - "application", - "kind" - ], - "type": "object" - }, - "CertificateObjectProperties": { - "properties": { - "alias": { - "description": "File name when written to disk.", - "type": "string" - }, - "encoding": { - "description": "Encoding format. Default utf-8", - "type": "string", - "enum": [ - "utf-8", - "hex", - "base64" - ], - "default": "utf-8", - "x-ms-enum": { - "name": "encoding", - "modelAsString": false - } - }, - "format": { - "description": "Certificate format. Default pem", - "type": "string", - "enum": [ - "pem", - "pfx" - ], - "default": "pem", - "x-ms-enum": { - "name": "format", - "modelAsString": false - } - }, - "name": { - "description": "The name of the certificate", - "type": "string" - }, - "certType": { - "description": "Certificate object type to be downloaded - the certificate itself, private key or public key of the certificate", - "type": "string", - "enum": [ - "certificate", - "publickey", - "privatekey" - ], - "x-ms-enum": { - "name": "certType", - "modelAsString": false - } - }, - "version": { - "description": "Certificate version", - "type": "string" - } - }, - "required": [ - "name", - "value" - ], - "type": "object" - }, - "KeyObjectProperties": { - "properties": { - "alias": { - "description": "File name when written to disk.", - "type": "string" - }, - "name": { - "description": "The name of the key", - "type": "string" - }, - "version": { - "description": "Key version", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "SecretObjectProperties": { - "properties": { - "alias": { - "description": "File name when written to disk.", - "type": "string" - }, - "encoding": { - "description": "Encoding format. Default utf-8", - "type": "string", - "enum": [ - "utf-8", - "hex", - "base64" - ], - "default": "utf-8", - "x-ms-enum": { - "name": "encoding", - "modelAsString": false - } - }, - "name": { - "description": "The name of the secret", - "type": "string" - }, - "version": { - "description": "Secret version", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "AzureKeyVaultVolumeProperties": { - "additionalProperties": false, - "allOf": [ - { - "$ref": "#/definitions/VolumeProperties" - } - ], - "properties": { - "certificates": { - "additionalProperties": { - "$ref": "#/definitions/CertificateObjectProperties" - }, - "description": "The KeyVault certificates that this volume exposes", - "type": "object" - }, - "keys": { - "additionalProperties": { - "$ref": "#/definitions/KeyObjectProperties" - }, - "description": "The KeyVault keys that this volume exposes", - "type": "object" - }, - "resource": { - "description": "The ID of the keyvault to use for this volume resource", - "type": "string" - }, - "secrets": { - "additionalProperties": { - "$ref": "#/definitions/SecretObjectProperties" - }, - "description": "The KeyVault secrets that this volume exposes", - "type": "object" - } - }, - "required": [ - "kind", - "resource" - ], - "type": "object", - "x-ms-discriminator-value": "azure.com.keyvault" - } - }, - "parameters": { - "VolumeNameParameter": { - "name": "volumeName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Volume.", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/readme.csharp.md b/swagger/specification/applications/resource-manager/readme.csharp.md index 7b7ca2b331..7f44ef028b 100644 --- a/swagger/specification/applications/resource-manager/readme.csharp.md +++ b/swagger/specification/applications/resource-manager/readme.csharp.md @@ -68,9 +68,7 @@ tag: package-messaging-2022-03-15-privatepreview ``` yaml $(tag) == 'package-core-2022-03-15-privatepreview' output-folder: $(csharp-sdks-folder)/applications/management/2022-03-15-privatepreview/core/src/Generated input-file: -- Applications.Core/preview/2022-03-15-privatepreview/global.json -- Applications.Core/preview/2022-03-15-privatepreview/environments.json -- Applications.Core/preview/2022-03-15-privatepreview/applications.json +- Applications.Core/preview/2022-03-15-privatepreview/openapi.json ``` ### Tag: package-link-2022-03-15-privatepreview diff --git a/swagger/specification/applications/resource-manager/readme.md b/swagger/specification/applications/resource-manager/readme.md index 72dd1cafe6..a601808c9c 100644 --- a/swagger/specification/applications/resource-manager/readme.md +++ b/swagger/specification/applications/resource-manager/readme.md @@ -43,15 +43,7 @@ These settings apply only when `--tag=package-core-2022-03-15-privatepreview` is ``` yaml $(tag) == 'package-core-2022-03-15-privatepreview' input-file: - - Applications.Core/preview/2022-03-15-privatepreview/global.json - - Applications.Core/preview/2022-03-15-privatepreview/environments.json - - Applications.Core/preview/2022-03-15-privatepreview/applications.json - - Applications.Core/preview/2022-03-15-privatepreview/httpRoutes.json - - Applications.Core/preview/2022-03-15-privatepreview/gateways.json - - Applications.Core/preview/2022-03-15-privatepreview/containers.json - - Applications.Core/preview/2022-03-15-privatepreview/volumes.json - - Applications.Core/preview/2022-03-15-privatepreview/secretstores.json - - Applications.Core/preview/2022-03-15-privatepreview/extenders.json + - Applications.Core/preview/2022-03-15-privatepreview/openapi.json ``` ### Tag: package-link-2022-03-15-privatepreview diff --git a/swagger/specs.go b/swagger/specs.go index 256a42aa32..0b6244a856 100644 --- a/swagger/specs.go +++ b/swagger/specs.go @@ -29,7 +29,7 @@ var ( //go:embed specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/*.json //go:embed specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/*.json //go:embed specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/*.json - //go:embed specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/*.json + //go:embed specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json //go:embed specification/common-types/resource-management/v2/types.json //go:embed specification/common-types/resource-management/v3/types.json SpecFiles embed.FS diff --git a/test/functional/shared/resources/recipe_bicep_test.go b/test/functional/shared/resources/recipe_bicep_test.go index ee5cc438fc..f5ba760123 100644 --- a/test/functional/shared/resources/recipe_bicep_test.go +++ b/test/functional/shared/resources/recipe_bicep_test.go @@ -206,12 +206,15 @@ func Test_BicepRecipe_ResourceCreation(t *testing.T) { scope := strings.ReplaceAll(parsed.RootScope(), "resourcegroups", "resourceGroups") expected := []any{ map[string]any{ - "id": "/planes/kubernetes/local/namespaces/" + name + "-app/providers/core/Secret/" + name, + "id": "/planes/kubernetes/local/namespaces/" + name + "-app/providers/core/Secret/" + name, + "radiusManaged": true, }, map[string]any{ - "id": scope + "/providers/Applications.Core/extenders/" + name + "-created", + "id": scope + "/providers/Applications.Core/extenders/" + name + "-created", + "radiusManaged": true, }, map[string]interface{}{ - "id": scope + "/providers/Applications.Core/extenders/" + name + "-module", + "id": scope + "/providers/Applications.Core/extenders/" + name + "-module", + "radiusManaged": true, }, } actual := resource.Properties["status"].(map[string]any)["outputResources"].([]any) diff --git a/typespec/Applications.Core/applications.tsp b/typespec/Applications.Core/applications.tsp index d0d8c284dc..4e53665781 100644 --- a/typespec/Applications.Core/applications.tsp +++ b/typespec/Applications.Core/applications.tsp @@ -57,7 +57,11 @@ model ApplicationProperties { @doc("The application extension.") @extension("x-ms-identifiers", []) - extensions: Array; + extensions?: Array; + + @doc("Status of a resource.") + @visibility("read") + status?: ResourceStatus; } #suppress "@azure-tools/typespec-azure-core/casing-style" diff --git a/typespec/Applications.Core/containers.tsp b/typespec/Applications.Core/containers.tsp index 88620cefac..2fc496bb21 100644 --- a/typespec/Applications.Core/containers.tsp +++ b/typespec/Applications.Core/containers.tsp @@ -206,7 +206,7 @@ model Container { args?: string[]; @doc("Working directory for the container") - workingDir: string; + workingDir?: string; } @doc("The protocol in use by the port") diff --git a/typespec/Applications.Core/environments.tsp b/typespec/Applications.Core/environments.tsp index 00da83fc20..922b1bd301 100644 --- a/typespec/Applications.Core/environments.tsp +++ b/typespec/Applications.Core/environments.tsp @@ -167,8 +167,8 @@ interface Environments { >; @doc("Gets recipe metadata including parameters and any constraints on the parameters.") - @action("getmetadata") - getmetadata is ArmResourceActionSync< + @action("getMetadata") + getMetadata is ArmResourceActionSync< EnvironmentResource, RecipeGetMetadata, RecipeGetMetadataResponse, diff --git a/typespec/Applications.Core/extenders.tsp b/typespec/Applications.Core/extenders.tsp index aeae0499e2..e29e6268e1 100644 --- a/typespec/Applications.Core/extenders.tsp +++ b/typespec/Applications.Core/extenders.tsp @@ -36,7 +36,7 @@ using OpenAPI; namespace Applications.Core; @doc("Response for list secrets API call") -model ExtenderListSecretResponse is Record; +model ExtenderListSecretResponse {} @doc("ExtenderResource link") model ExtenderResource is TrackedResource { @@ -56,7 +56,7 @@ model ExtenderProperties extends Record { ...EnvironmentScopedResource; @doc("The secrets for referenced resource") - secrets?: Record; + secrets?: {}; @doc("The recipe used to automatically deploy underlying infrastructure for the extender link") recipe?: Recipe; @@ -92,7 +92,7 @@ interface Extenders { "Scope" >; - @doc("Lists secrets values for the specified RedisCache resource") + @doc("Lists secrets values for the specified Extender resource") @action("listSecrets") listSecrets is ArmResourceActionSync< ExtenderResource, diff --git a/typespec/Applications.Core/gateways.tsp b/typespec/Applications.Core/gateways.tsp index 5b7ea798f8..843e54c8a5 100644 --- a/typespec/Applications.Core/gateways.tsp +++ b/typespec/Applications.Core/gateways.tsp @@ -99,10 +99,10 @@ model GatewayHostname { @doc("Route attached to Gateway") model GatewayRoute { @doc("The path to match the incoming request path on. Ex - /myservice.") - path: string; + path?: string; @doc("The HttpRoute to route to. Ex - myserviceroute.id.") - destination: string; + destination?: string; @doc("Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'") replacePrefix?: string; diff --git a/typespec/Applications.Core/secretstores.tsp b/typespec/Applications.Core/secretstores.tsp index 4ca7a5c4fb..af9b089024 100644 --- a/typespec/Applications.Core/secretstores.tsp +++ b/typespec/Applications.Core/secretstores.tsp @@ -44,7 +44,7 @@ model SecretStoreResource is TrackedResource { name: ResourceNameString; } -@doc("SecretStore properties") +@doc("The properties of SecretStore") model SecretStoreProperties { ...ApplicationScopedResource; @@ -59,7 +59,7 @@ model SecretStoreProperties { resource?: string; } -@doc("SecretStore data type") +@doc("The type of SecretStore data") enum SecretStoreDataType { @doc("Generic secret data type") generic, @@ -68,7 +68,7 @@ enum SecretStoreDataType { certificate, } -@doc("SecretValue Encoding type") +@doc("The type of SecretValue Encoding") enum SecretValueEncoding { @doc("The raw secret value") raw, @@ -86,14 +86,14 @@ model ValueFromProperties { version?: string; } -@doc("SecretValue properties") +@doc("The properties of SecretValue") model SecretValueProperties { @doc("The encoding of value") encoding?: SecretValueEncoding = SecretValueEncoding.raw; @doc("The value of secret.") @secret - value: string; + value?: string; @doc("The referenced secret in properties.resource") valueFrom?: ValueFromProperties; diff --git a/typespec/Applications.Core/tspconfig.yaml b/typespec/Applications.Core/tspconfig.yaml index 38f0dc630d..36ae5ddecf 100644 --- a/typespec/Applications.Core/tspconfig.yaml +++ b/typespec/Applications.Core/tspconfig.yaml @@ -4,7 +4,7 @@ options: "@azure-tools/typespec-autorest": use-read-only-status-schema: true azure-resource-provider-folder: "resource-manager" - examples-directory: "examples" + examples-directory: "{project-root}/examples" emitter-output-dir: "{project-root}/../../swagger/specification/applications" arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/Applications.Core/volumes.tsp b/typespec/Applications.Core/volumes.tsp index ef53e24cdb..0b82fb5b4b 100644 --- a/typespec/Applications.Core/volumes.tsp +++ b/typespec/Applications.Core/volumes.tsp @@ -131,10 +131,10 @@ model SecretObjectProperties { @doc("Encoding format. Default utf-8") encoding?: VolumeSecretEncodings = VolumeSecretEncodings.utf8; - @doc("The name of the certificate") + @doc("The name of the secret") name: string; - @doc("Certificate version") + @doc("secret version") version?: string; } @@ -143,10 +143,10 @@ model KeyObjectProperties { @doc("File name when written to disk") `alias`?: string; - @doc("The name of the certificate") + @doc("The name of the key") name: string; - @doc("Certificate version") + @doc("Key version") version?: string; } diff --git a/typespec/Test.Resource/tspconfig.yaml b/typespec/Test.Resource/tspconfig.yaml index 38f0dc630d..36ae5ddecf 100644 --- a/typespec/Test.Resource/tspconfig.yaml +++ b/typespec/Test.Resource/tspconfig.yaml @@ -4,7 +4,7 @@ options: "@azure-tools/typespec-autorest": use-read-only-status-schema: true azure-resource-provider-folder: "resource-manager" - examples-directory: "examples" + examples-directory: "{project-root}/examples" emitter-output-dir: "{project-root}/../../swagger/specification/applications" arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/radius/v1/ucprootscope.tsp b/typespec/radius/v1/ucprootscope.tsp index fbdf0076b5..15efa22483 100644 --- a/typespec/radius/v1/ucprootscope.tsp +++ b/typespec/radius/v1/ucprootscope.tsp @@ -28,8 +28,6 @@ using Azure.ResourceManager.Foundations; model RootScopeParameter { @path @minLength(1) - @maxLength(90) - @pattern("^[-\\w\\._\\(\\)]+$") @extension("x-ms-skip-url-encoding", true) @extension("x-ms-parameter-location", "client") @doc("The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}") From cf4843d79c2664020cf9a0c65fe6df3f87a0f71d Mon Sep 17 00:00:00 2001 From: nithyatsu <98416062+nithyatsu@users.noreply.github.com> Date: Thu, 24 Aug 2023 08:33:33 -0700 Subject: [PATCH 08/57] Return a daprmissing error if we are deploying dapr resource to a cluster which does not have dapr installed. (#5962) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Return a DaprMissingError when we try to deploy dapr components on a cluster which does not have dapr installed. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: #5689 ## Auto-generated summary ### 🤖 Generated by Copilot at e5fabaf ### Summary 🚀🧪🐛 This pull request adds error handling for the linkrp processors that use dapr components, and fixes some variable shadowing issues. It also adds a launch configuration and a test case for the dapr state store processor. The changes are intended to improve the robustness and usability of the rad command and the linkrp package. > _`dapr` not installed_ > _error handling is added_ > _autumn of testing_ ### Walkthrough * Add arguments to launch configuration for rad command in `.vscode/launch.json` ([link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-bd5430ee7c51dc892a67b3f2829d1f5b6d223f0fd48b82322cfd45baf9f5e945L47-R49)) * Add check for dapr installation in Process methods of dapr processors in `pkg/linkrp/processors` ([link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-db9d07a77b0bb7dfd13b27883858c44b43d8c17abb32203ad18068bc06c2d366R47-R53), [link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-92f3383fb233d7ca4cbc950765622a2f4b6bd08f8b4efd42c20c577808406d63L45-R57), [link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-2b1a2c217ff91b714ff59316e233c1b79a9524f8a41457df69f4936bda945053R47-R53)) * Use existing err variable instead of shadowing it in Process methods of dapr processors in `pkg/linkrp/processors` ([link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-db9d07a77b0bb7dfd13b27883858c44b43d8c17abb32203ad18068bc06c2d366L52-R60), [link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-2b1a2c217ff91b714ff59316e233c1b79a9524f8a41457df69f4936bda945053L52-R60)) * Add bicep file for dapr state store test case in `test/functional/shared/resources/testdata` ([link](https://github.com/project-radius/radius/pull/5962/files?diff=unified&w=0#diff-af296b08adf81df6175fb9f3c3c44eadd9e30ecbdfd2dbcfc0f6e2aecb188ae2R1-R65)) --- pkg/armrpc/api/v1/errorcodes.go | 3 ++ pkg/armrpc/rest/results.go | 12 ++++++++ pkg/linkrp/frontend/handler/routes.go | 13 +++++++++ pkg/rp/frontend/validator.go | 17 ++++++++++++ pkg/rp/frontend/validator_test.go | 40 +++++++++++++++++++++++++++ 5 files changed, 85 insertions(+) diff --git a/pkg/armrpc/api/v1/errorcodes.go b/pkg/armrpc/api/v1/errorcodes.go index 5519b72ef5..6d4b352c0b 100644 --- a/pkg/armrpc/api/v1/errorcodes.go +++ b/pkg/armrpc/api/v1/errorcodes.go @@ -26,6 +26,9 @@ const ( // Used for internal/unclassified failures. CodeInternal = "Internal" + // Used when a dependency to carry out current operation is missing. + CodeDependencyMissing = "DependencyMissing" + // Used for CodeNotFound error. CodeNotFound = "NotFound" diff --git a/pkg/armrpc/rest/results.go b/pkg/armrpc/rest/results.go index 18845cfca8..5dc5783bbd 100644 --- a/pkg/armrpc/rest/results.go +++ b/pkg/armrpc/rest/results.go @@ -407,6 +407,18 @@ func NewLinkedResourceUpdateErrorResponse(resourceID resources.ID, oldProp *rpv1 } } +// NewDependencyMissingResponse creates a DependencyMissingResponse with a given error message. +func NewDependencyMissingResponse(message string) Response { + return &BadRequestResponse{ + Body: v1.ErrorResponse{ + Error: v1.ErrorDetails{ + Code: v1.CodeDependencyMissing, + Message: message, + }, + }, + } +} + // NewBadRequestResponse creates a BadRequestResponse with a given error message. func NewBadRequestResponse(message string) Response { return &BadRequestResponse{ diff --git a/pkg/linkrp/frontend/handler/routes.go b/pkg/linkrp/frontend/handler/routes.go index fed9fa6e1d..caa54e7e58 100644 --- a/pkg/linkrp/frontend/handler/routes.go +++ b/pkg/linkrp/frontend/handler/routes.go @@ -7,6 +7,7 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -310,6 +311,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprPubSubBroker]{ rp_frontend.PrepareRadiusResource[*dapr_dm.DaprPubSubBroker], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprPubSubBroker], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, @@ -328,6 +330,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprPubSubBroker]{ rp_frontend.PrepareRadiusResource[*dapr_dm.DaprPubSubBroker], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprPubSubBroker], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, @@ -405,6 +408,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprSecretStore]{ rp_frontend.PrepareRadiusResource[*dapr_dm.DaprSecretStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprSecretStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, @@ -423,6 +427,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprSecretStore]{ rp_frontend.PrepareRadiusResource[*dapr_dm.DaprSecretStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprSecretStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, @@ -500,6 +505,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprStateStore]{ rp_frontend.PrepareRadiusResource[*dapr_dm.DaprStateStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprStateStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, @@ -518,6 +524,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprStateStore]{ rp_frontend.PrepareRadiusResource[*dapr_dm.DaprStateStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprStateStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, @@ -1072,6 +1079,7 @@ func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprPubSubBroker]{ + rp_frontend.PrepareDaprResource[*datamodel.DaprPubSubBroker], rp_frontend.PrepareRadiusResource[*datamodel.DaprPubSubBroker], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, @@ -1090,6 +1098,7 @@ func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprPubSubBroker]{ + rp_frontend.PrepareDaprResource[*datamodel.DaprPubSubBroker], rp_frontend.PrepareRadiusResource[*datamodel.DaprPubSubBroker], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, @@ -1167,6 +1176,7 @@ func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprSecretStore]{ + rp_frontend.PrepareDaprResource[*datamodel.DaprSecretStore], rp_frontend.PrepareRadiusResource[*datamodel.DaprSecretStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, @@ -1185,6 +1195,7 @@ func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprSecretStore]{ + rp_frontend.PrepareDaprResource[*datamodel.DaprSecretStore], rp_frontend.PrepareRadiusResource[*datamodel.DaprSecretStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, @@ -1262,6 +1273,7 @@ func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref RequestConverter: converter.DaprStateStoreDataModelFromVersioned, ResponseConverter: converter.DaprStateStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprStateStore]{ + rp_frontend.PrepareDaprResource[*datamodel.DaprStateStore], rp_frontend.PrepareRadiusResource[*datamodel.DaprStateStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, @@ -1280,6 +1292,7 @@ func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref RequestConverter: converter.DaprStateStoreDataModelFromVersioned, ResponseConverter: converter.DaprStateStoreDataModelToVersioned, UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprStateStore]{ + rp_frontend.PrepareDaprResource[*datamodel.DaprStateStore], rp_frontend.PrepareRadiusResource[*datamodel.DaprStateStore], }, AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, diff --git a/pkg/rp/frontend/validator.go b/pkg/rp/frontend/validator.go index 57e6315abf..36015d5482 100644 --- a/pkg/rp/frontend/validator.go +++ b/pkg/rp/frontend/validator.go @@ -22,6 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" + "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -47,3 +48,19 @@ func PrepareRadiusResource[P interface { return nil, nil } + +// PrepareDaprResource validates if the cluster has Dapr installed. +func PrepareDaprResource[P interface { + *T + rpv1.RadiusResourceModel +}, T any](ctx context.Context, newResource *T, oldResource *T, options *controller.Options) (rest.Response, error) { + isDaprSupported, err := datamodel.IsDaprInstalled(ctx, options.KubeClient) + if err != nil { + return nil, err + } + if !isDaprSupported { + return rest.NewDependencyMissingResponse(datamodel.DaprMissingError), nil + } + + return nil, nil +} diff --git a/pkg/rp/frontend/validator_test.go b/pkg/rp/frontend/validator_test.go index d9860f4a1d..a298d8bbe2 100644 --- a/pkg/rp/frontend/validator_test.go +++ b/pkg/rp/frontend/validator_test.go @@ -22,8 +22,13 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/armrpc/frontend/controller" + "github.com/project-radius/radius/pkg/armrpc/rest" + "github.com/project-radius/radius/pkg/linkrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/require" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apimachinery/pkg/runtime" ) func newTestARMContext() context.Context { @@ -88,3 +93,38 @@ func TestPrepareRadiusResource_DeepCopy(t *testing.T) { require.Nil(t, resp) require.Equal(t, "testID", newResource.Properties.BasicResourceProperties.Status.OutputResources[0].LocalID) } + +// TestPrepareDaprResource tests the PrepareDaprResource function. +// At present we have only a negative test, due to the challenge of receiving a different result for test purposes from fakekubeclient, which is called by datamodel.IsDaprInstalled. +// For positive case (dapr is installed), we have several E2E tests to make sure the functionality works. +func TestPrepareDaprResource(t *testing.T) { + crdScheme := runtime.NewScheme() + err := apiextv1.AddToScheme(crdScheme) + require.NoError(t, err) + + client := k8sutil.NewFakeKubeClient(crdScheme) + oldResource := &TestResourceDataModel{Properties: &TestResourceDataModelProperties{ + BasicResourceProperties: rpv1.BasicResourceProperties{ + Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + Status: rpv1.ResourceStatus{ + OutputResources: []rpv1.OutputResource{ + { + LocalID: "testID", + }, + }, + }, + }, + }} + newResource := &TestResourceDataModel{Properties: &TestResourceDataModelProperties{ + BasicResourceProperties: rpv1.BasicResourceProperties{ + Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + }, + }} + expectedResp := rest.NewDependencyMissingResponse(datamodel.DaprMissingError) + resp, err := PrepareDaprResource(newTestARMContext(), newResource, oldResource, &controller.Options{KubeClient: client}) + require.NoError(t, err) + require.Equal(t, expectedResp, resp) + +} From 8be4a639e20b347c6254e38dc5029c361efab9cb Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 24 Aug 2023 10:27:30 -0700 Subject: [PATCH 09/57] Install TypeSpec compiler and generate clients in lint action (#6122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This installs TypeSpec compiler and generate clients from tsp. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 2396e0f ### Summary 🚀🛠️📝 This pull request enables the use of TypeSpec models to define and document the radius APIs. It updates the GitHub workflow to install and run the `tsp` compiler and adds a new make target to generate OpenAPI specs from the models. It also updates the NodeJS version to 18. > _Sing, O Muse, of the skillful pull request_ > _That updated the workflow of NodeJS_ > _And installed the TypeSpec compiler, blessed_ > _By Hermes, the god of communication._ ### Walkthrough * Update NodeJS version to 18 for linting and testing workflow ([link](https://github.com/project-radius/radius/pull/6122/files?diff=unified&w=0#diff-4b122024a3a28ded65da76a2f1bface1f3a27328374438d1298d25585fe0603bL45-R48)) * Install and run TypeSpec compiler to generate OpenAPI specs from TypeSpec models ([link](https://github.com/project-radius/radius/pull/6122/files?diff=unified&w=0#diff-4b122024a3a28ded65da76a2f1bface1f3a27328374438d1298d25585fe0603bR54-R58), [link](https://github.com/project-radius/radius/pull/6122/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92R34-R39), [link](https://github.com/project-radius/radius/pull/6122/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92R50-R52)) * Fix formatting and improve readability of `generate-cadl-installed` target in `build/generate.mk` ([link](https://github.com/project-radius/radius/pull/6122/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L27-R27)) * Add `generate-tsp-installed` target as a dependency for Autorest client generation targets in `build/generate.mk` ([link](https://github.com/project-radius/radius/pull/6122/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L74-R103)) --- .github/workflows/lint.yaml | 9 +- .github/workflows/publish-bicep.yaml | 5 + build/generate.mk | 20 +++- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 8 +- .../zz_generated_interfaces.go | 9 -- .../zz_generated_models.go | 87 +++----------- .../zz_generated_models_serde.go | 107 +----------------- .../zz_generated_polymorphic_helpers.go | 42 ------- .../2022-03-15-privatepreview/openapi.json | 67 +---------- typespec/Applications.Core/containers.tsp | 2 +- typespec/Applications.Core/environments.tsp | 4 +- typespec/Applications.Core/extensions.tsp | 4 +- 13 files changed, 55 insertions(+), 311 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 319d0cb219..c0765f0f60 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -42,15 +42,20 @@ jobs: uses: actions/setup-go@v4 with: go-version: ${{ env.GOVER }} - - name: Setup npm + - name: Setup NodeJS uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18' - name: Install cadl compiler run: | pushd cadl npm ci popd + - name: Install TypeSpec compiler + run: | + pushd typespec + npm ci + popd - name: Install autorest run: npm install -g autorest@3.6.1 - name: Install oav diff --git a/.github/workflows/publish-bicep.yaml b/.github/workflows/publish-bicep.yaml index 69e5e78ae6..2903285379 100644 --- a/.github/workflows/publish-bicep.yaml +++ b/.github/workflows/publish-bicep.yaml @@ -43,6 +43,11 @@ jobs: pushd cadl npm ci popd + - name: Install TypeSpec compiler + run: | + pushd typespec + npm ci + popd - name: Install autorest run: npm install -g autorest@3.6.1 - name: Install oav diff --git a/build/generate.mk b/build/generate.mk index c4b6b8b672..f893e22819 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -24,13 +24,18 @@ endif .PHONY: generate generate: generate-genericcliclient generate-rad-corerp-client generate-rad-linkrp-client generate-rad-datastoresrp-client generate-rad-messagingrp-client generate-rad-daprrp-client generate-rad-ucp-client generate-go generate-bicep-types generate-ucp-crd ## Generates all targets. - + .PHONY: generate-cadl-installed generate-cadl-installed: @echo "$(ARROW) Detecting cadl..." cd cadl/Applications.Link && npx$(CMD_EXT) -q cadl --help > /dev/null || { echo "cadl is a required dependency"; exit 1; } @echo "$(ARROW) OK" +.PHONY: generate-tsp-installed +generate-tsp-installed: + @echo "$(ARROW) Detecting tsp..." + cd typespec/ && npx$(CMD_EXT) -q tsp --help > /dev/null || { echo "run 'npm ci' in typespec directory."; exit 1; } + @echo "$(ARROW) OK" .PHONY: generate-openapi-spec generate-openapi-spec: @@ -41,6 +46,9 @@ generate-openapi-spec: cd cadl/Applications.Dapr && npx$(CMD_EXT) cadl compile . cd cadl/Applications.Datastores && npx$(CMD_EXT) cadl compile . + @echo "Generating openapi specs from typespec models." + cd typespec/Applications.Core && npx$(CMD_EXT) tsp compile . + .PHONY: generate-node-installed generate-node-installed: @echo "$(ARROW) Detecting node..." @@ -71,27 +79,27 @@ generate-genericcliclient: generate-node-installed generate-autorest-installed autorest pkg/cli/clients_new/README.md --tag=2022-03-15-privatepreview .PHONY: generate-rad-corerp-client -generate-rad-corerp-client: generate-node-installed generate-autorest-installed ## Generates the corerp client SDK (Autorest). +generate-rad-corerp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the corerp client SDK (Autorest). @echo "$(AUTOREST_MODULE_VERSION) is module version" autorest pkg/corerp/api/README.md --tag=core-2022-03-15-privatepreview .PHONY: generate-rad-linkrp-client -generate-rad-linkrp-client: generate-node-installed generate-autorest-installed generate-openapi-spec ## Generates the linkrp client SDK (Autorest). +generate-rad-linkrp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the linkrp client SDK (Autorest). @echo "$(AUTOREST_MODULE_VERSION) is module version" autorest pkg/linkrp/api/README.md --tag=link-2022-03-15-privatepreview .PHONY: generate-rad-datastoresrp-client -generate-rad-datastoresrp-client: generate-node-installed generate-autorest-installed generate-openapi-spec ## Generates the datastoresrp client SDK (Autorest). +generate-rad-datastoresrp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the datastoresrp client SDK (Autorest). @echo "$(AUTOREST_MODULE_VERSION) is module version" autorest pkg/datastoresrp/api/README.md --tag=datastores-2022-03-15-privatepreview .PHONY: generate-rad-messagingrp-client -generate-rad-messagingrp-client: generate-node-installed generate-autorest-installed generate-openapi-spec ## Generates the messagingrp client SDK (Autorest). +generate-rad-messagingrp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the messagingrp client SDK (Autorest). @echo "$(AUTOREST_MODULE_VERSION) is module version" autorest pkg/messagingrp/api/README.md --tag=messaging-2022-03-15-privatepreview .PHONY: generate-rad-daprrp-client -generate-rad-daprrp-client: generate-node-installed generate-autorest-installed generate-openapi-spec ## Generates the daprrp client SDK (Autorest). +generate-rad-daprrp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the daprrp client SDK (Autorest). @echo "$(AUTOREST_MODULE_VERSION) is module version" autorest pkg/daprrp/api/README.md --tag=dapr-2022-03-15-privatepreview diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index bafee37f18..61a66f7e57 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":1,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":1,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":105,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":1,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":107,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":108,"Flags":10,"Description":"The resource api version"},"properties":{"Type":110,"Flags":0,"Description":"Environment properties"},"tags":{"Type":130,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":118,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":119,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":128,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":129,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[111,112,113,114,115,116,117]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":120,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":121,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":123,"terraform":125}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":124,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":1,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":122}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":127}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":109}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":132,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":133,"Flags":10,"Description":"The resource api version"},"properties":{"Type":135,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":148,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":143,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":144,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":147,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[136,137,138,139,140,141,142]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[145,146]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":134}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":150,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":151,"Flags":10,"Description":"The resource api version"},"properties":{"Type":153,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":169,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":161,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":162,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":164,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":165,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[154,155,156,157,158,159,160]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":163}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":168,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[166,167]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":152}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":171,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":172,"Flags":10,"Description":"The resource api version"},"properties":{"Type":174,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":183,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":182,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[175,176,177,178,179,180,181]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":173}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":185,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":186,"Flags":10,"Description":"The resource api version"},"properties":{"Type":188,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":206,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":196,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":199,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":205,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[189,190,191,192,193,194,195]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[197,198]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":203,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":204,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[201,202]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":200}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":187}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":208,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":209,"Flags":10,"Description":"The resource api version"},"properties":{"Type":211,"Flags":0,"Description":"Volume properties"},"tags":{"Type":243,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":219,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":220}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[212,213,214,215,216,217,218]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":233,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":235,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":241,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":242,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":225,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":228,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":232,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[222,223,224]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[226,227]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":221}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":240,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[237,238,239]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":236}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":210}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":249,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":250,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[247,248]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":200}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":246,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":105,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":107,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":108,"Flags":10,"Description":"The resource api version"},"properties":{"Type":110,"Flags":0,"Description":"Environment properties"},"tags":{"Type":130,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":118,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":119,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":128,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":129,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[111,112,113,114,115,116,117]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":120,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":121,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":123,"terraform":125}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":124,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":122}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":127}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":109}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":132,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":133,"Flags":10,"Description":"The resource api version"},"properties":{"Type":135,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":148,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":143,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":144,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":147,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[136,137,138,139,140,141,142]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[145,146]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":134}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":150,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":151,"Flags":10,"Description":"The resource api version"},"properties":{"Type":153,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":169,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":161,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":162,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":164,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":165,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[154,155,156,157,158,159,160]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":163}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":168,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[166,167]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":152}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":171,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":172,"Flags":10,"Description":"The resource api version"},"properties":{"Type":174,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":183,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":182,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[175,176,177,178,179,180,181]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":173}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":185,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":186,"Flags":10,"Description":"The resource api version"},"properties":{"Type":188,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":206,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":196,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":199,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":205,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[189,190,191,192,193,194,195]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[197,198]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":203,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":204,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[201,202]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":200}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":187}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":208,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":209,"Flags":10,"Description":"The resource api version"},"properties":{"Type":211,"Flags":0,"Description":"Volume properties"},"tags":{"Type":243,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":219,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":220}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[212,213,214,215,216,217,218]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":233,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":235,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":241,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":242,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":225,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":228,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":232,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[222,223,224]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[226,227]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":221}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":240,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[237,238,239]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":236}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":210}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":249,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":250,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[247,248]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":200}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":246,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index 89c3ea7844..a0cf1d6557 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -129,9 +129,9 @@ ### KubernetesMetadataExtension #### Properties -* **annotations**: [KubernetesMetadataExtensionAnnotations](#kubernetesmetadataextensionannotations) (Required): Annotations to be applied to the Kubernetes resources output by the resource +* **annotations**: [KubernetesMetadataExtensionAnnotations](#kubernetesmetadataextensionannotations): Annotations to be applied to the Kubernetes resources output by the resource * **kind**: 'kubernetesMetadata' (Required): Discriminator property for Extension. -* **labels**: [KubernetesMetadataExtensionLabels](#kubernetesmetadataextensionlabels) (Required): Labels to be applied to the Kubernetes resources output by the resource +* **labels**: [KubernetesMetadataExtensionLabels](#kubernetesmetadataextensionlabels): Labels to be applied to the Kubernetes resources output by the resource ### KubernetesNamespaceExtension #### Properties @@ -294,7 +294,7 @@ * **Discriminator**: kind ### Base Properties -* **mountPath**: string (Required): The path where the volume is mounted +* **mountPath**: string: The path where the volume is mounted ### EphemeralVolume #### Properties * **kind**: 'ephemeral' (Required): Discriminator property for Volume. @@ -356,7 +356,7 @@ ### TerraformRecipeProperties #### Properties * **templateKind**: 'terraform' (Required): Discriminator property for RecipeProperties. -* **templateVersion**: string (Required): Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources. +* **templateVersion**: string: Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources. ## TrackedResourceTags diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go index aa60fb38c2..ebed5bd3ac 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_interfaces.go @@ -79,12 +79,3 @@ type VolumePropertiesClassification interface { GetVolumeProperties() *VolumeProperties } -// VolumeUpdateClassification provides polymorphic access to related types. -// Call the interface's GetVolumeUpdate() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EphemeralVolumeUpdate, *PersistentVolumeUpdate, *VolumeUpdate -type VolumeUpdateClassification interface { - // GetVolumeUpdate returns the VolumeUpdate content of the underlying type. - GetVolumeUpdate() *VolumeUpdate -} - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index 9aa4fb52ec..d10ed29e9a 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -391,7 +391,7 @@ type ContainerUpdate struct { ReadinessProbe HealthProbePropertiesClassification // container volumes - Volumes map[string]VolumeUpdateClassification + Volumes map[string]VolumeClassification // Working directory for the container WorkingDir *string @@ -535,7 +535,7 @@ type EphemeralVolume struct { // REQUIRED; Backing store for the ephemeral volume ManagedStore *ManagedStore - // REQUIRED; The path where the volume is mounted + // The path where the volume is mounted MountPath *string } @@ -547,26 +547,6 @@ func (e *EphemeralVolume) GetVolume() *Volume { } } -// EphemeralVolumeUpdate - Specifies an ephemeral volume for a container -type EphemeralVolumeUpdate struct { - // REQUIRED; Discriminator property for Volume. - Kind *string - - // Backing store for the ephemeral volume - ManagedStore *ManagedStore - - // The path where the volume is mounted - MountPath *string -} - -// GetVolumeUpdate implements the VolumeUpdateClassification interface for type EphemeralVolumeUpdate. -func (e *EphemeralVolumeUpdate) GetVolumeUpdate() *VolumeUpdate { - return &VolumeUpdate{ - Kind: e.Kind, - MountPath: e.MountPath, - } -} - // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -1105,13 +1085,13 @@ func (k *KubernetesComputeUpdate) GetEnvironmentComputeUpdate() *EnvironmentComp // KubernetesMetadataExtension - Kubernetes metadata extension of a environment/application resource. type KubernetesMetadataExtension struct { - // REQUIRED; Annotations to be applied to the Kubernetes resources output by the resource - Annotations map[string]*string - // REQUIRED; Discriminator property for Extension. Kind *string - // REQUIRED; Labels to be applied to the Kubernetes resources output by the resource + // Annotations to be applied to the Kubernetes resources output by the resource + Annotations map[string]*string + + // Labels to be applied to the Kubernetes resources output by the resource Labels map[string]*string } @@ -1222,42 +1202,19 @@ type PersistentVolume struct { // REQUIRED; Discriminator property for Volume. Kind *string - // REQUIRED; The path where the volume is mounted - MountPath *string - // REQUIRED; The source of the volume Source *string - // Container read/write access to the volume - Permission *VolumePermission -} - -// GetVolume implements the VolumeClassification interface for type PersistentVolume. -func (p *PersistentVolume) GetVolume() *Volume { - return &Volume{ - Kind: p.Kind, - MountPath: p.MountPath, - } -} - -// PersistentVolumeUpdate - Specifies a persistent volume for a container -type PersistentVolumeUpdate struct { - // REQUIRED; Discriminator property for Volume. - Kind *string - // The path where the volume is mounted MountPath *string // Container read/write access to the volume Permission *VolumePermission - - // The source of the volume - Source *string } -// GetVolumeUpdate implements the VolumeUpdateClassification interface for type PersistentVolumeUpdate. -func (p *PersistentVolumeUpdate) GetVolumeUpdate() *VolumeUpdate { - return &VolumeUpdate{ +// GetVolume implements the VolumeClassification interface for type PersistentVolume. +func (p *PersistentVolume) GetVolume() *Volume { + return &Volume{ Kind: p.Kind, MountPath: p.MountPath, } @@ -1334,8 +1291,8 @@ type RecipeGetMetadataResponse struct { // REQUIRED; The path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. TemplatePath *string - // REQUIRED; The version of the template to deploy. For Terraform recipes using a module registry this is required, but must -// be omitted for other module sources. + // The version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted +// for other module sources. TemplateVersion *string } @@ -1583,12 +1540,12 @@ type TerraformRecipeProperties struct { // REQUIRED; Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported. TemplatePath *string - // REQUIRED; Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be -// omitted for other module sources. - TemplateVersion *string - // Key/value parameters to pass to the recipe template at deployment Parameters map[string]any + + // Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted +// for other module sources. + TemplateVersion *string } // GetRecipeProperties implements the RecipePropertiesClassification interface for type TerraformRecipeProperties. @@ -1661,7 +1618,7 @@ type Volume struct { // REQUIRED; Discriminator property for Volume. Kind *string - // REQUIRED; The path where the volume is mounted + // The path where the volume is mounted MountPath *string } @@ -1740,15 +1697,3 @@ type VolumeResourceUpdateProperties struct { Environment *string } -// VolumeUpdate - Specifies a volume for a container -type VolumeUpdate struct { - // REQUIRED; Discriminator property for Volume. - Kind *string - - // The path where the volume is mounted - MountPath *string -} - -// GetVolumeUpdate implements the VolumeUpdateClassification interface for type VolumeUpdate. -func (v *VolumeUpdate) GetVolumeUpdate() *VolumeUpdate { return v } - diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index 1c24d958d6..7f73eba0d1 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -868,7 +868,7 @@ func (c *ContainerUpdate) UnmarshalJSON(data []byte) error { c.ReadinessProbe, err = unmarshalHealthProbePropertiesClassification(val) delete(rawMsg, key) case "volumes": - c.Volumes, err = unmarshalVolumeUpdateClassificationMap(val) + c.Volumes, err = unmarshalVolumeClassificationMap(val) delete(rawMsg, key) case "workingDir": err = unpopulate(val, "WorkingDir", &c.WorkingDir) @@ -1246,41 +1246,6 @@ func (e *EphemeralVolume) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EphemeralVolumeUpdate. -func (e EphemeralVolumeUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["kind"] = "ephemeral" - populate(objectMap, "managedStore", e.ManagedStore) - populate(objectMap, "mountPath", e.MountPath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EphemeralVolumeUpdate. -func (e *EphemeralVolumeUpdate) 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 "kind": - err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) - case "managedStore": - err = unpopulate(val, "ManagedStore", &e.ManagedStore) - delete(rawMsg, key) - case "mountPath": - err = unpopulate(val, "MountPath", &e.MountPath) - 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 ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2832,45 +2797,6 @@ func (p *PersistentVolume) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PersistentVolumeUpdate. -func (p PersistentVolumeUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["kind"] = "persistent" - populate(objectMap, "mountPath", p.MountPath) - populate(objectMap, "permission", p.Permission) - populate(objectMap, "source", p.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PersistentVolumeUpdate. -func (p *PersistentVolumeUpdate) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, "Kind", &p.Kind) - delete(rawMsg, key) - case "mountPath": - err = unpopulate(val, "MountPath", &p.MountPath) - delete(rawMsg, key) - case "permission": - err = unpopulate(val, "Permission", &p.Permission) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &p.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Providers. func (p Providers) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4093,37 +4019,6 @@ func (v *VolumeResourceUpdateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VolumeUpdate. -func (v VolumeUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["kind"] = v.Kind - populate(objectMap, "mountPath", v.MountPath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeUpdate. -func (v *VolumeUpdate) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, "Kind", &v.Kind) - delete(rawMsg, key) - case "mountPath": - err = unpopulate(val, "MountPath", &v.MountPath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index 0f1bfbebd1..748d969c67 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -269,45 +269,3 @@ func unmarshalVolumePropertiesClassification(rawMsg json.RawMessage) (VolumeProp return b, nil } -func unmarshalVolumeUpdateClassification(rawMsg json.RawMessage) (VolumeUpdateClassification, error) { - if rawMsg == nil { - return nil, nil - } - var m map[string]any - if err := json.Unmarshal(rawMsg, &m); err != nil { - return nil, err - } - var b VolumeUpdateClassification - switch m["kind"] { - case "ephemeral": - b = &EphemeralVolumeUpdate{} - case "persistent": - b = &PersistentVolumeUpdate{} - default: - b = &VolumeUpdate{} - } - if err := json.Unmarshal(rawMsg, b); err != nil { - return nil, err - } - return b, nil -} - -func unmarshalVolumeUpdateClassificationMap(rawMsg json.RawMessage) (map[string]VolumeUpdateClassification, error) { - if rawMsg == nil { - return nil, nil - } - var rawMessages map[string]json.RawMessage - if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { - return nil, err - } - fMap := make(map[string]VolumeUpdateClassification, len(rawMessages)) - for key, rawMessage := range rawMessages { - f, err := unmarshalVolumeUpdateClassification(rawMessage) - if err != nil { - return nil, err - } - fMap[key] = f - } - return fMap, nil -} - diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index 0b82131ed2..f9e4f49d3c 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -3078,7 +3078,7 @@ "type": "object", "description": "container volumes", "additionalProperties": { - "$ref": "#/definitions/VolumeUpdate" + "$ref": "#/definitions/Volume" } }, "command": { @@ -3350,22 +3350,6 @@ ], "x-ms-discriminator-value": "ephemeral" }, - "EphemeralVolumeUpdate": { - "type": "object", - "description": "Specifies an ephemeral volume for a container", - "properties": { - "managedStore": { - "$ref": "#/definitions/ManagedStore", - "description": "Backing store for the ephemeral volume" - } - }, - "allOf": [ - { - "$ref": "#/definitions/VolumeUpdate" - } - ], - "x-ms-discriminator-value": "ephemeral" - }, "ExecHealthProbeProperties": { "type": "object", "description": "Specifies the properties for readiness/liveness probe using an executable", @@ -4122,10 +4106,6 @@ } } }, - "required": [ - "annotations", - "labels" - ], "allOf": [ { "$ref": "#/definitions/Extension" @@ -4237,26 +4217,6 @@ ], "x-ms-discriminator-value": "persistent" }, - "PersistentVolumeUpdate": { - "type": "object", - "description": "Specifies a persistent volume for a container", - "properties": { - "permission": { - "$ref": "#/definitions/VolumePermission", - "description": "Container read/write access to the volume" - }, - "source": { - "type": "string", - "description": "The source of the volume" - } - }, - "allOf": [ - { - "$ref": "#/definitions/VolumeUpdate" - } - ], - "x-ms-discriminator-value": "persistent" - }, "PortProtocol": { "type": "string", "description": "The protocol in use by the port", @@ -4471,7 +4431,6 @@ "required": [ "templateKind", "templatePath", - "templateVersion", "parameters" ] }, @@ -4856,9 +4815,6 @@ "description": "Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources." } }, - "required": [ - "templateVersion" - ], "allOf": [ { "$ref": "#/definitions/RecipeProperties" @@ -4956,8 +4912,7 @@ }, "discriminator": "kind", "required": [ - "kind", - "mountPath" + "kind" ] }, "VolumePermission": { @@ -5118,24 +5073,6 @@ } ] } - }, - "VolumeUpdate": { - "type": "object", - "description": "Specifies a volume for a container", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for Volume." - }, - "mountPath": { - "type": "string", - "description": "The path where the volume is mounted" - } - }, - "discriminator": "kind", - "required": [ - "kind" - ] } }, "parameters": { diff --git a/typespec/Applications.Core/containers.tsp b/typespec/Applications.Core/containers.tsp index 2fc496bb21..dd028635be 100644 --- a/typespec/Applications.Core/containers.tsp +++ b/typespec/Applications.Core/containers.tsp @@ -134,7 +134,7 @@ model ExecHealthProbeProperties extends HealthProbeProperties { @doc("Specifies a volume for a container") model Volume { @doc("The path where the volume is mounted") - mountPath: string; + mountPath?: string; } @doc("Specifies an ephemeral volume for a container") diff --git a/typespec/Applications.Core/environments.tsp b/typespec/Applications.Core/environments.tsp index 922b1bd301..6cc1691cbc 100644 --- a/typespec/Applications.Core/environments.tsp +++ b/typespec/Applications.Core/environments.tsp @@ -109,7 +109,7 @@ model TerraformRecipeProperties extends RecipeProperties { templateKind: "terraform"; @doc("Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources.") - templateVersion: string; + templateVersion?: string; } @doc("Represents the request body of the getmetadata action.") @@ -130,7 +130,7 @@ model RecipeGetMetadataResponse { templatePath: string; @doc("The version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources.") - templateVersion: string; + templateVersion?: string; @doc("The key/value parameters to pass to the recipe template at deployment.") parameters: {}; diff --git a/typespec/Applications.Core/extensions.tsp b/typespec/Applications.Core/extensions.tsp index c3f819c547..1d486000f0 100644 --- a/typespec/Applications.Core/extensions.tsp +++ b/typespec/Applications.Core/extensions.tsp @@ -37,10 +37,10 @@ model KubernetesMetadataExtension extends Extension { kind: "kubernetesMetadata"; @doc("Annotations to be applied to the Kubernetes resources output by the resource") - annotations: Record; + annotations?: Record; @doc("Labels to be applied to the Kubernetes resources output by the resource") - labels: Record; + labels?: Record; } @doc("ManualScaling Extension") From 00a2222e9ab41dd4692965296caef327bcce348c Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 24 Aug 2023 13:07:22 -0700 Subject: [PATCH 10/57] Convert Applications.Dapr CADL to TypeSpec (#6115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description * Convert Applications.Dapr cadl to TypeSpec ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at e5b5a68 ### Summary 🔄📝🆕 This pull request updates the Dapr resource provider API to the latest version, adds new client types and helper functions for the PubSubBrokers, SecretStores, and StateStores groups, and adds or modifies example files for the swagger specification. It also removes some obsolete files and replaces some deprecated function calls with the new ones. > _The Dapr API has some changes_ > _To handle the output resources ranges_ > _With `toOutputResources` function_ > _And some AutoRest production_ > _The `v20220315privatepreview` package rearranges_ ### Walkthrough * Add `PubSubBrokersClient`, `SecretStoresClient`, and `StateStoresClient` types and methods for the corresponding resource groups ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-e308e1f448083afeb9c86a40cc9d76d7fd1136cd4deea604bdd749c1b1b27f10R1-R335), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-3f9ce2b5e40c445621627dcf1a409492e39e6c92ae715a196ca92a0fb5415a7aR1-R335), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-7eb5defb887d575d2238e1ca0146d0067934a3f65edcbcb8df2bf465b23ea5fdR1-R332)) * Add `IdentitySettingKind` and `Versions` types and comments to the existing types `ProvisioningState` and `ResourceProvisioning` in the `zz_generated_constants.go` file ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-b804ec5ef8042851d82953f5d090ded3321cf37e91535040eadeb2a9f4dca3e2R50-R67), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-b804ec5ef8042851d82953f5d090ded3321cf37e91535040eadeb2a9f4dca3e2L73-R103), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-b804ec5ef8042851d82953f5d090ded3321cf37e91535040eadeb2a9f4dca3e2L101-R128), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-b804ec5ef8042851d82953f5d090ded3321cf37e91535040eadeb2a9f4dca3e2R140-R154)) * Add `toOutputResources` function to convert and serialize `OutputResource` types in the `datamodel_util.go` file ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-aacda259f121fc17b1c06417880dae07a0ed3d57db9f63b6df29f219137eb223R163-R182)) * Replace `rpv1.BuildExternalOutputResources` with `toOutputResources` in the `ConvertFrom` methods of the `pubsubbroker_conversion.go`, `secretstore_conversion.go`, and `statestore_conversion.go` files ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-965c176f464436097486787f48cdc1fb16360ad8e504be3ea4701632423b498eL132-R132), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-1dbf58d913cc6dc089a28c5ef976da4e6653b775d2b503c0526c3fad4b554fe0L126-R126), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-3d120a247a7758878b3dbfee51023d8f429a000005ce3f18afd078ad2bd81b83L109-R109)) * Add `unmarshalEnvironmentComputeClassification` function to handle polymorphic deserialization of `EnvironmentComputeClassification` type in the `zz_generated_polymorphic_helpers.go` file ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-3c17fed8c8413ec2da89ad3da289120762983748b27349ef3ed0938f939a4f28R1-R30)) * Rename response types for the PubSubBrokers group to match the client type in the `zz_generated_response_types.go` file ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-a8b17a7d620ad6c460acb7eceab825a81c3028abd98440a5c454df91b0f2b3a0L11-R88)) * Rename `PubSubBrokersPut.json` to `PubSubBrokers_CreateOrUpdate.json` and update the response body to use the new rootScope format in the `examples` folder ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-4868688c5df0ac4d47f9054b5cabdfd4e1c5b93f104b9ba494fc28308a507a0fL2-R12), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-4868688c5df0ac4d47f9054b5cabdfd4e1c5b93f104b9ba494fc28308a507a0fL28-R30), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-4868688c5df0ac4d47f9054b5cabdfd4e1c5b93f104b9ba494fc28308a507a0fL34-R37), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-4868688c5df0ac4d47f9054b5cabdfd4e1c5b93f104b9ba494fc28308a507a0fL52-R54), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-4868688c5df0ac4d47f9054b5cabdfd4e1c5b93f104b9ba494fc28308a507a0fL58-R61)) * Add `PubSubBrokers_CreateOrUpdateWithRecipe.json` and `PubSubBrokers_Delete.json` files to the `examples` folder ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-cc542f637adcab2b12fd8b446f9a5cead376945eb19a266843d0da8604101ad6L1-R65), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-98238d08245e7af63374d21195fb83da61fad733fed43d67ec72324d68a3afacL1-R13)) * Delete `zz_generated_daprpubsubbroker_client.go`, `zz_generated_daprsecretstore_client.go`, `zz_generated_daprstatestore_client.go`, `PubSubBrokersDelete.json`, and `PubSubBrokersPutWithRecipe.json` files ([link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-9d2c7e0a212018491092857b16898e3fb8e4235d6b21a02ca986501c5a2bdfc5), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-57f6164a4e56d4020c34539c7250a9448149301b0c18e3379b08f23922a676b0), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-40333e9867df73799fe9b992112bf208d1c5721913b4e697afeb112253759be8), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-f7da442567875a4e65a79ec4f356d85e2d07090a2c86a5cc186abfa470e31cc6), [link](https://github.com/project-radius/radius/pull/6115/files?diff=unified&w=0#diff-2265868ac243730d96b0aaf73ddcf38d25e08c036d7f939f9c8bfd3df97bc8d4)) --- build/generate.mk | 2 +- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 55 +- hack/bicep-types-radius/generated/index.json | 2 +- .../v20220315privatepreview/datamodel_util.go | 21 + .../pubsubbroker_conversion.go | 2 +- .../secretstore_conversion.go | 2 +- .../statestore_conversion.go | 2 +- .../zz_generated_constants.go | 42 + .../zz_generated_daprpubsubbroker_client.go | 276 ---- .../zz_generated_daprsecretstore_client.go | 272 ---- .../zz_generated_daprstatestore_client.go | 276 ---- .../zz_generated_models.go | 400 ++++-- .../zz_generated_models_serde.go | 507 ++++++- .../zz_generated_polymorphic_helpers.go | 30 + .../zz_generated_pubsubbrokers_client.go | 335 +++++ .../zz_generated_response_types.go | 78 +- .../zz_generated_secretstores_client.go | 335 +++++ .../zz_generated_statestores_client.go | 332 +++++ pkg/linkrp/frontend/handler/routes.go | 6 +- .../examples/PubSubBrokersDelete.json | 12 - .../examples/PubSubBrokersList.json | 71 - .../examples/PubSubBrokersPutWithRecipe.json | 64 - ...json => PubSubBrokers_CreateOrUpdate.json} | 24 +- ...ubSubBrokers_CreateOrUpdateWithRecipe.json | 66 + .../examples/PubSubBrokers_Delete.json | 14 + ...BrokersGet.json => PubSubBrokers_Get.json} | 12 +- .../examples/PubSubBrokers_List.json | 73 + ...son => PubSubBrokers_ListByRootScope.json} | 16 +- .../examples/PubSubBrokers_Update.json | 77 ++ .../examples/SecretStoresDelete.json | 12 - .../examples/SecretStoresGet.json | 28 - .../examples/SecretStoresList.json | 49 - .../examples/SecretStoresListByRootScope.json | 49 - .../examples/SecretStoresPut.json | 61 - .../examples/SecretStores_CreateOrUpdate.json | 63 + .../examples/SecretStores_Delete.json | 14 + .../examples/SecretStores_Get.json | 30 + .../examples/SecretStores_List.json | 51 + .../SecretStores_ListByRootScope.json | 51 + .../examples/SecretStores_Update.json | 63 + .../examples/StateStoresDelete.json | 12 - .../examples/StateStoresGet.json | 25 - .../examples/StateStoresList.json | 90 -- .../examples/StateStoresPutWithRecipe.json | 53 - ...t.json => StateStores_CreateOrUpdate.json} | 28 +- .../StateStores_CreateOrUpdateWithRecipe.json | 55 + .../examples/StateStores_Delete.json | 14 + .../examples/StateStores_Get.json | 26 + .../examples/StateStores_List.json | 92 ++ ....json => StateStores_ListByRootScope.json} | 30 +- .../examples/StateStores_Update.json | 73 + .../2022-03-15-privatepreview/openapi.json | 1204 +++++++++++++---- typespec/Applications.Dapr/common.tsp | 36 + .../PubSubBrokers_CreateOrUpdate.json | 77 ++ ...ubSubBrokers_CreateOrUpdateWithRecipe.json | 66 + .../PubSubBrokers_Delete.json | 14 + .../PubSubBrokers_Get.json | 35 + .../PubSubBrokers_List.json | 73 + .../PubSubBrokers_ListByRootScope.json | 56 + .../PubSubBrokers_Update.json | 77 ++ .../SecretStores_CreateOrUpdate.json | 63 + .../SecretStores_Delete.json | 14 + .../SecretStores_Get.json | 30 + .../SecretStores_List.json | 51 + .../SecretStores_ListByRootScope.json | 51 + .../SecretStores_Update.json | 63 + .../StateStores_CreateOrUpdate.json | 73 + .../StateStores_CreateOrUpdateWithRecipe.json | 55 + .../StateStores_Delete.json | 14 + .../StateStores_Get.json | 26 + .../StateStores_List.json | 92 ++ .../StateStores_ListByRootScope.json | 78 ++ .../StateStores_Update.json | 73 + typespec/Applications.Dapr/main.tsp | 43 + typespec/Applications.Dapr/pubSubBrokers.tsp | 88 ++ typespec/Applications.Dapr/secretStores.tsp | 83 ++ typespec/Applications.Dapr/stateStores.tsp | 87 ++ typespec/Applications.Dapr/tspconfig.yaml | 10 + typespec/radius/v1/resources.tsp | 9 + 80 files changed, 5098 insertions(+), 1918 deletions(-) delete mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go delete mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go delete mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPutWithRecipe.json rename swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/{PubSubBrokersPut.json => PubSubBrokers_CreateOrUpdate.json} (55%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdateWithRecipe.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Delete.json rename swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/{PubSubBrokersGet.json => PubSubBrokers_Get.json} (54%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_List.json rename swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/{PubSubBrokersListByRootScope.json => PubSubBrokers_ListByRootScope.json} (57%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresPut.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_List.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_ListByRootScope.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPutWithRecipe.json rename swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/{StateStoresPut.json => StateStores_CreateOrUpdate.json} (53%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdateWithRecipe.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Get.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_List.json rename swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/{StateStoresListByRootScope.json => StateStores_ListByRootScope.json} (54%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Update.json create mode 100644 typespec/Applications.Dapr/common.tsp create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdate.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdateWithRecipe.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Delete.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Get.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_List.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_ListByRootScope.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Update.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Delete.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Get.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_List.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_ListByRootScope.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Update.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdate.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdateWithRecipe.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Delete.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Get.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_List.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_ListByRootScope.json create mode 100644 typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Update.json create mode 100644 typespec/Applications.Dapr/main.tsp create mode 100644 typespec/Applications.Dapr/pubSubBrokers.tsp create mode 100644 typespec/Applications.Dapr/secretStores.tsp create mode 100644 typespec/Applications.Dapr/stateStores.tsp create mode 100644 typespec/Applications.Dapr/tspconfig.yaml diff --git a/build/generate.mk b/build/generate.mk index f893e22819..e6199fb709 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -43,11 +43,11 @@ generate-openapi-spec: cd cadl/Applications.Link && npx$(CMD_EXT) cadl compile . cd cadl/UCP && npx$(CMD_EXT) cadl compile . cd cadl/Applications.Messaging && npx$(CMD_EXT) cadl compile . - cd cadl/Applications.Dapr && npx$(CMD_EXT) cadl compile . cd cadl/Applications.Datastores && npx$(CMD_EXT) cadl compile . @echo "Generating openapi specs from typespec models." cd typespec/Applications.Core && npx$(CMD_EXT) tsp compile . + cd typespec/Applications.Dapr && npx$(CMD_EXT) tsp compile . .PHONY: generate-node-installed generate-node-installed: diff --git a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json index c755326474..ecb38ea173 100644 --- a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Dapr/pubSubBrokers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/pubSubBrokers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Dapr PubSubBroker portable resource properties"},"tags":{"Type":28,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprPubSubBrokerProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"resourceProvisioning":{"Type":22,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resources":{"Type":25,"Flags":0,"Description":"A collection of references to resources associated with the Dapr PubSubBroker"},"type":{"Type":4,"Flags":0,"Description":"Dapr PubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format."},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[20,21]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":24}},{"2":{"Name":"ResourceStatus","Properties":{"outputResources":{"Type":27,"Flags":0,"Description":"Properties of an output resource"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":34,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":39,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[30,31,32,33]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[35,36,37,38]}},{"4":{"Name":"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Dapr/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":41,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":42,"Flags":10,"Description":"The resource api version"},"properties":{"Type":44,"Flags":0,"Description":"Dapr SecretStore portable resource properties"},"tags":{"Type":56,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprSecretStoreProperties","Properties":{"provisioningState":{"Type":52,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"type":{"Type":4,"Flags":0,"Description":"Dapr SecretStore type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":55,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[45,46,47,48,49,50,51]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[53,54]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":43}},{"6":{"Value":"Applications.Dapr/stateStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/stateStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Dapr StateStore portable resource properties"},"tags":{"Type":74,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprStateStoreProperties","Properties":{"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"resourceProvisioning":{"Type":72,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resources":{"Type":73,"Flags":0,"Description":"A collection of references to resources associated with the Dapr StateStore"},"type":{"Type":4,"Flags":0,"Description":"Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format."},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[70,71]}},{"3":{"ItemType":24}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/stateStores@2022-03-15-privatepreview","ScopeType":0,"Body":60}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Dapr/pubSubBrokers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/pubSubBrokers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"PubSubBroker portable resource properties"},"tags":{"Type":36,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprPubSubBrokerProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"resources":{"Type":31,"Flags":0,"Description":"A collection of references to resources associated with the pubSubBroker"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":35,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":21,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":29,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":22,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":26}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":25,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[23,24]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":27,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":28}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":30}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[33,34]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":42,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":47,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[38,39,40,41]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[43,44,45,46]}},{"4":{"Name":"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Dapr/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":49,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":50,"Flags":10,"Description":"The resource api version"},"properties":{"Type":52,"Flags":0,"Description":"DaprSecretStore portable resource properties"},"tags":{"Type":64,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprSecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":60,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":63,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[53,54,55,56,57,58,59]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[61,62]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":51}},{"6":{"Value":"Applications.Dapr/stateStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/stateStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":66,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":67,"Flags":10,"Description":"The resource api version"},"properties":{"Type":69,"Flags":0,"Description":"StateStore portable resource properties"},"tags":{"Type":82,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprStateStoreProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":77,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"resources":{"Type":78,"Flags":0,"Description":"A collection of references to resources associated with the state store"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":81,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[70,71,72,73,74,75,76]}},{"3":{"ItemType":30}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[79,80]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/stateStores@2022-03-15-privatepreview","ScopeType":0,"Body":68}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md index 5d4c9ca5e6..66b0339e4b 100644 --- a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md @@ -7,7 +7,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprPubSubBrokerProperties](#daprpubsubbrokerproperties): Dapr PubSubBroker portable resource properties +* **properties**: [DaprPubSubBrokerProperties](#daprpubsubbrokerproperties): PubSubBroker portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Dapr/pubSubBrokers' (ReadOnly, DeployTimeConstant): The resource type @@ -19,7 +19,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprSecretStoreProperties](#daprsecretstoreproperties): Dapr SecretStore portable resource properties +* **properties**: [DaprSecretStoreProperties](#daprsecretstoreproperties): DaprSecretStore portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Dapr/secretStores' (ReadOnly, DeployTimeConstant): The resource type @@ -31,23 +31,23 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprStateStoreProperties](#daprstatestoreproperties): Dapr StateStore portable resource properties +* **properties**: [DaprStateStoreProperties](#daprstatestoreproperties): StateStore portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Dapr/stateStores' (ReadOnly, DeployTimeConstant): The resource type ## DaprPubSubBrokerProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **componentName**: string (ReadOnly): The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component. * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **metadata**: any: Any object * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the Dapr PubSubBroker +* **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the pubSubBroker * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: string: Dapr PubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format. +* **type**: string: Dapr component type which must matches the format used by Dapr Kubernetes configuration format * **version**: string: Dapr component version ## Recipe @@ -61,7 +61,32 @@ ## ResourceStatus ### Properties -* **outputResources**: any[]: Properties of an output resource +* **compute**: [EnvironmentCompute](#environmentcompute): Represents backing compute resource +* **outputResources**: [OutputResource](#outputresource)[]: Properties of an output resource + +## EnvironmentCompute +* **Discriminator**: kind + +### Base Properties +* **identity**: [IdentitySettings](#identitysettings): IdentitySettings is the external identity setting. +* **resourceId**: string: The resource id of the compute resource for application environment. +### KubernetesCompute +#### Properties +* **kind**: 'kubernetes' (Required): Discriminator property for EnvironmentCompute. +* **namespace**: string (Required): The namespace to use for the environment. + + +## IdentitySettings +### Properties +* **kind**: 'azure.com.workload' | 'undefined' (Required): IdentitySettingKind is the kind of supported external identity setting +* **oidcIssuer**: string: The URI for your compute platform's OIDC issuer +* **resource**: string: The resource ID of the provisioned identity + +## OutputResource +### Properties +* **id**: string: The UCP resource ID of the underlying resource. +* **localId**: string: The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships. +* **radiusManaged**: bool: Determines whether Radius manages the lifecycle of the underlying resource. ## SystemData ### Properties @@ -79,15 +104,15 @@ ## DaprSecretStoreProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **componentName**: string (ReadOnly): The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component. * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **metadata**: any: Any object * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: string: Dapr SecretStore type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/ +* **type**: string: Dapr component type which must matches the format used by Dapr Kubernetes configuration format * **version**: string: Dapr component version ## TrackedResourceTags @@ -97,16 +122,16 @@ ## DaprStateStoreProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **componentName**: string (ReadOnly): The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component. * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **metadata**: any: Any object * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the Dapr StateStore +* **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the state store * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: string: Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format. +* **type**: string: Dapr component type which must matches the format used by Dapr Kubernetes configuration format * **version**: string: Dapr component version ## TrackedResourceTags diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index f066b31885..923e23ff3f 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":106},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":131},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":149},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":170},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":184},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":207},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":244},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":40},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":57},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":75},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":41},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":60},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":79},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":41}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":245}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":81}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":43}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":106},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":131},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":149},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":170},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":184},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":207},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":244},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":41},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":60},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":79},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":41}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":245}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":81}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":43}]}}} \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go index 0ee66e2aeb..251a4aef3e 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go @@ -22,6 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -159,3 +160,23 @@ func fromResourcesDataModel(r []*linkrp.ResourceReference) []*ResourceReference } return resources } + +func toOutputResources(outputResources []rpv1.OutputResource) []*OutputResource { + var outResources []*OutputResource + for _, or := range outputResources { + r := &OutputResource{ + ID: to.Ptr(or.ID.String()), + } + + // We will not serialize the following fields if they are empty or nil. + if or.LocalID != "" { + r.LocalID = to.Ptr(or.LocalID) + } + if or.RadiusManaged != nil { + r.RadiusManaged = or.RadiusManaged + } + + outResources = append(outResources, r) + } + return outResources +} diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go index f16e6a2857..97350f6f1f 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go @@ -129,7 +129,7 @@ func (dst *DaprPubSubBrokerResource) ConvertFrom(src v1.DataModelInterface) erro ComponentName: to.Ptr(daprPubSub.Properties.ComponentName), ProvisioningState: fromProvisioningStateDataModel(daprPubSub.InternalMetadata.AsyncProvisioningState), Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(daprPubSub.Properties.Status.OutputResources), + OutputResources: toOutputResources(daprPubSub.Properties.Status.OutputResources), }, } diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go index 8f7e6d0447..5582acce52 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go @@ -123,7 +123,7 @@ func (dst *DaprSecretStoreResource) ConvertFrom(src v1.DataModelInterface) error Metadata: daprSecretStore.Properties.Metadata, ComponentName: to.Ptr(daprSecretStore.Properties.ComponentName), Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(daprSecretStore.Properties.Status.OutputResources), + OutputResources: toOutputResources(daprSecretStore.Properties.Status.OutputResources), }, } if daprSecretStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { diff --git a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go index 8dfa99cbcc..6cc73b37db 100644 --- a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go @@ -106,7 +106,7 @@ func (dst *DaprStateStoreResource) ConvertFrom(src v1.DataModelInterface) error dst.Tags = *to.StringMapPtr(daprStateStore.Tags) dst.Properties = &DaprStateStoreProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(daprStateStore.Properties.Status.OutputResources), + OutputResources: toOutputResources(daprStateStore.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(daprStateStore.InternalMetadata.AsyncProvisioningState), Environment: to.Ptr(daprStateStore.Properties.Environment), diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go index e80a581e36..807ed22086 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go @@ -47,6 +47,24 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// IdentitySettingKind - IdentitySettingKind is the kind of supported external identity setting +type IdentitySettingKind string + +const ( + // IdentitySettingKindAzureComWorkload - azure ad workload identity + IdentitySettingKindAzureComWorkload IdentitySettingKind = "azure.com.workload" + // IdentitySettingKindUndefined - undefined identity + IdentitySettingKindUndefined IdentitySettingKind = "undefined" +) + +// PossibleIdentitySettingKindValues returns the possible values for the IdentitySettingKind const type. +func PossibleIdentitySettingKindValues() []IdentitySettingKind { + return []IdentitySettingKind{ + IdentitySettingKindAzureComWorkload, + IdentitySettingKindUndefined, + } +} + // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -70,12 +88,19 @@ func PossibleOriginValues() []Origin { type ProvisioningState string const ( + // ProvisioningStateAccepted - The resource create request has been accepted ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - The resource is being deleted ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - The resource is being provisioned ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded - Resource has been created. ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - The resource is updating ProvisioningStateUpdating ProvisioningState = "Updating" ) @@ -98,7 +123,9 @@ func PossibleProvisioningStateValues() []ProvisioningState { type ResourceProvisioning string const ( + // ResourceProvisioningManual - The resource lifecycle will be managed by the user ResourceProvisioningManual ResourceProvisioning = "manual" + // ResourceProvisioningRecipe - The resource lifecycle will be managed by Radius ResourceProvisioningRecipe ResourceProvisioning = "recipe" ) @@ -110,3 +137,18 @@ func PossibleResourceProvisioningValues() []ResourceProvisioning { } } +// Versions - Supported API versions for the Applications.Dapr resource provider. +type Versions string + +const ( + // VersionsV20220315Privatepreview - 2022-03-15-privatepreview + VersionsV20220315Privatepreview Versions = "2022-03-15-privatepreview" +) + +// PossibleVersionsValues returns the possible values for the Versions const type. +func PossibleVersionsValues() []Versions { + return []Versions{ + VersionsV20220315Privatepreview, + } +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go deleted file mode 100644 index c033df708a..0000000000 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// DaprPubSubBrokerClient contains the methods for the DaprPubSubBroker group. -// Don't use this type directly, use NewDaprPubSubBrokerClient() instead. -type DaprPubSubBrokerClient struct { - host string - rootScope string - pl runtime.Pipeline -} - -// NewDaprPubSubBrokerClient creates a new instance of DaprPubSubBrokerClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDaprPubSubBrokerClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprPubSubBrokerClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DaprPubSubBrokerClient{ - rootScope: rootScope, - host: ep, -pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprPubSubBrokerName - Dapr PubSubBroker name -// resource - Resource create parameters. -// options - DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate -// method. -func (client *DaprPubSubBrokerClient) CreateOrUpdate(ctx context.Context, daprPubSubBrokerName string, resource DaprPubSubBrokerResource, options *DaprPubSubBrokerClientCreateOrUpdateOptions) (DaprPubSubBrokerClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, daprPubSubBrokerName, resource, options) - if err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprPubSubBrokerClient) createOrUpdateCreateRequest(ctx context.Context, daprPubSubBrokerName string, resource DaprPubSubBrokerResource, options *DaprPubSubBrokerClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{daprPubSubBrokerName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprPubSubBrokerName == "" { - return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprPubSubBrokerClient) createOrUpdateHandleResponse(resp *http.Response) (DaprPubSubBrokerClientCreateOrUpdateResponse, error) { - result := DaprPubSubBrokerClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResource); err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an existing DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprPubSubBrokerName - Dapr PubSubBroker name -// options - DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete -// method. -func (client *DaprPubSubBrokerClient) BeginDelete(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*runtime.Poller[DaprPubSubBrokerClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, daprPubSubBrokerName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DaprPubSubBrokerClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[DaprPubSubBrokerClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes an existing DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -func (client *DaprPubSubBrokerClient) deleteOperation(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, daprPubSubBrokerName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprPubSubBrokerClient) deleteCreateRequest(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{daprPubSubBrokerName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprPubSubBrokerName == "" { - return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprPubSubBrokerName - Dapr PubSubBroker name -// options - DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. -func (client *DaprPubSubBrokerClient) Get(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientGetOptions) (DaprPubSubBrokerClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, daprPubSubBrokerName, options) - if err != nil { - return DaprPubSubBrokerClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprPubSubBrokerClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprPubSubBrokerClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DaprPubSubBrokerClient) getCreateRequest(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{daprPubSubBrokerName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprPubSubBrokerName == "" { - return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DaprPubSubBrokerClient) getHandleResponse(resp *http.Response) (DaprPubSubBrokerClientGetResponse, error) { - result := DaprPubSubBrokerClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResource); err != nil { - return DaprPubSubBrokerClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all DaprPubSubBrokerResources in the given root scope -// Generated from API version 2022-03-15-privatepreview -// options - DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.ListByRootScope -// method. -func (client *DaprPubSubBrokerClient) NewListByRootScopePager(options *DaprPubSubBrokerClientListByRootScopeOptions) (*runtime.Pager[DaprPubSubBrokerClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[DaprPubSubBrokerClientListByRootScopeResponse]{ - More: func(page DaprPubSubBrokerClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprPubSubBrokerClientListByRootScopeResponse) (DaprPubSubBrokerClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DaprPubSubBrokerClientListByRootScopeResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprPubSubBrokerClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprPubSubBrokerClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *DaprPubSubBrokerClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprPubSubBrokerClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *DaprPubSubBrokerClient) listByRootScopeHandleResponse(resp *http.Response) (DaprPubSubBrokerClientListByRootScopeResponse, error) { - result := DaprPubSubBrokerClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResourceListResult); err != nil { - return DaprPubSubBrokerClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go deleted file mode 100644 index a085337891..0000000000 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go +++ /dev/null @@ -1,272 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// DaprSecretStoreClient contains the methods for the DaprSecretStore group. -// Don't use this type directly, use NewDaprSecretStoreClient() instead. -type DaprSecretStoreClient struct { - host string - rootScope string - pl runtime.Pipeline -} - -// NewDaprSecretStoreClient creates a new instance of DaprSecretStoreClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDaprSecretStoreClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprSecretStoreClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DaprSecretStoreClient{ - rootScope: rootScope, - host: ep, -pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a DaprSecretStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprSecretStoreName - Dapr SecretStore name -// resource - Resource create parameters. -// options - DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate -// method. -func (client *DaprSecretStoreClient) CreateOrUpdate(ctx context.Context, daprSecretStoreName string, resource DaprSecretStoreResource, options *DaprSecretStoreClientCreateOrUpdateOptions) (DaprSecretStoreClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, daprSecretStoreName, resource, options) - if err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DaprSecretStoreClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprSecretStoreClient) createOrUpdateCreateRequest(ctx context.Context, daprSecretStoreName string, resource DaprSecretStoreResource, options *DaprSecretStoreClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{daprSecretStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprSecretStoreName == "" { - return nil, errors.New("parameter daprSecretStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprSecretStoreClient) createOrUpdateHandleResponse(resp *http.Response) (DaprSecretStoreClientCreateOrUpdateResponse, error) { - result := DaprSecretStoreClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResource); err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing DaprSecretStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprSecretStoreName - Dapr SecretStore name -// options - DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. -func (client *DaprSecretStoreClient) Delete(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientDeleteOptions) (DaprSecretStoreClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, daprSecretStoreName, options) - if err != nil { - return DaprSecretStoreClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprSecretStoreClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return DaprSecretStoreClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return client.deleteHandleResponse(resp) -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprSecretStoreClient) deleteCreateRequest(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{daprSecretStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprSecretStoreName == "" { - return nil, errors.New("parameter daprSecretStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *DaprSecretStoreClient) deleteHandleResponse(resp *http.Response) (DaprSecretStoreClientDeleteResponse, error) { - result := DaprSecretStoreClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprSecretStoreClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a DaprSecretStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprSecretStoreName - Dapr SecretStore name -// options - DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. -func (client *DaprSecretStoreClient) Get(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientGetOptions) (DaprSecretStoreClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, daprSecretStoreName, options) - if err != nil { - return DaprSecretStoreClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprSecretStoreClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprSecretStoreClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DaprSecretStoreClient) getCreateRequest(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{daprSecretStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprSecretStoreName == "" { - return nil, errors.New("parameter daprSecretStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DaprSecretStoreClient) getHandleResponse(resp *http.Response) (DaprSecretStoreClientGetResponse, error) { - result := DaprSecretStoreClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResource); err != nil { - return DaprSecretStoreClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all DaprSecretStoreResources in the given root scope -// Generated from API version 2022-03-15-privatepreview -// options - DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.ListByRootScope -// method. -func (client *DaprSecretStoreClient) NewListByRootScopePager(options *DaprSecretStoreClientListByRootScopeOptions) (*runtime.Pager[DaprSecretStoreClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[DaprSecretStoreClientListByRootScopeResponse]{ - More: func(page DaprSecretStoreClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprSecretStoreClientListByRootScopeResponse) (DaprSecretStoreClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DaprSecretStoreClientListByRootScopeResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprSecretStoreClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprSecretStoreClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *DaprSecretStoreClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprSecretStoreClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *DaprSecretStoreClient) listByRootScopeHandleResponse(resp *http.Response) (DaprSecretStoreClientListByRootScopeResponse, error) { - result := DaprSecretStoreClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResourceListResult); err != nil { - return DaprSecretStoreClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go deleted file mode 100644 index 0f813ae1b5..0000000000 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// DaprStateStoreClient contains the methods for the DaprStateStore group. -// Don't use this type directly, use NewDaprStateStoreClient() instead. -type DaprStateStoreClient struct { - host string - rootScope string - pl runtime.Pipeline -} - -// NewDaprStateStoreClient creates a new instance of DaprStateStoreClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewDaprStateStoreClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprStateStoreClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &DaprStateStoreClient{ - rootScope: rootScope, - host: ep, -pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprStateStoreName - Dapr StateStore name -// resource - Resource create parameters. -// options - DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate -// method. -func (client *DaprStateStoreClient) CreateOrUpdate(ctx context.Context, daprStateStoreName string, resource DaprStateStoreResource, options *DaprStateStoreClientCreateOrUpdateOptions) (DaprStateStoreClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, daprStateStoreName, resource, options) - if err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DaprStateStoreClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprStateStoreClient) createOrUpdateCreateRequest(ctx context.Context, daprStateStoreName string, resource DaprStateStoreResource, options *DaprStateStoreClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{daprStateStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprStateStoreName == "" { - return nil, errors.New("parameter daprStateStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprStateStoreClient) createOrUpdateHandleResponse(resp *http.Response) (DaprStateStoreClientCreateOrUpdateResponse, error) { - result := DaprStateStoreClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResource); err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an existing DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprStateStoreName - Dapr StateStore name -// options - DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete -// method. -func (client *DaprStateStoreClient) BeginDelete(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*runtime.Poller[DaprStateStoreClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, daprStateStoreName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DaprStateStoreClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[DaprStateStoreClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Deletes an existing DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -func (client *DaprStateStoreClient) deleteOperation(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, daprStateStoreName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprStateStoreClient) deleteCreateRequest(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{daprStateStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprStateStoreName == "" { - return nil, errors.New("parameter daprStateStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-03-15-privatepreview -// daprStateStoreName - Dapr StateStore name -// options - DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. -func (client *DaprStateStoreClient) Get(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientGetOptions) (DaprStateStoreClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, daprStateStoreName, options) - if err != nil { - return DaprStateStoreClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprStateStoreClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprStateStoreClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *DaprStateStoreClient) getCreateRequest(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{daprStateStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprStateStoreName == "" { - return nil, errors.New("parameter daprStateStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DaprStateStoreClient) getHandleResponse(resp *http.Response) (DaprStateStoreClientGetResponse, error) { - result := DaprStateStoreClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResource); err != nil { - return DaprStateStoreClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all DaprStateStoreResources in the given root scope -// Generated from API version 2022-03-15-privatepreview -// options - DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.ListByRootScope -// method. -func (client *DaprStateStoreClient) NewListByRootScopePager(options *DaprStateStoreClientListByRootScopeOptions) (*runtime.Pager[DaprStateStoreClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[DaprStateStoreClientListByRootScopeResponse]{ - More: func(page DaprStateStoreClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprStateStoreClientListByRootScopeResponse) (DaprStateStoreClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DaprStateStoreClientListByRootScopeResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DaprStateStoreClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprStateStoreClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *DaprStateStoreClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprStateStoreClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *DaprStateStoreClient) listByRootScopeHandleResponse(resp *http.Response) (DaprStateStoreClientListByRootScopeResponse, error) { - result := DaprStateStoreClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResourceListResult); err != nil { - return DaprStateStoreClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go index c98d66b222..447f7639c4 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go @@ -10,78 +10,27 @@ package v20220315privatepreview import "time" -// BasicDaprResourceProperties - Basic properties of a Dapr component object. -type BasicDaprResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` - - // Fully qualified resource ID for the application that the portable resource is consumed by - Application *string `json:"application,omitempty"` - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` - - // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` -} - -// BasicResourceProperties - Basic properties of a Radius resource. -type BasicResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` - - // Fully qualified resource ID for the application that the portable resource is consumed by - Application *string `json:"application,omitempty"` - - // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` -} - -// DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete method. -type DaprPubSubBrokerClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate -// method. -type DaprPubSubBrokerClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. -type DaprPubSubBrokerClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.ListByRootScope -// method. -type DaprPubSubBrokerClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerProperties - Dapr PubSubBroker portable resource properties +// DaprPubSubBrokerProperties - PubSubBroker portable resource properties type DaprPubSubBrokerProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` - // Metadata for the Dapr PubSubBroker resource. This should match the values specified in Dapr component spec + // The metadata for Dapr resource which must match the values specified in Dapr component spec Metadata map[string]interface{} `json:"metadata,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the Dapr PubSubBroker portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // A collection of references to resources associated with the Dapr PubSubBroker + // A collection of references to resources associated with the pubSubBroker Resources []*ResourceReference `json:"resources,omitempty"` - // Dapr PubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format. + // Dapr component type which must matches the format used by Dapr Kubernetes configuration format Type *string `json:"type,omitempty"` // Dapr component version @@ -91,14 +40,14 @@ type DaprPubSubBrokerProperties struct { // use the Dapr component. ComponentName *string `json:"componentName,omitempty" azure:"ro"` - // READ-ONLY; Provisioning state of the Dapr PubSubBroker portable resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// DaprPubSubBrokerResource - Dapr PubSubBroker portable resource +// DaprPubSubBrokerResource - PubSubBroker portable resource type DaprPubSubBrokerResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -131,46 +80,60 @@ type DaprPubSubBrokerResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate -// method. -type DaprSecretStoreClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} +// DaprPubSubBrokerResourceUpdate - The type used for update operations of the DaprPubSubBrokerResource. +type DaprPubSubBrokerResourceUpdate struct { + // The updatable properties of the DaprPubSubBrokerResource. + Properties *DaprPubSubBrokerResourceUpdateProperties `json:"properties,omitempty"` -// DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. -type DaprSecretStoreClientDeleteOptions struct { - // placeholder for future optional parameters + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` } -// DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. -type DaprSecretStoreClientGetOptions struct { - // placeholder for future optional parameters -} +// DaprPubSubBrokerResourceUpdateProperties - The updatable properties of the DaprPubSubBrokerResource. +type DaprPubSubBrokerResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` -// DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.ListByRootScope -// method. -type DaprSecretStoreClientListByRootScopeOptions struct { - // placeholder for future optional parameters + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // The metadata for Dapr resource which must match the values specified in Dapr component spec + Metadata map[string]interface{} `json:"metadata,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // A collection of references to resources associated with the pubSubBroker + Resources []*ResourceReference `json:"resources,omitempty"` + + // Dapr component type which must matches the format used by Dapr Kubernetes configuration format + Type *string `json:"type,omitempty"` + + // Dapr component version + Version *string `json:"version,omitempty"` } -// DaprSecretStoreProperties - Dapr SecretStore portable resource properties +// DaprSecretStoreProperties - DaprSecretStore portable resource properties type DaprSecretStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` - // Metadata for the Dapr SecretStore resource. This should match the values specified in Dapr component spec + // The metadata for Dapr resource which must match the values specified in Dapr component spec Metadata map[string]interface{} `json:"metadata,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the Dapr SecretStore portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // Dapr SecretStore type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/ + // Dapr component type which must matches the format used by Dapr Kubernetes configuration format Type *string `json:"type,omitempty"` // Dapr component version @@ -180,14 +143,14 @@ type DaprSecretStoreProperties struct { // use the Dapr component. ComponentName *string `json:"componentName,omitempty" azure:"ro"` - // READ-ONLY; Provisioning state of the dapr secret store portable resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// DaprSecretStoreResource - Dapr SecretStore portable resource +// DaprSecretStoreResource - DaprSecretStore portable resource type DaprSecretStoreResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -220,50 +183,60 @@ type DaprSecretStoreResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete method. -type DaprStateStoreClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} +// DaprSecretStoreResourceUpdate - The type used for update operations of the DaprSecretStoreResource. +type DaprSecretStoreResourceUpdate struct { + // The updatable properties of the DaprSecretStoreResource. + Properties *DaprSecretStoreResourceUpdateProperties `json:"properties,omitempty"` -// DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate -// method. -type DaprStateStoreClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` } -// DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. -type DaprStateStoreClientGetOptions struct { - // placeholder for future optional parameters -} +// DaprSecretStoreResourceUpdateProperties - The updatable properties of the DaprSecretStoreResource. +type DaprSecretStoreResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` -// DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.ListByRootScope -// method. -type DaprStateStoreClientListByRootScopeOptions struct { - // placeholder for future optional parameters + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // The metadata for Dapr resource which must match the values specified in Dapr component spec + Metadata map[string]interface{} `json:"metadata,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // Dapr component type which must matches the format used by Dapr Kubernetes configuration format + Type *string `json:"type,omitempty"` + + // Dapr component version + Version *string `json:"version,omitempty"` } -// DaprStateStoreProperties - Dapr StateStore portable resource properties +// DaprStateStoreProperties - StateStore portable resource properties type DaprStateStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` - // Metadata for the Dapr StateStore resource. This should match the values specified in Dapr component spec + // The metadata for Dapr resource which must match the values specified in Dapr component spec Metadata map[string]interface{} `json:"metadata,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the Dapr StateStore portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // A collection of references to resources associated with the Dapr StateStore + // A collection of references to resources associated with the state store Resources []*ResourceReference `json:"resources,omitempty"` - // Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format. + // Dapr component type which must matches the format used by Dapr Kubernetes configuration format Type *string `json:"type,omitempty"` // Dapr component version @@ -273,14 +246,14 @@ type DaprStateStoreProperties struct { // use the Dapr component. ComponentName *string `json:"componentName,omitempty" azure:"ro"` - // READ-ONLY; Provisioning state of the DaprStateStore portable resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// DaprStateStoreResource - Dapr StateStore portable resource +// DaprStateStoreResource - StateStore portable resource type DaprStateStoreResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -313,6 +286,66 @@ type DaprStateStoreResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } +// DaprStateStoreResourceUpdate - The type used for update operations of the DaprStateStoreResource. +type DaprStateStoreResourceUpdate struct { + // The updatable properties of the DaprStateStoreResource. + Properties *DaprStateStoreResourceUpdateProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// DaprStateStoreResourceUpdateProperties - The updatable properties of the DaprStateStoreResource. +type DaprStateStoreResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` + + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // The metadata for Dapr resource which must match the values specified in Dapr component spec + Metadata map[string]interface{} `json:"metadata,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // A collection of references to resources associated with the state store + Resources []*ResourceReference `json:"resources,omitempty"` + + // Dapr component type which must matches the format used by Dapr Kubernetes configuration format + Type *string `json:"type,omitempty"` + + // Dapr component version + Version *string `json:"version,omitempty"` +} + +// EnvironmentComputeClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnvironmentCompute, *KubernetesCompute +type EnvironmentComputeClassification interface { + // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. + GetEnvironmentCompute() *EnvironmentCompute +} + +// EnvironmentCompute - Represents backing compute resource +type EnvironmentCompute struct { + // REQUIRED; Discriminator property for EnvironmentCompute. + Kind *string `json:"kind,omitempty"` + + // Configuration for supported external identity providers + Identity *IdentitySettings `json:"identity,omitempty"` + + // The resource id of the compute resource for application environment. + ResourceID *string `json:"resourceId,omitempty"` +} + +// GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. +func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { return e } + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -347,6 +380,42 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// IdentitySettings is the external identity setting. +type IdentitySettings struct { + // REQUIRED; kind of identity setting + Kind *IdentitySettingKind `json:"kind,omitempty"` + + // The URI for your compute platform's OIDC issuer + OidcIssuer *string `json:"oidcIssuer,omitempty"` + + // The resource ID of the provisioned identity + Resource *string `json:"resource,omitempty"` +} + +// KubernetesCompute - The Kubernetes compute configuration +type KubernetesCompute struct { + // REQUIRED; Discriminator property for EnvironmentCompute. + Kind *string `json:"kind,omitempty"` + + // REQUIRED; The namespace to use for the environment. + Namespace *string `json:"namespace,omitempty"` + + // Configuration for supported external identity providers + Identity *IdentitySettings `json:"identity,omitempty"` + + // The resource id of the compute resource for application environment. + ResourceID *string `json:"resourceId,omitempty"` +} + +// GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type KubernetesCompute. +func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { + return &EnvironmentCompute{ + Kind: k.Kind, + ResourceID: k.ResourceID, + Identity: k.Identity, + } +} + // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -401,7 +470,50 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } -// Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource +// OutputResource - Properties of an output resource. +type OutputResource struct { + // The UCP resource ID of the underlying resource. + ID *string `json:"id,omitempty"` + + // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency +// relationship. LocalIDs do not have any particular format or meaning beyond +// being compared to determine dependency relationships. + LocalID *string `json:"localId,omitempty"` + + // Determines whether Radius manages the lifecycle of the underlying resource. + RadiusManaged *bool `json:"radiusManaged,omitempty"` +} + +// PubSubBrokersClientBeginCreateOrUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginCreateOrUpdate +// method. +type PubSubBrokersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PubSubBrokersClientBeginDeleteOptions contains the optional parameters for the PubSubBrokersClient.BeginDelete method. +type PubSubBrokersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PubSubBrokersClientBeginUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginUpdate method. +type PubSubBrokersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PubSubBrokersClientGetOptions contains the optional parameters for the PubSubBrokersClient.Get method. +type PubSubBrokersClientGetOptions struct { + // placeholder for future optional parameters +} + +// PubSubBrokersClientListByScopeOptions contains the optional parameters for the PubSubBrokersClient.ListByScope method. +type PubSubBrokersClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// Recipe - The recipe used to automatically deploy underlying infrastructure for a link type Recipe struct { // REQUIRED; The name of the recipe within the environment to use Name *string `json:"name,omitempty"` @@ -410,6 +522,15 @@ type Recipe struct { Parameters map[string]interface{} `json:"parameters,omitempty"` } +// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a link +type RecipeUpdate struct { + // The name of the recipe within the environment to use + Name *string `json:"name,omitempty"` + + // Key/value parameters to pass into the recipe at deployment + Parameters map[string]interface{} `json:"parameters,omitempty"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -433,8 +554,69 @@ type ResourceReference struct { // ResourceStatus - Status of a resource. type ResourceStatus struct { + // The compute resource associated with the resource. + Compute EnvironmentComputeClassification `json:"compute,omitempty"` + // Properties of an output resource - OutputResources []map[string]interface{} `json:"outputResources,omitempty"` + OutputResources []*OutputResource `json:"outputResources,omitempty"` +} + +// SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate +// method. +type SecretStoresClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete method. +type SecretStoresClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate method. +type SecretStoresClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. +type SecretStoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.ListByScope method. +type SecretStoresClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// StateStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the StateStoresClient.BeginCreateOrUpdate +// method. +type StateStoresClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StateStoresClientBeginDeleteOptions contains the optional parameters for the StateStoresClient.BeginDelete method. +type StateStoresClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StateStoresClientBeginUpdateOptions contains the optional parameters for the StateStoresClient.BeginUpdate method. +type StateStoresClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StateStoresClientGetOptions contains the optional parameters for the StateStoresClient.Get method. +type StateStoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// StateStoresClientListByScopeOptions contains the optional parameters for the StateStoresClient.ListByScope method. +type StateStoresClientListByScopeOptions struct { + // placeholder for future optional parameters } // SystemData - Metadata pertaining to creation and last modification of the resource. diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go index 5f5f674f81..cd518b142f 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -15,80 +15,6 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type BasicDaprResourceProperties. -func (b BasicDaprResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "application", b.Application) - populate(objectMap, "componentName", b.ComponentName) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicDaprResourceProperties. -func (b *BasicDaprResourceProperties) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &b.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. -func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "application", b.Application) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicResourceProperties. -func (b *BasicResourceProperties) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerProperties. func (d DaprPubSubBrokerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -238,6 +164,92 @@ func (d *DaprPubSubBrokerResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceUpdate. +func (d DaprPubSubBrokerResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprPubSubBrokerResourceUpdate. +func (d *DaprPubSubBrokerResourceUpdate) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceUpdateProperties. +func (d DaprPubSubBrokerResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", d.Application) + populate(objectMap, "environment", d.Environment) + populate(objectMap, "metadata", d.Metadata) + populate(objectMap, "recipe", d.Recipe) + populate(objectMap, "resourceProvisioning", d.ResourceProvisioning) + populate(objectMap, "resources", d.Resources) + populate(objectMap, "type", d.Type) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprPubSubBrokerResourceUpdateProperties. +func (d *DaprPubSubBrokerResourceUpdateProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &d.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &d.Environment) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &d.Metadata) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &d.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &d.Resources) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreProperties. func (d DaprSecretStoreProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -383,6 +395,88 @@ func (d *DaprSecretStoreResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceUpdate. +func (d DaprSecretStoreResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretStoreResourceUpdate. +func (d *DaprSecretStoreResourceUpdate) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceUpdateProperties. +func (d DaprSecretStoreResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", d.Application) + populate(objectMap, "environment", d.Environment) + populate(objectMap, "metadata", d.Metadata) + populate(objectMap, "recipe", d.Recipe) + populate(objectMap, "resourceProvisioning", d.ResourceProvisioning) + populate(objectMap, "type", d.Type) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretStoreResourceUpdateProperties. +func (d *DaprSecretStoreResourceUpdateProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &d.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &d.Environment) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &d.Metadata) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &d.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreProperties. func (d DaprStateStoreProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -532,6 +626,127 @@ func (d *DaprStateStoreResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceUpdate. +func (d DaprStateStoreResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprStateStoreResourceUpdate. +func (d *DaprStateStoreResourceUpdate) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceUpdateProperties. +func (d DaprStateStoreResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", d.Application) + populate(objectMap, "environment", d.Environment) + populate(objectMap, "metadata", d.Metadata) + populate(objectMap, "recipe", d.Recipe) + populate(objectMap, "resourceProvisioning", d.ResourceProvisioning) + populate(objectMap, "resources", d.Resources) + populate(objectMap, "type", d.Type) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprStateStoreResourceUpdateProperties. +func (d *DaprStateStoreResourceUpdateProperties) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &d.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &d.Environment) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &d.Metadata) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &d.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &d.Resources) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. +func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", e.Identity) + objectMap["kind"] = e.Kind + populate(objectMap, "resourceId", e.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentCompute. +func (e *EnvironmentCompute) 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 "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) + 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 ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -633,6 +848,80 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. +func (i IdentitySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "oidcIssuer", i.OidcIssuer) + populate(objectMap, "resource", i.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentitySettings. +func (i *IdentitySettings) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "oidcIssuer": + err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &i.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesCompute. +func (k KubernetesCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", k.Identity) + objectMap["kind"] = "kubernetes" + populate(objectMap, "namespace", k.Namespace) + populate(objectMap, "resourceId", k.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesCompute. +func (k *KubernetesCompute) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &k.Namespace) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &k.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -746,6 +1035,41 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OutputResource. +func (o OutputResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "localId", o.LocalID) + populate(objectMap, "radiusManaged", o.RadiusManaged) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputResource. +func (o *OutputResource) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "localId": + err = unpopulate(val, "LocalID", &o.LocalID) + delete(rawMsg, key) + case "radiusManaged": + err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -777,6 +1101,37 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. +func (r RecipeUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", r.Name) + populate(objectMap, "parameters", r.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeUpdate. +func (r *RecipeUpdate) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -846,6 +1201,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "compute", r.Compute) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) } @@ -859,6 +1215,9 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "compute": + r.Compute, err = unmarshalEnvironmentComputeClassification(val) + delete(rawMsg, key) case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) delete(rawMsg, key) diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go new file mode 100644 index 0000000000..cba5e61f5a --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -0,0 +1,30 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import "encoding/json" + +func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (EnvironmentComputeClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EnvironmentComputeClassification + switch m["kind"] { + case "kubernetes": + b = &KubernetesCompute{} + default: + b = &EnvironmentCompute{} + } + return b, json.Unmarshal(rawMsg, b) +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go new file mode 100644 index 0000000000..4e08b0a194 --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go @@ -0,0 +1,335 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// PubSubBrokersClient contains the methods for the PubSubBrokers group. +// Don't use this type directly, use NewPubSubBrokersClient() instead. +type PubSubBrokersClient struct { + host string + rootScope string + pl runtime.Pipeline +} + +// NewPubSubBrokersClient creates a new instance of PubSubBrokersClient with the specified values. +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPubSubBrokersClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PubSubBrokersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &PubSubBrokersClient{ + rootScope: rootScope, + host: ep, +pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// pubSubBrokerName - PubSubBroker name +// resource - Resource create parameters. +// options - PubSubBrokersClientBeginCreateOrUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginCreateOrUpdate +// method. +func (client *PubSubBrokersClient) BeginCreateOrUpdate(ctx context.Context, pubSubBrokerName string, resource DaprPubSubBrokerResource, options *PubSubBrokersClientBeginCreateOrUpdateOptions) (*runtime.Poller[PubSubBrokersClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, pubSubBrokerName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PubSubBrokersClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[PubSubBrokersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *PubSubBrokersClient) createOrUpdate(ctx context.Context, pubSubBrokerName string, resource DaprPubSubBrokerResource, options *PubSubBrokersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, pubSubBrokerName, resource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PubSubBrokersClient) createOrUpdateCreateRequest(ctx context.Context, pubSubBrokerName string, resource DaprPubSubBrokerResource, options *PubSubBrokersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{pubSubBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if pubSubBrokerName == "" { + return nil, errors.New("parameter pubSubBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// pubSubBrokerName - PubSubBroker name +// options - PubSubBrokersClientBeginDeleteOptions contains the optional parameters for the PubSubBrokersClient.BeginDelete +// method. +func (client *PubSubBrokersClient) BeginDelete(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientBeginDeleteOptions) (*runtime.Poller[PubSubBrokersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, pubSubBrokerName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PubSubBrokersClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PubSubBrokersClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *PubSubBrokersClient) deleteOperation(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, pubSubBrokerName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PubSubBrokersClient) deleteCreateRequest(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{pubSubBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if pubSubBrokerName == "" { + return nil, errors.New("parameter pubSubBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// pubSubBrokerName - PubSubBroker name +// options - PubSubBrokersClientGetOptions contains the optional parameters for the PubSubBrokersClient.Get method. +func (client *PubSubBrokersClient) Get(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientGetOptions) (PubSubBrokersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, pubSubBrokerName, options) + if err != nil { + return PubSubBrokersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PubSubBrokersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PubSubBrokersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PubSubBrokersClient) getCreateRequest(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientGetOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{pubSubBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if pubSubBrokerName == "" { + return nil, errors.New("parameter pubSubBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PubSubBrokersClient) getHandleResponse(resp *http.Response) (PubSubBrokersClientGetResponse, error) { + result := PubSubBrokersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResource); err != nil { + return PubSubBrokersClientGetResponse{}, err + } + return result, nil +} + +// NewListByScopePager - List DaprPubSubBrokerResource resources by Scope +// Generated from API version 2022-03-15-privatepreview +// options - PubSubBrokersClientListByScopeOptions contains the optional parameters for the PubSubBrokersClient.ListByScope +// method. +func (client *PubSubBrokersClient) NewListByScopePager(options *PubSubBrokersClientListByScopeOptions) (*runtime.Pager[PubSubBrokersClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[PubSubBrokersClientListByScopeResponse]{ + More: func(page PubSubBrokersClientListByScopeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PubSubBrokersClientListByScopeResponse) (PubSubBrokersClientListByScopeResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScopeCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PubSubBrokersClientListByScopeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PubSubBrokersClientListByScopeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PubSubBrokersClientListByScopeResponse{}, runtime.NewResponseError(resp) + } + return client.listByScopeHandleResponse(resp) + }, + }) +} + +// listByScopeCreateRequest creates the ListByScope request. +func (client *PubSubBrokersClient) listByScopeCreateRequest(ctx context.Context, options *PubSubBrokersClientListByScopeOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScopeHandleResponse handles the ListByScope response. +func (client *PubSubBrokersClient) listByScopeHandleResponse(resp *http.Response) (PubSubBrokersClientListByScopeResponse, error) { + result := PubSubBrokersClientListByScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResourceListResult); err != nil { + return PubSubBrokersClientListByScopeResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// pubSubBrokerName - PubSubBroker name +// properties - The resource properties to be updated. +// options - PubSubBrokersClientBeginUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginUpdate +// method. +func (client *PubSubBrokersClient) BeginUpdate(ctx context.Context, pubSubBrokerName string, properties DaprPubSubBrokerResourceUpdate, options *PubSubBrokersClientBeginUpdateOptions) (*runtime.Poller[PubSubBrokersClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, pubSubBrokerName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PubSubBrokersClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PubSubBrokersClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a DaprPubSubBrokerResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *PubSubBrokersClient) update(ctx context.Context, pubSubBrokerName string, properties DaprPubSubBrokerResourceUpdate, options *PubSubBrokersClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, pubSubBrokerName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PubSubBrokersClient) updateCreateRequest(ctx context.Context, pubSubBrokerName string, properties DaprPubSubBrokerResourceUpdate, options *PubSubBrokersClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{pubSubBrokerName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if pubSubBrokerName == "" { + return nil, errors.New("parameter pubSubBrokerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go index 7957eeabe4..1261376958 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -8,75 +8,83 @@ package v20220315privatepreview -// DaprPubSubBrokerClientCreateOrUpdateResponse contains the response from method DaprPubSubBrokerClient.CreateOrUpdate. -type DaprPubSubBrokerClientCreateOrUpdateResponse struct { +// OperationsClientListResponse contains the response from method OperationsClient.List. +type OperationsClientListResponse struct { + OperationListResult +} + +// PubSubBrokersClientCreateOrUpdateResponse contains the response from method PubSubBrokersClient.CreateOrUpdate. +type PubSubBrokersClientCreateOrUpdateResponse struct { DaprPubSubBrokerResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } -// DaprPubSubBrokerClientDeleteResponse contains the response from method DaprPubSubBrokerClient.Delete. -type DaprPubSubBrokerClientDeleteResponse struct { +// PubSubBrokersClientDeleteResponse contains the response from method PubSubBrokersClient.Delete. +type PubSubBrokersClientDeleteResponse struct { // placeholder for future response values } -// DaprPubSubBrokerClientGetResponse contains the response from method DaprPubSubBrokerClient.Get. -type DaprPubSubBrokerClientGetResponse struct { +// PubSubBrokersClientGetResponse contains the response from method PubSubBrokersClient.Get. +type PubSubBrokersClientGetResponse struct { DaprPubSubBrokerResource } -// DaprPubSubBrokerClientListByRootScopeResponse contains the response from method DaprPubSubBrokerClient.ListByRootScope. -type DaprPubSubBrokerClientListByRootScopeResponse struct { +// PubSubBrokersClientListByScopeResponse contains the response from method PubSubBrokersClient.ListByScope. +type PubSubBrokersClientListByScopeResponse struct { DaprPubSubBrokerResourceListResult } -// DaprSecretStoreClientCreateOrUpdateResponse contains the response from method DaprSecretStoreClient.CreateOrUpdate. -type DaprSecretStoreClientCreateOrUpdateResponse struct { +// PubSubBrokersClientUpdateResponse contains the response from method PubSubBrokersClient.Update. +type PubSubBrokersClientUpdateResponse struct { + DaprPubSubBrokerResource +} + +// SecretStoresClientCreateOrUpdateResponse contains the response from method SecretStoresClient.CreateOrUpdate. +type SecretStoresClientCreateOrUpdateResponse struct { DaprSecretStoreResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } -// DaprSecretStoreClientDeleteResponse contains the response from method DaprSecretStoreClient.Delete. -type DaprSecretStoreClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 +// SecretStoresClientDeleteResponse contains the response from method SecretStoresClient.Delete. +type SecretStoresClientDeleteResponse struct { + // placeholder for future response values } -// DaprSecretStoreClientGetResponse contains the response from method DaprSecretStoreClient.Get. -type DaprSecretStoreClientGetResponse struct { +// SecretStoresClientGetResponse contains the response from method SecretStoresClient.Get. +type SecretStoresClientGetResponse struct { DaprSecretStoreResource } -// DaprSecretStoreClientListByRootScopeResponse contains the response from method DaprSecretStoreClient.ListByRootScope. -type DaprSecretStoreClientListByRootScopeResponse struct { +// SecretStoresClientListByScopeResponse contains the response from method SecretStoresClient.ListByScope. +type SecretStoresClientListByScopeResponse struct { DaprSecretStoreResourceListResult } -// DaprStateStoreClientCreateOrUpdateResponse contains the response from method DaprStateStoreClient.CreateOrUpdate. -type DaprStateStoreClientCreateOrUpdateResponse struct { +// SecretStoresClientUpdateResponse contains the response from method SecretStoresClient.Update. +type SecretStoresClientUpdateResponse struct { + DaprSecretStoreResource +} + +// StateStoresClientCreateOrUpdateResponse contains the response from method StateStoresClient.CreateOrUpdate. +type StateStoresClientCreateOrUpdateResponse struct { DaprStateStoreResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } -// DaprStateStoreClientDeleteResponse contains the response from method DaprStateStoreClient.Delete. -type DaprStateStoreClientDeleteResponse struct { +// StateStoresClientDeleteResponse contains the response from method StateStoresClient.Delete. +type StateStoresClientDeleteResponse struct { // placeholder for future response values } -// DaprStateStoreClientGetResponse contains the response from method DaprStateStoreClient.Get. -type DaprStateStoreClientGetResponse struct { +// StateStoresClientGetResponse contains the response from method StateStoresClient.Get. +type StateStoresClientGetResponse struct { DaprStateStoreResource } -// DaprStateStoreClientListByRootScopeResponse contains the response from method DaprStateStoreClient.ListByRootScope. -type DaprStateStoreClientListByRootScopeResponse struct { +// StateStoresClientListByScopeResponse contains the response from method StateStoresClient.ListByScope. +type StateStoresClientListByScopeResponse struct { DaprStateStoreResourceListResult } -// OperationsClientListResponse contains the response from method OperationsClient.List. -type OperationsClientListResponse struct { - OperationListResult +// StateStoresClientUpdateResponse contains the response from method StateStoresClient.Update. +type StateStoresClientUpdateResponse struct { + DaprStateStoreResource } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go new file mode 100644 index 0000000000..76c5ff57ce --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go @@ -0,0 +1,335 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SecretStoresClient contains the methods for the SecretStores group. +// Don't use this type directly, use NewSecretStoresClient() instead. +type SecretStoresClient struct { + host string + rootScope string + pl runtime.Pipeline +} + +// NewSecretStoresClient creates a new instance of SecretStoresClient with the specified values. +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewSecretStoresClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretStoresClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SecretStoresClient{ + rootScope: rootScope, + host: ep, +pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// secretStoreName - SecretStore name +// resource - Resource create parameters. +// options - SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate +// method. +func (client *SecretStoresClient) BeginCreateOrUpdate(ctx context.Context, secretStoreName string, resource DaprSecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecretStoresClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, secretStoreName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecretStoresClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SecretStoresClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *SecretStoresClient) createOrUpdate(ctx context.Context, secretStoreName string, resource DaprSecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, secretStoreName, resource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecretStoresClient) createOrUpdateCreateRequest(ctx context.Context, secretStoreName string, resource DaprSecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{secretStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if secretStoreName == "" { + return nil, errors.New("parameter secretStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// secretStoreName - SecretStore name +// options - SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete +// method. +func (client *SecretStoresClient) BeginDelete(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*runtime.Poller[SecretStoresClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, secretStoreName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecretStoresClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SecretStoresClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *SecretStoresClient) deleteOperation(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, secretStoreName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecretStoresClient) deleteCreateRequest(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{secretStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if secretStoreName == "" { + return nil, errors.New("parameter secretStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// secretStoreName - SecretStore name +// options - SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. +func (client *SecretStoresClient) Get(ctx context.Context, secretStoreName string, options *SecretStoresClientGetOptions) (SecretStoresClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, secretStoreName, options) + if err != nil { + return SecretStoresClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SecretStoresClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecretStoresClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SecretStoresClient) getCreateRequest(ctx context.Context, secretStoreName string, options *SecretStoresClientGetOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{secretStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if secretStoreName == "" { + return nil, errors.New("parameter secretStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecretStoresClient) getHandleResponse(resp *http.Response) (SecretStoresClientGetResponse, error) { + result := SecretStoresClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResource); err != nil { + return SecretStoresClientGetResponse{}, err + } + return result, nil +} + +// NewListByScopePager - List DaprSecretStoreResource resources by Scope +// Generated from API version 2022-03-15-privatepreview +// options - SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.ListByScope +// method. +func (client *SecretStoresClient) NewListByScopePager(options *SecretStoresClientListByScopeOptions) (*runtime.Pager[SecretStoresClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[SecretStoresClientListByScopeResponse]{ + More: func(page SecretStoresClientListByScopeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecretStoresClientListByScopeResponse) (SecretStoresClientListByScopeResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScopeCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SecretStoresClientListByScopeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SecretStoresClientListByScopeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecretStoresClientListByScopeResponse{}, runtime.NewResponseError(resp) + } + return client.listByScopeHandleResponse(resp) + }, + }) +} + +// listByScopeCreateRequest creates the ListByScope request. +func (client *SecretStoresClient) listByScopeCreateRequest(ctx context.Context, options *SecretStoresClientListByScopeOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScopeHandleResponse handles the ListByScope response. +func (client *SecretStoresClient) listByScopeHandleResponse(resp *http.Response) (SecretStoresClientListByScopeResponse, error) { + result := SecretStoresClientListByScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResourceListResult); err != nil { + return SecretStoresClientListByScopeResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// secretStoreName - SecretStore name +// properties - The resource properties to be updated. +// options - SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate +// method. +func (client *SecretStoresClient) BeginUpdate(ctx context.Context, secretStoreName string, properties DaprSecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*runtime.Poller[SecretStoresClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, secretStoreName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecretStoresClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SecretStoresClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a DaprSecretStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *SecretStoresClient) update(ctx context.Context, secretStoreName string, properties DaprSecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, secretStoreName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *SecretStoresClient) updateCreateRequest(ctx context.Context, secretStoreName string, properties DaprSecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores/{secretStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if secretStoreName == "" { + return nil, errors.New("parameter secretStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go new file mode 100644 index 0000000000..bdb2431438 --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go @@ -0,0 +1,332 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// StateStoresClient contains the methods for the StateStores group. +// Don't use this type directly, use NewStateStoresClient() instead. +type StateStoresClient struct { + host string + rootScope string + pl runtime.Pipeline +} + +// NewStateStoresClient creates a new instance of StateStoresClient with the specified values. +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewStateStoresClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StateStoresClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &StateStoresClient{ + rootScope: rootScope, + host: ep, +pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// stateStoreName - StateStore name +// resource - Resource create parameters. +// options - StateStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the StateStoresClient.BeginCreateOrUpdate +// method. +func (client *StateStoresClient) BeginCreateOrUpdate(ctx context.Context, stateStoreName string, resource DaprStateStoreResource, options *StateStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[StateStoresClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, stateStoreName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[StateStoresClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[StateStoresClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *StateStoresClient) createOrUpdate(ctx context.Context, stateStoreName string, resource DaprStateStoreResource, options *StateStoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, stateStoreName, resource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StateStoresClient) createOrUpdateCreateRequest(ctx context.Context, stateStoreName string, resource DaprStateStoreResource, options *StateStoresClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{stateStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if stateStoreName == "" { + return nil, errors.New("parameter stateStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, resource) +} + +// BeginDelete - Delete a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// stateStoreName - StateStore name +// options - StateStoresClientBeginDeleteOptions contains the optional parameters for the StateStoresClient.BeginDelete method. +func (client *StateStoresClient) BeginDelete(ctx context.Context, stateStoreName string, options *StateStoresClientBeginDeleteOptions) (*runtime.Poller[StateStoresClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, stateStoreName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[StateStoresClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[StateStoresClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *StateStoresClient) deleteOperation(ctx context.Context, stateStoreName string, options *StateStoresClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, stateStoreName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StateStoresClient) deleteCreateRequest(ctx context.Context, stateStoreName string, options *StateStoresClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{stateStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if stateStoreName == "" { + return nil, errors.New("parameter stateStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// stateStoreName - StateStore name +// options - StateStoresClientGetOptions contains the optional parameters for the StateStoresClient.Get method. +func (client *StateStoresClient) Get(ctx context.Context, stateStoreName string, options *StateStoresClientGetOptions) (StateStoresClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, stateStoreName, options) + if err != nil { + return StateStoresClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StateStoresClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StateStoresClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *StateStoresClient) getCreateRequest(ctx context.Context, stateStoreName string, options *StateStoresClientGetOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{stateStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if stateStoreName == "" { + return nil, errors.New("parameter stateStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *StateStoresClient) getHandleResponse(resp *http.Response) (StateStoresClientGetResponse, error) { + result := StateStoresClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResource); err != nil { + return StateStoresClientGetResponse{}, err + } + return result, nil +} + +// NewListByScopePager - List DaprStateStoreResource resources by Scope +// Generated from API version 2022-03-15-privatepreview +// options - StateStoresClientListByScopeOptions contains the optional parameters for the StateStoresClient.ListByScope method. +func (client *StateStoresClient) NewListByScopePager(options *StateStoresClientListByScopeOptions) (*runtime.Pager[StateStoresClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[StateStoresClientListByScopeResponse]{ + More: func(page StateStoresClientListByScopeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StateStoresClientListByScopeResponse) (StateStoresClientListByScopeResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScopeCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StateStoresClientListByScopeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StateStoresClientListByScopeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StateStoresClientListByScopeResponse{}, runtime.NewResponseError(resp) + } + return client.listByScopeHandleResponse(resp) + }, + }) +} + +// listByScopeCreateRequest creates the ListByScope request. +func (client *StateStoresClient) listByScopeCreateRequest(ctx context.Context, options *StateStoresClientListByScopeOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScopeHandleResponse handles the ListByScope response. +func (client *StateStoresClient) listByScopeHandleResponse(resp *http.Response) (StateStoresClientListByScopeResponse, error) { + result := StateStoresClientListByScopeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResourceListResult); err != nil { + return StateStoresClientListByScopeResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// stateStoreName - StateStore name +// properties - The resource properties to be updated. +// options - StateStoresClientBeginUpdateOptions contains the optional parameters for the StateStoresClient.BeginUpdate method. +func (client *StateStoresClient) BeginUpdate(ctx context.Context, stateStoreName string, properties DaprStateStoreResourceUpdate, options *StateStoresClientBeginUpdateOptions) (*runtime.Poller[StateStoresClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, stateStoreName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[StateStoresClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[StateStoresClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a DaprStateStoreResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *StateStoresClient) update(ctx context.Context, stateStoreName string, properties DaprStateStoreResourceUpdate, options *StateStoresClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, stateStoreName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *StateStoresClient) updateCreateRequest(ctx context.Context, stateStoreName string, properties DaprStateStoreResourceUpdate, options *StateStoresClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores/{stateStoreName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if stateStoreName == "" { + return nil, errors.New("parameter stateStoreName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/linkrp/frontend/handler/routes.go b/pkg/linkrp/frontend/handler/routes.go index caa54e7e58..a65a58ab7e 100644 --- a/pkg/linkrp/frontend/handler/routes.go +++ b/pkg/linkrp/frontend/handler/routes.go @@ -260,7 +260,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref pubsubPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/pubsubbrokers", validator) pubsubResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers", validator) - pubsubResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers/{daprPubSubBrokerName}", validator) + pubsubResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers/{pubSubBrokerName}", validator) handlerOptions := []server.HandlerOptions{ { @@ -357,7 +357,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref secretStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/secretstores", validator) secretStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores", validator) - secretStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores/{daprSecretStoreName}", validator) + secretStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores/{secretStoreName}", validator) handlerOptions = append(handlerOptions, []server.HandlerOptions{ { @@ -454,7 +454,7 @@ func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, pref stateStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/statestores", validator) stateStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores", validator) - stateStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores/{daprStateStoreName}", validator) + stateStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores/{stateStoreName}", validator) handlerOptions = append(handlerOptions, []server.HandlerOptions{ { diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersDelete.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersDelete.json deleted file mode 100644 index 24c9b77867..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersDelete.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprPubSubBrokerName": "daprpubsub0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersList.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersList.json deleted file mode 100644 index 5fb3b1ac37..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersList.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub0", - "name": "daprPubSub0", - "type": "Applications.Dapr/pubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub1", - "name": "daprPubSub1", - "type": "Applications.Dapr/pubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "pubsub.kafka", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub2", - "name": "daprPubSub2", - "type": "Applications.Dapr/pubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPutWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPutWithRecipe.json deleted file mode 100644 index a42ce2035a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPutWithRecipe.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprPubSubBrokerName": "daprpubsub0", - "api-version": "2022-03-15-privatepreview", - "DaprPubSubBrokerParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", - "name": "daprpubsub0", - "type": "Applications.Dapr/pubSubBrokers", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "recipe", - "type": "pubsub.azure.servicebus", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", - "name": "daprpubsub0", - "type": "Applications.Dapr/pubSubBrokers", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "recipe", - "type": "pubsub.azure.servicebus", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPut.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdate.json similarity index 55% rename from swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPut.json rename to swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdate.json index 9905ed6511..bcc72c4ab8 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersPut.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdate.json @@ -1,13 +1,15 @@ { + "operationId": "PubSubBrokers_CreateOrUpdate", + "title": "Create or update a PubSubBroker resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprPubSubBrokerName": "daprpubsub0", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", "api-version": "2022-03-15-privatepreview", - "DaprPubSubBrokerParameters": { + "PubSubBrokerParameters": { "location": "West US", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -25,14 +27,14 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", "name": "daprpubsub0", "type": "Applications.Dapr/pubSubBrokers", "location": "West US", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -49,14 +51,14 @@ }, "201": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", "name": "daprpubsub0", "type": "Applications.Dapr/pubSubBrokers", "location": "West US", "properties": { "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdateWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdateWithRecipe.json new file mode 100644 index 0000000000..83391aca67 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_CreateOrUpdateWithRecipe.json @@ -0,0 +1,66 @@ +{ + "operationId": "PubSubBrokers_CreateOrUpdate", + "title": "Create or update a PubSubBroker resource with recipe", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview", + "PubSubBrokerParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "recipe", + "type": "pubsub.azure.servicebus", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "recipe", + "type": "pubsub.azure.servicebus", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Delete.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Delete.json new file mode 100644 index 0000000000..be9fe77463 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "PubSubBrokers_Delete", + "title": "Delete a PubSubBroker resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersGet.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Get.json similarity index 54% rename from swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersGet.json rename to swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Get.json index c0c5ff6e51..eaaad281b0 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Get.json @@ -1,20 +1,22 @@ { + "operationId": "PubSubBrokers_Get", + "title": "Get a PubSubBroker resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", - "daprPubSubBrokerName": "daprpubsub0" + "pubSubBrokerName": "daprpubsub0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", "name": "daprpubsub0", "type": "Applications.Dapr/pubSubBrokers", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_List.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_List.json new file mode 100644 index 0000000000..28213b5b37 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_List.json @@ -0,0 +1,73 @@ +{ + "operationId": "PubSubBrokers_ListByScope", + "title": "List a PubSubBroker resource by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub0", + "name": "daprPubSub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub1", + "name": "daprPubSub1", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "pubsub.kafka", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub2", + "name": "daprPubSub2", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_ListByRootScope.json similarity index 57% rename from swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersListByRootScope.json rename to swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_ListByRootScope.json index 1b8d123b2e..a10cf160c7 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokersListByRootScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_ListByRootScope.json @@ -1,6 +1,8 @@ { + "operationId": "PubSubBrokers_ListByScope", + "title": "List a PubSubBroker resource by rootScope", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "/planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,14 +10,14 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub0", "name": "daprPubSub0", "type": "Applications.Dapr/pubSubBrokers", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -36,8 +38,8 @@ "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "type": "pubsub.kafka", "version": "v1", @@ -47,7 +49,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Dapr/pubSubBrokers?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Dapr/pubSubBrokers?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Update.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Update.json new file mode 100644 index 0000000000..f22de30773 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/PubSubBrokers_Update.json @@ -0,0 +1,77 @@ +{ + "operationId": "PubSubBrokers_Update", + "title": "Update a PubSubBroker resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview", + "PubSubBrokerParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json deleted file mode 100644 index ec511b165e..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresDelete.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprSecretStoreName": "daprsecretstore0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json deleted file mode 100644 index 693095b80a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresGet.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "daprSecretStoreName": "daprsecretstore0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprsecretstore0", - "name": "daprsecretstore0", - "type": "Applications.Dapr/secretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresList.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresList.json deleted file mode 100644 index 4c0375079c..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresList.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Dapr/secretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Dapr/secretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters": { - "foo": "bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresListByRootScope.json deleted file mode 100644 index 82d7a26c56..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresListByRootScope.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Dapr/secretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Dapr/secretStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters": { - "foo": "bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Dapr/secretStores?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresPut.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresPut.json deleted file mode 100644 index e0690b1884..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStoresPut.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprSecretStoreName": "daprsecretstore0", - "api-version": "2022-03-15-privatepreview", - "DaprSecretStoreParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Dapr/secretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "kind": "generic", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore1", - "name": "daprSecretStore1", - "type": "Applications.Dapr/secretStores", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json new file mode 100644 index 0000000000..7cdd6b3396 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_CreateOrUpdate.json @@ -0,0 +1,63 @@ +{ + "operationId": "SecretStores_CreateOrUpdate", + "title": "Create or update an SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "daprsecretstore0", + "api-version": "2022-03-15-privatepreview", + "SecretStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "kind": "generic", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore1", + "name": "daprSecretStore1", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json new file mode 100644 index 0000000000..d00bd593fe --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "SecretStores_Delete", + "title": "Delete a SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "daprsecretstore0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json new file mode 100644 index 0000000000..38340c89f7 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Get.json @@ -0,0 +1,30 @@ +{ + "operationId": "SecretStores_Get", + "title": "Get a SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "secretStoreName": "daprsecretstore0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprsecretstore0", + "name": "daprsecretstore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_List.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_List.json new file mode 100644 index 0000000000..4c2a74ee3e --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_List.json @@ -0,0 +1,51 @@ +{ + "operationId": "SecretStores_ListByScope", + "title": "List SecretStore resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_ListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_ListByRootScope.json new file mode 100644 index 0000000000..b66685650b --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_ListByRootScope.json @@ -0,0 +1,51 @@ +{ + "operationId": "SecretStores_ListByScope", + "title": "List SecretStore resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Dapr/secretStores?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json new file mode 100644 index 0000000000..974e788940 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/SecretStores_Update.json @@ -0,0 +1,63 @@ +{ + "operationId": "SecretStores_Update", + "title": "Update an SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "daprsecretstore0", + "api-version": "2022-03-15-privatepreview", + "SecretStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "kind": "generic", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore1", + "name": "daprSecretStore1", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresDelete.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresDelete.json deleted file mode 100644 index 75d4d9010d..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresDelete.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprStateStoreName": "daprstatestore0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresGet.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresGet.json deleted file mode 100644 index be78c9533a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresGet.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview", - "daprStateStoreName": "daprstatestore0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", - "name": "daprstatestore0", - "type": "Applications.Dapr/stateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresList.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresList.json deleted file mode 100644 index 83778da283..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresList.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Dapr/stateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" - } - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore1", - "name": "daprStateStore1", - "type": "Applications.Dapr/stateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" - } - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore2", - "name": "daprStateStore2", - "type": "Applications.Dapr/stateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore3", - "name": "daprStateStore3", - "type": "Applications.Dapr/stateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "recipe-test" - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPutWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPutWithRecipe.json deleted file mode 100644 index b6f54e3d3a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPutWithRecipe.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprStateStoreName": "daprstatestore0", - "api-version": "2022-03-15-privatepreview", - "DaprStateStoreParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "recipe-test" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", - "name": "daprstatestore0", - "type": "Applications.Dapr/stateStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "kind": "state.sqlserver", - "recipe": { - "name": "recipe-test" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", - "name": "daprstatestore0", - "type": "Applications.Dapr/stateStores", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "recipe": { - "name": "recipe-test" - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPut.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdate.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPut.json rename to swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdate.json index 65247b4965..48912c2186 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresPut.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdate.json @@ -1,13 +1,15 @@ { + "operationId": "StateStores_CreateOrUpdate", + "title": "Create or update a StateStore resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprStateStoreName": "daprstatestore0", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", "api-version": "2022-03-15-privatepreview", - "DaprStateStoreParameters": { + "StateStoreParameters": { "location": "West US", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -20,14 +22,14 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore0", - "name": "daprStateStore0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", "type": "Applications.Dapr/stateStores", "location": "West US", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "kind": "state.sqlserver", "resources": [ { @@ -45,14 +47,14 @@ }, "201": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore1", - "name": "daprStateStore1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", "type": "Applications.Dapr/stateStores", "location": "West US", "properties": { "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resources": [ { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdateWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdateWithRecipe.json new file mode 100644 index 0000000000..df781c63f4 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_CreateOrUpdateWithRecipe.json @@ -0,0 +1,55 @@ +{ + "operationId": "StateStores_CreateOrUpdate", + "title": "Create or update a StateStore resource with recipe", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview", + "StateStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "recipe-test" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", + "name": "daprstatestore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "kind": "state.sqlserver", + "recipe": { + "name": "recipe-test" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", + "name": "daprstatestore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "recipe": { + "name": "recipe-test" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Delete.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Delete.json new file mode 100644 index 0000000000..f65fe45f3a --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "StateStores_Delete", + "title": "Delete a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Get.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Get.json new file mode 100644 index 0000000000..f3c635f3ae --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Get.json @@ -0,0 +1,26 @@ +{ + "operationId": "StateStores_Get", + "title": "Get a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "stateStoreName": "daprstatestore0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", + "name": "daprstatestore0", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_List.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_List.json new file mode 100644 index 0000000000..c6a84c66f8 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_List.json @@ -0,0 +1,92 @@ +{ + "operationId": "StateStores_ListByScope", + "title": "List StateStore resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore2", + "name": "stateStore2", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore3", + "name": "stateStore3", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "recipe-test" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_ListByRootScope.json similarity index 54% rename from swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresListByRootScope.json rename to swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_ListByRootScope.json index 63926bc563..faa2d33d60 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStoresListByRootScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_ListByRootScope.json @@ -1,6 +1,8 @@ { + "operationId": "StateStores_ListByScope", + "title": "List StateStore resources by rootScope", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "/planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,14 +10,14 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore0", - "name": "daprStateStore0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", "type": "Applications.Dapr/stateStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -30,14 +32,14 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Dapr/stateStores/daprStateStore1", - "name": "daprStateStore1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", "type": "Applications.Dapr/stateStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -52,14 +54,14 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprStateStore2", - "name": "daprStateStore2", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore2", + "name": "stateStore2", "type": "Applications.Dapr/stateStores", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "type": "state.zookeeper", "version": "v1", @@ -69,7 +71,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Dapr/stateStores?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Dapr/stateStores?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Update.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Update.json new file mode 100644 index 0000000000..a93dca0ae8 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/examples/StateStores_Update.json @@ -0,0 +1,73 @@ +{ + "operationId": "StateStores_Update", + "title": "Update a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview", + "StateStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "kind": "state.sqlserver", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json index cde4084aaa..880a038b92 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json @@ -1,12 +1,12 @@ { "swagger": "2.0", "info": { - "title": "Applications.Dapr Management APIs", + "title": "Applications.Dapr Resource Management APIs", "version": "2022-03-15-privatepreview", - "description": "REST APIs for Applications.Dapr", - "x-cadl-generated": [ + "description": "REST API for Applications.Dapr", + "x-typespec-generated": [ { - "emitter": "@azure-tools/cadl-autorest" + "emitter": "@azure-tools/typespec-autorest" } ] }, @@ -43,29 +43,29 @@ "name": "Operations" }, { - "name": "DaprPubSubBroker" + "name": "SecretStores" }, { - "name": "DaprSecretStore" + "name": "StateStores" }, { - "name": "DaprStateStore" + "name": "PubSubBrokers" } ], "paths": { "/{rootScope}/providers/Applications.Dapr/pubSubBrokers": { "get": { + "operationId": "PubSubBrokers_ListByScope", "tags": [ - "DaprPubSubBroker" + "PubSubBrokers" ], - "operationId": "DaprPubSubBroker_ListByRootScope", - "description": "Lists information about all DaprPubSubBrokerResources in the given root scope", + "description": "List DaprPubSubBrokerResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -82,34 +82,41 @@ } } }, + "x-ms-examples": { + "List a PubSubBroker resource by resource group": { + "$ref": "./examples/PubSubBrokers_List.json" + }, + "List a PubSubBroker resource by rootScope": { + "$ref": "./examples/PubSubBrokers_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, - "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{daprPubSubBrokerName}": { + "/{rootScope}/providers/Applications.Dapr/pubSubBrokers/{pubSubBrokerName}": { "get": { + "operationId": "PubSubBrokers_Get", "tags": [ - "DaprPubSubBroker" + "PubSubBrokers" ], - "operationId": "DaprPubSubBroker_Get", - "description": "Retrieves information about a DaprPubSubBrokerResource", + "description": "Get a DaprPubSubBrokerResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprPubSubBrokerName", + "name": "pubSubBrokerName", "in": "path", + "description": "PubSubBroker name", "required": true, - "description": "Dapr PubSubBroker name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -125,36 +132,40 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a PubSubBroker resource": { + "$ref": "./examples/PubSubBrokers_Get.json" + } } }, "put": { + "operationId": "PubSubBrokers_CreateOrUpdate", "tags": [ - "DaprPubSubBroker" + "PubSubBrokers" ], - "operationId": "DaprPubSubBroker_CreateOrUpdate", - "description": "Creates or updates a DaprPubSubBrokerResource", + "description": "Create a DaprPubSubBrokerResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprPubSubBrokerName", + "name": "pubSubBrokerName", "in": "path", + "description": "PubSubBroker name", "required": true, - "description": "Dapr PubSubBroker name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/DaprPubSubBrokerResource" } @@ -162,54 +173,135 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'DaprPubSubBrokerResource' update operation succeeded", "schema": { "$ref": "#/definitions/DaprPubSubBrokerResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'DaprPubSubBrokerResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/DaprPubSubBrokerResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a PubSubBroker resource": { + "$ref": "./examples/PubSubBrokers_CreateOrUpdate.json" + }, + "Create or update a PubSubBroker resource with recipe": { + "$ref": "./examples/PubSubBrokers_CreateOrUpdateWithRecipe.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "PubSubBrokers_Update", + "tags": [ + "PubSubBrokers" + ], + "description": "Update a DaprPubSubBrokerResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "pubSubBrokerName", + "in": "path", + "description": "PubSubBroker name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/DaprPubSubBrokerResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/DaprPubSubBrokerResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Update a PubSubBroker resource": { + "$ref": "./examples/PubSubBrokers_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "PubSubBrokers_Delete", "tags": [ - "DaprPubSubBroker" + "PubSubBrokers" ], - "operationId": "DaprPubSubBroker_Delete", - "description": "Deletes an existing DaprPubSubBrokerResource", + "description": "Delete a DaprPubSubBrokerResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprPubSubBrokerName", + "name": "pubSubBrokerName", "in": "path", + "description": "PubSubBroker name", "required": true, - "description": "Dapr PubSubBroker name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -220,9 +312,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -236,25 +332,30 @@ } } }, + "x-ms-examples": { + "Delete a PubSubBroker resource": { + "$ref": "./examples/PubSubBrokers_Delete.json" + } + }, "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" + "final-state-via": "location" }, "x-ms-long-running-operation": true } }, "/{rootScope}/providers/Applications.Dapr/secretStores": { "get": { + "operationId": "SecretStores_ListByScope", "tags": [ - "DaprSecretStore" + "SecretStores" ], - "operationId": "DaprSecretStore_ListByRootScope", - "description": "Lists information about all DaprSecretStoreResources in the given root scope", + "description": "List DaprSecretStoreResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -271,34 +372,41 @@ } } }, + "x-ms-examples": { + "List SecretStore resources by resource group": { + "$ref": "./examples/SecretStores_List.json" + }, + "List SecretStore resources by rootScope": { + "$ref": "./examples/SecretStores_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, - "/{rootScope}/providers/Applications.Dapr/secretStores/{daprSecretStoreName}": { + "/{rootScope}/providers/Applications.Dapr/secretStores/{secretStoreName}": { "get": { + "operationId": "SecretStores_Get", "tags": [ - "DaprSecretStore" + "SecretStores" ], - "operationId": "DaprSecretStore_Get", - "description": "Retrieves information about a DaprSecretStoreResource", + "description": "Get a DaprSecretStoreResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprSecretStoreName", + "name": "secretStoreName", "in": "path", + "description": "SecretStore name", "required": true, - "description": "Dapr SecretStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -314,36 +422,40 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a SecretStore resource": { + "$ref": "./examples/SecretStores_Get.json" + } } }, "put": { + "operationId": "SecretStores_CreateOrUpdate", "tags": [ - "DaprSecretStore" + "SecretStores" ], - "operationId": "DaprSecretStore_CreateOrUpdate", - "description": "Creates or updates a DaprSecretStoreResource", + "description": "Create a DaprSecretStoreResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprSecretStoreName", + "name": "secretStoreName", "in": "path", + "description": "SecretStore name", "required": true, - "description": "Dapr SecretStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/DaprSecretStoreResource" } @@ -351,54 +463,132 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'DaprSecretStoreResource' update operation succeeded", "schema": { "$ref": "#/definitions/DaprSecretStoreResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'DaprSecretStoreResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/DaprSecretStoreResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update an SecretStore resource": { + "$ref": "./examples/SecretStores_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "SecretStores_Update", + "tags": [ + "SecretStores" + ], + "description": "Update a DaprSecretStoreResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "secretStoreName", + "in": "path", + "description": "SecretStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/DaprSecretStoreResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/DaprSecretStoreResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Update an SecretStore resource": { + "$ref": "./examples/SecretStores_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "SecretStores_Delete", "tags": [ - "DaprSecretStore" + "SecretStores" ], - "operationId": "DaprSecretStore_Delete", - "description": "Deletes an existing DaprSecretStoreResource", + "description": "Delete a DaprSecretStoreResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprSecretStoreName", + "name": "secretStoreName", "in": "path", + "description": "SecretStore name", "required": true, - "description": "Dapr SecretStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -409,9 +599,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -424,22 +618,31 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Delete a SecretStore resource": { + "$ref": "./examples/SecretStores_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true } }, "/{rootScope}/providers/Applications.Dapr/stateStores": { "get": { + "operationId": "StateStores_ListByScope", "tags": [ - "DaprStateStore" + "StateStores" ], - "operationId": "DaprStateStore_ListByRootScope", - "description": "Lists information about all DaprStateStoreResources in the given root scope", + "description": "List DaprStateStoreResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -456,34 +659,41 @@ } } }, + "x-ms-examples": { + "List StateStore resources by resource group": { + "$ref": "./examples/StateStores_List.json" + }, + "List StateStore resources by rootScope": { + "$ref": "./examples/StateStores_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, - "/{rootScope}/providers/Applications.Dapr/stateStores/{daprStateStoreName}": { + "/{rootScope}/providers/Applications.Dapr/stateStores/{stateStoreName}": { "get": { + "operationId": "StateStores_Get", "tags": [ - "DaprStateStore" + "StateStores" ], - "operationId": "DaprStateStore_Get", - "description": "Retrieves information about a DaprStateStoreResource", + "description": "Get a DaprStateStoreResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprStateStoreName", + "name": "stateStoreName", "in": "path", + "description": "StateStore name", "required": true, - "description": "Dapr StateStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -499,36 +709,40 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a StateStore resource": { + "$ref": "./examples/StateStores_Get.json" + } } }, "put": { + "operationId": "StateStores_CreateOrUpdate", "tags": [ - "DaprStateStore" + "StateStores" ], - "operationId": "DaprStateStore_CreateOrUpdate", - "description": "Creates or updates a DaprStateStoreResource", + "description": "Create a DaprStateStoreResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprStateStoreName", + "name": "stateStoreName", "in": "path", + "description": "StateStore name", "required": true, - "description": "Dapr StateStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/DaprStateStoreResource" } @@ -536,54 +750,135 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'DaprStateStoreResource' update operation succeeded", "schema": { "$ref": "#/definitions/DaprStateStoreResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'DaprStateStoreResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/DaprStateStoreResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a StateStore resource": { + "$ref": "./examples/StateStores_CreateOrUpdate.json" + }, + "Create or update a StateStore resource with recipe": { + "$ref": "./examples/StateStores_CreateOrUpdateWithRecipe.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "StateStores_Update", + "tags": [ + "StateStores" + ], + "description": "Update a DaprStateStoreResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "stateStoreName", + "in": "path", + "description": "StateStore name", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/DaprStateStoreResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/DaprStateStoreResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Update a StateStore resource": { + "$ref": "./examples/StateStores_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "StateStores_Delete", "tags": [ - "DaprStateStore" + "StateStores" ], - "operationId": "DaprStateStore_Delete", - "description": "Deletes an existing DaprStateStoreResource", + "description": "Delete a DaprStateStoreResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { - "name": "daprStateStoreName", + "name": "stateStoreName", "in": "path", + "description": "StateStore name", "required": true, - "description": "Dapr StateStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -594,9 +889,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -610,18 +909,23 @@ } } }, + "x-ms-examples": { + "Delete a StateStore resource": { + "$ref": "./examples/StateStores_Delete.json" + } + }, "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" + "final-state-via": "location" }, "x-ms-long-running-operation": true } }, "/providers/Applications.Dapr/operations": { "get": { + "operationId": "Operations_List", "tags": [ "Operations" ], - "operationId": "Operations_List", "description": "List the operations for the provider", "parameters": [ { @@ -649,94 +953,69 @@ } }, "definitions": { - "Application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "BasicDaprResourceProperties": { - "type": "object", - "properties": { - "componentName": { - "type": "string", - "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", - "readOnly": true - } - }, - "description": "Basic properties of a Dapr component object.", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "BasicResourceProperties": { + "DaprPubSubBrokerProperties": { "type": "object", + "description": "PubSubBroker portable resource properties", "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, "environment": { "type": "string", "description": "Fully qualified resource ID for the environment that the portable resource is linked to" }, "application": { - "$ref": "#/definitions/Application", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - } - }, - "description": "Basic properties of a Radius resource.", - "required": [ - "environment" - ] - }, - "DaprPubSubBrokerProperties": { - "type": "object", - "properties": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the Dapr PubSubBroker portable resource at the time the operation was called", + "description": "The status of the asynchronous operation.", "readOnly": true }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "componentName": { + "type": "string", + "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", + "readOnly": true }, "metadata": { - "$ref": "#/definitions/object", - "description": "Metadata for the Dapr PubSubBroker resource. This should match the values specified in Dapr component spec" + "type": "object", + "description": "The metadata for Dapr resource which must match the values specified in Dapr component spec", + "properties": {} }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Dapr PubSubBroker portable resource" + "type": { + "type": "string", + "description": "Dapr component type which must matches the format used by Dapr Kubernetes configuration format" + }, + "version": { + "type": "string", + "description": "Dapr component version" }, "resources": { "type": "array", + "description": "A collection of references to resources associated with the pubSubBroker", "items": { "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "A collection of references to resources associated with the Dapr PubSubBroker" + } }, - "type": { - "type": "string", - "description": "Dapr PubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format." + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" }, - "version": { - "type": "string", - "description": "Dapr component version" + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "Dapr PubSubBroker portable resource properties", - "allOf": [ - { - "$ref": "#/definitions/BasicDaprResourceProperties" - } + "required": [ + "environment" ] }, "DaprPubSubBrokerResource": { "type": "object", + "description": "PubSubBroker portable resource", "properties": { "properties": { "$ref": "#/definitions/DaprPubSubBrokerProperties", @@ -748,7 +1027,6 @@ ] } }, - "description": "Dapr PubSubBroker portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -757,65 +1035,140 @@ }, "DaprPubSubBrokerResourceListResult": { "type": "object", + "description": "The response of a DaprPubSubBrokerResource list operation.", "properties": { "value": { "type": "array", + "description": "The DaprPubSubBrokerResource items on this page", "items": { "$ref": "#/definitions/DaprPubSubBrokerResource" - }, - "x-cadl-name": "DaprPubSubBrokerResource[]", - "description": "The DaprPubSubBrokerResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a DaprPubSubBrokerResource list operation.", "required": [ "value" ] }, + "DaprPubSubBrokerResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the DaprPubSubBrokerResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/DaprPubSubBrokerResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "DaprPubSubBrokerResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the DaprPubSubBrokerResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "metadata": { + "type": "object", + "description": "The metadata for Dapr resource which must match the values specified in Dapr component spec", + "properties": {} + }, + "type": { + "type": "string", + "description": "Dapr component type which must matches the format used by Dapr Kubernetes configuration format" + }, + "version": { + "type": "string", + "description": "Dapr component version" + }, + "resources": { + "type": "array", + "description": "A collection of references to resources associated with the pubSubBroker", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, "DaprSecretStoreProperties": { "type": "object", + "description": "DaprSecretStore portable resource properties", "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the dapr secret store portable resource at the time the operation was called", + "description": "The status of the asynchronous operation.", "readOnly": true }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "componentName": { + "type": "string", + "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", + "readOnly": true + }, + "metadata": { + "type": "object", + "description": "The metadata for Dapr resource which must match the values specified in Dapr component spec", + "properties": {} + }, "type": { "type": "string", - "description": "Dapr SecretStore type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/" + "description": "Dapr component type which must matches the format used by Dapr Kubernetes configuration format" }, "version": { "type": "string", "description": "Dapr component version" }, - "metadata": { - "$ref": "#/definitions/object", - "description": "Metadata for the Dapr SecretStore resource. This should match the values specified in Dapr component spec" - }, "recipe": { "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Dapr SecretStore portable resource" + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" }, "resourceProvisioning": { "$ref": "#/definitions/ResourceProvisioning", "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "Dapr SecretStore portable resource properties", - "allOf": [ - { - "$ref": "#/definitions/BasicDaprResourceProperties" - } + "required": [ + "environment" ] }, "DaprSecretStoreResource": { "type": "object", + "description": "DaprSecretStore portable resource", "properties": { "properties": { "$ref": "#/definitions/DaprSecretStoreProperties", @@ -827,7 +1180,6 @@ ] } }, - "description": "Dapr SecretStore portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -836,73 +1188,140 @@ }, "DaprSecretStoreResourceListResult": { "type": "object", + "description": "The response of a DaprSecretStoreResource list operation.", "properties": { "value": { "type": "array", + "description": "The DaprSecretStoreResource items on this page", "items": { "$ref": "#/definitions/DaprSecretStoreResource" - }, - "x-cadl-name": "DaprSecretStoreResource[]", - "description": "The DaprSecretStoreResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a DaprSecretStoreResource list operation.", "required": [ "value" ] }, + "DaprSecretStoreResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the DaprSecretStoreResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/DaprSecretStoreResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "DaprSecretStoreResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the DaprSecretStoreResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "metadata": { + "type": "object", + "description": "The metadata for Dapr resource which must match the values specified in Dapr component spec", + "properties": {} + }, + "type": { + "type": "string", + "description": "Dapr component type which must matches the format used by Dapr Kubernetes configuration format" + }, + "version": { + "type": "string", + "description": "Dapr component version" + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, "DaprStateStoreProperties": { "type": "object", + "description": "StateStore portable resource properties", "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the DaprStateStore portable resource at the time the operation was called", + "description": "The status of the asynchronous operation.", "readOnly": true }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "componentName": { + "type": "string", + "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", + "readOnly": true }, "metadata": { - "$ref": "#/definitions/object", - "description": "Metadata for the Dapr StateStore resource. This should match the values specified in Dapr component spec" + "type": "object", + "description": "The metadata for Dapr resource which must match the values specified in Dapr component spec", + "properties": {} }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Dapr StateStore portable resource" + "type": { + "type": "string", + "description": "Dapr component type which must matches the format used by Dapr Kubernetes configuration format" + }, + "version": { + "type": "string", + "description": "Dapr component version" }, "resources": { "type": "array", + "description": "A collection of references to resources associated with the state store", "items": { "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "A collection of references to resources associated with the Dapr StateStore" + } }, - "type": { - "type": "string", - "description": "Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format." + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" }, - "version": { - "type": "string", - "description": "Dapr component version" + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "Dapr StateStore portable resource properties", - "allOf": [ - { - "$ref": "#/definitions/BasicDaprResourceProperties" - } + "required": [ + "environment" ] }, "DaprStateStoreResource": { "type": "object", + "description": "StateStore portable resource", "properties": { "properties": { "$ref": "#/definitions/DaprStateStoreProperties", @@ -914,7 +1333,6 @@ ] } }, - "description": "Dapr StateStore portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -923,36 +1341,187 @@ }, "DaprStateStoreResourceListResult": { "type": "object", + "description": "The response of a DaprStateStoreResource list operation.", "properties": { "value": { "type": "array", + "description": "The DaprStateStoreResource items on this page", "items": { "$ref": "#/definitions/DaprStateStoreResource" - }, - "x-cadl-name": "DaprStateStoreResource[]", - "description": "The DaprStateStoreResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a DaprStateStoreResource list operation.", "required": [ "value" ] }, - "OutputResource": { + "DaprStateStoreResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the DaprStateStoreResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/DaprStateStoreResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "DaprStateStoreResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the DaprStateStoreResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "metadata": { + "type": "object", + "description": "The metadata for Dapr resource which must match the values specified in Dapr component spec", + "properties": {} + }, + "type": { + "type": "string", + "description": "Dapr component type which must matches the format used by Dapr Kubernetes configuration format" + }, + "version": { + "type": "string", + "description": "Dapr component version" + }, + "resources": { + "type": "array", + "description": "A collection of references to resources associated with the state store", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, + "EnvironmentCompute": { + "type": "object", + "description": "Represents backing compute resource", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { "type": "object", - "properties": {}, - "description": "Properties of an output resource." + "description": "IdentitySettings is the external identity setting.", + "properties": { + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" + }, + "oidcIssuer": { + "type": "string", + "description": "The URI for your compute platform's OIDC issuer" + }, + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" + } + }, + "required": [ + "kind" + ] }, - "Parameters": { + "KubernetesCompute": { "type": "object", - "properties": {}, - "description": "Key/value parameters to pass into the recipe at deployment" + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, + "OutputResource": { + "type": "object", + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } }, "ProvisioningState": { "type": "string", @@ -968,26 +1537,80 @@ ], "x-ms-enum": { "name": "ProvisioningState", - "modelAsString": true - } + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true }, "Recipe": { "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a link", "properties": { "name": { "type": "string", "description": "The name of the recipe within the environment to use" }, "parameters": { - "$ref": "#/definitions/Parameters", - "description": "Key/value parameters to pass into the recipe at deployment" + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} } }, - "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "required": [ "name" ] }, + "RecipeUpdate": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + } + }, "ResourceProvisioning": { "type": "string", "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", @@ -997,52 +1620,81 @@ ], "x-ms-enum": { "name": "ResourceProvisioning", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "recipe", + "value": "recipe", + "description": "The resource lifecycle will be managed by Radius" + }, + { + "name": "manual", + "value": "manual", + "description": "The resource lifecycle will be managed by the user" + } + ] } }, "ResourceReference": { "type": "object", + "description": "Describes a reference to an existing resource", "properties": { "id": { "type": "string", "description": "Resource id of an existing resource" } }, - "description": "Describes a reference to an existing resource", "required": [ "id" ] }, "ResourceStatus": { "type": "object", + "description": "Status of a resource.", "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, "outputResources": { "type": "array", + "description": "Properties of an output resource", "items": { "$ref": "#/definitions/OutputResource" }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" + "x-ms-identifiers": [] } - }, - "description": "Status of a resource." + } }, - "object": { - "type": "object", - "properties": {} + "Versions": { + "type": "string", + "description": "Supported API versions for the Applications.Dapr resource provider.", + "enum": [ + "2022-03-15-privatepreview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_03_15_privatepreview", + "value": "2022-03-15-privatepreview", + "description": "2022-03-15-privatepreview" + } + ] + } } }, "parameters": { - "RootScopeParam": { + "RootScopeParameter": { "name": "rootScope", "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", "required": true, - "description": "The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "type": "string", "minLength": 1, "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true, - "type": "string" + "x-ms-skip-url-encoding": true } } } diff --git a/typespec/Applications.Dapr/common.tsp b/typespec/Applications.Dapr/common.tsp new file mode 100644 index 0000000000..c1543172d1 --- /dev/null +++ b/typespec/Applications.Dapr/common.tsp @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; + +using OpenAPI; + +@doc("The base properties of a Dapr component object.") +model DaprResourceProperties { + @doc("The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.") + @visibility("read") + componentName?: string; + + @doc("The metadata for Dapr resource which must match the values specified in Dapr component spec") + metadata?: {}; + + #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property" + @doc("Dapr component type which must matches the format used by Dapr Kubernetes configuration format") + type?: string; + + @doc("Dapr component version") + version?: string; +} diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdate.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdate.json new file mode 100644 index 0000000000..bcc72c4ab8 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdate.json @@ -0,0 +1,77 @@ +{ + "operationId": "PubSubBrokers_CreateOrUpdate", + "title": "Create or update a PubSubBroker resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview", + "PubSubBrokerParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdateWithRecipe.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdateWithRecipe.json new file mode 100644 index 0000000000..83391aca67 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_CreateOrUpdateWithRecipe.json @@ -0,0 +1,66 @@ +{ + "operationId": "PubSubBrokers_CreateOrUpdate", + "title": "Create or update a PubSubBroker resource with recipe", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview", + "PubSubBrokerParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "recipe", + "type": "pubsub.azure.servicebus", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "recipe", + "type": "pubsub.azure.servicebus", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Delete.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Delete.json new file mode 100644 index 0000000000..be9fe77463 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "PubSubBrokers_Delete", + "title": "Delete a PubSubBroker resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Get.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Get.json new file mode 100644 index 0000000000..eaaad281b0 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Get.json @@ -0,0 +1,35 @@ +{ + "operationId": "PubSubBrokers_Get", + "title": "Get a PubSubBroker resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "pubSubBrokerName": "daprpubsub0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_List.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_List.json new file mode 100644 index 0000000000..28213b5b37 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_List.json @@ -0,0 +1,73 @@ +{ + "operationId": "PubSubBrokers_ListByScope", + "title": "List a PubSubBroker resource by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub0", + "name": "daprPubSub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub1", + "name": "daprPubSub1", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "pubsub.kafka", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub2", + "name": "daprPubSub2", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "pubsub-test", + "parameters": { + "port": 6081 + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_ListByRootScope.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_ListByRootScope.json new file mode 100644 index 0000000000..a10cf160c7 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_ListByRootScope.json @@ -0,0 +1,56 @@ +{ + "operationId": "PubSubBrokers_ListByScope", + "title": "List a PubSubBroker resource by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprPubSub0", + "name": "daprPubSub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Dapr/pubSubBrokers/daprPubSub1", + "name": "daprPubSub1", + "type": "Applications.Dapr/pubSubBrokers", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "pubsub.kafka", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Dapr/pubSubBrokers?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Update.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Update.json new file mode 100644 index 0000000000..f22de30773 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/PubSubBrokers_Update.json @@ -0,0 +1,77 @@ +{ + "operationId": "PubSubBrokers_Update", + "title": "Update a PubSubBroker resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "pubSubBrokerName": "daprpubsub0", + "api-version": "2022-03-15-privatepreview", + "PubSubBrokerParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/pubSubBrokers/daprpubsub0", + "name": "daprpubsub0", + "type": "Applications.Dapr/pubSubBrokers", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" + } + ], + "type": "pubsub.azure.servicebus", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json new file mode 100644 index 0000000000..7cdd6b3396 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_CreateOrUpdate.json @@ -0,0 +1,63 @@ +{ + "operationId": "SecretStores_CreateOrUpdate", + "title": "Create or update an SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "daprsecretstore0", + "api-version": "2022-03-15-privatepreview", + "SecretStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "kind": "generic", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore1", + "name": "daprSecretStore1", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Delete.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Delete.json new file mode 100644 index 0000000000..d00bd593fe --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "SecretStores_Delete", + "title": "Delete a SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "daprsecretstore0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Get.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Get.json new file mode 100644 index 0000000000..38340c89f7 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Get.json @@ -0,0 +1,30 @@ +{ + "operationId": "SecretStores_Get", + "title": "Get a SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "secretStoreName": "daprsecretstore0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprsecretstore0", + "name": "daprsecretstore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_List.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_List.json new file mode 100644 index 0000000000..4c2a74ee3e --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_List.json @@ -0,0 +1,51 @@ +{ + "operationId": "SecretStores_ListByScope", + "title": "List SecretStore resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_ListByRootScope.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_ListByRootScope.json new file mode 100644 index 0000000000..b66685650b --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_ListByRootScope.json @@ -0,0 +1,51 @@ +{ + "operationId": "SecretStores_ListByScope", + "title": "List SecretStore resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Dapr/secretStores?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Update.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Update.json new file mode 100644 index 0000000000..974e788940 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/SecretStores_Update.json @@ -0,0 +1,63 @@ +{ + "operationId": "SecretStores_Update", + "title": "Update an SecretStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "secretStoreName": "daprsecretstore0", + "api-version": "2022-03-15-privatepreview", + "SecretStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore0", + "name": "daprSecretStore0", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "kind": "generic", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/secretStores/daprSecretStore1", + "name": "daprSecretStore1", + "type": "Applications.Dapr/secretStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "secretstores.hashicorp.vault", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdate.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdate.json new file mode 100644 index 0000000000..48912c2186 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdate.json @@ -0,0 +1,73 @@ +{ + "operationId": "StateStores_CreateOrUpdate", + "title": "Create or update a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview", + "StateStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "kind": "state.sqlserver", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdateWithRecipe.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdateWithRecipe.json new file mode 100644 index 0000000000..df781c63f4 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_CreateOrUpdateWithRecipe.json @@ -0,0 +1,55 @@ +{ + "operationId": "StateStores_CreateOrUpdate", + "title": "Create or update a StateStore resource with recipe", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview", + "StateStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "recipe-test" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", + "name": "daprstatestore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "kind": "state.sqlserver", + "recipe": { + "name": "recipe-test" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", + "name": "daprstatestore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "recipe": { + "name": "recipe-test" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Delete.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Delete.json new file mode 100644 index 0000000000..f65fe45f3a --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "StateStores_Delete", + "title": "Delete a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Get.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Get.json new file mode 100644 index 0000000000..f3c635f3ae --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Get.json @@ -0,0 +1,26 @@ +{ + "operationId": "StateStores_Get", + "title": "Get a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "stateStoreName": "daprstatestore0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/daprstatestore0", + "name": "daprstatestore0", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_List.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_List.json new file mode 100644 index 0000000000..c6a84c66f8 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_List.json @@ -0,0 +1,92 @@ +{ + "operationId": "StateStores_ListByScope", + "title": "List StateStore resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore2", + "name": "stateStore2", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore3", + "name": "stateStore3", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "recipe-test" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_ListByRootScope.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_ListByRootScope.json new file mode 100644 index 0000000000..faa2d33d60 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_ListByRootScope.json @@ -0,0 +1,78 @@ +{ + "operationId": "StateStores_ListByScope", + "title": "List StateStore resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore2", + "name": "stateStore2", + "type": "Applications.Dapr/stateStores", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Dapr/stateStores?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Update.json b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Update.json new file mode 100644 index 0000000000..a93dca0ae8 --- /dev/null +++ b/typespec/Applications.Dapr/examples/2022-03-15-privatepreview/StateStores_Update.json @@ -0,0 +1,73 @@ +{ + "operationId": "StateStores_Update", + "title": "Update a StateStore resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "stateStoreName": "daprstatestore0", + "api-version": "2022-03-15-privatepreview", + "StateStoreParameters": { + "location": "West US", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore0", + "name": "stateStore0", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "kind": "state.sqlserver", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Dapr/stateStores/stateStore1", + "name": "stateStore1", + "type": "Applications.Dapr/stateStores", + "location": "West US", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable" + } + ], + "type": "state.zookeeper", + "version": "v1", + "metadata": { + "foo": "bar" + }, + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Dapr/main.tsp b/typespec/Applications.Dapr/main.tsp new file mode 100644 index 0000000000..5a31245fa5 --- /dev/null +++ b/typespec/Applications.Dapr/main.tsp @@ -0,0 +1,43 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-resource-manager"; + +import "./secretStores.tsp"; +import "./stateStores.tsp"; +import "./pubSubBrokers.tsp"; + +using TypeSpec.Versioning; +using Azure.ResourceManager; + +@armProviderNamespace +@service({ + title: "Applications.Dapr Resource Management APIs", +}) +@doc("REST API for Applications.Dapr") +@versioned(Versions) +namespace Applications.Dapr; + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Supported API versions for the Applications.Dapr resource provider.") +enum Versions { + @doc("2022-03-15-privatepreview") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2022_03_15_privatepreview: "2022-03-15-privatepreview", +} diff --git a/typespec/Applications.Dapr/pubSubBrokers.tsp b/typespec/Applications.Dapr/pubSubBrokers.tsp new file mode 100644 index 0000000000..6fee307bc0 --- /dev/null +++ b/typespec/Applications.Dapr/pubSubBrokers.tsp @@ -0,0 +1,88 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Dapr; + +@doc("PubSubBroker portable resource") +model DaprPubSubBrokerResource is TrackedResource { + @doc("PubSubBroker name") + @key("pubSubBrokerName") + @path + @segment("pubSubBrokers") + name: ResourceNameString; +} + +@doc("PubSubBroker portable resource properties") +model DaprPubSubBrokerProperties { + ...EnvironmentScopedResource; + ...DaprResourceProperties; + + @doc("A collection of references to resources associated with the pubSubBroker") + resources?: ResourceReference[]; + + ...RecipeBaseProperties; +} + +@armResourceOperations +interface PubSubBrokers { + get is ArmResourceRead< + DaprPubSubBrokerResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + DaprPubSubBrokerResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + DaprPubSubBrokerResource, + DaprPubSubBrokerProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + DaprPubSubBrokerResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + DaprPubSubBrokerResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Applications.Dapr/secretStores.tsp b/typespec/Applications.Dapr/secretStores.tsp new file mode 100644 index 0000000000..80c2cf0e61 --- /dev/null +++ b/typespec/Applications.Dapr/secretStores.tsp @@ -0,0 +1,83 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Dapr; + +@doc("DaprSecretStore portable resource") +model DaprSecretStoreResource is TrackedResource { + @doc("SecretStore name") + @key("secretStoreName") + @path + @segment("secretStores") + name: ResourceNameString; +} + +@doc("DaprSecretStore portable resource properties") +model DaprSecretStoreProperties { + ...EnvironmentScopedResource; + ...DaprResourceProperties; + ...RecipeBaseProperties; +} + +@armResourceOperations +interface SecretStores { + get is ArmResourceRead< + DaprSecretStoreResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + DaprSecretStoreResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + DaprSecretStoreResource, + DaprSecretStoreProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + DaprSecretStoreResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + DaprSecretStoreResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Applications.Dapr/stateStores.tsp b/typespec/Applications.Dapr/stateStores.tsp new file mode 100644 index 0000000000..d0efbd0c82 --- /dev/null +++ b/typespec/Applications.Dapr/stateStores.tsp @@ -0,0 +1,87 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Dapr; + +@doc("StateStore portable resource") +model DaprStateStoreResource is TrackedResource { + @doc("StateStore name") + @key("stateStoreName") + @path + @segment("stateStores") + name: ResourceNameString; +} + +@doc("StateStore portable resource properties") +model DaprStateStoreProperties { + ...EnvironmentScopedResource; + ...DaprResourceProperties; + + @doc("A collection of references to resources associated with the state store") + resources?: ResourceReference[]; + + ...RecipeBaseProperties; +} + +@armResourceOperations +interface StateStores { + get is ArmResourceRead< + DaprStateStoreResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + DaprStateStoreResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + DaprStateStoreResource, + DaprStateStoreProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + DaprStateStoreResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + DaprStateStoreResource, + UCPBaseParameters, + "Scope", + "Scope" + >; +} diff --git a/typespec/Applications.Dapr/tspconfig.yaml b/typespec/Applications.Dapr/tspconfig.yaml new file mode 100644 index 0000000000..38f0dc630d --- /dev/null +++ b/typespec/Applications.Dapr/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + azure-resource-provider-folder: "resource-manager" + examples-directory: "examples" + emitter-output-dir: "{project-root}/../../swagger/specification/applications" + arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/radius/v1/resources.tsp b/typespec/radius/v1/resources.tsp index c86806d223..64912069e0 100644 --- a/typespec/radius/v1/resources.tsp +++ b/typespec/radius/v1/resources.tsp @@ -148,6 +148,15 @@ enum ProvisioningState { Accepted, } +@doc("The base properties of Recipe") +model RecipeBaseProperties { + @doc("The recipe used to automatically deploy underlying infrastructure for the resource") + recipe?: Recipe; + + @doc("Specifies how the underlying service/resource is provisioned and managed.") + resourceProvisioning?: ResourceProvisioning; +} + @doc("Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.") enum ResourceProvisioning { @doc("The resource lifecycle will be managed by Radius") From 3646778200ae0d44694279c43bcd8263866d778e Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 24 Aug 2023 19:01:46 -0700 Subject: [PATCH 11/57] Convert App.Datastores and App.Messaging Cadl to TypeSpec (#6121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This converts Applications.Datastores and Applications.Messaging Cadls to TypeSpec. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). #5350 ## Auto-generated summary ### 🤖 Generated by Copilot at dd9913c ### Summary No summary available (Limit exceeded: required to process 58394 tokens, but only 50000 are allowed per call) ### Walkthrough No walkthrough available (Limit exceeded: required to process 58394 tokens, but only 50000 are allowed per call) --- build/generate.mk | 4 +- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 2 +- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 12 +- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 68 +- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 32 +- hack/bicep-types-radius/generated/index.json | 2 +- .../zz_generated_models.go | 4 +- .../zz_generated_models.go | 16 +- .../v20220315privatepreview/datamodel_util.go | 21 + .../mongodatabase_conversion.go | 2 +- .../rediscache_conversion.go | 2 +- .../sqldatabase_conversion.go | 2 +- .../zz_generated_constants.go | 42 + .../zz_generated_models.go | 362 ++++- .../zz_generated_models_serde.go | 495 ++++++- .../zz_generated_mongodatabases_client.go | 174 ++- .../zz_generated_polymorphic_helpers.go | 30 + .../zz_generated_rediscaches_client.go | 205 ++- .../zz_generated_response_types.go | 39 +- .../zz_generated_sqldatabases_client.go | 206 ++- .../v20220315privatepreview/datamodel_util.go | 21 + .../rabbitmq_conversion.go | 2 +- .../zz_generated_constants.go | 42 + .../zz_generated_models.go | 187 ++- .../zz_generated_models_serde.go | 315 +++- .../zz_generated_polymorphic_helpers.go | 30 + .../zz_generated_rabbitmqqueues_client.go | 204 ++- .../zz_generated_response_types.go | 14 +- .../2022-03-15-privatepreview/openapi.json | 4 +- .../2022-03-15-privatepreview/openapi.json | 16 +- .../examples/MongoDatabasesPutRecipe.json | 60 - .../MongoDatabases_CreateOrUpdateRecipe.json | 62 + ... MongoDatabases_CreateOrUpdateValues.json} | 22 +- ...Delete.json => MongoDatabases_Delete.json} | 4 +- ...abasesGet.json => MongoDatabases_Get.json} | 10 +- ...asesList.json => MongoDatabases_List.json} | 20 +- ...on => MongoDatabases_ListByRootScope.json} | 20 +- ...s.json => MongoDatabases_ListSecrets.json} | 4 +- .../examples/MongoDatabases_Update.json | 65 + .../examples/RedisCachesList.json | 67 - .../examples/RedisCachesPutRecipe.json | 60 - .../examples/RedisCachesPutValues.json | 57 - ...e.json => RedisCaches_CreateOrUpdate.json} | 26 +- .../RedisCaches_CreateOrUpdateRecipe.json | 62 + .../RedisCaches_CreateOrUpdateValues.json | 59 + ...hesDelete.json => RedisCaches_Delete.json} | 4 +- ...disCachesGet.json => RedisCaches_Get.json} | 10 +- .../examples/RedisCaches_List.json | 69 + ....json => RedisCaches_ListByRootScope.json} | 22 +- ...rets.json => RedisCaches_ListSecrets.json} | 4 +- .../examples/RedisCaches_Update.json | 68 + .../examples/SQLDatabasesList.json | 65 - .../examples/SQLDatabasesPut.json | 50 - .../examples/SQLDatabases_CreateOrUpdate.json | 52 + ...esDelete.json => SQLDatabases_Delete.json} | 4 +- ...atabasesGet.json => SQLDatabases_Get.json} | 10 +- .../examples/SQLDatabases_List.json | 67 + ...json => SQLDatabases_ListByRootScope.json} | 22 +- .../examples/SQLDatabases_Update.json | 52 + .../2022-03-15-privatepreview/openapi.json | 1263 +++++++++++++---- .../2022-03-15-privatepreview/openapi.json | 885 ++++++++++++ .../examples/RabbitMQQueuesDelete.json | 13 - .../examples/RabbitMQQueuesGet.json | 28 - .../examples/RabbitMQQueuesList.json | 46 - .../RabbitMQQueuesListByRootScope.json | 49 - .../examples/RabbitMQQueuesListSecrets.json | 16 - .../examples/RabbitMQQueuesPut.json | 58 - .../2022-03-15-privatepreview/openapi.json | 541 +++++-- typespec/Applications.Dapr/pubSubBrokers.tsp | 4 +- typespec/Applications.Dapr/secretStores.tsp | 4 +- typespec/Applications.Dapr/stateStores.tsp | 4 +- typespec/Applications.Datastores/common.tsp | 19 + .../MongoDatabases_CreateOrUpdateRecipe.json | 62 + .../MongoDatabases_CreateOrUpdateValues.json | 65 + .../MongoDatabases_Delete.json | 14 + .../MongoDatabases_Get.json | 33 + .../MongoDatabases_List.json | 73 + .../MongoDatabases_ListByRootScope.json | 74 + .../MongoDatabases_ListSecrets.json | 18 + .../RedisCaches_CreateOrUpdate.json | 68 + .../RedisCaches_CreateOrUpdateRecipe.json | 62 + .../RedisCaches_CreateOrUpdateValues.json | 59 + .../RedisCaches_Delete.json | 14 + .../RedisCaches_Get.json | 33 + .../RedisCaches_List.json | 69 + .../RedisCaches_ListByRootScope.json | 68 + .../RedisCaches_ListSecrets.json | 19 + .../RedisCaches_Update.json | 68 + .../SQLDatabases_CreateOrUpdate.json | 52 + .../SQLDatabases_Delete.json | 14 + .../SQLDatabases_Get.json | 32 + .../SQLDatabases_List.json | 67 + .../SQLDatabases_ListByRootScope.json | 72 + .../SQLDatabases_ListSecrets.json | 19 + .../SQLDatabases_Update.json | 52 + typespec/Applications.Datastores/main.tsp | 43 + .../mongoDatabases.tsp | 124 ++ .../Applications.Datastores/redisCaches.tsp | 125 ++ .../Applications.Datastores/sqlDatabases.tsp | 123 ++ .../Applications.Datastores/tspconfig.yaml | 10 + typespec/Applications.Messaging/common.tsp | 19 + .../RabbitMQQueues_CreateOrUpdate.json | 59 + .../RabbitMQQueues_Delete.json | 14 + .../RabbitMQQueues_Get.json | 29 + .../RabbitMQQueues_List.json | 47 + .../RabbitMQQueues_ListByRootScope.json | 50 + .../RabbitMQQueues_ListSecrets.json | 17 + .../RabbitMQQueues_Update.json | 59 + typespec/Applications.Messaging/main.tsp | 41 + .../Applications.Messaging/rabbitMQQueues.tsp | 133 ++ .../Applications.Messaging/tspconfig.yaml | 10 + typespec/Test.Resource/main.tsp | 2 +- typespec/radius/v1/resources.tsp | 2 +- 117 files changed, 6988 insertions(+), 1616 deletions(-) create mode 100644 pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go create mode 100644 pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go delete mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateRecipe.json rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{MongoDatabasesPutValues.json => MongoDatabases_CreateOrUpdateValues.json} (53%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{MongoDatabasesDelete.json => MongoDatabases_Delete.json} (53%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{MongoDatabasesGet.json => MongoDatabases_Get.json} (57%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{MongoDatabasesList.json => MongoDatabases_List.json} (59%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{MongoDatabasesListByRootScope.json => MongoDatabases_ListByRootScope.json} (61%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{MongoDatabasesListSecrets.json => MongoDatabases_ListSecrets.json} (66%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{RedisCachesPutResource.json => RedisCaches_CreateOrUpdate.json} (52%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateRecipe.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateValues.json rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{RedisCachesDelete.json => RedisCaches_Delete.json} (53%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{RedisCachesGet.json => RedisCaches_Get.json} (56%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_List.json rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{RedisCachesListByRootScope.json => RedisCaches_ListByRootScope.json} (53%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{RedisCachesListSecrets.json => RedisCaches_ListSecrets.json} (69%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_CreateOrUpdate.json rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{SQLDatabasesDelete.json => SQLDatabases_Delete.json} (53%) rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{SQLDatabasesGet.json => SQLDatabases_Get.json} (55%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_List.json rename swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/{SQLDatabasesListByRootScope.json => SQLDatabases_ListByRootScope.json} (56%) create mode 100644 swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Update.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListSecrets.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesPut.json create mode 100644 typespec/Applications.Datastores/common.tsp create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateRecipe.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateValues.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Delete.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Get.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_List.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListByRootScope.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListSecrets.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdate.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateRecipe.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateValues.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Delete.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Get.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_List.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListByRootScope.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListSecrets.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Update.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_CreateOrUpdate.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Delete.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Get.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_List.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListByRootScope.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListSecrets.json create mode 100644 typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Update.json create mode 100644 typespec/Applications.Datastores/main.tsp create mode 100644 typespec/Applications.Datastores/mongoDatabases.tsp create mode 100644 typespec/Applications.Datastores/redisCaches.tsp create mode 100644 typespec/Applications.Datastores/sqlDatabases.tsp create mode 100644 typespec/Applications.Datastores/tspconfig.yaml create mode 100644 typespec/Applications.Messaging/common.tsp create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json create mode 100644 typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json create mode 100644 typespec/Applications.Messaging/main.tsp create mode 100644 typespec/Applications.Messaging/rabbitMQQueues.tsp create mode 100644 typespec/Applications.Messaging/tspconfig.yaml diff --git a/build/generate.mk b/build/generate.mk index e6199fb709..5ab7eeaafb 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -42,12 +42,12 @@ generate-openapi-spec: @echo "Generating openapi specs from cadl models." cd cadl/Applications.Link && npx$(CMD_EXT) cadl compile . cd cadl/UCP && npx$(CMD_EXT) cadl compile . - cd cadl/Applications.Messaging && npx$(CMD_EXT) cadl compile . - cd cadl/Applications.Datastores && npx$(CMD_EXT) cadl compile . @echo "Generating openapi specs from typespec models." cd typespec/Applications.Core && npx$(CMD_EXT) tsp compile . cd typespec/Applications.Dapr && npx$(CMD_EXT) tsp compile . + cd typespec/Applications.Messaging && npx$(CMD_EXT) tsp compile . + cd typespec/Applications.Datastores && npx$(CMD_EXT) tsp compile . .PHONY: generate-node-installed generate-node-installed: diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index 61a66f7e57..89d578a0dd 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":105,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":107,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":108,"Flags":10,"Description":"The resource api version"},"properties":{"Type":110,"Flags":0,"Description":"Environment properties"},"tags":{"Type":130,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":118,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":119,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":128,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":129,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[111,112,113,114,115,116,117]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":120,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":121,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":123,"terraform":125}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":124,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":122}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":127}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":109}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":132,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":133,"Flags":10,"Description":"The resource api version"},"properties":{"Type":135,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":148,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":143,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":144,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":147,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[136,137,138,139,140,141,142]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[145,146]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":134}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":150,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":151,"Flags":10,"Description":"The resource api version"},"properties":{"Type":153,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":169,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":161,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":162,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":164,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":165,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[154,155,156,157,158,159,160]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":163}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":168,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[166,167]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":152}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":171,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":172,"Flags":10,"Description":"The resource api version"},"properties":{"Type":174,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":183,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":182,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[175,176,177,178,179,180,181]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":173}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":185,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":186,"Flags":10,"Description":"The resource api version"},"properties":{"Type":188,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":206,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":196,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":199,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":205,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[189,190,191,192,193,194,195]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[197,198]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":203,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":204,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[201,202]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":200}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":187}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":208,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":209,"Flags":10,"Description":"The resource api version"},"properties":{"Type":211,"Flags":0,"Description":"Volume properties"},"tags":{"Type":243,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":219,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":220}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[212,213,214,215,216,217,218]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":233,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":235,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":241,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":242,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":225,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":228,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":232,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[222,223,224]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[226,227]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":221}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":240,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[237,238,239]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":236}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":210}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":249,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":250,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[247,248]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":200}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":246,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":105,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":107,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":108,"Flags":10,"Description":"The resource api version"},"properties":{"Type":110,"Flags":0,"Description":"Environment properties"},"tags":{"Type":130,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":118,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":119,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":128,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":129,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[111,112,113,114,115,116,117]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":120,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":121,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":123,"terraform":125}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":124,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":122}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":127}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":109}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":132,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":133,"Flags":10,"Description":"The resource api version"},"properties":{"Type":135,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":148,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":143,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":144,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":147,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[136,137,138,139,140,141,142]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[145,146]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":134}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":150,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":151,"Flags":10,"Description":"The resource api version"},"properties":{"Type":153,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":169,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":161,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":162,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":164,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":165,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[154,155,156,157,158,159,160]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":163}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":168,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[166,167]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":152}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":171,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":172,"Flags":10,"Description":"The resource api version"},"properties":{"Type":174,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":183,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":182,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[175,176,177,178,179,180,181]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":173}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":185,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":186,"Flags":10,"Description":"The resource api version"},"properties":{"Type":188,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":206,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":196,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":199,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":205,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[189,190,191,192,193,194,195]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[197,198]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":203,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":204,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[201,202]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":200}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":187}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":208,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":209,"Flags":10,"Description":"The resource api version"},"properties":{"Type":211,"Flags":0,"Description":"Volume properties"},"tags":{"Type":243,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":219,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":220}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[212,213,214,215,216,217,218]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":233,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":235,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":241,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":242,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":225,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":228,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":232,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[222,223,224]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[226,227]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":221}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":240,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[237,238,239]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":236}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":210}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":249,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":250,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[247,248]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":200}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":246,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index a0cf1d6557..97d9686c9e 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -369,7 +369,7 @@ * **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **secrets**: any: Any object * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. diff --git a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json index ecb38ea173..f1553f9ea4 100644 --- a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Dapr/pubSubBrokers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/pubSubBrokers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"PubSubBroker portable resource properties"},"tags":{"Type":36,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprPubSubBrokerProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"resources":{"Type":31,"Flags":0,"Description":"A collection of references to resources associated with the pubSubBroker"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":35,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":21,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":29,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":22,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":26}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":25,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[23,24]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":27,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":28}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":30}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[33,34]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":42,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":47,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[38,39,40,41]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[43,44,45,46]}},{"4":{"Name":"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Dapr/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":49,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":50,"Flags":10,"Description":"The resource api version"},"properties":{"Type":52,"Flags":0,"Description":"DaprSecretStore portable resource properties"},"tags":{"Type":64,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprSecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":60,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":63,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[53,54,55,56,57,58,59]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[61,62]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":51}},{"6":{"Value":"Applications.Dapr/stateStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/stateStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":66,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":67,"Flags":10,"Description":"The resource api version"},"properties":{"Type":69,"Flags":0,"Description":"StateStore portable resource properties"},"tags":{"Type":82,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprStateStoreProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":77,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"resources":{"Type":78,"Flags":0,"Description":"A collection of references to resources associated with the state store"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":81,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[70,71,72,73,74,75,76]}},{"3":{"ItemType":30}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[79,80]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/stateStores@2022-03-15-privatepreview","ScopeType":0,"Body":68}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Dapr/pubSubBrokers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/pubSubBrokers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Dapr PubSubBroker portable resource properties"},"tags":{"Type":36,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprPubSubBrokerProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"resources":{"Type":31,"Flags":0,"Description":"A collection of references to resources associated with the pubSubBroker"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":35,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":21,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":29,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":22,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":26}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":25,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[23,24]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":27,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":28}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":30}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[33,34]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":42,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":47,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[38,39,40,41]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[43,44,45,46]}},{"4":{"Name":"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Dapr/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":49,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":50,"Flags":10,"Description":"The resource api version"},"properties":{"Type":52,"Flags":0,"Description":"Dapr SecretStore portable resource properties"},"tags":{"Type":64,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprSecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":60,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":63,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[53,54,55,56,57,58,59]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[61,62]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":51}},{"6":{"Value":"Applications.Dapr/stateStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Dapr/stateStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":66,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":67,"Flags":10,"Description":"The resource api version"},"properties":{"Type":69,"Flags":0,"Description":"Dapr StateStore portable resource properties"},"tags":{"Type":82,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":37,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprStateStoreProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":77,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"type":{"Type":4,"Flags":0,"Description":"Dapr component type which must matches the format used by Dapr Kubernetes configuration format"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"resources":{"Type":78,"Flags":0,"Description":"A collection of references to resources associated with the state store"},"recipe":{"Type":32,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":81,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[70,71,72,73,74,75,76]}},{"3":{"ItemType":30}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[79,80]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Dapr/stateStores@2022-03-15-privatepreview","ScopeType":0,"Body":68}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md index 66b0339e4b..7eb90e7ee1 100644 --- a/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.dapr/2022-03-15-privatepreview/types.md @@ -7,7 +7,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprPubSubBrokerProperties](#daprpubsubbrokerproperties): PubSubBroker portable resource properties +* **properties**: [DaprPubSubBrokerProperties](#daprpubsubbrokerproperties): Dapr PubSubBroker portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Dapr/pubSubBrokers' (ReadOnly, DeployTimeConstant): The resource type @@ -19,7 +19,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprSecretStoreProperties](#daprsecretstoreproperties): DaprSecretStore portable resource properties +* **properties**: [DaprSecretStoreProperties](#daprsecretstoreproperties): Dapr SecretStore portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Dapr/secretStores' (ReadOnly, DeployTimeConstant): The resource type @@ -31,7 +31,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprStateStoreProperties](#daprstatestoreproperties): StateStore portable resource properties +* **properties**: [DaprStateStoreProperties](#daprstatestoreproperties): Dapr StateStore portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Dapr/stateStores' (ReadOnly, DeployTimeConstant): The resource type @@ -43,7 +43,7 @@ * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **metadata**: any: Any object * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the pubSubBroker * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. @@ -109,7 +109,7 @@ * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **metadata**: any: Any object * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. * **type**: string: Dapr component type which must matches the format used by Dapr Kubernetes configuration format @@ -127,7 +127,7 @@ * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **metadata**: any: Any object * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link +* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the state store * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. diff --git a/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.json index 0034117fb4..63ac3ae3a4 100644 --- a/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Datastores/mongoDatabases"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Datastores/mongoDatabases","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Mongo database portable resource properties"},"tags":{"Type":29,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":30,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"MongoDatabaseProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"secrets":{"Type":20,"Flags":0,"Description":"The secret values for the given Mongo database resource"},"host":{"Type":4,"Flags":0,"Description":"Host name of the target Mongo database"},"port":{"Type":3,"Flags":0,"Description":"Port value of the target Mongo database"},"database":{"Type":4,"Flags":0,"Description":"Database name of the target Mongo database"},"recipe":{"Type":21,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resources":{"Type":23,"Flags":0,"Description":"List of the resource IDs that support the Mongo database resource"},"resourceProvisioning":{"Type":26,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"username":{"Type":4,"Flags":0,"Description":"Username to use when connecting to the target Mongo database"},"status":{"Type":27,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"MongoDatabaseSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"Password to use when connecting to the target Mongo database"},"connectionString":{"Type":4,"Flags":0,"Description":"Connection string used to connect to the target Mongo database"}}}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":22}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[24,25]}},{"2":{"Name":"ResourceStatus","Properties":{"outputResources":{"Type":28,"Flags":0,"Description":"Properties of an output resource"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":35,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":40,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[31,32,33,34]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[36,37,38,39]}},{"4":{"Name":"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Datastores/redisCaches"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Datastores/redisCaches","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":42,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":43,"Flags":10,"Description":"The resource api version"},"properties":{"Type":45,"Flags":0,"Description":"Redis cache portable resource properties"},"tags":{"Type":59,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":30,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"RedisCacheProperties","Properties":{"provisioningState":{"Type":53,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"secrets":{"Type":54,"Flags":0,"Description":"The secret values for the given Redis cache resource"},"host":{"Type":4,"Flags":0,"Description":"The host name of the target Redis cache"},"port":{"Type":3,"Flags":0,"Description":"The port value of the target Redis cache"},"username":{"Type":4,"Flags":0,"Description":"The username for Redis cache"},"tls":{"Type":2,"Flags":0,"Description":"Specifies whether to enable SSL connections to the Redis cache"},"recipe":{"Type":21,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resources":{"Type":55,"Flags":0,"Description":"List of the resource IDs that support the Redis resource"},"resourceProvisioning":{"Type":58,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"status":{"Type":27,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[46,47,48,49,50,51,52]}},{"2":{"Name":"RedisCacheSecrets","Properties":{"connectionString":{"Type":4,"Flags":0,"Description":"The connection string used to connect to the Redis cache"},"password":{"Type":4,"Flags":0,"Description":"The password for this Redis cache instance"},"url":{"Type":4,"Flags":0,"Description":"The URL used to connect to the Redis cache"}}}},{"3":{"ItemType":22}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[56,57]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Datastores/redisCaches@2022-03-15-privatepreview","ScopeType":0,"Body":44}},{"6":{"Value":"Applications.Datastores/sqlDatabases"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Datastores/sqlDatabases","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":61,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":62,"Flags":10,"Description":"The resource api version"},"properties":{"Type":64,"Flags":0,"Description":"Sql database properties"},"tags":{"Type":78,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":30,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SqlDatabaseProperties","Properties":{"provisioningState":{"Type":72,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"database":{"Type":4,"Flags":0,"Description":"The name of the SQL database."},"server":{"Type":4,"Flags":0,"Description":"The fully qualified domain name of the target SQL database."},"port":{"Type":3,"Flags":0,"Description":"Port value of the target SQL database"},"username":{"Type":4,"Flags":0,"Description":"Username to use when connecting to the target SQL database"},"recipe":{"Type":21,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resources":{"Type":73,"Flags":0,"Description":"List of the resource IDs that support the SQL database resource"},"resourceProvisioning":{"Type":76,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"secrets":{"Type":77,"Flags":0,"Description":"The secret values for the given SQL database resource"},"status":{"Type":27,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[65,66,67,68,69,70,71]}},{"3":{"ItemType":22}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[74,75]}},{"2":{"Name":"SqlDatabaseSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"Password to use when connecting to the target SQL database"},"connectionString":{"Type":4,"Flags":0,"Description":"Connection string used to connect to the target SQL database"}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview","ScopeType":0,"Body":63}},{"2":{"Name":"MongoDatabaseListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"Password to use when connecting to the target Mongo database"},"connectionString":{"Type":4,"Flags":2,"Description":"Connection string used to connect to the target Mongo database"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Datastores/mongoDatabases","ApiVersion":"2022-03-15-privatepreview","Output":80}},{"2":{"Name":"RedisCacheListSecretsResult","Properties":{"connectionString":{"Type":4,"Flags":2,"Description":"The connection string used to connect to the Redis cache"},"password":{"Type":4,"Flags":2,"Description":"The password for this Redis cache instance"},"url":{"Type":4,"Flags":2,"Description":"The URL used to connect to the Redis cache"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Datastores/redisCaches","ApiVersion":"2022-03-15-privatepreview","Output":82}},{"2":{"Name":"SqlDatabaseListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"Password to use when connecting to the target SQL database"},"connectionString":{"Type":4,"Flags":2,"Description":"Connection string used to connect to the target SQL database"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Datastores/sqlDatabases","ApiVersion":"2022-03-15-privatepreview","Output":84}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Datastores/mongoDatabases"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Datastores/mongoDatabases","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"MongoDatabase portable resource properties"},"tags":{"Type":37,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":38,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"MongoDatabaseProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":30,"Flags":0,"Description":"The secret values for the given MongoDatabase resource"},"host":{"Type":4,"Flags":0,"Description":"Host name of the target Mongo database"},"port":{"Type":3,"Flags":0,"Description":"Port value of the target Mongo database"},"database":{"Type":4,"Flags":0,"Description":"Database name of the target Mongo database"},"resources":{"Type":32,"Flags":0,"Description":"List of the resource IDs that support the MongoDB resource"},"username":{"Type":4,"Flags":0,"Description":"Username to use when connecting to the target Mongo database"},"recipe":{"Type":33,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":36,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":21,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":29,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":22,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":26}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":25,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[23,24]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":27,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":28}},{"2":{"Name":"MongoDatabaseSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"Password to use when connecting to the target Mongo database"},"connectionString":{"Type":4,"Flags":0,"Description":"Connection string used to connect to the target Mongo database"}}}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":31}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[34,35]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":43,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":48,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[39,40,41,42]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[44,45,46,47]}},{"4":{"Name":"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Datastores/redisCaches"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Datastores/redisCaches","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":50,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":51,"Flags":10,"Description":"The resource api version"},"properties":{"Type":53,"Flags":0,"Description":"RedisCache portable resource properties"},"tags":{"Type":67,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":38,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"RedisCacheProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":61,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":62,"Flags":0,"Description":"The secret values for the given RedisCache resource"},"host":{"Type":4,"Flags":0,"Description":"The host name of the target Redis cache"},"port":{"Type":3,"Flags":0,"Description":"The port value of the target Redis cache"},"username":{"Type":4,"Flags":0,"Description":"The username for Redis cache"},"tls":{"Type":2,"Flags":0,"Description":"Specifies whether to enable SSL connections to the Redis cache"},"resources":{"Type":63,"Flags":0,"Description":"List of the resource IDs that support the Redis resource"},"recipe":{"Type":33,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":66,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[54,55,56,57,58,59,60]}},{"2":{"Name":"RedisCacheSecrets","Properties":{"connectionString":{"Type":4,"Flags":0,"Description":"The connection string used to connect to the Redis cache"},"password":{"Type":4,"Flags":0,"Description":"The password for this Redis cache instance"},"url":{"Type":4,"Flags":0,"Description":"The URL used to connect to the Redis cache"}}}},{"3":{"ItemType":31}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[64,65]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Datastores/redisCaches@2022-03-15-privatepreview","ScopeType":0,"Body":52}},{"6":{"Value":"Applications.Datastores/sqlDatabases"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Datastores/sqlDatabases","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":69,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":70,"Flags":10,"Description":"The resource api version"},"properties":{"Type":72,"Flags":0,"Description":"SqlDatabase properties"},"tags":{"Type":86,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":38,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SqlDatabaseProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":80,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"database":{"Type":4,"Flags":0,"Description":"The name of the Sql database."},"server":{"Type":4,"Flags":0,"Description":"The fully qualified domain name of the Sql database."},"port":{"Type":3,"Flags":0,"Description":"Port value of the target Sql database"},"username":{"Type":4,"Flags":0,"Description":"Username to use when connecting to the target Sql database"},"resources":{"Type":81,"Flags":0,"Description":"List of the resource IDs that support the SqlDatabase resource"},"secrets":{"Type":82,"Flags":0,"Description":"The secret values for the given SqlDatabase resource"},"recipe":{"Type":33,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":85,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[73,74,75,76,77,78,79]}},{"3":{"ItemType":31}},{"2":{"Name":"SqlDatabaseSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"Password to use when connecting to the target Sql database"},"connectionString":{"Type":4,"Flags":0,"Description":"Connection string used to connect to the target Sql database"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[83,84]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview","ScopeType":0,"Body":71}},{"2":{"Name":"MongoDatabaseListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"Password to use when connecting to the target Mongo database"},"connectionString":{"Type":4,"Flags":2,"Description":"Connection string used to connect to the target Mongo database"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Datastores/mongoDatabases","ApiVersion":"2022-03-15-privatepreview","Output":88,"Input":0}},{"2":{"Name":"RedisCacheListSecretsResult","Properties":{"connectionString":{"Type":4,"Flags":2,"Description":"The connection string used to connect to the Redis cache"},"password":{"Type":4,"Flags":2,"Description":"The password for this Redis cache instance"},"url":{"Type":4,"Flags":2,"Description":"The URL used to connect to the Redis cache"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Datastores/redisCaches","ApiVersion":"2022-03-15-privatepreview","Output":90,"Input":0}},{"2":{"Name":"SqlDatabaseListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"Password to use when connecting to the target Sql database"},"connectionString":{"Type":4,"Flags":2,"Description":"Connection string used to connect to the target Sql database"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Datastores/sqlDatabases","ApiVersion":"2022-03-15-privatepreview","Output":92,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.md index 856113971a..91c2ced2c5 100644 --- a/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.datastores/2022-03-15-privatepreview/types.md @@ -7,7 +7,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [MongoDatabaseProperties](#mongodatabaseproperties): Mongo database portable resource properties +* **properties**: [MongoDatabaseProperties](#mongodatabaseproperties): MongoDatabase portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Datastores/mongoDatabases' (ReadOnly, DeployTimeConstant): The resource type @@ -19,7 +19,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [RedisCacheProperties](#rediscacheproperties): Redis cache portable resource properties +* **properties**: [RedisCacheProperties](#rediscacheproperties): RedisCache portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Datastores/redisCaches' (ReadOnly, DeployTimeConstant): The resource type @@ -31,7 +31,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [SqlDatabaseProperties](#sqldatabaseproperties): Sql database properties +* **properties**: [SqlDatabaseProperties](#sqldatabaseproperties): SqlDatabase properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Datastores/sqlDatabases' (ReadOnly, DeployTimeConstant): The resource type @@ -39,21 +39,24 @@ ## Function listSecrets (Applications.Datastores/mongoDatabases@2022-03-15-privatepreview) * **Resource**: Applications.Datastores/mongoDatabases * **ApiVersion**: 2022-03-15-privatepreview +* **Input**: any * **Output**: [MongoDatabaseListSecretsResult](#mongodatabaselistsecretsresult) ## Function listSecrets (Applications.Datastores/redisCaches@2022-03-15-privatepreview) * **Resource**: Applications.Datastores/redisCaches * **ApiVersion**: 2022-03-15-privatepreview +* **Input**: any * **Output**: [RedisCacheListSecretsResult](#rediscachelistsecretsresult) ## Function listSecrets (Applications.Datastores/sqlDatabases@2022-03-15-privatepreview) * **Resource**: Applications.Datastores/sqlDatabases * **ApiVersion**: 2022-03-15-privatepreview +* **Input**: any * **Output**: [SqlDatabaseListSecretsResult](#sqldatabaselistsecretsresult) ## MongoDatabaseProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **database**: string: Database name of the target Mongo database * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **host**: string: Host name of the target Mongo database @@ -61,8 +64,8 @@ * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the Mongo database resource -* **secrets**: [MongoDatabaseSecrets](#mongodatabasesecrets): The secret values for the given Mongo database resource +* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the MongoDB resource +* **secrets**: [MongoDatabaseSecrets](#mongodatabasesecrets): The secret values for the given MongoDatabase resource * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. * **username**: string: Username to use when connecting to the target Mongo database @@ -82,7 +85,32 @@ ## ResourceStatus ### Properties -* **outputResources**: any[]: Properties of an output resource +* **compute**: [EnvironmentCompute](#environmentcompute): Represents backing compute resource +* **outputResources**: [OutputResource](#outputresource)[]: Properties of an output resource + +## EnvironmentCompute +* **Discriminator**: kind + +### Base Properties +* **identity**: [IdentitySettings](#identitysettings): IdentitySettings is the external identity setting. +* **resourceId**: string: The resource id of the compute resource for application environment. +### KubernetesCompute +#### Properties +* **kind**: 'kubernetes' (Required): Discriminator property for EnvironmentCompute. +* **namespace**: string (Required): The namespace to use for the environment. + + +## IdentitySettings +### Properties +* **kind**: 'azure.com.workload' | 'undefined' (Required): IdentitySettingKind is the kind of supported external identity setting +* **oidcIssuer**: string: The URI for your compute platform's OIDC issuer +* **resource**: string: The resource ID of the provisioned identity + +## OutputResource +### Properties +* **id**: string: The UCP resource ID of the underlying resource. +* **localId**: string: The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships. +* **radiusManaged**: bool: Determines whether Radius manages the lifecycle of the underlying resource. ## SystemData ### Properties @@ -100,7 +128,7 @@ ## RedisCacheProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **host**: string: The host name of the target Redis cache * **port**: int: The port value of the target Redis cache @@ -108,7 +136,7 @@ * **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the Redis resource -* **secrets**: [RedisCacheSecrets](#rediscachesecrets): The secret values for the given Redis cache resource +* **secrets**: [RedisCacheSecrets](#rediscachesecrets): The secret values for the given RedisCache resource * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. * **tls**: bool: Specifies whether to enable SSL connections to the Redis cache * **username**: string: The username for Redis cache @@ -126,23 +154,23 @@ ## SqlDatabaseProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by -* **database**: string: The name of the SQL database. +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) +* **database**: string: The name of the Sql database. * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to -* **port**: int: Port value of the target SQL database +* **port**: int: Port value of the target Sql database * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called * **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the SQL database resource -* **secrets**: [SqlDatabaseSecrets](#sqldatabasesecrets): The secret values for the given SQL database resource -* **server**: string: The fully qualified domain name of the target SQL database. +* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the SqlDatabase resource +* **secrets**: [SqlDatabaseSecrets](#sqldatabasesecrets): The secret values for the given SqlDatabase resource +* **server**: string: The fully qualified domain name of the Sql database. * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **username**: string: Username to use when connecting to the target SQL database +* **username**: string: Username to use when connecting to the target Sql database ## SqlDatabaseSecrets ### Properties -* **connectionString**: string: Connection string used to connect to the target SQL database -* **password**: string: Password to use when connecting to the target SQL database +* **connectionString**: string: Connection string used to connect to the target Sql database +* **password**: string: Password to use when connecting to the target Sql database ## TrackedResourceTags ### Properties @@ -162,6 +190,6 @@ ## SqlDatabaseListSecretsResult ### Properties -* **connectionString**: string (ReadOnly): Connection string used to connect to the target SQL database -* **password**: string (ReadOnly): Password to use when connecting to the target SQL database +* **connectionString**: string (ReadOnly): Connection string used to connect to the target Sql database +* **password**: string (ReadOnly): Password to use when connecting to the target Sql database diff --git a/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.json index 69d0739ada..85196702ea 100644 --- a/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Messaging/rabbitMQQueues"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Messaging/rabbitMQQueues","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"RabbitMQQueue portable resource properties"},"tags":{"Type":29,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":30,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"RabbitMQQueueProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"secrets":{"Type":20,"Flags":0,"Description":"The secret values for the given RabbitMQQueue resource"},"queue":{"Type":4,"Flags":0,"Description":"The name of the queue"},"host":{"Type":4,"Flags":0,"Description":"The hostname of the RabbitMQ instance"},"port":{"Type":3,"Flags":0,"Description":"The port of the RabbitMQ instance. Defaults to 5672"},"vHost":{"Type":4,"Flags":0,"Description":"The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost."},"username":{"Type":4,"Flags":0,"Description":"The username to use when connecting to the RabbitMQ instance"},"resources":{"Type":22,"Flags":0,"Description":"List of the resource IDs that support the rabbitMQ resource"},"resourceProvisioning":{"Type":25,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"recipe":{"Type":26,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"tls":{"Type":2,"Flags":0,"Description":"Specifies whether to use SSL when connecting to the RabbitMQ instance"},"status":{"Type":27,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"RabbitMQSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"The password used to connect to the RabbitMQ instance"},"uri":{"Type":4,"Flags":0,"Description":"The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value"}}}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":21}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[23,24]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"ResourceStatus","Properties":{"outputResources":{"Type":28,"Flags":0,"Description":"Properties of an output resource"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":35,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":40,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[31,32,33,34]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[36,37,38,39]}},{"4":{"Name":"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"2":{"Name":"RabbitMQListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"The password used to connect to the RabbitMQ instance"},"uri":{"Type":4,"Flags":2,"Description":"The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Messaging/rabbitMQQueues","ApiVersion":"2022-03-15-privatepreview","Output":42}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Messaging/rabbitMQQueues"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Messaging/rabbitMQQueues","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"RabbitMQQueue portable resource properties"},"tags":{"Type":37,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":38,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"RabbitMQQueueProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":20,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":30,"Flags":0,"Description":"The connection secrets properties to the RabbitMQ instance"},"queue":{"Type":4,"Flags":0,"Description":"The name of the queue"},"host":{"Type":4,"Flags":0,"Description":"The hostname of the RabbitMQ instance"},"port":{"Type":3,"Flags":0,"Description":"The port of the RabbitMQ instance. Defaults to 5672"},"vHost":{"Type":4,"Flags":0,"Description":"The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost."},"username":{"Type":4,"Flags":0,"Description":"The username to use when connecting to the RabbitMQ instance"},"resources":{"Type":32,"Flags":0,"Description":"List of the resource IDs that support the rabbitMQ resource"},"tls":{"Type":2,"Flags":0,"Description":"Specifies whether to use SSL when connecting to the RabbitMQ instance"},"recipe":{"Type":33,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":36,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":21,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":29,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":22,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":26}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":25,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[23,24]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":27,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":28}},{"2":{"Name":"RabbitMQSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"The password used to connect to the RabbitMQ instance"},"uri":{"Type":4,"Flags":0,"Description":"The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value"}}}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":31}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[34,35]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":43,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":48,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[39,40,41,42]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[44,45,46,47]}},{"4":{"Name":"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"2":{"Name":"RabbitMQListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"The password used to connect to the RabbitMQ instance"},"uri":{"Type":4,"Flags":2,"Description":"The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Messaging/rabbitMQQueues","ApiVersion":"2022-03-15-privatepreview","Output":50,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.md index 4111281c54..bca991e7e2 100644 --- a/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.messaging/2022-03-15-privatepreview/types.md @@ -15,11 +15,12 @@ ## Function listSecrets (Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview) * **Resource**: Applications.Messaging/rabbitMQQueues * **ApiVersion**: 2022-03-15-privatepreview +* **Input**: any * **Output**: [RabbitMQListSecretsResult](#rabbitmqlistsecretsresult) ## RabbitMQQueueProperties ### Properties -* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by +* **application**: string: Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) * **environment**: string (Required): Fully qualified resource ID for the environment that the portable resource is linked to * **host**: string: The hostname of the RabbitMQ instance * **port**: int: The port of the RabbitMQ instance. Defaults to 5672 @@ -28,7 +29,7 @@ * **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a portable resource * **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. * **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the rabbitMQ resource -* **secrets**: [RabbitMQSecrets](#rabbitmqsecrets): The secret values for the given RabbitMQQueue resource +* **secrets**: [RabbitMQSecrets](#rabbitmqsecrets): The connection secrets properties to the RabbitMQ instance * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. * **tls**: bool: Specifies whether to use SSL when connecting to the RabbitMQ instance * **username**: string: The username to use when connecting to the RabbitMQ instance @@ -50,7 +51,32 @@ ## ResourceStatus ### Properties -* **outputResources**: any[]: Properties of an output resource +* **compute**: [EnvironmentCompute](#environmentcompute): Represents backing compute resource +* **outputResources**: [OutputResource](#outputresource)[]: Properties of an output resource + +## EnvironmentCompute +* **Discriminator**: kind + +### Base Properties +* **identity**: [IdentitySettings](#identitysettings): IdentitySettings is the external identity setting. +* **resourceId**: string: The resource id of the compute resource for application environment. +### KubernetesCompute +#### Properties +* **kind**: 'kubernetes' (Required): Discriminator property for EnvironmentCompute. +* **namespace**: string (Required): The namespace to use for the environment. + + +## IdentitySettings +### Properties +* **kind**: 'azure.com.workload' | 'undefined' (Required): IdentitySettingKind is the kind of supported external identity setting +* **oidcIssuer**: string: The URI for your compute platform's OIDC issuer +* **resource**: string: The resource ID of the provisioned identity + +## OutputResource +### Properties +* **id**: string: The UCP resource ID of the underlying resource. +* **localId**: string: The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships. +* **radiusManaged**: bool: Determines whether Radius manages the lifecycle of the underlying resource. ## SystemData ### Properties diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 923e23ff3f..79d0324450 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":106},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":131},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":149},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":170},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":184},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":207},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":244},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":41},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":60},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":79},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":41}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":245}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":81}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":83}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":85}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":43}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":106},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":131},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":149},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":170},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":184},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":207},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":244},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":245}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index d10ed29e9a..b6ad447ba9 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -1262,7 +1262,7 @@ type ProvidersUpdate struct { Azure *ProvidersAzureUpdate } -// Recipe - The recipe used to automatically deploy underlying infrastructure for a link +// Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource type Recipe struct { // REQUIRED; The name of the recipe within the environment to use Name *string @@ -1326,7 +1326,7 @@ type RecipePropertiesUpdate struct { // GetRecipePropertiesUpdate implements the RecipePropertiesUpdateClassification interface for type RecipePropertiesUpdate. func (r *RecipePropertiesUpdate) GetRecipePropertiesUpdate() *RecipePropertiesUpdate { return r } -// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a link +// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource type RecipeUpdate struct { // The name of the recipe within the environment to use Name *string diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go index 447f7639c4..2d50850306 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go @@ -10,7 +10,7 @@ package v20220315privatepreview import "time" -// DaprPubSubBrokerProperties - PubSubBroker portable resource properties +// DaprPubSubBrokerProperties - Dapr PubSubBroker portable resource properties type DaprPubSubBrokerProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` @@ -47,7 +47,7 @@ type DaprPubSubBrokerProperties struct { Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// DaprPubSubBrokerResource - PubSubBroker portable resource +// DaprPubSubBrokerResource - Dapr PubSubBroker portable resource type DaprPubSubBrokerResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -116,7 +116,7 @@ type DaprPubSubBrokerResourceUpdateProperties struct { Version *string `json:"version,omitempty"` } -// DaprSecretStoreProperties - DaprSecretStore portable resource properties +// DaprSecretStoreProperties - Dapr SecretStore portable resource properties type DaprSecretStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` @@ -150,7 +150,7 @@ type DaprSecretStoreProperties struct { Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// DaprSecretStoreResource - DaprSecretStore portable resource +// DaprSecretStoreResource - Dapr SecretStore portable resource type DaprSecretStoreResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -216,7 +216,7 @@ type DaprSecretStoreResourceUpdateProperties struct { Version *string `json:"version,omitempty"` } -// DaprStateStoreProperties - StateStore portable resource properties +// DaprStateStoreProperties - Dapr StateStore portable resource properties type DaprStateStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` @@ -253,7 +253,7 @@ type DaprStateStoreProperties struct { Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// DaprStateStoreResource - StateStore portable resource +// DaprStateStoreResource - Dapr StateStore portable resource type DaprStateStoreResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -513,7 +513,7 @@ type PubSubBrokersClientListByScopeOptions struct { // placeholder for future optional parameters } -// Recipe - The recipe used to automatically deploy underlying infrastructure for a link +// Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource type Recipe struct { // REQUIRED; The name of the recipe within the environment to use Name *string `json:"name,omitempty"` @@ -522,7 +522,7 @@ type Recipe struct { Parameters map[string]interface{} `json:"parameters,omitempty"` } -// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a link +// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource type RecipeUpdate struct { // The name of the recipe within the environment to use Name *string `json:"name,omitempty"` diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go index b9b7b29790..ae80aac404 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go @@ -22,6 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -159,3 +160,23 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { LastModifiedAt: v20220315privatepreview.UnmarshalTimeString(s.LastModifiedAt), } } + +func toOutputResources(outputResources []rpv1.OutputResource) []*OutputResource { + var outResources []*OutputResource + for _, or := range outputResources { + r := &OutputResource{ + ID: to.Ptr(or.ID.String()), + } + + // We will not serialize the following fields if they are empty or nil. + if or.LocalID != "" { + r.LocalID = to.Ptr(or.LocalID) + } + if or.RadiusManaged != nil { + r.RadiusManaged = or.RadiusManaged + } + + outResources = append(outResources, r) + } + return outResources +} diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go index 7e794eee3f..15d3ffe8e7 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go @@ -98,7 +98,7 @@ func (dst *MongoDatabaseResource) ConvertFrom(src v1.DataModelInterface) error { Port: to.Ptr(mongo.Properties.Port), Database: to.Ptr(mongo.Properties.Database), Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(mongo.Properties.Status.OutputResources), + OutputResources: toOutputResources(mongo.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(mongo.InternalMetadata.AsyncProvisioningState), Environment: to.Ptr(mongo.Properties.Environment), diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go index 4765fb06bf..84d6c7391c 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go @@ -100,7 +100,7 @@ func (dst *RedisCacheResource) ConvertFrom(src v1.DataModelInterface) error { TLS: to.Ptr(redis.Properties.TLS), Username: to.Ptr(redis.Properties.Username), Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(redis.Properties.Status.OutputResources), + OutputResources: toOutputResources(redis.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(redis.InternalMetadata.AsyncProvisioningState), Environment: to.Ptr(redis.Properties.Environment), diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go index 704d4ad419..88b7d59073 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go @@ -98,7 +98,7 @@ func (dst *SQLDatabaseResource) ConvertFrom(src v1.DataModelInterface) error { Server: to.Ptr(sql.Properties.Server), Port: to.Ptr(sql.Properties.Port), Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(sql.Properties.Status.OutputResources), + OutputResources: toOutputResources(sql.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(sql.InternalMetadata.AsyncProvisioningState), Environment: to.Ptr(sql.Properties.Environment), diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go index e80a581e36..e87c3c361a 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go @@ -47,6 +47,24 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// IdentitySettingKind - IdentitySettingKind is the kind of supported external identity setting +type IdentitySettingKind string + +const ( + // IdentitySettingKindAzureComWorkload - azure ad workload identity + IdentitySettingKindAzureComWorkload IdentitySettingKind = "azure.com.workload" + // IdentitySettingKindUndefined - undefined identity + IdentitySettingKindUndefined IdentitySettingKind = "undefined" +) + +// PossibleIdentitySettingKindValues returns the possible values for the IdentitySettingKind const type. +func PossibleIdentitySettingKindValues() []IdentitySettingKind { + return []IdentitySettingKind{ + IdentitySettingKindAzureComWorkload, + IdentitySettingKindUndefined, + } +} + // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -70,12 +88,19 @@ func PossibleOriginValues() []Origin { type ProvisioningState string const ( + // ProvisioningStateAccepted - The resource create request has been accepted ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - The resource is being deleted ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - The resource is being provisioned ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded - Resource has been created. ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - The resource is updating ProvisioningStateUpdating ProvisioningState = "Updating" ) @@ -98,7 +123,9 @@ func PossibleProvisioningStateValues() []ProvisioningState { type ResourceProvisioning string const ( + // ResourceProvisioningManual - The resource lifecycle will be managed by the user ResourceProvisioningManual ResourceProvisioning = "manual" + // ResourceProvisioningRecipe - The resource lifecycle will be managed by Radius ResourceProvisioningRecipe ResourceProvisioning = "recipe" ) @@ -110,3 +137,18 @@ func PossibleResourceProvisioningValues() []ResourceProvisioning { } } +// Versions - Supported API versions for the Applications.Databases resource provider. +type Versions string + +const ( + // VersionsV20220315Privatepreview - 2022-03-15-privatepreview + VersionsV20220315Privatepreview Versions = "2022-03-15-privatepreview" +) + +// PossibleVersionsValues returns the possible values for the Versions const type. +func PossibleVersionsValues() []Versions { + return []Versions{ + VersionsV20220315Privatepreview, + } +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go index cf56b6c0b5..a9e9d28dd5 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go @@ -10,34 +10,30 @@ package v20220315privatepreview import "time" -// BasicDaprResourceProperties - Basic properties of a Dapr component object. -type BasicDaprResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` - - // Fully qualified resource ID for the application that the portable resource is consumed by - Application *string `json:"application,omitempty"` - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` - - // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` +// EnvironmentComputeClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnvironmentCompute, *KubernetesCompute +type EnvironmentComputeClassification interface { + // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. + GetEnvironmentCompute() *EnvironmentCompute } -// BasicResourceProperties - Basic properties of a Radius resource. -type BasicResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` +// EnvironmentCompute - Represents backing compute resource +type EnvironmentCompute struct { + // REQUIRED; Discriminator property for EnvironmentCompute. + Kind *string `json:"kind,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by - Application *string `json:"application,omitempty"` + // Configuration for supported external identity providers + Identity *IdentitySettings `json:"identity,omitempty"` - // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + // The resource id of the compute resource for application environment. + ResourceID *string `json:"resourceId,omitempty"` } +// GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. +func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { return e } + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -72,7 +68,43 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } -// MongoDatabaseListSecretsResult - The secret values for the given Mongo database resource +// IdentitySettings is the external identity setting. +type IdentitySettings struct { + // REQUIRED; kind of identity setting + Kind *IdentitySettingKind `json:"kind,omitempty"` + + // The URI for your compute platform's OIDC issuer + OidcIssuer *string `json:"oidcIssuer,omitempty"` + + // The resource ID of the provisioned identity + Resource *string `json:"resource,omitempty"` +} + +// KubernetesCompute - The Kubernetes compute configuration +type KubernetesCompute struct { + // REQUIRED; Discriminator property for EnvironmentCompute. + Kind *string `json:"kind,omitempty"` + + // REQUIRED; The namespace to use for the environment. + Namespace *string `json:"namespace,omitempty"` + + // Configuration for supported external identity providers + Identity *IdentitySettings `json:"identity,omitempty"` + + // The resource id of the compute resource for application environment. + ResourceID *string `json:"resourceId,omitempty"` +} + +// GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type KubernetesCompute. +func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { + return &EnvironmentCompute{ + Kind: k.Kind, + ResourceID: k.ResourceID, + Identity: k.Identity, + } +} + +// MongoDatabaseListSecretsResult - The secret values for the given MongoDatabase resource type MongoDatabaseListSecretsResult struct { // Connection string used to connect to the target Mongo database ConnectionString *string `json:"connectionString,omitempty"` @@ -81,12 +113,12 @@ type MongoDatabaseListSecretsResult struct { Password *string `json:"password,omitempty"` } -// MongoDatabaseProperties - Mongo database portable resource properties +// MongoDatabaseProperties - MongoDatabase portable resource properties type MongoDatabaseProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` // Database name of the target Mongo database @@ -98,13 +130,13 @@ type MongoDatabaseProperties struct { // Port value of the target Mongo database Port *int32 `json:"port,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the Mongo database portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // List of the resource IDs that support the Mongo database resource + // List of the resource IDs that support the MongoDB resource Resources []*ResourceReference `json:"resources,omitempty"` // Secret values provided for the resource @@ -113,14 +145,14 @@ type MongoDatabaseProperties struct { // Username to use when connecting to the target Mongo database Username *string `json:"username,omitempty"` - // READ-ONLY; Provisioning state of the Mongo database portable resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// MongoDatabaseResource - Mongo database portable resource +// MongoDatabaseResource - MongoDatabase portable resource type MongoDatabaseResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -153,7 +185,49 @@ type MongoDatabaseResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// MongoDatabaseSecrets - The secret values for the given Mongo database resource +// MongoDatabaseResourceUpdate - The type used for update operations of the MongoDatabaseResource. +type MongoDatabaseResourceUpdate struct { + // The updatable properties of the MongoDatabaseResource. + Properties *MongoDatabaseResourceUpdateProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// MongoDatabaseResourceUpdateProperties - The updatable properties of the MongoDatabaseResource. +type MongoDatabaseResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` + + // Database name of the target Mongo database + Database *string `json:"database,omitempty"` + + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // Host name of the target Mongo database + Host *string `json:"host,omitempty"` + + // Port value of the target Mongo database + Port *int32 `json:"port,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // List of the resource IDs that support the MongoDB resource + Resources []*ResourceReference `json:"resources,omitempty"` + + // Secret values provided for the resource + Secrets *MongoDatabaseSecrets `json:"secrets,omitempty"` + + // Username to use when connecting to the target Mongo database + Username *string `json:"username,omitempty"` +} + +// MongoDatabaseSecrets - The secret values for the given MongoDatabase resource type MongoDatabaseSecrets struct { // Connection string used to connect to the target Mongo database ConnectionString *string `json:"connectionString,omitempty"` @@ -162,16 +236,23 @@ type MongoDatabaseSecrets struct { Password *string `json:"password,omitempty"` } +// MongoDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginCreateOrUpdate +// method. +type MongoDatabasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete method. type MongoDatabasesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate -// method. -type MongoDatabasesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// MongoDatabasesClientBeginUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginUpdate method. +type MongoDatabasesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. @@ -179,9 +260,8 @@ type MongoDatabasesClientGetOptions struct { // placeholder for future optional parameters } -// MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByRootScope -// method. -type MongoDatabasesClientListByRootScopeOptions struct { +// MongoDatabasesClientListByScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByScope method. +type MongoDatabasesClientListByScopeOptions struct { // placeholder for future optional parameters } @@ -244,6 +324,20 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// OutputResource - Properties of an output resource. +type OutputResource struct { + // The UCP resource ID of the underlying resource. + ID *string `json:"id,omitempty"` + + // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency +// relationship. LocalIDs do not have any particular format or meaning beyond +// being compared to determine dependency relationships. + LocalID *string `json:"localId,omitempty"` + + // Determines whether Radius manages the lifecycle of the underlying resource. + RadiusManaged *bool `json:"radiusManaged,omitempty"` +} + // Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource type Recipe struct { // REQUIRED; The name of the recipe within the environment to use @@ -253,7 +347,16 @@ type Recipe struct { Parameters map[string]interface{} `json:"parameters,omitempty"` } -// RedisCacheListSecretsResult - The secret values for the given Redis cache resource +// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource +type RecipeUpdate struct { + // The name of the recipe within the environment to use + Name *string `json:"name,omitempty"` + + // Key/value parameters to pass into the recipe at deployment + Parameters map[string]interface{} `json:"parameters,omitempty"` +} + +// RedisCacheListSecretsResult - The secret values for the given RedisCache resource type RedisCacheListSecretsResult struct { // The connection string used to connect to the Redis cache ConnectionString *string `json:"connectionString,omitempty"` @@ -265,12 +368,12 @@ type RedisCacheListSecretsResult struct { URL *string `json:"url,omitempty"` } -// RedisCacheProperties - Redis cache portable resource properties +// RedisCacheProperties - RedisCache portable resource properties type RedisCacheProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` // The host name of the target Redis cache @@ -279,7 +382,7 @@ type RedisCacheProperties struct { // The port value of the target Redis cache Port *int32 `json:"port,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the Redis cache portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. @@ -297,14 +400,14 @@ type RedisCacheProperties struct { // The username for Redis cache Username *string `json:"username,omitempty"` - // READ-ONLY; Provisioning state of the redis cache portable at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// RedisCacheResource - Redis cache portable resource +// RedisCacheResource - RedisCache portable resource type RedisCacheResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -337,7 +440,49 @@ type RedisCacheResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// RedisCacheSecrets - The secret values for the given Redis cache resource +// RedisCacheResourceUpdate - The type used for update operations of the RedisCacheResource. +type RedisCacheResourceUpdate struct { + // The updatable properties of the RedisCacheResource. + Properties *RedisCacheResourceUpdateProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// RedisCacheResourceUpdateProperties - The updatable properties of the RedisCacheResource. +type RedisCacheResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` + + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // The host name of the target Redis cache + Host *string `json:"host,omitempty"` + + // The port value of the target Redis cache + Port *int32 `json:"port,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // List of the resource IDs that support the Redis resource + Resources []*ResourceReference `json:"resources,omitempty"` + + // Secrets provided by resource + Secrets *RedisCacheSecrets `json:"secrets,omitempty"` + + // Specifies whether to enable SSL connections to the Redis cache + TLS *bool `json:"tls,omitempty"` + + // The username for Redis cache + Username *string `json:"username,omitempty"` +} + +// RedisCacheSecrets - The secret values for the given RedisCache resource type RedisCacheSecrets struct { // The connection string used to connect to the Redis cache ConnectionString *string `json:"connectionString,omitempty"` @@ -349,14 +494,23 @@ type RedisCacheSecrets struct { URL *string `json:"url,omitempty"` } -// RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate method. -type RedisCachesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// RedisCachesClientBeginCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.BeginCreateOrUpdate +// method. +type RedisCachesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. -type RedisCachesClientDeleteOptions struct { - // placeholder for future optional parameters +// RedisCachesClientBeginDeleteOptions contains the optional parameters for the RedisCachesClient.BeginDelete method. +type RedisCachesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RedisCachesClientBeginUpdateOptions contains the optional parameters for the RedisCachesClient.BeginUpdate method. +type RedisCachesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. @@ -364,8 +518,8 @@ type RedisCachesClientGetOptions struct { // placeholder for future optional parameters } -// RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.ListByRootScope method. -type RedisCachesClientListByRootScopeOptions struct { +// RedisCachesClientListByScopeOptions contains the optional parameters for the RedisCachesClient.ListByScope method. +type RedisCachesClientListByScopeOptions struct { // placeholder for future optional parameters } @@ -397,59 +551,62 @@ type ResourceReference struct { // ResourceStatus - Status of a resource. type ResourceStatus struct { + // The compute resource associated with the resource. + Compute EnvironmentComputeClassification `json:"compute,omitempty"` + // Properties of an output resource - OutputResources []map[string]interface{} `json:"outputResources,omitempty"` + OutputResources []*OutputResource `json:"outputResources,omitempty"` } -// SQLDatabaseListSecretsResult - The secret values for the given SQL database resource +// SQLDatabaseListSecretsResult - The secret values for the given SqlDatabase resource type SQLDatabaseListSecretsResult struct { - // Connection string used to connect to the target SQL database + // Connection string used to connect to the target Sql database ConnectionString *string `json:"connectionString,omitempty"` - // Password to use when connecting to the target SQL database + // Password to use when connecting to the target Sql database Password *string `json:"password,omitempty"` } -// SQLDatabaseProperties - Sql database properties +// SQLDatabaseProperties - SqlDatabase properties type SQLDatabaseProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` - // The name of the SQL database. + // The name of the Sql database. Database *string `json:"database,omitempty"` - // Port value of the target SQL database + // Port value of the target Sql database Port *int32 `json:"port,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the SQL database portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // List of the resource IDs that support the SQL database resource + // List of the resource IDs that support the SqlDatabase resource Resources []*ResourceReference `json:"resources,omitempty"` // Secret values provided for the resource Secrets *SQLDatabaseSecrets `json:"secrets,omitempty"` - // The fully qualified domain name of the target SQL database. + // The fully qualified domain name of the Sql database. Server *string `json:"server,omitempty"` - // Username to use when connecting to the target SQL database + // Username to use when connecting to the target Sql database Username *string `json:"username,omitempty"` - // READ-ONLY; Provisioning state of the SQL database portable resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. Status *ResourceStatus `json:"status,omitempty" azure:"ro"` } -// SQLDatabaseResource - Sql database portable resource +// SQLDatabaseResource - SqlDatabase portable resource type SQLDatabaseResource struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -482,23 +639,74 @@ type SQLDatabaseResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// SQLDatabaseSecrets - The secret values for the given SQL database resource +// SQLDatabaseResourceUpdate - The type used for update operations of the SqlDatabaseResource. +type SQLDatabaseResourceUpdate struct { + // The updatable properties of the SqlDatabaseResource. + Properties *SQLDatabaseResourceUpdateProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// SQLDatabaseResourceUpdateProperties - The updatable properties of the SqlDatabaseResource. +type SQLDatabaseResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` + + // The name of the Sql database. + Database *string `json:"database,omitempty"` + + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // Port value of the target Sql database + Port *int32 `json:"port,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // List of the resource IDs that support the SqlDatabase resource + Resources []*ResourceReference `json:"resources,omitempty"` + + // Secret values provided for the resource + Secrets *SQLDatabaseSecrets `json:"secrets,omitempty"` + + // The fully qualified domain name of the Sql database. + Server *string `json:"server,omitempty"` + + // Username to use when connecting to the target Sql database + Username *string `json:"username,omitempty"` +} + +// SQLDatabaseSecrets - The secret values for the given SqlDatabase resource type SQLDatabaseSecrets struct { - // Connection string used to connect to the target SQL database + // Connection string used to connect to the target Sql database ConnectionString *string `json:"connectionString,omitempty"` - // Password to use when connecting to the target SQL database + // Password to use when connecting to the target Sql database Password *string `json:"password,omitempty"` } -// SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate method. -type SQLDatabasesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// SQLDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginCreateOrUpdate +// method. +type SQLDatabasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. -type SQLDatabasesClientDeleteOptions struct { - // placeholder for future optional parameters +// SQLDatabasesClientBeginDeleteOptions contains the optional parameters for the SQLDatabasesClient.BeginDelete method. +type SQLDatabasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLDatabasesClientBeginUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginUpdate method. +type SQLDatabasesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. @@ -506,8 +714,8 @@ type SQLDatabasesClientGetOptions struct { // placeholder for future optional parameters } -// SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByRootScope method. -type SQLDatabasesClientListByRootScopeOptions struct { +// SQLDatabasesClientListByScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByScope method. +type SQLDatabasesClientListByScopeOptions struct { // placeholder for future optional parameters } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go index c6b3c18269..53f9070d42 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -15,75 +15,36 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type BasicDaprResourceProperties. -func (b BasicDaprResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. +func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "application", b.Application) - populate(objectMap, "componentName", b.ComponentName) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) + populate(objectMap, "identity", e.Identity) + objectMap["kind"] = e.Kind + populate(objectMap, "resourceId", e.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicDaprResourceProperties. -func (b *BasicDaprResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentCompute. +func (e *EnvironmentCompute) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &b.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. -func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "application", b.Application) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicResourceProperties. -func (b *BasicResourceProperties) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) + case "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil @@ -190,6 +151,80 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. +func (i IdentitySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "oidcIssuer", i.OidcIssuer) + populate(objectMap, "resource", i.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentitySettings. +func (i *IdentitySettings) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "oidcIssuer": + err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &i.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesCompute. +func (k KubernetesCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", k.Identity) + objectMap["kind"] = "kubernetes" + populate(objectMap, "namespace", k.Namespace) + populate(objectMap, "resourceId", k.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesCompute. +func (k *KubernetesCompute) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &k.Namespace) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &k.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseListSecretsResult. func (m MongoDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -374,6 +409,100 @@ func (m *MongoDatabaseResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceUpdate. +func (m MongoDatabaseResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseResourceUpdate. +func (m *MongoDatabaseResourceUpdate) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceUpdateProperties. +func (m MongoDatabaseResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", m.Application) + populate(objectMap, "database", m.Database) + populate(objectMap, "environment", m.Environment) + populate(objectMap, "host", m.Host) + populate(objectMap, "port", m.Port) + populate(objectMap, "recipe", m.Recipe) + populate(objectMap, "resourceProvisioning", m.ResourceProvisioning) + populate(objectMap, "resources", m.Resources) + populate(objectMap, "secrets", m.Secrets) + populate(objectMap, "username", m.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseResourceUpdateProperties. +func (m *MongoDatabaseResourceUpdateProperties) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &m.Application) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &m.Database) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &m.Environment) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &m.Host) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &m.Port) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &m.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &m.ResourceProvisioning) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &m.Resources) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &m.Secrets) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &m.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseSecrets. func (m MongoDatabaseSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -518,6 +647,41 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OutputResource. +func (o OutputResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "localId", o.LocalID) + populate(objectMap, "radiusManaged", o.RadiusManaged) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputResource. +func (o *OutputResource) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "localId": + err = unpopulate(val, "LocalID", &o.LocalID) + delete(rawMsg, key) + case "radiusManaged": + err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -549,6 +713,37 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. +func (r RecipeUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", r.Name) + populate(objectMap, "parameters", r.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeUpdate. +func (r *RecipeUpdate) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RedisCacheListSecretsResult. func (r RedisCacheListSecretsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -737,6 +932,100 @@ func (r *RedisCacheResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceUpdate. +func (r RedisCacheResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheResourceUpdate. +func (r *RedisCacheResourceUpdate) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceUpdateProperties. +func (r RedisCacheResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", r.Application) + populate(objectMap, "environment", r.Environment) + populate(objectMap, "host", r.Host) + populate(objectMap, "port", r.Port) + populate(objectMap, "recipe", r.Recipe) + populate(objectMap, "resourceProvisioning", r.ResourceProvisioning) + populate(objectMap, "resources", r.Resources) + populate(objectMap, "secrets", r.Secrets) + populate(objectMap, "tls", r.TLS) + populate(objectMap, "username", r.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheResourceUpdateProperties. +func (r *RedisCacheResourceUpdateProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &r.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &r.Environment) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &r.Host) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &r.Port) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &r.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &r.Resources) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &r.Secrets) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &r.TLS) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &r.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RedisCacheSecrets. func (r RedisCacheSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -841,6 +1130,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "compute", r.Compute) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) } @@ -854,6 +1144,9 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "compute": + r.Compute, err = unmarshalEnvironmentComputeClassification(val) + delete(rawMsg, key) case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) delete(rawMsg, key) @@ -1049,6 +1342,100 @@ func (s *SQLDatabaseResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceUpdate. +func (s SQLDatabaseResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseResourceUpdate. +func (s *SQLDatabaseResourceUpdate) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceUpdateProperties. +func (s SQLDatabaseResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", s.Application) + populate(objectMap, "database", s.Database) + populate(objectMap, "environment", s.Environment) + populate(objectMap, "port", s.Port) + populate(objectMap, "recipe", s.Recipe) + populate(objectMap, "resourceProvisioning", s.ResourceProvisioning) + populate(objectMap, "resources", s.Resources) + populate(objectMap, "secrets", s.Secrets) + populate(objectMap, "server", s.Server) + populate(objectMap, "username", s.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseResourceUpdateProperties. +func (s *SQLDatabaseResourceUpdateProperties) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &s.Application) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &s.Database) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &s.Environment) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &s.Port) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &s.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &s.ResourceProvisioning) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &s.Resources) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &s.Secrets) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &s.Server) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &s.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseSecrets. func (s SQLDatabaseSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go index 6a53129292..1036870efc 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go @@ -19,7 +19,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -32,7 +31,9 @@ type MongoDatabasesClient struct { } // NewMongoDatabasesClient creates a new instance of MongoDatabasesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewMongoDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoDatabasesClient, error) { @@ -55,30 +56,47 @@ pl: pl, return client, nil } -// CreateOrUpdate - Creates or updates a MongoDatabaseResource +// BeginCreateOrUpdate - Create a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the Mongo database portable resource +// mongoDatabaseName - The name of the MongoDatabase portable resource resource // resource - Resource create parameters. -// options - MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate +// options - MongoDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginCreateOrUpdate // method. -func (client *MongoDatabasesClient) CreateOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientCreateOrUpdateOptions) (MongoDatabasesClientCreateOrUpdateResponse, error) { +func (client *MongoDatabasesClient) BeginCreateOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[MongoDatabasesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, mongoDatabaseName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[MongoDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a MongoDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *MongoDatabasesClient) createOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, mongoDatabaseName, resource, options) if err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return MongoDatabasesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if mongoDatabaseName == "" { @@ -96,27 +114,10 @@ func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Cont return req, runtime.MarshalAsJSON(req, resource) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *MongoDatabasesClient) createOrUpdateHandleResponse(resp *http.Response) (MongoDatabasesClientCreateOrUpdateResponse, error) { - result := MongoDatabasesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.MongoDatabaseResource); err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an existing MongoDatabaseResource +// BeginDelete - Delete a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the Mongo database portable resource +// mongoDatabaseName - The name of the MongoDatabase portable resource resource // options - MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete // method. func (client *MongoDatabasesClient) BeginDelete(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*runtime.Poller[MongoDatabasesClientDeleteResponse], error) { @@ -126,14 +127,14 @@ func (client *MongoDatabasesClient) BeginDelete(ctx context.Context, mongoDataba return nil, err } return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + FinalStateVia: runtime.FinalStateViaLocation, }) } else { return runtime.NewPollerFromResumeToken[MongoDatabasesClientDeleteResponse](options.ResumeToken, client.pl, nil) } } -// Delete - Deletes an existing MongoDatabaseResource +// Delete - Delete a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview func (client *MongoDatabasesClient) deleteOperation(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*http.Response, error) { @@ -170,10 +171,10 @@ func (client *MongoDatabasesClient) deleteCreateRequest(ctx context.Context, mon return req, nil } -// Get - Retrieves information about a MongoDatabaseResource +// Get - Get a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the Mongo database portable resource +// mongoDatabaseName - The name of the MongoDatabase portable resource resource // options - MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. func (client *MongoDatabasesClient) Get(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientGetOptions) (MongoDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, mongoDatabaseName, options) @@ -218,40 +219,40 @@ func (client *MongoDatabasesClient) getHandleResponse(resp *http.Response) (Mong return result, nil } -// NewListByRootScopePager - Lists information about all MongoDatabaseResources in the given root scope +// NewListByScopePager - List MongoDatabaseResource resources by Scope // Generated from API version 2022-03-15-privatepreview -// options - MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByRootScope +// options - MongoDatabasesClientListByScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByScope // method. -func (client *MongoDatabasesClient) NewListByRootScopePager(options *MongoDatabasesClientListByRootScopeOptions) (*runtime.Pager[MongoDatabasesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[MongoDatabasesClientListByRootScopeResponse]{ - More: func(page MongoDatabasesClientListByRootScopeResponse) bool { +func (client *MongoDatabasesClient) NewListByScopePager(options *MongoDatabasesClientListByScopeOptions) (*runtime.Pager[MongoDatabasesClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[MongoDatabasesClientListByScopeResponse]{ + More: func(page MongoDatabasesClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *MongoDatabasesClientListByRootScopeResponse) (MongoDatabasesClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *MongoDatabasesClientListByScopeResponse) (MongoDatabasesClientListByScopeResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) + req, err = client.listByScopeCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return MongoDatabasesClientListByRootScopeResponse{}, err + return MongoDatabasesClientListByScopeResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return MongoDatabasesClientListByRootScopeResponse{}, err + return MongoDatabasesClientListByScopeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDatabasesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return MongoDatabasesClientListByScopeResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listByScopeHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *MongoDatabasesClient) listByRootScopeCreateRequest(ctx context.Context, options *MongoDatabasesClientListByRootScopeOptions) (*policy.Request, error) { +// listByScopeCreateRequest creates the ListByScope request. +func (client *MongoDatabasesClient) listByScopeCreateRequest(ctx context.Context, options *MongoDatabasesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/mongoDatabases" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) @@ -265,23 +266,24 @@ func (client *MongoDatabasesClient) listByRootScopeCreateRequest(ctx context.Con return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *MongoDatabasesClient) listByRootScopeHandleResponse(resp *http.Response) (MongoDatabasesClientListByRootScopeResponse, error) { - result := MongoDatabasesClientListByRootScopeResponse{} +// listByScopeHandleResponse handles the ListByScope response. +func (client *MongoDatabasesClient) listByScopeHandleResponse(resp *http.Response) (MongoDatabasesClientListByScopeResponse, error) { + result := MongoDatabasesClientListByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MongoDatabaseResourceListResult); err != nil { - return MongoDatabasesClientListByRootScopeResponse{}, err + return MongoDatabasesClientListByScopeResponse{}, err } return result, nil } -// ListSecrets - Lists secrets values for the specified Mongo database resource +// ListSecrets - Lists secrets values for the specified MongoDatabases resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the Mongo database portable resource +// mongoDatabaseName - The name of the MongoDatabase portable resource resource +// body - The content of the action request // options - MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets // method. -func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientListSecretsOptions) (MongoDatabasesClientListSecretsResponse, error) { - req, err := client.listSecretsCreateRequest(ctx, mongoDatabaseName, options) +func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDatabaseName string, body map[string]interface{}, options *MongoDatabasesClientListSecretsOptions) (MongoDatabasesClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, mongoDatabaseName, body, options) if err != nil { return MongoDatabasesClientListSecretsResponse{}, err } @@ -296,7 +298,7 @@ func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDataba } // listSecretsCreateRequest creates the ListSecrets request. -func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientListSecretsOptions) (*policy.Request, error) { +func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context, mongoDatabaseName string, body map[string]interface{}, options *MongoDatabasesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if mongoDatabaseName == "" { @@ -311,7 +313,7 @@ func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, body) } // listSecretsHandleResponse handles the ListSecrets response. @@ -323,3 +325,61 @@ func (client *MongoDatabasesClient) listSecretsHandleResponse(resp *http.Respons return result, nil } +// BeginUpdate - Update a MongoDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// mongoDatabaseName - The name of the MongoDatabase portable resource resource +// properties - The resource properties to be updated. +// options - MongoDatabasesClientBeginUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginUpdate +// method. +func (client *MongoDatabasesClient) BeginUpdate(ctx context.Context, mongoDatabaseName string, properties MongoDatabaseResourceUpdate, options *MongoDatabasesClientBeginUpdateOptions) (*runtime.Poller[MongoDatabasesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, mongoDatabaseName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[MongoDatabasesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a MongoDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *MongoDatabasesClient) update(ctx context.Context, mongoDatabaseName string, properties MongoDatabaseResourceUpdate, options *MongoDatabasesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, mongoDatabaseName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *MongoDatabasesClient) updateCreateRequest(ctx context.Context, mongoDatabaseName string, properties MongoDatabaseResourceUpdate, options *MongoDatabasesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if mongoDatabaseName == "" { + return nil, errors.New("parameter mongoDatabaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go new file mode 100644 index 0000000000..cba5e61f5a --- /dev/null +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -0,0 +1,30 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import "encoding/json" + +func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (EnvironmentComputeClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EnvironmentComputeClassification + switch m["kind"] { + case "kubernetes": + b = &KubernetesCompute{} + default: + b = &EnvironmentCompute{} + } + return b, json.Unmarshal(rawMsg, b) +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go index b275958abf..455ca92bb6 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go @@ -19,7 +19,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -32,7 +31,9 @@ type RedisCachesClient struct { } // NewRedisCachesClient creates a new instance of RedisCachesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewRedisCachesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RedisCachesClient, error) { @@ -55,30 +56,47 @@ pl: pl, return client, nil } -// CreateOrUpdate - Creates or updates a RedisCacheResource +// BeginCreateOrUpdate - Create a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the Redis cache portable resource +// redisCacheName - The name of the RedisCache portable resource resource // resource - Resource create parameters. -// options - RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate +// options - RedisCachesClientBeginCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.BeginCreateOrUpdate // method. -func (client *RedisCachesClient) CreateOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientCreateOrUpdateOptions) (RedisCachesClientCreateOrUpdateResponse, error) { +func (client *RedisCachesClient) BeginCreateOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RedisCachesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, redisCacheName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RedisCachesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RedisCachesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a RedisCacheResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *RedisCachesClient) createOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, redisCacheName, resource, options) if err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return RedisCachesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if redisCacheName == "" { @@ -96,45 +114,45 @@ func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context return req, runtime.MarshalAsJSON(req, resource) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RedisCachesClient) createOrUpdateHandleResponse(resp *http.Response) (RedisCachesClientCreateOrUpdateResponse, error) { - result := RedisCachesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) +// BeginDelete - Delete a RedisCacheResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// redisCacheName - The name of the RedisCache portable resource resource +// options - RedisCachesClientBeginDeleteOptions contains the optional parameters for the RedisCachesClient.BeginDelete method. +func (client *RedisCachesClient) BeginDelete(ctx context.Context, redisCacheName string, options *RedisCachesClientBeginDeleteOptions) (*runtime.Poller[RedisCachesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, redisCacheName, options) if err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err + return nil, err } - result.RetryAfter = &retryAfter + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RedisCachesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RedisCachesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - if err := runtime.UnmarshalAsJSON(resp, &result.RedisCacheResource); err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err - } - return result, nil } -// Delete - Deletes an existing RedisCacheResource +// Delete - Delete a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the Redis cache portable resource -// options - RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. -func (client *RedisCachesClient) Delete(ctx context.Context, redisCacheName string, options *RedisCachesClientDeleteOptions) (RedisCachesClientDeleteResponse, error) { +func (client *RedisCachesClient) deleteOperation(ctx context.Context, redisCacheName string, options *RedisCachesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, redisCacheName, options) if err != nil { - return RedisCachesClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return RedisCachesClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return RedisCachesClientDeleteResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.deleteHandleResponse(resp) + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisCacheName string, options *RedisCachesClientDeleteOptions) (*policy.Request, error) { +func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisCacheName string, options *RedisCachesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if redisCacheName == "" { @@ -152,24 +170,10 @@ func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisC return req, nil } -// deleteHandleResponse handles the Delete response. -func (client *RedisCachesClient) deleteHandleResponse(resp *http.Response) (RedisCachesClientDeleteResponse, error) { - result := RedisCachesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return RedisCachesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a RedisCacheResource +// Get - Get a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the Redis cache portable resource +// redisCacheName - The name of the RedisCache portable resource resource // options - RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. func (client *RedisCachesClient) Get(ctx context.Context, redisCacheName string, options *RedisCachesClientGetOptions) (RedisCachesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, redisCacheName, options) @@ -214,40 +218,39 @@ func (client *RedisCachesClient) getHandleResponse(resp *http.Response) (RedisCa return result, nil } -// NewListByRootScopePager - Lists information about all RedisCacheResources in the given root scope +// NewListByScopePager - List RedisCacheResource resources by Scope // Generated from API version 2022-03-15-privatepreview -// options - RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.ListByRootScope -// method. -func (client *RedisCachesClient) NewListByRootScopePager(options *RedisCachesClientListByRootScopeOptions) (*runtime.Pager[RedisCachesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[RedisCachesClientListByRootScopeResponse]{ - More: func(page RedisCachesClientListByRootScopeResponse) bool { +// options - RedisCachesClientListByScopeOptions contains the optional parameters for the RedisCachesClient.ListByScope method. +func (client *RedisCachesClient) NewListByScopePager(options *RedisCachesClientListByScopeOptions) (*runtime.Pager[RedisCachesClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[RedisCachesClientListByScopeResponse]{ + More: func(page RedisCachesClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *RedisCachesClientListByRootScopeResponse) (RedisCachesClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *RedisCachesClientListByScopeResponse) (RedisCachesClientListByScopeResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) + req, err = client.listByScopeCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return RedisCachesClientListByRootScopeResponse{}, err + return RedisCachesClientListByScopeResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return RedisCachesClientListByRootScopeResponse{}, err + return RedisCachesClientListByScopeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RedisCachesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return RedisCachesClientListByScopeResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listByScopeHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *RedisCachesClient) listByRootScopeCreateRequest(ctx context.Context, options *RedisCachesClientListByRootScopeOptions) (*policy.Request, error) { +// listByScopeCreateRequest creates the ListByScope request. +func (client *RedisCachesClient) listByScopeCreateRequest(ctx context.Context, options *RedisCachesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) @@ -261,22 +264,23 @@ func (client *RedisCachesClient) listByRootScopeCreateRequest(ctx context.Contex return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *RedisCachesClient) listByRootScopeHandleResponse(resp *http.Response) (RedisCachesClientListByRootScopeResponse, error) { - result := RedisCachesClientListByRootScopeResponse{} +// listByScopeHandleResponse handles the ListByScope response. +func (client *RedisCachesClient) listByScopeHandleResponse(resp *http.Response) (RedisCachesClientListByScopeResponse, error) { + result := RedisCachesClientListByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RedisCacheResourceListResult); err != nil { - return RedisCachesClientListByRootScopeResponse{}, err + return RedisCachesClientListByScopeResponse{}, err } return result, nil } -// ListSecrets - Lists secrets values for the specified Redis cache resource +// ListSecrets - Lists secrets values for the specified RedisCache resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the Redis cache portable resource +// redisCacheName - The name of the RedisCache portable resource resource +// body - The content of the action request // options - RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. -func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName string, options *RedisCachesClientListSecretsOptions) (RedisCachesClientListSecretsResponse, error) { - req, err := client.listSecretsCreateRequest(ctx, redisCacheName, options) +func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName string, body map[string]interface{}, options *RedisCachesClientListSecretsOptions) (RedisCachesClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, redisCacheName, body, options) if err != nil { return RedisCachesClientListSecretsResponse{}, err } @@ -291,7 +295,7 @@ func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName } // listSecretsCreateRequest creates the ListSecrets request. -func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, redisCacheName string, options *RedisCachesClientListSecretsOptions) (*policy.Request, error) { +func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, redisCacheName string, body map[string]interface{}, options *RedisCachesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if redisCacheName == "" { @@ -306,7 +310,7 @@ func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, body) } // listSecretsHandleResponse handles the ListSecrets response. @@ -318,3 +322,60 @@ func (client *RedisCachesClient) listSecretsHandleResponse(resp *http.Response) return result, nil } +// BeginUpdate - Update a RedisCacheResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// redisCacheName - The name of the RedisCache portable resource resource +// properties - The resource properties to be updated. +// options - RedisCachesClientBeginUpdateOptions contains the optional parameters for the RedisCachesClient.BeginUpdate method. +func (client *RedisCachesClient) BeginUpdate(ctx context.Context, redisCacheName string, properties RedisCacheResourceUpdate, options *RedisCachesClientBeginUpdateOptions) (*runtime.Poller[RedisCachesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, redisCacheName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RedisCachesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RedisCachesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a RedisCacheResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *RedisCachesClient) update(ctx context.Context, redisCacheName string, properties RedisCacheResourceUpdate, options *RedisCachesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, redisCacheName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *RedisCachesClient) updateCreateRequest(ctx context.Context, redisCacheName string, properties RedisCacheResourceUpdate, options *RedisCachesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if redisCacheName == "" { + return nil, errors.New("parameter redisCacheName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go index 4f6f944e57..489c6a2e0c 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -11,8 +11,6 @@ package v20220315privatepreview // MongoDatabasesClientCreateOrUpdateResponse contains the response from method MongoDatabasesClient.CreateOrUpdate. type MongoDatabasesClientCreateOrUpdateResponse struct { MongoDatabaseResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } // MongoDatabasesClientDeleteResponse contains the response from method MongoDatabasesClient.Delete. @@ -25,8 +23,8 @@ type MongoDatabasesClientGetResponse struct { MongoDatabaseResource } -// MongoDatabasesClientListByRootScopeResponse contains the response from method MongoDatabasesClient.ListByRootScope. -type MongoDatabasesClientListByRootScopeResponse struct { +// MongoDatabasesClientListByScopeResponse contains the response from method MongoDatabasesClient.ListByScope. +type MongoDatabasesClientListByScopeResponse struct { MongoDatabaseResourceListResult } @@ -35,6 +33,11 @@ type MongoDatabasesClientListSecretsResponse struct { MongoDatabaseListSecretsResult } +// MongoDatabasesClientUpdateResponse contains the response from method MongoDatabasesClient.Update. +type MongoDatabasesClientUpdateResponse struct { + MongoDatabaseResource +} + // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { OperationListResult @@ -43,14 +46,11 @@ type OperationsClientListResponse struct { // RedisCachesClientCreateOrUpdateResponse contains the response from method RedisCachesClient.CreateOrUpdate. type RedisCachesClientCreateOrUpdateResponse struct { RedisCacheResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } // RedisCachesClientDeleteResponse contains the response from method RedisCachesClient.Delete. type RedisCachesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 + // placeholder for future response values } // RedisCachesClientGetResponse contains the response from method RedisCachesClient.Get. @@ -58,8 +58,8 @@ type RedisCachesClientGetResponse struct { RedisCacheResource } -// RedisCachesClientListByRootScopeResponse contains the response from method RedisCachesClient.ListByRootScope. -type RedisCachesClientListByRootScopeResponse struct { +// RedisCachesClientListByScopeResponse contains the response from method RedisCachesClient.ListByScope. +type RedisCachesClientListByScopeResponse struct { RedisCacheResourceListResult } @@ -68,17 +68,19 @@ type RedisCachesClientListSecretsResponse struct { RedisCacheListSecretsResult } +// RedisCachesClientUpdateResponse contains the response from method RedisCachesClient.Update. +type RedisCachesClientUpdateResponse struct { + RedisCacheResource +} + // SQLDatabasesClientCreateOrUpdateResponse contains the response from method SQLDatabasesClient.CreateOrUpdate. type SQLDatabasesClientCreateOrUpdateResponse struct { SQLDatabaseResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } // SQLDatabasesClientDeleteResponse contains the response from method SQLDatabasesClient.Delete. type SQLDatabasesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 + // placeholder for future response values } // SQLDatabasesClientGetResponse contains the response from method SQLDatabasesClient.Get. @@ -86,8 +88,8 @@ type SQLDatabasesClientGetResponse struct { SQLDatabaseResource } -// SQLDatabasesClientListByRootScopeResponse contains the response from method SQLDatabasesClient.ListByRootScope. -type SQLDatabasesClientListByRootScopeResponse struct { +// SQLDatabasesClientListByScopeResponse contains the response from method SQLDatabasesClient.ListByScope. +type SQLDatabasesClientListByScopeResponse struct { SQLDatabaseResourceListResult } @@ -96,3 +98,8 @@ type SQLDatabasesClientListSecretsResponse struct { SQLDatabaseListSecretsResult } +// SQLDatabasesClientUpdateResponse contains the response from method SQLDatabasesClient.Update. +type SQLDatabasesClientUpdateResponse struct { + SQLDatabaseResource +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go index 706be5dd05..16286650a6 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go @@ -19,7 +19,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -32,7 +31,9 @@ type SQLDatabasesClient struct { } // NewSQLDatabasesClient creates a new instance of SQLDatabasesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewSQLDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLDatabasesClient, error) { @@ -55,30 +56,47 @@ pl: pl, return client, nil } -// CreateOrUpdate - Creates or updates a SqlDatabaseResource +// BeginCreateOrUpdate - Create a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SQL database portable resource +// sqlDatabaseName - The name of the SqlDatabase portable resource resource // resource - Resource create parameters. -// options - SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate +// options - SQLDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginCreateOrUpdate // method. -func (client *SQLDatabasesClient) CreateOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientCreateOrUpdateOptions) (SQLDatabasesClientCreateOrUpdateResponse, error) { +func (client *SQLDatabasesClient) BeginCreateOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SQLDatabasesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, sqlDatabaseName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLDatabasesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[SQLDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a SqlDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *SQLDatabasesClient) createOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, sqlDatabaseName, resource, options) if err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SQLDatabasesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if sqlDatabaseName == "" { @@ -96,45 +114,46 @@ func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Contex return req, runtime.MarshalAsJSON(req, resource) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *SQLDatabasesClient) createOrUpdateHandleResponse(resp *http.Response) (SQLDatabasesClientCreateOrUpdateResponse, error) { - result := SQLDatabasesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) +// BeginDelete - Delete a SqlDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// sqlDatabaseName - The name of the SqlDatabase portable resource resource +// options - SQLDatabasesClientBeginDeleteOptions contains the optional parameters for the SQLDatabasesClient.BeginDelete +// method. +func (client *SQLDatabasesClient) BeginDelete(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientBeginDeleteOptions) (*runtime.Poller[SQLDatabasesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, sqlDatabaseName, options) if err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err + return nil, err } - result.RetryAfter = &retryAfter + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLDatabasesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SQLDatabasesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - if err := runtime.UnmarshalAsJSON(resp, &result.SQLDatabaseResource); err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err - } - return result, nil } -// Delete - Deletes an existing SqlDatabaseResource +// Delete - Delete a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SQL database portable resource -// options - SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. -func (client *SQLDatabasesClient) Delete(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientDeleteOptions) (SQLDatabasesClientDeleteResponse, error) { +func (client *SQLDatabasesClient) deleteOperation(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, sqlDatabaseName, options) if err != nil { - return SQLDatabasesClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return SQLDatabasesClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return SQLDatabasesClientDeleteResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.deleteHandleResponse(resp) + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientDeleteOptions) (*policy.Request, error) { +func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if sqlDatabaseName == "" { @@ -152,24 +171,10 @@ func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDa return req, nil } -// deleteHandleResponse handles the Delete response. -func (client *SQLDatabasesClient) deleteHandleResponse(resp *http.Response) (SQLDatabasesClientDeleteResponse, error) { - result := SQLDatabasesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return SQLDatabasesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a SqlDatabaseResource +// Get - Get a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SQL database portable resource +// sqlDatabaseName - The name of the SqlDatabase portable resource resource // options - SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. func (client *SQLDatabasesClient) Get(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientGetOptions) (SQLDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, sqlDatabaseName, options) @@ -214,40 +219,40 @@ func (client *SQLDatabasesClient) getHandleResponse(resp *http.Response) (SQLDat return result, nil } -// NewListByRootScopePager - Lists information about all SqlDatabaseResources in the given root scope +// NewListByScopePager - List SqlDatabaseResource resources by Scope // Generated from API version 2022-03-15-privatepreview -// options - SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByRootScope +// options - SQLDatabasesClientListByScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByScope // method. -func (client *SQLDatabasesClient) NewListByRootScopePager(options *SQLDatabasesClientListByRootScopeOptions) (*runtime.Pager[SQLDatabasesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[SQLDatabasesClientListByRootScopeResponse]{ - More: func(page SQLDatabasesClientListByRootScopeResponse) bool { +func (client *SQLDatabasesClient) NewListByScopePager(options *SQLDatabasesClientListByScopeOptions) (*runtime.Pager[SQLDatabasesClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[SQLDatabasesClientListByScopeResponse]{ + More: func(page SQLDatabasesClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *SQLDatabasesClientListByRootScopeResponse) (SQLDatabasesClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *SQLDatabasesClientListByScopeResponse) (SQLDatabasesClientListByScopeResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) + req, err = client.listByScopeCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return SQLDatabasesClientListByRootScopeResponse{}, err + return SQLDatabasesClientListByScopeResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return SQLDatabasesClientListByRootScopeResponse{}, err + return SQLDatabasesClientListByScopeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLDatabasesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return SQLDatabasesClientListByScopeResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listByScopeHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *SQLDatabasesClient) listByRootScopeCreateRequest(ctx context.Context, options *SQLDatabasesClientListByRootScopeOptions) (*policy.Request, error) { +// listByScopeCreateRequest creates the ListByScope request. +func (client *SQLDatabasesClient) listByScopeCreateRequest(ctx context.Context, options *SQLDatabasesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) @@ -261,23 +266,24 @@ func (client *SQLDatabasesClient) listByRootScopeCreateRequest(ctx context.Conte return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *SQLDatabasesClient) listByRootScopeHandleResponse(resp *http.Response) (SQLDatabasesClientListByRootScopeResponse, error) { - result := SQLDatabasesClientListByRootScopeResponse{} +// listByScopeHandleResponse handles the ListByScope response. +func (client *SQLDatabasesClient) listByScopeHandleResponse(resp *http.Response) (SQLDatabasesClientListByScopeResponse, error) { + result := SQLDatabasesClientListByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SQLDatabaseResourceListResult); err != nil { - return SQLDatabasesClientListByRootScopeResponse{}, err + return SQLDatabasesClientListByScopeResponse{}, err } return result, nil } -// ListSecrets - Lists secrets values for the specified SQL database resource +// ListSecrets - Lists secrets values for the specified SqlDatabase resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SQL database portable resource +// sqlDatabaseName - The name of the SqlDatabase portable resource resource +// body - The content of the action request // options - SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets // method. -func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientListSecretsOptions) (SQLDatabasesClientListSecretsResponse, error) { - req, err := client.listSecretsCreateRequest(ctx, sqlDatabaseName, options) +func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseName string, body map[string]interface{}, options *SQLDatabasesClientListSecretsOptions) (SQLDatabasesClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, sqlDatabaseName, body, options) if err != nil { return SQLDatabasesClientListSecretsResponse{}, err } @@ -292,7 +298,7 @@ func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseNa } // listSecretsCreateRequest creates the ListSecrets request. -func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientListSecretsOptions) (*policy.Request, error) { +func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, sqlDatabaseName string, body map[string]interface{}, options *SQLDatabasesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if sqlDatabaseName == "" { @@ -307,7 +313,7 @@ func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, body) } // listSecretsHandleResponse handles the ListSecrets response. @@ -319,3 +325,61 @@ func (client *SQLDatabasesClient) listSecretsHandleResponse(resp *http.Response) return result, nil } +// BeginUpdate - Update a SqlDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// sqlDatabaseName - The name of the SqlDatabase portable resource resource +// properties - The resource properties to be updated. +// options - SQLDatabasesClientBeginUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginUpdate +// method. +func (client *SQLDatabasesClient) BeginUpdate(ctx context.Context, sqlDatabaseName string, properties SQLDatabaseResourceUpdate, options *SQLDatabasesClientBeginUpdateOptions) (*runtime.Poller[SQLDatabasesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, sqlDatabaseName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLDatabasesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SQLDatabasesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a SqlDatabaseResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *SQLDatabasesClient) update(ctx context.Context, sqlDatabaseName string, properties SQLDatabaseResourceUpdate, options *SQLDatabasesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, sqlDatabaseName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *SQLDatabasesClient) updateCreateRequest(ctx context.Context, sqlDatabaseName string, properties SQLDatabaseResourceUpdate, options *SQLDatabasesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if sqlDatabaseName == "" { + return nil, errors.New("parameter sqlDatabaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go index 0ee66e2aeb..251a4aef3e 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go @@ -22,6 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -159,3 +160,23 @@ func fromResourcesDataModel(r []*linkrp.ResourceReference) []*ResourceReference } return resources } + +func toOutputResources(outputResources []rpv1.OutputResource) []*OutputResource { + var outResources []*OutputResource + for _, or := range outputResources { + r := &OutputResource{ + ID: to.Ptr(or.ID.String()), + } + + // We will not serialize the following fields if they are empty or nil. + if or.LocalID != "" { + r.LocalID = to.Ptr(or.LocalID) + } + if or.RadiusManaged != nil { + r.RadiusManaged = or.RadiusManaged + } + + outResources = append(outResources, r) + } + return outResources +} diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go index c9de629349..05dd39b4a3 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go @@ -95,7 +95,7 @@ func (dst *RabbitMQQueueResource) ConvertFrom(src v1.DataModelInterface) error { dst.Tags = *to.StringMapPtr(rabbitmq.Tags) dst.Properties = &RabbitMQQueueProperties{ Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(rabbitmq.Properties.Status.OutputResources), + OutputResources: toOutputResources(rabbitmq.Properties.Status.OutputResources), }, ProvisioningState: fromProvisioningStateDataModel(rabbitmq.InternalMetadata.AsyncProvisioningState), Environment: to.Ptr(rabbitmq.Properties.Environment), diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go index e80a581e36..b6c5e512d4 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go @@ -47,6 +47,24 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// IdentitySettingKind - IdentitySettingKind is the kind of supported external identity setting +type IdentitySettingKind string + +const ( + // IdentitySettingKindAzureComWorkload - azure ad workload identity + IdentitySettingKindAzureComWorkload IdentitySettingKind = "azure.com.workload" + // IdentitySettingKindUndefined - undefined identity + IdentitySettingKindUndefined IdentitySettingKind = "undefined" +) + +// PossibleIdentitySettingKindValues returns the possible values for the IdentitySettingKind const type. +func PossibleIdentitySettingKindValues() []IdentitySettingKind { + return []IdentitySettingKind{ + IdentitySettingKindAzureComWorkload, + IdentitySettingKindUndefined, + } +} + // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -70,12 +88,19 @@ func PossibleOriginValues() []Origin { type ProvisioningState string const ( + // ProvisioningStateAccepted - The resource create request has been accepted ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - The resource is being deleted ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - The resource is being provisioned ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded - Resource has been created. ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - The resource is updating ProvisioningStateUpdating ProvisioningState = "Updating" ) @@ -98,7 +123,9 @@ func PossibleProvisioningStateValues() []ProvisioningState { type ResourceProvisioning string const ( + // ResourceProvisioningManual - The resource lifecycle will be managed by the user ResourceProvisioningManual ResourceProvisioning = "manual" + // ResourceProvisioningRecipe - The resource lifecycle will be managed by Radius ResourceProvisioningRecipe ResourceProvisioning = "recipe" ) @@ -110,3 +137,18 @@ func PossibleResourceProvisioningValues() []ResourceProvisioning { } } +// Versions - Supported API versions for the Applications.Messaging resource provider. +type Versions string + +const ( + // VersionsV20220315Privatepreview - 2022-03-15-privatepreview + VersionsV20220315Privatepreview Versions = "2022-03-15-privatepreview" +) + +// PossibleVersionsValues returns the possible values for the Versions const type. +func PossibleVersionsValues() []Versions { + return []Versions{ + VersionsV20220315Privatepreview, + } +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go index 497c1f46b5..0f414bc068 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go @@ -10,34 +10,30 @@ package v20220315privatepreview import "time" -// BasicDaprResourceProperties - Basic properties of a Dapr component object. -type BasicDaprResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` - - // Fully qualified resource ID for the application that the portable resource is consumed by - Application *string `json:"application,omitempty"` - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` - - // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` +// EnvironmentComputeClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnvironmentCompute, *KubernetesCompute +type EnvironmentComputeClassification interface { + // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. + GetEnvironmentCompute() *EnvironmentCompute } -// BasicResourceProperties - Basic properties of a Radius resource. -type BasicResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` +// EnvironmentCompute - Represents backing compute resource +type EnvironmentCompute struct { + // REQUIRED; Discriminator property for EnvironmentCompute. + Kind *string `json:"kind,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by - Application *string `json:"application,omitempty"` + // Configuration for supported external identity providers + Identity *IdentitySettings `json:"identity,omitempty"` - // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + // The resource id of the compute resource for application environment. + ResourceID *string `json:"resourceId,omitempty"` } +// GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. +func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { return e } + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -72,6 +68,42 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// IdentitySettings is the external identity setting. +type IdentitySettings struct { + // REQUIRED; kind of identity setting + Kind *IdentitySettingKind `json:"kind,omitempty"` + + // The URI for your compute platform's OIDC issuer + OidcIssuer *string `json:"oidcIssuer,omitempty"` + + // The resource ID of the provisioned identity + Resource *string `json:"resource,omitempty"` +} + +// KubernetesCompute - The Kubernetes compute configuration +type KubernetesCompute struct { + // REQUIRED; Discriminator property for EnvironmentCompute. + Kind *string `json:"kind,omitempty"` + + // REQUIRED; The namespace to use for the environment. + Namespace *string `json:"namespace,omitempty"` + + // Configuration for supported external identity providers + Identity *IdentitySettings `json:"identity,omitempty"` + + // The resource id of the compute resource for application environment. + ResourceID *string `json:"resourceId,omitempty"` +} + +// GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type KubernetesCompute. +func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { + return &EnvironmentCompute{ + Kind: k.Kind, + ResourceID: k.ResourceID, + Identity: k.Identity, + } +} + // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -126,6 +158,20 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } +// OutputResource - Properties of an output resource. +type OutputResource struct { + // The UCP resource ID of the underlying resource. + ID *string `json:"id,omitempty"` + + // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency +// relationship. LocalIDs do not have any particular format or meaning beyond +// being compared to determine dependency relationships. + LocalID *string `json:"localId,omitempty"` + + // Determines whether Radius manages the lifecycle of the underlying resource. + RadiusManaged *bool `json:"radiusManaged,omitempty"` +} + // RabbitMQListSecretsResult - The secret values for the given RabbitMQQueue resource type RabbitMQListSecretsResult struct { // The password used to connect to the RabbitMQ instance @@ -141,7 +187,7 @@ type RabbitMQQueueProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string `json:"environment,omitempty"` - // Fully qualified resource ID for the application that the portable resource is consumed by + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string `json:"application,omitempty"` // The hostname of the RabbitMQ instance @@ -153,7 +199,7 @@ type RabbitMQQueueProperties struct { // The name of the queue Queue *string `json:"queue,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the rabbitMQQueue portable resource + // The recipe used to automatically deploy underlying infrastructure for the resource Recipe *Recipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed. @@ -162,7 +208,7 @@ type RabbitMQQueueProperties struct { // List of the resource IDs that support the rabbitMQ resource Resources []*ResourceReference `json:"resources,omitempty"` - // Secrets provided by resources, + // The secrets to connect to the RabbitMQ instance Secrets *RabbitMQSecrets `json:"secrets,omitempty"` // Specifies whether to use SSL when connecting to the RabbitMQ instance @@ -174,7 +220,7 @@ type RabbitMQQueueProperties struct { // The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. VHost *string `json:"vHost,omitempty"` - // READ-ONLY; Provisioning state of the rabbitMQ message queue portable resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Status of a resource. @@ -214,7 +260,55 @@ type RabbitMQQueueResourceListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// RabbitMQSecrets - The secret values for the given RabbitMQQueue resource +// RabbitMQQueueResourceUpdate - The type used for update operations of the RabbitMQQueueResource. +type RabbitMQQueueResourceUpdate struct { + // The updatable properties of the RabbitMQQueueResource. + Properties *RabbitMQQueueResourceUpdateProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// RabbitMQQueueResourceUpdateProperties - The updatable properties of the RabbitMQQueueResource. +type RabbitMQQueueResourceUpdateProperties struct { + // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) + Application *string `json:"application,omitempty"` + + // Fully qualified resource ID for the environment that the portable resource is linked to + Environment *string `json:"environment,omitempty"` + + // The hostname of the RabbitMQ instance + Host *string `json:"host,omitempty"` + + // The port of the RabbitMQ instance. Defaults to 5672 + Port *int32 `json:"port,omitempty"` + + // The name of the queue + Queue *string `json:"queue,omitempty"` + + // The recipe used to automatically deploy underlying infrastructure for the resource + Recipe *RecipeUpdate `json:"recipe,omitempty"` + + // Specifies how the underlying service/resource is provisioned and managed. + ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + + // List of the resource IDs that support the rabbitMQ resource + Resources []*ResourceReference `json:"resources,omitempty"` + + // The secrets to connect to the RabbitMQ instance + Secrets *RabbitMQSecrets `json:"secrets,omitempty"` + + // Specifies whether to use SSL when connecting to the RabbitMQ instance + TLS *bool `json:"tls,omitempty"` + + // The username to use when connecting to the RabbitMQ instance + Username *string `json:"username,omitempty"` + + // The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. + VHost *string `json:"vHost,omitempty"` +} + +// RabbitMQSecrets - The connection secrets properties to the RabbitMQ instance type RabbitMQSecrets struct { // The password used to connect to the RabbitMQ instance Password *string `json:"password,omitempty"` @@ -224,15 +318,23 @@ type RabbitMQSecrets struct { URI *string `json:"uri,omitempty"` } -// RabbitMqQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.CreateOrUpdate +// RabbitMqQueuesClientBeginCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginCreateOrUpdate // method. -type RabbitMqQueuesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +type RabbitMqQueuesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } -// RabbitMqQueuesClientDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.Delete method. -type RabbitMqQueuesClientDeleteOptions struct { - // placeholder for future optional parameters +// RabbitMqQueuesClientBeginDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.BeginDelete method. +type RabbitMqQueuesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RabbitMqQueuesClientBeginUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginUpdate method. +type RabbitMqQueuesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // RabbitMqQueuesClientGetOptions contains the optional parameters for the RabbitMqQueuesClient.Get method. @@ -240,9 +342,8 @@ type RabbitMqQueuesClientGetOptions struct { // placeholder for future optional parameters } -// RabbitMqQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqQueuesClient.ListByRootScope -// method. -type RabbitMqQueuesClientListByRootScopeOptions struct { +// RabbitMqQueuesClientListByScopeOptions contains the optional parameters for the RabbitMqQueuesClient.ListByScope method. +type RabbitMqQueuesClientListByScopeOptions struct { // placeholder for future optional parameters } @@ -260,6 +361,15 @@ type Recipe struct { Parameters map[string]interface{} `json:"parameters,omitempty"` } +// RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource +type RecipeUpdate struct { + // The name of the recipe within the environment to use + Name *string `json:"name,omitempty"` + + // Key/value parameters to pass into the recipe at deployment + Parameters map[string]interface{} `json:"parameters,omitempty"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -283,8 +393,11 @@ type ResourceReference struct { // ResourceStatus - Status of a resource. type ResourceStatus struct { + // The compute resource associated with the resource. + Compute EnvironmentComputeClassification `json:"compute,omitempty"` + // Properties of an output resource - OutputResources []map[string]interface{} `json:"outputResources,omitempty"` + OutputResources []*OutputResource `json:"outputResources,omitempty"` } // SystemData - Metadata pertaining to creation and last modification of the resource. diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go index 14a413334c..292d76a42b 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -15,75 +15,36 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type BasicDaprResourceProperties. -func (b BasicDaprResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. +func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "application", b.Application) - populate(objectMap, "componentName", b.ComponentName) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) + populate(objectMap, "identity", e.Identity) + objectMap["kind"] = e.Kind + populate(objectMap, "resourceId", e.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicDaprResourceProperties. -func (b *BasicDaprResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentCompute. +func (e *EnvironmentCompute) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &b.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. -func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "application", b.Application) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicResourceProperties. -func (b *BasicResourceProperties) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) + case "resourceId": + err = unpopulate(val, "ResourceID", &e.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil @@ -190,6 +151,80 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. +func (i IdentitySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kind", i.Kind) + populate(objectMap, "oidcIssuer", i.OidcIssuer) + populate(objectMap, "resource", i.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentitySettings. +func (i *IdentitySettings) 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", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "oidcIssuer": + err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &i.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KubernetesCompute. +func (k KubernetesCompute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", k.Identity) + objectMap["kind"] = "kubernetes" + populate(objectMap, "namespace", k.Namespace) + populate(objectMap, "resourceId", k.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesCompute. +func (k *KubernetesCompute) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &k.Kind) + delete(rawMsg, key) + case "namespace": + err = unpopulate(val, "Namespace", &k.Namespace) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &k.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -303,6 +338,41 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OutputResource. +func (o OutputResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", o.ID) + populate(objectMap, "localId", o.LocalID) + populate(objectMap, "radiusManaged", o.RadiusManaged) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutputResource. +func (o *OutputResource) 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", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "localId": + err = unpopulate(val, "LocalID", &o.LocalID) + delete(rawMsg, key) + case "radiusManaged": + err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RabbitMQListSecretsResult. func (r RabbitMQListSecretsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -495,6 +565,108 @@ func (r *RabbitMQQueueResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueResourceUpdate. +func (r RabbitMQQueueResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQQueueResourceUpdate. +func (r *RabbitMQQueueResourceUpdate) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueResourceUpdateProperties. +func (r RabbitMQQueueResourceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "application", r.Application) + populate(objectMap, "environment", r.Environment) + populate(objectMap, "host", r.Host) + populate(objectMap, "port", r.Port) + populate(objectMap, "queue", r.Queue) + populate(objectMap, "recipe", r.Recipe) + populate(objectMap, "resourceProvisioning", r.ResourceProvisioning) + populate(objectMap, "resources", r.Resources) + populate(objectMap, "secrets", r.Secrets) + populate(objectMap, "tls", r.TLS) + populate(objectMap, "username", r.Username) + populate(objectMap, "vHost", r.VHost) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQQueueResourceUpdateProperties. +func (r *RabbitMQQueueResourceUpdateProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "application": + err = unpopulate(val, "Application", &r.Application) + delete(rawMsg, key) + case "environment": + err = unpopulate(val, "Environment", &r.Environment) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &r.Host) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &r.Port) + delete(rawMsg, key) + case "queue": + err = unpopulate(val, "Queue", &r.Queue) + delete(rawMsg, key) + case "recipe": + err = unpopulate(val, "Recipe", &r.Recipe) + delete(rawMsg, key) + case "resourceProvisioning": + err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &r.Resources) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &r.Secrets) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &r.TLS) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &r.Username) + delete(rawMsg, key) + case "vHost": + err = unpopulate(val, "VHost", &r.VHost) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RabbitMQSecrets. func (r RabbitMQSecrets) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -557,6 +729,37 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. +func (r RecipeUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", r.Name) + populate(objectMap, "parameters", r.Parameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipeUpdate. +func (r *RecipeUpdate) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &r.Parameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -626,6 +829,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "compute", r.Compute) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) } @@ -639,6 +843,9 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "compute": + r.Compute, err = unmarshalEnvironmentComputeClassification(val) + delete(rawMsg, key) case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) delete(rawMsg, key) diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go new file mode 100644 index 0000000000..cba5e61f5a --- /dev/null +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -0,0 +1,30 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package v20220315privatepreview + +import "encoding/json" + +func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (EnvironmentComputeClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EnvironmentComputeClassification + switch m["kind"] { + case "kubernetes": + b = &KubernetesCompute{} + default: + b = &EnvironmentCompute{} + } + return b, json.Unmarshal(rawMsg, b) +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go index 70178b3461..785ec94514 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go @@ -19,7 +19,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -32,7 +31,9 @@ type RabbitMqQueuesClient struct { } // NewRabbitMqQueuesClient creates a new instance of RabbitMqQueuesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewRabbitMqQueuesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RabbitMqQueuesClient, error) { @@ -55,30 +56,47 @@ pl: pl, return client, nil } -// CreateOrUpdate - Creates or updates a RabbitMQQueueResource +// BeginCreateOrUpdate - Create a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource +// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource // resource - Resource create parameters. -// options - RabbitMqQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.CreateOrUpdate +// options - RabbitMqQueuesClientBeginCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginCreateOrUpdate // method. -func (client *RabbitMqQueuesClient) CreateOrUpdate(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientCreateOrUpdateOptions) (RabbitMqQueuesClientCreateOrUpdateResponse, error) { +func (client *RabbitMqQueuesClient) BeginCreateOrUpdate(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RabbitMqQueuesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, rabbitMQQueueName, resource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RabbitMqQueuesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create a RabbitMQQueueResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *RabbitMqQueuesClient) createOrUpdate(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, rabbitMQQueueName, resource, options) if err != nil { - return RabbitMqQueuesClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return RabbitMqQueuesClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return RabbitMqQueuesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RabbitMqQueuesClient) createOrUpdateCreateRequest(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RabbitMqQueuesClient) createOrUpdateCreateRequest(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if rabbitMQQueueName == "" { @@ -96,45 +114,46 @@ func (client *RabbitMqQueuesClient) createOrUpdateCreateRequest(ctx context.Cont return req, runtime.MarshalAsJSON(req, resource) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RabbitMqQueuesClient) createOrUpdateHandleResponse(resp *http.Response) (RabbitMqQueuesClientCreateOrUpdateResponse, error) { - result := RabbitMqQueuesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) +// BeginDelete - Delete a RabbitMQQueueResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// options - RabbitMqQueuesClientBeginDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.BeginDelete +// method. +func (client *RabbitMqQueuesClient) BeginDelete(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientBeginDeleteOptions) (*runtime.Poller[RabbitMqQueuesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, rabbitMQQueueName, options) if err != nil { - return RabbitMqQueuesClientCreateOrUpdateResponse{}, err + return nil, err } - result.RetryAfter = &retryAfter + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RabbitMqQueuesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - if err := runtime.UnmarshalAsJSON(resp, &result.RabbitMQQueueResource); err != nil { - return RabbitMqQueuesClientCreateOrUpdateResponse{}, err - } - return result, nil } -// Delete - Deletes an existing RabbitMQQueueResource +// Delete - Delete a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource -// options - RabbitMqQueuesClientDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.Delete method. -func (client *RabbitMqQueuesClient) Delete(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientDeleteOptions) (RabbitMqQueuesClientDeleteResponse, error) { +func (client *RabbitMqQueuesClient) deleteOperation(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, rabbitMQQueueName, options) if err != nil { - return RabbitMqQueuesClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return RabbitMqQueuesClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return RabbitMqQueuesClientDeleteResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.deleteHandleResponse(resp) + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *RabbitMqQueuesClient) deleteCreateRequest(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientDeleteOptions) (*policy.Request, error) { +func (client *RabbitMqQueuesClient) deleteCreateRequest(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if rabbitMQQueueName == "" { @@ -152,24 +171,10 @@ func (client *RabbitMqQueuesClient) deleteCreateRequest(ctx context.Context, rab return req, nil } -// deleteHandleResponse handles the Delete response. -func (client *RabbitMqQueuesClient) deleteHandleResponse(resp *http.Response) (RabbitMqQueuesClientDeleteResponse, error) { - result := RabbitMqQueuesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return RabbitMqQueuesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a RabbitMQQueueResource +// Get - Get a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource +// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource // options - RabbitMqQueuesClientGetOptions contains the optional parameters for the RabbitMqQueuesClient.Get method. func (client *RabbitMqQueuesClient) Get(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientGetOptions) (RabbitMqQueuesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, rabbitMQQueueName, options) @@ -214,40 +219,40 @@ func (client *RabbitMqQueuesClient) getHandleResponse(resp *http.Response) (Rabb return result, nil } -// NewListByRootScopePager - Lists information about all RabbitMQQueueResources in the given root scope +// NewListByScopePager - List RabbitMQQueueResource resources by Scope // Generated from API version 2022-03-15-privatepreview -// options - RabbitMqQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqQueuesClient.ListByRootScope +// options - RabbitMqQueuesClientListByScopeOptions contains the optional parameters for the RabbitMqQueuesClient.ListByScope // method. -func (client *RabbitMqQueuesClient) NewListByRootScopePager(options *RabbitMqQueuesClientListByRootScopeOptions) (*runtime.Pager[RabbitMqQueuesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[RabbitMqQueuesClientListByRootScopeResponse]{ - More: func(page RabbitMqQueuesClientListByRootScopeResponse) bool { +func (client *RabbitMqQueuesClient) NewListByScopePager(options *RabbitMqQueuesClientListByScopeOptions) (*runtime.Pager[RabbitMqQueuesClientListByScopeResponse]) { + return runtime.NewPager(runtime.PagingHandler[RabbitMqQueuesClientListByScopeResponse]{ + More: func(page RabbitMqQueuesClientListByScopeResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *RabbitMqQueuesClientListByRootScopeResponse) (RabbitMqQueuesClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *RabbitMqQueuesClientListByScopeResponse) (RabbitMqQueuesClientListByScopeResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) + req, err = client.listByScopeCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return RabbitMqQueuesClientListByRootScopeResponse{}, err + return RabbitMqQueuesClientListByScopeResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return RabbitMqQueuesClientListByRootScopeResponse{}, err + return RabbitMqQueuesClientListByScopeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RabbitMqQueuesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return RabbitMqQueuesClientListByScopeResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listByScopeHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *RabbitMqQueuesClient) listByRootScopeCreateRequest(ctx context.Context, options *RabbitMqQueuesClientListByRootScopeOptions) (*policy.Request, error) { +// listByScopeCreateRequest creates the ListByScope request. +func (client *RabbitMqQueuesClient) listByScopeCreateRequest(ctx context.Context, options *RabbitMqQueuesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) @@ -261,11 +266,11 @@ func (client *RabbitMqQueuesClient) listByRootScopeCreateRequest(ctx context.Con return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *RabbitMqQueuesClient) listByRootScopeHandleResponse(resp *http.Response) (RabbitMqQueuesClientListByRootScopeResponse, error) { - result := RabbitMqQueuesClientListByRootScopeResponse{} +// listByScopeHandleResponse handles the ListByScope response. +func (client *RabbitMqQueuesClient) listByScopeHandleResponse(resp *http.Response) (RabbitMqQueuesClientListByScopeResponse, error) { + result := RabbitMqQueuesClientListByScopeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RabbitMQQueueResourceListResult); err != nil { - return RabbitMqQueuesClientListByRootScopeResponse{}, err + return RabbitMqQueuesClientListByScopeResponse{}, err } return result, nil } @@ -273,11 +278,12 @@ func (client *RabbitMqQueuesClient) listByRootScopeHandleResponse(resp *http.Res // ListSecrets - Lists secrets values for the specified RabbitMQQueue resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource +// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// body - The content of the action request // options - RabbitMqQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqQueuesClient.ListSecrets // method. -func (client *RabbitMqQueuesClient) ListSecrets(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientListSecretsOptions) (RabbitMqQueuesClientListSecretsResponse, error) { - req, err := client.listSecretsCreateRequest(ctx, rabbitMQQueueName, options) +func (client *RabbitMqQueuesClient) ListSecrets(ctx context.Context, rabbitMQQueueName string, body map[string]interface{}, options *RabbitMqQueuesClientListSecretsOptions) (RabbitMqQueuesClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, rabbitMQQueueName, body, options) if err != nil { return RabbitMqQueuesClientListSecretsResponse{}, err } @@ -292,7 +298,7 @@ func (client *RabbitMqQueuesClient) ListSecrets(ctx context.Context, rabbitMQQue } // listSecretsCreateRequest creates the ListSecrets request. -func (client *RabbitMqQueuesClient) listSecretsCreateRequest(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientListSecretsOptions) (*policy.Request, error) { +func (client *RabbitMqQueuesClient) listSecretsCreateRequest(ctx context.Context, rabbitMQQueueName string, body map[string]interface{}, options *RabbitMqQueuesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if rabbitMQQueueName == "" { @@ -307,7 +313,7 @@ func (client *RabbitMqQueuesClient) listSecretsCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, body) } // listSecretsHandleResponse handles the ListSecrets response. @@ -319,3 +325,61 @@ func (client *RabbitMqQueuesClient) listSecretsHandleResponse(resp *http.Respons return result, nil } +// BeginUpdate - Update a RabbitMQQueueResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// properties - The resource properties to be updated. +// options - RabbitMqQueuesClientBeginUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginUpdate +// method. +func (client *RabbitMqQueuesClient) BeginUpdate(ctx context.Context, rabbitMQQueueName string, properties RabbitMQQueueResourceUpdate, options *RabbitMqQueuesClientBeginUpdateOptions) (*runtime.Poller[RabbitMqQueuesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, rabbitMQQueueName, properties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RabbitMqQueuesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a RabbitMQQueueResource +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-03-15-privatepreview +func (client *RabbitMqQueuesClient) update(ctx context.Context, rabbitMQQueueName string, properties RabbitMQQueueResourceUpdate, options *RabbitMqQueuesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, rabbitMQQueueName, properties, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *RabbitMqQueuesClient) updateCreateRequest(ctx context.Context, rabbitMQQueueName string, properties RabbitMQQueueResourceUpdate, options *RabbitMqQueuesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}" + urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) + if rabbitMQQueueName == "" { + return nil, errors.New("parameter rabbitMQQueueName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{rabbitMQQueueName}", url.PathEscape(rabbitMQQueueName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-03-15-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go index a030141adf..6d9628da03 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -16,14 +16,11 @@ type OperationsClientListResponse struct { // RabbitMqQueuesClientCreateOrUpdateResponse contains the response from method RabbitMqQueuesClient.CreateOrUpdate. type RabbitMqQueuesClientCreateOrUpdateResponse struct { RabbitMQQueueResource - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } // RabbitMqQueuesClientDeleteResponse contains the response from method RabbitMqQueuesClient.Delete. type RabbitMqQueuesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 + // placeholder for future response values } // RabbitMqQueuesClientGetResponse contains the response from method RabbitMqQueuesClient.Get. @@ -31,8 +28,8 @@ type RabbitMqQueuesClientGetResponse struct { RabbitMQQueueResource } -// RabbitMqQueuesClientListByRootScopeResponse contains the response from method RabbitMqQueuesClient.ListByRootScope. -type RabbitMqQueuesClientListByRootScopeResponse struct { +// RabbitMqQueuesClientListByScopeResponse contains the response from method RabbitMqQueuesClient.ListByScope. +type RabbitMqQueuesClientListByScopeResponse struct { RabbitMQQueueResourceListResult } @@ -41,3 +38,8 @@ type RabbitMqQueuesClientListSecretsResponse struct { RabbitMQListSecretsResult } +// RabbitMqQueuesClientUpdateResponse contains the response from method RabbitMqQueuesClient.Update. +type RabbitMqQueuesClientUpdateResponse struct { + RabbitMQQueueResource +} + diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index f9e4f49d3c..03ed579d48 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -4372,7 +4372,7 @@ }, "Recipe": { "type": "object", - "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "properties": { "name": { "type": "string", @@ -4483,7 +4483,7 @@ }, "RecipeUpdate": { "type": "object", - "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "properties": { "name": { "type": "string", diff --git a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json index 880a038b92..d80cf1e782 100644 --- a/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/openapi.json @@ -955,7 +955,7 @@ "definitions": { "DaprPubSubBrokerProperties": { "type": "object", - "description": "PubSubBroker portable resource properties", + "description": "Dapr PubSubBroker portable resource properties", "properties": { "environment": { "type": "string", @@ -1015,7 +1015,7 @@ }, "DaprPubSubBrokerResource": { "type": "object", - "description": "PubSubBroker portable resource", + "description": "Dapr PubSubBroker portable resource", "properties": { "properties": { "$ref": "#/definitions/DaprPubSubBrokerProperties", @@ -1115,7 +1115,7 @@ }, "DaprSecretStoreProperties": { "type": "object", - "description": "DaprSecretStore portable resource properties", + "description": "Dapr SecretStore portable resource properties", "properties": { "environment": { "type": "string", @@ -1168,7 +1168,7 @@ }, "DaprSecretStoreResource": { "type": "object", - "description": "DaprSecretStore portable resource", + "description": "Dapr SecretStore portable resource", "properties": { "properties": { "$ref": "#/definitions/DaprSecretStoreProperties", @@ -1261,7 +1261,7 @@ }, "DaprStateStoreProperties": { "type": "object", - "description": "StateStore portable resource properties", + "description": "Dapr StateStore portable resource properties", "properties": { "environment": { "type": "string", @@ -1321,7 +1321,7 @@ }, "DaprStateStoreResource": { "type": "object", - "description": "StateStore portable resource", + "description": "Dapr StateStore portable resource", "properties": { "properties": { "$ref": "#/definitions/DaprStateStoreProperties", @@ -1580,7 +1580,7 @@ }, "Recipe": { "type": "object", - "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "properties": { "name": { "type": "string", @@ -1598,7 +1598,7 @@ }, "RecipeUpdate": { "type": "object", - "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "properties": { "name": { "type": "string", diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json deleted file mode 100644 index 0c89ec2e56..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "mongoDatabaseName": "mongo0", - "api-version": "2022-03-15-privatepreview", - "MongoDatabaseParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters": { - "foo": "bar" - } - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Datastores/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters": { - "foo": "bar" - } - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Datastores/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters": { - "foo": "bar" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateRecipe.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateRecipe.json new file mode 100644 index 0000000000..42e4018d11 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateRecipe.json @@ -0,0 +1,62 @@ +{ + "operationId": "MongoDatabases_CreateOrUpdate", + "title": "Create or update a MongoDatabase resource with recipe", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "mongoDatabaseName": "mongo0", + "api-version": "2022-03-15-privatepreview", + "MongoDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateValues.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateValues.json index ae4375dd06..0d6be4423b 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_CreateOrUpdateValues.json @@ -1,13 +1,15 @@ { + "operationId": "MongoDatabases_CreateOrUpdate", + "title": "Create or update a MongoDatabase resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "mongoDatabaseName": "mongo0", "api-version": "2022-03-15-privatepreview", "MongoDatabaseParameters": { - "location": "West US", + "location": "global", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, @@ -27,14 +29,14 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", "name": "mongo0", "type": "Applications.Datastores/mongoDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, @@ -44,14 +46,14 @@ }, "201": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", "name": "mongo0", "type": "Applications.Datastores/mongoDatabases", "location": "global", "properties": { "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Delete.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Delete.json index d4048e1792..c5f7221cbf 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "MongoDatabases_Delete", + "title": "Delete a MongoDatabase resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "mongoDatabaseName": "mongo0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Get.json similarity index 57% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Get.json index d6f0030183..79e1b7ae90 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Get.json @@ -1,20 +1,22 @@ { + "operationId": "MongoDatabases_Get", + "title": "Get a MongoDatabase resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "mongoDatabaseName": "mongo0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", "name": "mongo0", "type": "Applications.Datastores/mongoDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_List.json similarity index 59% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_List.json index 12fbbaaad0..0739f0cbb0 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_List.json @@ -1,6 +1,8 @@ { + "operationId": "MongoDatabases_ListByScope", + "title": "List MongoDatabase resources by resource group", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,13 +10,13 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", "name": "mongo0", "type": "Applications.Datastores/mongoDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, @@ -27,14 +29,14 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo1", "name": "mongo1", "type": "Applications.Datastores/mongoDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, @@ -53,8 +55,8 @@ "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "recipe": { "name": "cosmosdb", "parameters": { @@ -64,7 +66,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_ListByRootScope.json similarity index 61% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_ListByRootScope.json index 8a0338b3df..4113d8a707 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_ListByRootScope.json @@ -1,6 +1,8 @@ { + "operationId": "MongoDatabases_ListByScope", + "title": "List MongoDatabase resources by rootScope", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,14 +10,14 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", "name": "mongo0", "type": "Applications.Datastores/mongoDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, @@ -34,8 +36,8 @@ "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "host": "testAccount1.mongo.cosmos.azure.com", "port": 10255, @@ -54,8 +56,8 @@ "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "recipe": { "name": "cosmosdb", "parameters": { @@ -65,7 +67,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Datastores/mongoDatabases?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Datastores/mongoDatabases?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_ListSecrets.json similarity index 66% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_ListSecrets.json index b01ba95aec..504f90ffb2 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_ListSecrets.json @@ -1,6 +1,8 @@ { + "operationId": "MongoDatabases_ListSecrets", + "title": "List the secrets of a MongoDatabase resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "mongoDatabaseName": "mongo0" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Update.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Update.json new file mode 100644 index 0000000000..d3461506a7 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/MongoDatabases_Update.json @@ -0,0 +1,65 @@ +{ + "operationId": "MongoDatabases_Update", + "title": "Update a MongoDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "mongoDatabaseName": "mongo0", + "api-version": "2022-03-15-privatepreview", + "MongoDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" + }, + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "mongo0" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "mongo0" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesList.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesList.json deleted file mode 100644 index 9a7a17a8be..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesList.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" - } - ], - "resourceProvisioning": "manual", - "host": "myrediscache.redis.cache.windows.net", - "port": 6380, - "username": "username" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis1", - "name": "redis1", - "type": "Applications.Datastores/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis2", - "name": "redis2", - "type": "Applications.Datastores/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "resourceProvisioning": "manual", - "host": "myrediscache.redis.cache.windows.net", - "port": 6380, - "username": "username" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json deleted file mode 100644 index 5775a2f295..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "redisCacheName": "redis0", - "api-version": "2022-03-15-privatepreview", - "RedisCacheParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json deleted file mode 100644 index 2a08c560b7..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "redisCacheName": "redis0", - "api-version": "2022-03-15-privatepreview", - "RedisCacheParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "myrediscache.redis.cache.windows.net", - "port": 6380, - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "myrediscache.redis.cache.windows.net", - "port": 6380, - "username": "username" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Datastores/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "myrediscache.redis.cache.windows.net", - "port": 6380, - "username": "username" - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdate.json similarity index 52% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdate.json index 2ec88102d9..003bc22fc3 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdate.json @@ -1,13 +1,15 @@ { + "operationId": "RedisCaches_CreateOrUpdate", + "title": "Create or update a RedisCache resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "redisCacheName": "redis0", "api-version": "2022-03-15-privatepreview", "RedisCacheParameters": { - "location": "West US", + "location": "global", "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -22,14 +24,14 @@ "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", "name": "redis0", "type": "Applications.Datastores/redisCaches", - "location": "West US", + "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -43,14 +45,14 @@ }, "201": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", "name": "redis0", "type": "Applications.Datastores/redisCaches", - "location": "West US", + "location": "global", "properties": { "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateRecipe.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateRecipe.json new file mode 100644 index 0000000000..838f7332d1 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateRecipe.json @@ -0,0 +1,62 @@ +{ + "operationId": "RedisCaches_CreateOrUpdate", + "title": "Create or update a RedisCache resource with recipe", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateValues.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateValues.json new file mode 100644 index 0000000000..417b0a2588 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_CreateOrUpdateValues.json @@ -0,0 +1,59 @@ +{ + "operationId": "RedisCaches_CreateOrUpdate", + "title": "Create or update a RedisCache resource with values", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Delete.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Delete.json index f1198944ae..dbedada922 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "RedisCaches_Delete", + "title": "Delete a RedisCache resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "redisCacheName": "redis0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Get.json similarity index 56% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Get.json index 79acf8fafb..0bfe5aad6f 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Get.json @@ -1,20 +1,22 @@ { + "operationId": "RedisCaches_Get", + "title": "Get a RedisCache resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "redisCacheName": "redis0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", "name": "redis0", "type": "Applications.Datastores/redisCaches", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_List.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_List.json new file mode 100644 index 0000000000..20eff8c433 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_List.json @@ -0,0 +1,69 @@ +{ + "operationId": "RedisCaches_ListByScope", + "title": "List RedisCache resources by resource group", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis1", + "name": "redis1", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis2", + "name": "redis2", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_ListByRootScope.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_ListByRootScope.json index 8fbdf550d2..7c74f8ef11 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_ListByRootScope.json @@ -1,6 +1,8 @@ { + "operationId": "RedisCaches_ListByScope", + "title": "List RedisCache resources by rootScope", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,14 +10,14 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", "name": "redis0", "type": "Applications.Datastores/redisCaches", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resourceProvisioning": "manual", "resources": [ { @@ -27,14 +29,14 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis1", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis1", "name": "redis1", "type": "Applications.Datastores/redisCaches", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "recipe": { "name": "redis", "parameters": { @@ -50,8 +52,8 @@ "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", "resourceProvisioning": "manual", "host": "myrediscache.redis.cache.windows.net", "port": 6380, @@ -59,7 +61,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Datastores/redisCaches?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Datastores/redisCaches?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_ListSecrets.json similarity index 69% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_ListSecrets.json index b1f3620fee..7e0f2d9547 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_ListSecrets.json @@ -1,6 +1,8 @@ { + "operationId": "RedisCaches_ListSecrets", + "title": "List the secrets of a RedisCaches resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "testGroup", "api-version": "2022-03-15-privatepreview", diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Update.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Update.json new file mode 100644 index 0000000000..04d8bed899 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/RedisCaches_Update.json @@ -0,0 +1,68 @@ +{ + "operationId": "RedisCaches_Update", + "title": "Update a RedisCache resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json deleted file mode 100644 index f7b520b9fa..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Datastores/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", - "name": "sql1", - "type": "Applications.Datastores/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql2", - "name": "sql2", - "type": "Applications.Datastores/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "recipe": { - "name": "sqldb", - "parameters": { - "foo": "bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json deleted file mode 100644 index 11fd33f43f..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "sqlDatabaseName": "sql0", - "api-version": "2022-03-15-privatepreview", - "SQLDatabaseParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "resourceProvisioning": "manual" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Datastores/sqlDatabases", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", - "name": "sql1", - "type": "Applications.Datastores/sqlDatabases", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual" - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_CreateOrUpdate.json new file mode 100644 index 0000000000..fecc16494a --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_CreateOrUpdate.json @@ -0,0 +1,52 @@ +{ + "operationId": "SqlDatabases_CreateOrUpdate", + "title": "Create or update a SqlDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "sqlDatabaseName": "sql0", + "api-version": "2022-03-15-privatepreview", + "SQLDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Delete.json similarity index 53% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Delete.json index 9410434361..f703412f87 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Delete.json @@ -1,6 +1,8 @@ { + "operationId": "SqlDatabases_Delete", + "title": "Delete a SqlDatabase resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "sqlDatabaseName": "sql0", "api-version": "2022-03-15-privatepreview" }, diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Get.json similarity index 55% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Get.json index 2547c41efd..bf6cc2f581 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Get.json @@ -1,20 +1,22 @@ { + "operationId": "SqlDatabases_Get", + "title": "Get a SqlDatabase resource", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + "rootScope": "planes/radius/local/resourceGroups/testGroup", "api-version": "2022-03-15-privatepreview", "sqlDatabaseName": "sql0" }, "responses": { "200": { "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", "name": "sql0", "type": "Applications.Datastores/sqlDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resources": [ { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_List.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_List.json new file mode 100644 index 0000000000..928bbd95f9 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_List.json @@ -0,0 +1,67 @@ +{ + "operationId": "SqlDatabases_ListByScope", + "title": "List SqlDatabases resources by resource group", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql2", + "name": "sql2", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_ListByRootScope.json similarity index 56% rename from swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json rename to swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_ListByRootScope.json index bab24558dc..1f16e6e489 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_ListByRootScope.json @@ -1,6 +1,8 @@ { + "operationId": "SqlDatabases_ListByScope", + "title": "List SqlDatabases resources by rootScope", "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", + "rootScope": "planes/radius/local", "api-version": "2022-03-15-privatepreview" }, "responses": { @@ -8,14 +10,14 @@ "body": { "value": [ { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", "name": "sql0", "type": "Applications.Datastores/sqlDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", "resources": [ { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" @@ -33,8 +35,8 @@ "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", "resources": [ { "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase1" @@ -46,14 +48,14 @@ } }, { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql2", + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql2", "name": "sql2", "type": "Applications.Datastores/sqlDatabases", "location": "global", "properties": { "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", "recipe": { "name": "sqldb", "parameters": { @@ -63,7 +65,7 @@ } } ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Datastores/sqlDatabases?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Datastores/sqlDatabases?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Update.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Update.json new file mode 100644 index 0000000000..52e5223523 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/examples/SQLDatabases_Update.json @@ -0,0 +1,52 @@ +{ + "operationId": "SqlDatabases_Update", + "title": "Update a SqlDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "sqlDatabaseName": "sql0", + "api-version": "2022-03-15-privatepreview", + "SQLDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/openapi.json index fc9f565d0d..dc2fd9552e 100644 --- a/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/openapi.json @@ -1,12 +1,12 @@ { "swagger": "2.0", "info": { - "title": "Applications.Datastores Management APIs", + "title": "Applications.Datastores Resource Management APIs", "version": "2022-03-15-privatepreview", "description": "REST APIs for Applications.Datastores", - "x-cadl-generated": [ + "x-typespec-generated": [ { - "emitter": "@azure-tools/cadl-autorest" + "emitter": "@azure-tools/typespec-autorest" } ] }, @@ -46,26 +46,26 @@ "name": "MongoDatabases" }, { - "name": "SqlDatabases" + "name": "RedisCaches" }, { - "name": "RedisCaches" + "name": "SqlDatabases" } ], "paths": { "/{rootScope}/providers/Applications.Datastores/mongoDatabases": { "get": { + "operationId": "MongoDatabases_ListByScope", "tags": [ "MongoDatabases" ], - "operationId": "MongoDatabases_ListByRootScope", - "description": "Lists information about all MongoDatabaseResources in the given root scope", + "description": "List MongoDatabaseResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -82,6 +82,14 @@ } } }, + "x-ms-examples": { + "List MongoDatabase resources by resource group": { + "$ref": "./examples/MongoDatabases_List.json" + }, + "List MongoDatabase resources by rootScope": { + "$ref": "./examples/MongoDatabases_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -89,27 +97,26 @@ }, "/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}": { "get": { + "operationId": "MongoDatabases_Get", "tags": [ "MongoDatabases" ], - "operationId": "MongoDatabases_Get", - "description": "Retrieves information about a MongoDatabaseResource", + "description": "Get a MongoDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "mongoDatabaseName", "in": "path", + "description": "The name of the MongoDatabase portable resource resource", "required": true, - "description": "The name of the Mongo database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -125,36 +132,40 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a MongoDatabase resource": { + "$ref": "./examples/MongoDatabases_Get.json" + } } }, "put": { + "operationId": "MongoDatabases_CreateOrUpdate", "tags": [ "MongoDatabases" ], - "operationId": "MongoDatabases_CreateOrUpdate", - "description": "Creates or updates a MongoDatabaseResource", + "description": "Create a MongoDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "mongoDatabaseName", "in": "path", + "description": "The name of the MongoDatabase portable resource resource", "required": true, - "description": "The name of the Mongo database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/MongoDatabaseResource" } @@ -162,54 +173,130 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'MongoDatabaseResource' update operation succeeded", "schema": { "$ref": "#/definitions/MongoDatabaseResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'MongoDatabaseResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/MongoDatabaseResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a MongoDatabase resource with recipe": { + "$ref": "./examples/MongoDatabases_CreateOrUpdateRecipe.json" + }, + "Create or update a MongoDatabase resource": { + "$ref": "./examples/MongoDatabases_CreateOrUpdateValues.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "MongoDatabases_Update", + "tags": [ + "MongoDatabases" + ], + "description": "Update a MongoDatabaseResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "mongoDatabaseName", + "in": "path", + "description": "The name of the MongoDatabase portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/MongoDatabaseResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/MongoDatabaseResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "MongoDatabases_Delete", "tags": [ "MongoDatabases" ], - "operationId": "MongoDatabases_Delete", - "description": "Deletes an existing MongoDatabaseResource", + "description": "Delete a MongoDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "mongoDatabaseName", "in": "path", + "description": "The name of the MongoDatabase portable resource resource", "required": true, - "description": "The name of the Mongo database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -220,9 +307,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -236,8 +327,13 @@ } } }, + "x-ms-examples": { + "Delete a MongoDatabase resource": { + "$ref": "./examples/MongoDatabases_Delete.json" + } + }, "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" + "final-state-via": "location" }, "x-ms-long-running-operation": true } @@ -245,23 +341,35 @@ "/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}/listSecrets": { "post": { "operationId": "MongoDatabases_ListSecrets", - "description": "Lists secrets values for the specified Mongo database resource", + "tags": [ + "MongoDatabases" + ], + "description": "Lists secrets values for the specified MongoDatabases resource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "mongoDatabaseName", "in": "path", + "description": "The name of the MongoDatabase portable resource resource", "required": true, - "description": "The name of the Mongo database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } } ], "responses": { @@ -277,22 +385,27 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "List the secrets of a MongoDatabase resource": { + "$ref": "./examples/MongoDatabases_ListSecrets.json" + } } } }, "/{rootScope}/providers/Applications.Datastores/redisCaches": { "get": { + "operationId": "RedisCaches_ListByScope", "tags": [ "RedisCaches" ], - "operationId": "RedisCaches_ListByRootScope", - "description": "Lists information about all RedisCacheResources in the given root scope", + "description": "List RedisCacheResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -309,6 +422,14 @@ } } }, + "x-ms-examples": { + "List RedisCache resources by resource group": { + "$ref": "./examples/RedisCaches_List.json" + }, + "List RedisCache resources by rootScope": { + "$ref": "./examples/RedisCaches_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -316,26 +437,26 @@ }, "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}": { "get": { + "operationId": "RedisCaches_Get", "tags": [ "RedisCaches" ], - "operationId": "RedisCaches_Get", - "description": "Retrieves information about a RedisCacheResource", + "description": "Get a RedisCacheResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "redisCacheName", "in": "path", + "description": "The name of the RedisCache portable resource resource", "required": true, - "description": "The name of the Redis cache portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -351,35 +472,40 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a RedisCache resource": { + "$ref": "./examples/RedisCaches_Get.json" + } } }, "put": { + "operationId": "RedisCaches_CreateOrUpdate", "tags": [ "RedisCaches" ], - "operationId": "RedisCaches_CreateOrUpdate", - "description": "Creates or updates a RedisCacheResource", + "description": "Create a RedisCacheResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "redisCacheName", "in": "path", + "description": "The name of the RedisCache portable resource resource", "required": true, - "description": "The name of the Redis cache portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/RedisCacheResource" } @@ -387,53 +513,138 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'RedisCacheResource' update operation succeeded", "schema": { "$ref": "#/definitions/RedisCacheResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'RedisCacheResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/RedisCacheResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a RedisCache resource": { + "$ref": "./examples/RedisCaches_CreateOrUpdate.json" + }, + "Create or update a RedisCache resource with recipe": { + "$ref": "./examples/RedisCaches_CreateOrUpdateRecipe.json" + }, + "Create or update a RedisCache resource with values": { + "$ref": "./examples/RedisCaches_CreateOrUpdateValues.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "RedisCaches_Update", + "tags": [ + "RedisCaches" + ], + "description": "Update a RedisCacheResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "redisCacheName", + "in": "path", + "description": "The name of the RedisCache portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/RedisCacheResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/RedisCacheResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Update a RedisCache resource": { + "$ref": "./examples/RedisCaches_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "RedisCaches_Delete", "tags": [ "RedisCaches" ], - "operationId": "RedisCaches_Delete", - "description": "Deletes an existing RedisCacheResource", + "description": "Delete a RedisCacheResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "redisCacheName", "in": "path", + "description": "The name of the RedisCache portable resource resource", "required": true, - "description": "The name of the Redis cache portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -444,9 +655,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -459,29 +674,50 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Delete a RedisCache resource": { + "$ref": "./examples/RedisCaches_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true } }, "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}/listSecrets": { "post": { "operationId": "RedisCaches_ListSecrets", - "description": "Lists secrets values for the specified Redis cache resource", + "tags": [ + "RedisCaches" + ], + "description": "Lists secrets values for the specified RedisCache resource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "redisCacheName", "in": "path", + "description": "The name of the RedisCache portable resource resource", "required": true, - "description": "The name of the Redis cache portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } } ], "responses": { @@ -497,22 +733,27 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "List the secrets of a RedisCaches resource": { + "$ref": "./examples/RedisCaches_ListSecrets.json" + } } } }, "/{rootScope}/providers/Applications.Datastores/sqlDatabases": { "get": { + "operationId": "SqlDatabases_ListByScope", "tags": [ "SqlDatabases" ], - "operationId": "SqlDatabases_ListByRootScope", - "description": "Lists information about all SqlDatabaseResources in the given root scope", + "description": "List SqlDatabaseResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -529,6 +770,14 @@ } } }, + "x-ms-examples": { + "List SqlDatabases resources by resource group": { + "$ref": "./examples/SQLDatabases_List.json" + }, + "List SqlDatabases resources by rootScope": { + "$ref": "./examples/SQLDatabases_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -536,27 +785,26 @@ }, "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}": { "get": { + "operationId": "SqlDatabases_Get", "tags": [ "SqlDatabases" ], - "operationId": "SqlDatabases_Get", - "description": "Retrieves information about a SqlDatabaseResource", + "description": "Get a SqlDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "sqlDatabaseName", "in": "path", + "description": "The name of the SqlDatabase portable resource resource", "required": true, - "description": "The name of the SQL database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -572,36 +820,40 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a SqlDatabase resource": { + "$ref": "./examples/SQLDatabases_Get.json" + } } }, "put": { + "operationId": "SqlDatabases_CreateOrUpdate", "tags": [ "SqlDatabases" ], - "operationId": "SqlDatabases_CreateOrUpdate", - "description": "Creates or updates a SqlDatabaseResource", + "description": "Create a SqlDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "sqlDatabaseName", "in": "path", + "description": "The name of the SqlDatabase portable resource resource", "required": true, - "description": "The name of the SQL database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/SqlDatabaseResource" } @@ -609,22 +861,22 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'SqlDatabaseResource' update operation succeeded", "schema": { "$ref": "#/definitions/SqlDatabaseResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'SqlDatabaseResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/SqlDatabaseResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, - "schema": { - "$ref": "#/definitions/SqlDatabaseResource" } }, "default": { @@ -633,78 +885,181 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Create or update a SqlDatabase resource": { + "$ref": "./examples/SQLDatabases_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true }, - "delete": { + "patch": { + "operationId": "SqlDatabases_Update", "tags": [ "SqlDatabases" ], - "operationId": "SqlDatabases_Delete", - "description": "Deletes an existing SqlDatabaseResource", + "description": "Update a SqlDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "sqlDatabaseName", "in": "path", + "description": "The name of the SqlDatabase portable resource resource", "required": true, - "description": "The name of the SQL database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/SqlDatabaseResourceUpdate" + } } ], "responses": { "200": { - "description": "Resource deleted successfully." + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/SqlDatabaseResource" + } }, "202": { - "description": "Resource deletion accepted.", + "description": "Resource update request accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, - "204": { - "description": "Resource deleted successfully." - }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } - } - }, - "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}/listSecrets": { - "post": { - "operationId": "SqlDatabases_ListSecrets", - "description": "Lists secrets values for the specified SQL database resource", + }, + "x-ms-examples": { + "Update a SqlDatabase resource": { + "$ref": "./examples/SQLDatabases_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "SqlDatabases_Delete", + "tags": [ + "SqlDatabases" + ], + "description": "Delete a SqlDatabaseResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "sqlDatabaseName", "in": "path", + "description": "The name of the SqlDatabase portable resource resource", "required": true, - "description": "The name of the SQL database portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a SqlDatabase resource": { + "$ref": "./examples/SQLDatabases_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}/listSecrets": { + "post": { + "operationId": "SqlDatabases_ListSecrets", + "tags": [ + "SqlDatabases" + ], + "description": "Lists secrets values for the specified SqlDatabase resource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "sqlDatabaseName", + "in": "path", + "description": "The name of the SqlDatabase portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } } ], "responses": { @@ -725,10 +1080,10 @@ }, "/providers/Applications.Datastores/operations": { "get": { + "operationId": "Operations_List", "tags": [ "Operations" ], - "operationId": "Operations_List", "description": "List the operations for the provider", "parameters": [ { @@ -756,50 +1111,95 @@ } }, "definitions": { - "Application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "BasicDaprResourceProperties": { + "EnvironmentCompute": { "type": "object", + "description": "Represents backing compute resource", "properties": { - "componentName": { + "kind": { "type": "string", - "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", - "readOnly": true + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" } }, - "description": "Basic properties of a Dapr component object.", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } + "discriminator": "kind", + "required": [ + "kind" ] }, - "BasicResourceProperties": { + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { "type": "object", + "description": "IdentitySettings is the external identity setting.", "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" }, - "environment": { + "oidcIssuer": { "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + "description": "The URI for your compute platform's OIDC issuer" }, - "application": { - "$ref": "#/definitions/Application", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" } }, - "description": "Basic properties of a Radius resource.", "required": [ - "environment" + "kind" ] }, + "KubernetesCompute": { + "type": "object", + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, "MongoDatabaseListSecretsResult": { "type": "object", + "description": "The secret values for the given MongoDatabase resource", "properties": { "password": { "type": "string", @@ -809,15 +1209,28 @@ "type": "string", "description": "Connection string used to connect to the target Mongo database" } - }, - "description": "The secret values for the given Mongo database resource" + } }, "MongoDatabaseProperties": { "type": "object", + "description": "MongoDatabase portable resource properties", "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the Mongo database portable resource at the time the operation was called", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", "readOnly": true }, "secrets": { @@ -837,36 +1250,33 @@ "type": "string", "description": "Database name of the target Mongo database" }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Mongo database portable resource" - }, "resources": { "type": "array", + "description": "List of the resource IDs that support the MongoDB resource", "items": { "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the Mongo database resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." + } }, "username": { "type": "string", "description": "Username to use when connecting to the target Mongo database" + }, + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "Mongo database portable resource properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } + "required": [ + "environment" ] }, "MongoDatabaseResource": { "type": "object", + "description": "MongoDatabase portable resource", "properties": { "properties": { "$ref": "#/definitions/MongoDatabaseProperties", @@ -878,7 +1288,6 @@ ] } }, - "description": "Mongo database portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -887,29 +1296,95 @@ }, "MongoDatabaseResourceListResult": { "type": "object", + "description": "The response of a MongoDatabaseResource list operation.", "properties": { "value": { "type": "array", + "description": "The MongoDatabaseResource items on this page", "items": { "$ref": "#/definitions/MongoDatabaseResource" - }, - "x-cadl-name": "MongoDatabaseResource[]", - "description": "The MongoDatabaseResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a MongoDatabaseResource list operation.", "required": [ "value" ] }, + "MongoDatabaseResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the MongoDatabaseResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/MongoDatabaseResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "MongoDatabaseResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the MongoDatabaseResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "secrets": { + "$ref": "#/definitions/MongoDatabaseSecrets", + "description": "Secret values provided for the resource" + }, + "host": { + "type": "string", + "description": "Host name of the target Mongo database" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "Port value of the target Mongo database" + }, + "database": { + "type": "string", + "description": "Database name of the target Mongo database" + }, + "resources": { + "type": "array", + "description": "List of the resource IDs that support the MongoDB resource", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "username": { + "type": "string", + "description": "Username to use when connecting to the target Mongo database" + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, "MongoDatabaseSecrets": { "type": "object", + "description": "The secret values for the given MongoDatabase resource", "properties": { "password": { "type": "string", @@ -919,18 +1394,25 @@ "type": "string", "description": "Connection string used to connect to the target Mongo database" } - }, - "description": "The secret values for the given Mongo database resource" + } }, "OutputResource": { "type": "object", - "properties": {}, - "description": "Properties of an output resource." - }, - "Parameters": { - "type": "object", - "properties": {}, - "description": "Key/value parameters to pass into the recipe at deployment" + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } }, "ProvisioningState": { "type": "string", @@ -946,28 +1428,83 @@ ], "x-ms-enum": { "name": "ProvisioningState", - "modelAsString": true - } + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true }, "Recipe": { "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "properties": { "name": { "type": "string", "description": "The name of the recipe within the environment to use" }, "parameters": { - "$ref": "#/definitions/Parameters", - "description": "Key/value parameters to pass into the recipe at deployment" + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} } }, - "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "required": [ "name" ] }, + "RecipeUpdate": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + } + }, "RedisCacheListSecretsResult": { "type": "object", + "description": "The secret values for the given RedisCache resource", "properties": { "connectionString": { "type": "string", @@ -981,15 +1518,28 @@ "type": "string", "description": "The URL used to connect to the Redis cache" } - }, - "description": "The secret values for the given Redis cache resource" + } }, "RedisCacheProperties": { "type": "object", + "description": "RedisCache portable resource properties", "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the redis cache portable at the time the operation was called", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", "readOnly": true }, "secrets": { @@ -1013,32 +1563,29 @@ "type": "boolean", "description": "Specifies whether to enable SSL connections to the Redis cache" }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Redis cache portable resource" - }, "resources": { "type": "array", + "description": "List of the resource IDs that support the Redis resource", "items": { "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the Redis resource" + } + }, + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" }, "resourceProvisioning": { "$ref": "#/definitions/ResourceProvisioning", "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "Redis cache portable resource properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } + "required": [ + "environment" ] }, "RedisCacheResource": { "type": "object", + "description": "RedisCache portable resource", "properties": { "properties": { "$ref": "#/definitions/RedisCacheProperties", @@ -1050,7 +1597,6 @@ ] } }, - "description": "Redis cache portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -1059,29 +1605,95 @@ }, "RedisCacheResourceListResult": { "type": "object", + "description": "The response of a RedisCacheResource list operation.", "properties": { "value": { "type": "array", + "description": "The RedisCacheResource items on this page", "items": { "$ref": "#/definitions/RedisCacheResource" - }, - "x-cadl-name": "RedisCacheResource[]", - "description": "The RedisCacheResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a RedisCacheResource list operation.", "required": [ "value" ] }, + "RedisCacheResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the RedisCacheResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/RedisCacheResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "RedisCacheResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the RedisCacheResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "secrets": { + "$ref": "#/definitions/RedisCacheSecrets", + "description": "Secrets provided by resource" + }, + "host": { + "type": "string", + "description": "The host name of the target Redis cache" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port value of the target Redis cache" + }, + "username": { + "type": "string", + "description": "The username for Redis cache" + }, + "tls": { + "type": "boolean", + "description": "Specifies whether to enable SSL connections to the Redis cache" + }, + "resources": { + "type": "array", + "description": "List of the resource IDs that support the Redis resource", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, "RedisCacheSecrets": { "type": "object", + "description": "The secret values for the given RedisCache resource", "properties": { "connectionString": { "type": "string", @@ -1095,8 +1707,7 @@ "type": "string", "description": "The URL used to connect to the Redis cache" } - }, - "description": "The secret values for the given Redis cache resource" + } }, "ResourceProvisioning": { "type": "string", @@ -1107,106 +1718,132 @@ ], "x-ms-enum": { "name": "ResourceProvisioning", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "recipe", + "value": "recipe", + "description": "The resource lifecycle will be managed by Radius" + }, + { + "name": "manual", + "value": "manual", + "description": "The resource lifecycle will be managed by the user" + } + ] } }, "ResourceReference": { "type": "object", + "description": "Describes a reference to an existing resource", "properties": { "id": { "type": "string", "description": "Resource id of an existing resource" } }, - "description": "Describes a reference to an existing resource", "required": [ "id" ] }, "ResourceStatus": { "type": "object", + "description": "Status of a resource.", "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, "outputResources": { "type": "array", + "description": "Properties of an output resource", "items": { "$ref": "#/definitions/OutputResource" }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" + "x-ms-identifiers": [] } - }, - "description": "Status of a resource." + } }, "SqlDatabaseListSecretsResult": { "type": "object", + "description": "The secret values for the given SqlDatabase resource", "properties": { "password": { "type": "string", - "description": "Password to use when connecting to the target SQL database" + "description": "Password to use when connecting to the target Sql database" }, "connectionString": { "type": "string", - "description": "Connection string used to connect to the target SQL database" + "description": "Connection string used to connect to the target Sql database" } - }, - "description": "The secret values for the given SQL database resource" + } }, "SqlDatabaseProperties": { "type": "object", + "description": "SqlDatabase properties", "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the SQL database portable resource at the time the operation was called", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", "readOnly": true }, "database": { "type": "string", - "description": "The name of the SQL database." + "description": "The name of the Sql database." }, "server": { "type": "string", - "description": "The fully qualified domain name of the target SQL database." + "description": "The fully qualified domain name of the Sql database." }, "port": { "type": "integer", "format": "int32", - "description": "Port value of the target SQL database" + "description": "Port value of the target Sql database" }, "username": { "type": "string", - "description": "Username to use when connecting to the target SQL database" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the SQL database portable resource" + "description": "Username to use when connecting to the target Sql database" }, "resources": { "type": "array", + "description": "List of the resource IDs that support the SqlDatabase resource", "items": { "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the SQL database resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." + } }, "secrets": { "$ref": "#/definitions/SqlDatabaseSecrets", "description": "Secret values provided for the resource" + }, + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "Sql database properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } + "required": [ + "environment" ] }, "SqlDatabaseResource": { "type": "object", + "description": "SqlDatabase portable resource", "properties": { "properties": { "$ref": "#/definitions/SqlDatabaseProperties", @@ -1218,7 +1855,6 @@ ] } }, - "description": "Sql database portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -1227,52 +1863,135 @@ }, "SqlDatabaseResourceListResult": { "type": "object", + "description": "The response of a SqlDatabaseResource list operation.", "properties": { "value": { "type": "array", + "description": "The SqlDatabaseResource items on this page", "items": { "$ref": "#/definitions/SqlDatabaseResource" - }, - "x-cadl-name": "SqlDatabaseResource[]", - "description": "The SqlDatabaseResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a SqlDatabaseResource list operation.", "required": [ "value" ] }, + "SqlDatabaseResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the SqlDatabaseResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/SqlDatabaseResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "SqlDatabaseResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the SqlDatabaseResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "database": { + "type": "string", + "description": "The name of the Sql database." + }, + "server": { + "type": "string", + "description": "The fully qualified domain name of the Sql database." + }, + "port": { + "type": "integer", + "format": "int32", + "description": "Port value of the target Sql database" + }, + "username": { + "type": "string", + "description": "Username to use when connecting to the target Sql database" + }, + "resources": { + "type": "array", + "description": "List of the resource IDs that support the SqlDatabase resource", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "secrets": { + "$ref": "#/definitions/SqlDatabaseSecrets", + "description": "Secret values provided for the resource" + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, "SqlDatabaseSecrets": { "type": "object", + "description": "The secret values for the given SqlDatabase resource", "properties": { "password": { "type": "string", - "description": "Password to use when connecting to the target SQL database" + "description": "Password to use when connecting to the target Sql database" }, "connectionString": { "type": "string", - "description": "Connection string used to connect to the target SQL database" + "description": "Connection string used to connect to the target Sql database" } - }, - "description": "The secret values for the given SQL database resource" + } + }, + "Versions": { + "type": "string", + "description": "Supported API versions for the Applications.Databases resource provider.", + "enum": [ + "2022-03-15-privatepreview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_03_15_privatepreview", + "value": "2022-03-15-privatepreview", + "description": "2022-03-15-privatepreview" + } + ] + } } }, "parameters": { - "RootScopeParam": { + "RootScopeParameter": { "name": "rootScope", "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", "required": true, - "description": "The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "type": "string", "minLength": 1, "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true, - "type": "string" + "x-ms-skip-url-encoding": true } } } diff --git a/swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json new file mode 100644 index 0000000000..33873541da --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json @@ -0,0 +1,885 @@ +{ + "swagger": "2.0", + "info": { + "title": "Applications.Messagging Resource Management APIs", + "version": "2022-03-15-privatepreview", + "description": "REST API for Applications.Messagging", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "RabbitMQQueues" + } + ], + "paths": { + "/{rootScope}/providers/Applications.Messagging/rabbitMQQueues": { + "get": { + "operationId": "RabbitMqQueues_ListByScope", + "tags": [ + "RabbitMQQueues" + ], + "description": "List RabbitMQQueueResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/RabbitMQQueueResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Applications.Messagging/rabbitMQQueues/{rabbitMQQueueName}": { + "get": { + "operationId": "RabbitMqQueues_Get", + "tags": [ + "RabbitMQQueues" + ], + "description": "Get a RabbitMQQueueResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "rabbitMQQueueName", + "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/RabbitMQQueueResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "operationId": "RabbitMqQueues_Create", + "tags": [ + "RabbitMQQueues" + ], + "description": "Create a RabbitMQQueueResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "rabbitMQQueueName", + "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/RabbitMQQueueResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'RabbitMQQueueResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/RabbitMQQueueResource" + } + }, + "201": { + "description": "Resource 'RabbitMQQueueResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/RabbitMQQueueResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "RabbitMqQueues_Update", + "tags": [ + "RabbitMQQueues" + ], + "description": "Update a RabbitMQQueueResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "rabbitMQQueueName", + "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/RabbitMQQueueResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/RabbitMQQueueResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "RabbitMqQueues_Delete", + "tags": [ + "RabbitMQQueues" + ], + "description": "Delete a RabbitMQQueueResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "rabbitMQQueueName", + "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Applications.Messagging/rabbitMQQueues/{rabbitMQQueueName}/listSecrets": { + "post": { + "operationId": "RabbitMqQueues_ListSecrets", + "tags": [ + "RabbitMQQueues" + ], + "description": "Lists secrets values for the specified RabbitMQQueue resource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "rabbitMQQueueName", + "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/RabbitMQListSecretsResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Applications.Messagging/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "EnvironmentCompute": { + "type": "object", + "description": "Represents backing compute resource", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { + "type": "object", + "description": "IdentitySettings is the external identity setting.", + "properties": { + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" + }, + "oidcIssuer": { + "type": "string", + "description": "The URI for your compute platform's OIDC issuer" + }, + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" + } + }, + "required": [ + "kind" + ] + }, + "KubernetesCompute": { + "type": "object", + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, + "OutputResource": { + "type": "object", + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } + }, + "ProvisioningState": { + "type": "string", + "description": "Provisioning state of the portable resource at the time the operation was called", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Provisioning", + "Updating", + "Deleting", + "Accepted" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true + }, + "RabbitMQListSecretsResult": { + "type": "object", + "description": "The secret values for the given RabbitMQMessageQueue resource", + "properties": { + "password": { + "type": "string", + "description": "The password used to connect to the RabbitMQ instance" + }, + "uri": { + "type": "string", + "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" + } + } + }, + "RabbitMQQueueProperties": { + "type": "object", + "description": "RabbitMQQueue portable resource properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "secrets": { + "$ref": "#/definitions/RabbitMQSecrets", + "description": "Secrets provided by resources," + }, + "queue": { + "type": "string", + "description": "The name of the queue" + }, + "host": { + "type": "string", + "description": "The hostname of the RabbitMQ instance" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port of the RabbitMQ instance. Defaults to 5672" + }, + "vHost": { + "type": "string", + "description": "The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost." + }, + "username": { + "type": "string", + "description": "The username to use when connecting to the RabbitMQ instance" + }, + "resources": { + "type": "array", + "description": "List of the resource IDs that support the rabbitMQ resource", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "tls": { + "type": "boolean", + "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" + }, + "recipe": { + "$ref": "#/definitions/Recipe", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + }, + "required": [ + "environment" + ] + }, + "RabbitMQQueueResource": { + "type": "object", + "description": "RabbitMQQueue portable resource", + "properties": { + "properties": { + "$ref": "#/definitions/RabbitMQQueueProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "RabbitMQQueueResourceListResult": { + "type": "object", + "description": "The response of a RabbitMQQueueResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The RabbitMQQueueResource items on this page", + "items": { + "$ref": "#/definitions/RabbitMQQueueResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "RabbitMQQueueResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the RabbitMQQueueResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/RabbitMQQueueResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "RabbitMQQueueResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the RabbitMQQueueResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "secrets": { + "$ref": "#/definitions/RabbitMQSecrets", + "description": "Secrets provided by resources," + }, + "queue": { + "type": "string", + "description": "The name of the queue" + }, + "host": { + "type": "string", + "description": "The hostname of the RabbitMQ instance" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port of the RabbitMQ instance. Defaults to 5672" + }, + "vHost": { + "type": "string", + "description": "The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost." + }, + "username": { + "type": "string", + "description": "The username to use when connecting to the RabbitMQ instance" + }, + "resources": { + "type": "array", + "description": "List of the resource IDs that support the rabbitMQ resource", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "tls": { + "type": "boolean", + "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, + "RabbitMQSecrets": { + "type": "object", + "description": "The secret values for the given RabbitMQMessageQueue resource", + "properties": { + "password": { + "type": "string", + "description": "The password used to connect to the RabbitMQ instance" + }, + "uri": { + "type": "string", + "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" + } + } + }, + "Recipe": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + }, + "required": [ + "name" + ] + }, + "RecipeUpdate": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a link", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + } + }, + "ResourceProvisioning": { + "type": "string", + "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", + "enum": [ + "recipe", + "manual" + ], + "x-ms-enum": { + "name": "ResourceProvisioning", + "modelAsString": true, + "values": [ + { + "name": "recipe", + "value": "recipe", + "description": "The resource lifecycle will be managed by Radius" + }, + { + "name": "manual", + "value": "manual", + "description": "The resource lifecycle will be managed by the user" + } + ] + } + }, + "ResourceReference": { + "type": "object", + "description": "Describes a reference to an existing resource", + "properties": { + "id": { + "type": "string", + "description": "Resource id of an existing resource" + } + }, + "required": [ + "id" + ] + }, + "ResourceStatus": { + "type": "object", + "description": "Status of a resource.", + "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, + "outputResources": { + "type": "array", + "description": "Properties of an output resource", + "items": { + "$ref": "#/definitions/OutputResource" + }, + "x-ms-identifiers": [] + } + } + }, + "Versions": { + "type": "string", + "description": "Supported API versions for the Applications.Messagging resource provider.", + "enum": [ + "2022-03-15-privatepreview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_03_15_privatepreview", + "value": "2022-03-15-privatepreview", + "description": "2022-03-15-privatepreview" + } + ] + } + } + }, + "parameters": { + "RootScopeParameter": { + "name": "rootScope", + "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesDelete.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesDelete.json deleted file mode 100644 index d4951bcf32..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "rabbitMQMessageQueueName": "rabbitmq0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesGet.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesGet.json deleted file mode 100644 index a3ba86102a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesGet.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "rabbitMQMessageQueueName": "rabbitmq0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesList.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesList.json deleted file mode 100644 index 29cfdb4d75..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesList.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", - "name": "rabbitmq1", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListByRootScope.json deleted file mode 100644 index 04651a266e..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListByRootScope.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", - "name": "rabbitmq1", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Messaging/rabbitMQQueues?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListSecrets.json deleted file mode 100644 index 5a329dbcdf..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesListSecrets.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "testGroup", - "api-version": "2022-03-15-privatepreview", - "rabbitMQMessageQueueName": "rabbitmq0" - }, - "responses": { - "200": { - "body": { - "connectionString": "connection://string" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesPut.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesPut.json deleted file mode 100644 index c86b57ef4b..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueuesPut.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "rabbitMQMessageQueueName": "rabbitmq0", - "api-version": "2022-03-15-privatepreview", - "RabbitMQMessageQueueParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", - "name": "rabbitmq1", - "type": "Applications.Messaging/rabbitMQQueues", - "location": "West US", - "properties": { - "provisioningState": "Accepted", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json index 1cb8c90519..4622b0b394 100644 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json @@ -1,12 +1,12 @@ { "swagger": "2.0", "info": { - "title": "Applications.Messaging Management APIs", + "title": "Applications.Messaging Resource Management APIs", "version": "2022-03-15-privatepreview", "description": "REST APIs for Applications.Messaging", - "x-cadl-generated": [ + "x-typespec-generated": [ { - "emitter": "@azure-tools/cadl-autorest" + "emitter": "@azure-tools/typespec-autorest" } ] }, @@ -49,17 +49,17 @@ "paths": { "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues": { "get": { + "operationId": "RabbitMqQueues_ListByScope", "tags": [ "RabbitMQQueues" ], - "operationId": "RabbitMqQueues_ListByRootScope", - "description": "Lists information about all RabbitMQQueueResources in the given root scope", + "description": "List RabbitMQQueueResource resources by Scope", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" } ], "responses": { @@ -83,26 +83,26 @@ }, "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}": { "get": { + "operationId": "RabbitMqQueues_Get", "tags": [ "RabbitMQQueues" ], - "operationId": "RabbitMqQueues_Get", - "description": "Retrieves information about a RabbitMQQueueResource", + "description": "Get a RabbitMQQueueResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "rabbitMQQueueName", "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", "required": true, - "description": "The name of the RabbitMQQueue portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -121,32 +121,32 @@ } }, "put": { + "operationId": "RabbitMqQueues_CreateOrUpdate", "tags": [ "RabbitMQQueues" ], - "operationId": "RabbitMqQueues_CreateOrUpdate", - "description": "Creates or updates a RabbitMQQueueResource", + "description": "Create a RabbitMQQueueResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "rabbitMQQueueName", "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", "required": true, - "description": "The name of the RabbitMQQueue portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/RabbitMQQueueResource" } @@ -154,53 +154,122 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'RabbitMQQueueResource' update operation succeeded", "schema": { "$ref": "#/definitions/RabbitMQQueueResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'RabbitMQQueueResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/RabbitMQQueueResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "RabbitMqQueues_Update", + "tags": [ + "RabbitMQQueues" + ], + "description": "Update a RabbitMQQueueResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "rabbitMQQueueName", + "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/RabbitMQQueueResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/RabbitMQQueueResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "RabbitMqQueues_Delete", "tags": [ "RabbitMQQueues" ], - "operationId": "RabbitMqQueues_Delete", - "description": "Deletes an existing RabbitMQQueueResource", + "description": "Delete a RabbitMQQueueResource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "rabbitMQQueueName", "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", "required": true, - "description": "The name of the RabbitMQQueue portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -211,9 +280,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -226,29 +299,45 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true } }, "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}/listSecrets": { "post": { "operationId": "RabbitMqQueues_ListSecrets", + "tags": [ + "RabbitMQQueues" + ], "description": "Lists secrets values for the specified RabbitMQQueue resource", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/RootScopeParam" + "$ref": "#/parameters/RootScopeParameter" }, { "name": "rabbitMQQueueName", "in": "path", + "description": "The name of the RabbitMQQueue portable resource resource", "required": true, - "description": "The name of the RabbitMQQueue portable resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "body", + "in": "body", + "description": "The content of the action request", + "required": true, + "schema": { + "type": "object", + "properties": {} + } } ], "responses": { @@ -269,10 +358,10 @@ }, "/providers/Applications.Messaging/operations": { "get": { + "operationId": "Operations_List", "tags": [ "Operations" ], - "operationId": "Operations_List", "description": "List the operations for the provider", "parameters": [ { @@ -300,57 +389,109 @@ } }, "definitions": { - "Application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "BasicDaprResourceProperties": { + "EnvironmentCompute": { "type": "object", + "description": "Represents backing compute resource", "properties": { - "componentName": { + "kind": { "type": "string", - "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", - "readOnly": true + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" } }, - "description": "Basic properties of a Dapr component object.", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } + "discriminator": "kind", + "required": [ + "kind" ] }, - "BasicResourceProperties": { + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { "type": "object", + "description": "IdentitySettings is the external identity setting.", "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" }, - "environment": { + "oidcIssuer": { "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + "description": "The URI for your compute platform's OIDC issuer" }, - "application": { - "$ref": "#/definitions/Application", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" } }, - "description": "Basic properties of a Radius resource.", "required": [ - "environment" + "kind" ] }, - "OutputResource": { + "KubernetesCompute": { "type": "object", - "properties": {}, - "description": "Properties of an output resource." + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" }, - "Parameters": { + "OutputResource": { "type": "object", - "properties": {}, - "description": "Key/value parameters to pass into the recipe at deployment" + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } }, "ProvisioningState": { "type": "string", @@ -366,11 +507,50 @@ ], "x-ms-enum": { "name": "ProvisioningState", - "modelAsString": true - } + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true }, "RabbitMQListSecretsResult": { "type": "object", + "description": "The secret values for the given RabbitMQQueue resource", "properties": { "password": { "type": "string", @@ -380,20 +560,33 @@ "type": "string", "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" } - }, - "description": "The secret values for the given RabbitMQQueue resource" + } }, "RabbitMQQueueProperties": { "type": "object", + "description": "RabbitMQQueue portable resource properties", "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, "provisioningState": { "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the rabbitMQ message queue portable resource at the time the operation was called", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", "readOnly": true }, "secrets": { "$ref": "#/definitions/RabbitMQSecrets", - "description": "Secrets provided by resources," + "description": "The secrets to connect to the RabbitMQ instance" }, "queue": { "type": "string", @@ -418,34 +611,31 @@ }, "resources": { "type": "array", + "description": "List of the resource IDs that support the rabbitMQ resource", "items": { "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the rabbitMQ resource" + } }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." + "tls": { + "type": "boolean", + "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" }, "recipe": { "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the rabbitMQQueue portable resource" + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" }, - "tls": { - "type": "boolean", - "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." } }, - "description": "RabbitMQQueue portable resource properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } + "required": [ + "environment" ] }, "RabbitMQQueueResource": { "type": "object", + "description": "RabbitMQQueue portable resource", "properties": { "properties": { "$ref": "#/definitions/RabbitMQQueueProperties", @@ -457,7 +647,6 @@ ] } }, - "description": "RabbitMQQueue portable resource", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -466,29 +655,103 @@ }, "RabbitMQQueueResourceListResult": { "type": "object", + "description": "The response of a RabbitMQQueueResource list operation.", "properties": { "value": { "type": "array", + "description": "The RabbitMQQueueResource items on this page", "items": { "$ref": "#/definitions/RabbitMQQueueResource" - }, - "x-cadl-name": "RabbitMQQueueResource[]", - "description": "The RabbitMQQueueResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a RabbitMQQueueResource list operation.", "required": [ "value" ] }, + "RabbitMQQueueResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the RabbitMQQueueResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/RabbitMQQueueResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "RabbitMQQueueResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the RabbitMQQueueResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" + }, + "secrets": { + "$ref": "#/definitions/RabbitMQSecrets", + "description": "The secrets to connect to the RabbitMQ instance" + }, + "queue": { + "type": "string", + "description": "The name of the queue" + }, + "host": { + "type": "string", + "description": "The hostname of the RabbitMQ instance" + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port of the RabbitMQ instance. Defaults to 5672" + }, + "vHost": { + "type": "string", + "description": "The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost." + }, + "username": { + "type": "string", + "description": "The username to use when connecting to the RabbitMQ instance" + }, + "resources": { + "type": "array", + "description": "List of the resource IDs that support the rabbitMQ resource", + "items": { + "$ref": "#/definitions/ResourceReference" + } + }, + "tls": { + "type": "boolean", + "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" + }, + "recipe": { + "$ref": "#/definitions/RecipeUpdate", + "description": "The recipe used to automatically deploy underlying infrastructure for the resource" + }, + "resourceProvisioning": { + "$ref": "#/definitions/ResourceProvisioning", + "description": "Specifies how the underlying service/resource is provisioned and managed." + } + } + }, "RabbitMQSecrets": { "type": "object", + "description": "The connection secrets properties to the RabbitMQ instance", "properties": { "password": { "type": "string", @@ -498,26 +761,41 @@ "type": "string", "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" } - }, - "description": "The secret values for the given RabbitMQQueue resource" + } }, "Recipe": { "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "properties": { "name": { "type": "string", "description": "The name of the recipe within the environment to use" }, "parameters": { - "$ref": "#/definitions/Parameters", - "description": "Key/value parameters to pass into the recipe at deployment" + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} } }, - "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", "required": [ "name" ] }, + "RecipeUpdate": { + "type": "object", + "description": "The recipe used to automatically deploy underlying infrastructure for a portable resource", + "properties": { + "name": { + "type": "string", + "description": "The name of the recipe within the environment to use" + }, + "parameters": { + "type": "object", + "description": "Key/value parameters to pass into the recipe at deployment", + "properties": {} + } + } + }, "ResourceProvisioning": { "type": "string", "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", @@ -527,48 +805,81 @@ ], "x-ms-enum": { "name": "ResourceProvisioning", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "recipe", + "value": "recipe", + "description": "The resource lifecycle will be managed by Radius" + }, + { + "name": "manual", + "value": "manual", + "description": "The resource lifecycle will be managed by the user" + } + ] } }, "ResourceReference": { "type": "object", + "description": "Describes a reference to an existing resource", "properties": { "id": { "type": "string", "description": "Resource id of an existing resource" } }, - "description": "Describes a reference to an existing resource", "required": [ "id" ] }, "ResourceStatus": { "type": "object", + "description": "Status of a resource.", "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, "outputResources": { "type": "array", + "description": "Properties of an output resource", "items": { "$ref": "#/definitions/OutputResource" }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" + "x-ms-identifiers": [] } - }, - "description": "Status of a resource." + } + }, + "Versions": { + "type": "string", + "description": "Supported API versions for the Applications.Messaging resource provider.", + "enum": [ + "2022-03-15-privatepreview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_03_15_privatepreview", + "value": "2022-03-15-privatepreview", + "description": "2022-03-15-privatepreview" + } + ] + } } }, "parameters": { - "RootScopeParam": { + "RootScopeParameter": { "name": "rootScope", "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", "required": true, - "description": "The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "type": "string", "minLength": 1, "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true, - "type": "string" + "x-ms-skip-url-encoding": true } } } diff --git a/typespec/Applications.Dapr/pubSubBrokers.tsp b/typespec/Applications.Dapr/pubSubBrokers.tsp index 6fee307bc0..1d16d1bcb6 100644 --- a/typespec/Applications.Dapr/pubSubBrokers.tsp +++ b/typespec/Applications.Dapr/pubSubBrokers.tsp @@ -36,7 +36,7 @@ using OpenAPI; namespace Applications.Dapr; -@doc("PubSubBroker portable resource") +@doc("Dapr PubSubBroker portable resource") model DaprPubSubBrokerResource is TrackedResource { @doc("PubSubBroker name") @key("pubSubBrokerName") @@ -45,7 +45,7 @@ model DaprPubSubBrokerResource is TrackedResource { name: ResourceNameString; } -@doc("PubSubBroker portable resource properties") +@doc("Dapr PubSubBroker portable resource properties") model DaprPubSubBrokerProperties { ...EnvironmentScopedResource; ...DaprResourceProperties; diff --git a/typespec/Applications.Dapr/secretStores.tsp b/typespec/Applications.Dapr/secretStores.tsp index 80c2cf0e61..f188f87bd3 100644 --- a/typespec/Applications.Dapr/secretStores.tsp +++ b/typespec/Applications.Dapr/secretStores.tsp @@ -35,7 +35,7 @@ using OpenAPI; namespace Applications.Dapr; -@doc("DaprSecretStore portable resource") +@doc("Dapr SecretStore portable resource") model DaprSecretStoreResource is TrackedResource { @doc("SecretStore name") @key("secretStoreName") @@ -44,7 +44,7 @@ model DaprSecretStoreResource is TrackedResource { name: ResourceNameString; } -@doc("DaprSecretStore portable resource properties") +@doc("Dapr SecretStore portable resource properties") model DaprSecretStoreProperties { ...EnvironmentScopedResource; ...DaprResourceProperties; diff --git a/typespec/Applications.Dapr/stateStores.tsp b/typespec/Applications.Dapr/stateStores.tsp index d0efbd0c82..240efa22dd 100644 --- a/typespec/Applications.Dapr/stateStores.tsp +++ b/typespec/Applications.Dapr/stateStores.tsp @@ -35,7 +35,7 @@ using OpenAPI; namespace Applications.Dapr; -@doc("StateStore portable resource") +@doc("Dapr StateStore portable resource") model DaprStateStoreResource is TrackedResource { @doc("StateStore name") @key("stateStoreName") @@ -44,7 +44,7 @@ model DaprStateStoreResource is TrackedResource { name: ResourceNameString; } -@doc("StateStore portable resource properties") +@doc("Dapr StateStore portable resource properties") model DaprStateStoreProperties { ...EnvironmentScopedResource; ...DaprResourceProperties; diff --git a/typespec/Applications.Datastores/common.tsp b/typespec/Applications.Datastores/common.tsp new file mode 100644 index 0000000000..13aac0cadd --- /dev/null +++ b/typespec/Applications.Datastores/common.tsp @@ -0,0 +1,19 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; + +using OpenAPI; diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateRecipe.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateRecipe.json new file mode 100644 index 0000000000..42e4018d11 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateRecipe.json @@ -0,0 +1,62 @@ +{ + "operationId": "MongoDatabases_CreateOrUpdate", + "title": "Create or update a MongoDatabase resource with recipe", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "mongoDatabaseName": "mongo0", + "api-version": "2022-03-15-privatepreview", + "MongoDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateValues.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateValues.json new file mode 100644 index 0000000000..0d6be4423b --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_CreateOrUpdateValues.json @@ -0,0 +1,65 @@ +{ + "operationId": "MongoDatabases_CreateOrUpdate", + "title": "Create or update a MongoDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "mongoDatabaseName": "mongo0", + "api-version": "2022-03-15-privatepreview", + "MongoDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" + }, + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "mongo0" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "mongo0" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Delete.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Delete.json new file mode 100644 index 0000000000..c5f7221cbf --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "MongoDatabases_Delete", + "title": "Delete a MongoDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "mongoDatabaseName": "mongo0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Get.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Get.json new file mode 100644 index 0000000000..79e1b7ae90 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_Get.json @@ -0,0 +1,33 @@ +{ + "operationId": "MongoDatabases_Get", + "title": "Get a MongoDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "mongoDatabaseName": "mongo0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" + } + ], + "database": "mongo0", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255 + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_List.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_List.json new file mode 100644 index 0000000000..0739f0cbb0 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_List.json @@ -0,0 +1,73 @@ +{ + "operationId": "MongoDatabases_ListByScope", + "title": "List MongoDatabase resources by resource group", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" + } + ], + "database": "mongo0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo1", + "name": "mongo1", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "mongo0", + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" + } + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Datastores/mongoDatabases/mongo1", + "name": "mongo1", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListByRootScope.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListByRootScope.json new file mode 100644 index 0000000000..4113d8a707 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListByRootScope.json @@ -0,0 +1,74 @@ +{ + "operationId": "MongoDatabases_ListByScope", + "title": "List MongoDatabase resources by rootScope", + "parameters": { + "rootScope": "planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/mongoDatabases/mongo0", + "name": "mongo0", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" + } + ], + "database": "mongo0" + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Datastores/mongoDatabases/mongo1", + "name": "mongo1", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "testAccount1.mongo.cosmos.azure.com", + "port": 10255, + "database": "mongo1", + "username": "testUser", + "secrets": { + "password": "testPassword", + "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" + } + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Datastores/mongoDatabases/mongo2", + "name": "mongo2", + "type": "Applications.Datastores/mongoDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "cosmosdb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Datastores/mongoDatabases?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListSecrets.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListSecrets.json new file mode 100644 index 0000000000..504f90ffb2 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/MongoDatabases_ListSecrets.json @@ -0,0 +1,18 @@ +{ + "operationId": "MongoDatabases_ListSecrets", + "title": "List the secrets of a MongoDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "mongoDatabaseName": "mongo0" + }, + "responses": { + "200": { + "body": { + "username": "testUser", + "password": "testPassword", + "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" + } + } + } +} diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdate.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdate.json new file mode 100644 index 0000000000..003bc22fc3 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdate.json @@ -0,0 +1,68 @@ +{ + "operationId": "RedisCaches_CreateOrUpdate", + "title": "Create or update a RedisCache resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateRecipe.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateRecipe.json new file mode 100644 index 0000000000..838f7332d1 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateRecipe.json @@ -0,0 +1,62 @@ +{ + "operationId": "RedisCaches_CreateOrUpdate", + "title": "Create or update a RedisCache resource with recipe", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateValues.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateValues.json new file mode 100644 index 0000000000..417b0a2588 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_CreateOrUpdateValues.json @@ -0,0 +1,59 @@ +{ + "operationId": "RedisCaches_CreateOrUpdate", + "title": "Create or update a RedisCache resource with values", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "secrets": { + "password": "testPassword", + "connectionString": "test-connection-string" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Delete.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Delete.json new file mode 100644 index 0000000000..dbedada922 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "RedisCaches_Delete", + "title": "Delete a RedisCache resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Get.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Get.json new file mode 100644 index 0000000000..0bfe5aad6f --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Get.json @@ -0,0 +1,33 @@ +{ + "operationId": "RedisCaches_Get", + "title": "Get a RedisCache resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "redisCacheName": "redis0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_List.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_List.json new file mode 100644 index 0000000000..20eff8c433 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_List.json @@ -0,0 +1,69 @@ +{ + "operationId": "RedisCaches_ListByScope", + "title": "List RedisCache resources by resource group", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis1", + "name": "redis1", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis2", + "name": "redis2", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListByRootScope.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListByRootScope.json new file mode 100644 index 0000000000..7c74f8ef11 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListByRootScope.json @@ -0,0 +1,68 @@ +{ + "operationId": "RedisCaches_ListByScope", + "title": "List RedisCache resources by rootScope", + "parameters": { + "rootScope": "planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis1", + "name": "redis1", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "redis", + "parameters": { + "port": 2334 + } + } + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Datastores/redisCaches/redis2", + "name": "redis2", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "resourceProvisioning": "manual", + "host": "myrediscache.redis.cache.windows.net", + "port": 6380, + "username": "username" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Datastores/redisCaches?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListSecrets.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListSecrets.json new file mode 100644 index 0000000000..7e0f2d9547 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_ListSecrets.json @@ -0,0 +1,19 @@ +{ + "operationId": "RedisCaches_ListSecrets", + "title": "List the secrets of a RedisCaches resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testGroup", + "api-version": "2022-03-15-privatepreview", + "redisCacheName": "redis0" + }, + "responses": { + "200": { + "body": { + "connectionString": "myrediscache.redis.cache.windows.net:6380", + "password": "testPassword" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Update.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Update.json new file mode 100644 index 0000000000..04d8bed899 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/RedisCaches_Update.json @@ -0,0 +1,68 @@ +{ + "operationId": "RedisCaches_Update", + "title": "Update a RedisCache resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "redisCacheName": "redis0", + "api-version": "2022-03-15-privatepreview", + "RedisCacheParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/redisCaches/redis0", + "name": "redis0", + "type": "Applications.Datastores/redisCaches", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache" + } + ], + "host": "myrediscache.redis.cache.windows.net", + "port": 6380 + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_CreateOrUpdate.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_CreateOrUpdate.json new file mode 100644 index 0000000000..fecc16494a --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_CreateOrUpdate.json @@ -0,0 +1,52 @@ +{ + "operationId": "SqlDatabases_CreateOrUpdate", + "title": "Create or update a SqlDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "sqlDatabaseName": "sql0", + "api-version": "2022-03-15-privatepreview", + "SQLDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Delete.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Delete.json new file mode 100644 index 0000000000..f703412f87 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "SqlDatabases_Delete", + "title": "Delete a SqlDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "sqlDatabaseName": "sql0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Get.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Get.json new file mode 100644 index 0000000000..bf6cc2f581 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Get.json @@ -0,0 +1,32 @@ +{ + "operationId": "SqlDatabases_Get", + "title": "Get a SqlDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "sqlDatabaseName": "sql0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "sql-database", + "server": "test-server", + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_List.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_List.json new file mode 100644 index 0000000000..928bbd95f9 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_List.json @@ -0,0 +1,67 @@ +{ + "operationId": "SqlDatabases_ListByScope", + "title": "List SqlDatabases resources by resource group", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql2", + "name": "sql2", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases?api-version=2022-01-25-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListByRootScope.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListByRootScope.json new file mode 100644 index 0000000000..1f16e6e489 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListByRootScope.json @@ -0,0 +1,72 @@ +{ + "operationId": "SqlDatabases_ListByScope", + "title": "List SqlDatabases resources by rootScope", + "parameters": { + "rootScope": "planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "database": "sql-database", + "server": "test-server", + "resourceProvisioning": "manual" + } + }, + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase1" + } + ], + "database": "testDatabase", + "server": "testAccount1.sql.cosmos.azure.com", + "resourceProvisioning": "manual" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql2", + "name": "sql2", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env1", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Applications.Datastores/sqlDatabases?api-version=2022-03-15-privatepreview&$skipToken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListSecrets.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListSecrets.json new file mode 100644 index 0000000000..d7445e926b --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_ListSecrets.json @@ -0,0 +1,19 @@ +{ + "operationId": "SQLDatabases_ListSecrets", + "title": "List the secrets of a SQLDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testGroup", + "api-version": "2022-03-15-privatepreview", + "redisCacheName": "redis0" + }, + "responses": { + "200": { + "body": { + "connectionString": "sqldatabases:5000", + "password": "testPassword" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Update.json b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Update.json new file mode 100644 index 0000000000..52e5223523 --- /dev/null +++ b/typespec/Applications.Datastores/examples/2022-03-15-privatepreview/SQLDatabases_Update.json @@ -0,0 +1,52 @@ +{ + "operationId": "SqlDatabases_Update", + "title": "Update a SqlDatabase resource", + "parameters": { + "rootScope": "planes/radius/local/resourceGroups/testGroup", + "sqlDatabaseName": "sql0", + "api-version": "2022-03-15-privatepreview", + "SQLDatabaseParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resources": [ + { + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" + } + ], + "resourceProvisioning": "manual" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql0", + "name": "sql0", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Datastores/sqlDatabases/sql1", + "name": "sql1", + "type": "Applications.Datastores/sqlDatabases", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Datastores/main.tsp b/typespec/Applications.Datastores/main.tsp new file mode 100644 index 0000000000..87e9a31c0e --- /dev/null +++ b/typespec/Applications.Datastores/main.tsp @@ -0,0 +1,43 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-resource-manager"; + +import "./mongoDatabases.tsp"; +import "./redisCaches.tsp"; +import "./sqlDatabases.tsp"; + +using TypeSpec.Versioning; +using Azure.ResourceManager; + +@armProviderNamespace +@service({ + title: "Applications.Datastores Resource Management APIs", +}) +@doc("REST APIs for Applications.Datastores") +@versioned(Versions) +namespace Applications.Datastores; + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Supported API versions for the Applications.Databases resource provider.") +enum Versions { + @doc("2022-03-15-privatepreview") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2022_03_15_privatepreview: "2022-03-15-privatepreview", +} diff --git a/typespec/Applications.Datastores/mongoDatabases.tsp b/typespec/Applications.Datastores/mongoDatabases.tsp new file mode 100644 index 0000000000..11dcaaa65c --- /dev/null +++ b/typespec/Applications.Datastores/mongoDatabases.tsp @@ -0,0 +1,124 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; + +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Datastores; + +@doc("MongoDatabase portable resource") +model MongoDatabaseResource is TrackedResource { + @doc("The name of the MongoDatabase portable resource resource") + @path + @segment("mongoDatabases") + @key("mongoDatabaseName") + name: ResourceNameString; +} + +@doc("The secret values for the given MongoDatabase resource") +model MongoDatabaseListSecretsResult is MongoDatabaseSecrets; + +@doc("The secret values for the given MongoDatabase resource") +model MongoDatabaseSecrets { + @doc("Password to use when connecting to the target Mongo database") + password?: string; + + @doc("Connection string used to connect to the target Mongo database") + connectionString?: string; +} + +@doc("MongoDatabase portable resource properties") +model MongoDatabaseProperties { + ...EnvironmentScopedResource; + + @doc("Secret values provided for the resource") + secrets?: MongoDatabaseSecrets; + + @doc("Host name of the target Mongo database") + host?: string; + + @doc("Port value of the target Mongo database") + port?: int32; + + @doc("Database name of the target Mongo database") + database?: string; + + @doc("List of the resource IDs that support the MongoDB resource") + resources?: ResourceReference[]; + + @doc("Username to use when connecting to the target Mongo database") + username?: string; + + ...RecipeBaseProperties; +} + +#suppress "@azure-tools/typespec-azure-core/casing-style" +@armResourceOperations +interface MongoDatabases { + get is ArmResourceRead< + MongoDatabaseResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + MongoDatabaseResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + MongoDatabaseResource, + MongoDatabaseProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + MongoDatabaseResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + MongoDatabaseResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("Lists secrets values for the specified MongoDatabases resource") + @action("listSecrets") + listSecrets is ArmResourceActionSync< + MongoDatabaseResource, + {}, + MongoDatabaseListSecretsResult, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Datastores/redisCaches.tsp b/typespec/Applications.Datastores/redisCaches.tsp new file mode 100644 index 0000000000..58e69e226a --- /dev/null +++ b/typespec/Applications.Datastores/redisCaches.tsp @@ -0,0 +1,125 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Datastores; + +@doc("RedisCache portable resource") +model RedisCacheResource is TrackedResource { + @path + @doc("The name of the RedisCache portable resource resource") + @key("redisCacheName") + @segment("redisCaches") + name: ResourceNameString; +} + +@doc("The secret values for the given RedisCache resource") +model RedisCacheListSecretsResult is RedisCacheSecrets; + +@doc("The secret values for the given RedisCache resource") +model RedisCacheSecrets { + @doc("The connection string used to connect to the Redis cache") + connectionString?: string; + + @doc("The password for this Redis cache instance") + password?: string; + + @doc("The URL used to connect to the Redis cache") + url?: string; +} + +@doc("RedisCache portable resource properties") +model RedisCacheProperties { + ...EnvironmentScopedResource; + + @doc("Secrets provided by resource") + secrets?: RedisCacheSecrets; + + @doc("The host name of the target Redis cache") + host?: string; + + @doc("The port value of the target Redis cache") + port?: int32; + + @doc("The username for Redis cache") + username?: string; + + @doc("Specifies whether to enable SSL connections to the Redis cache") + tls?: boolean; + + @doc("List of the resource IDs that support the Redis resource") + resources?: ResourceReference[]; + + ...RecipeBaseProperties; +} + +@armResourceOperations +interface RedisCaches { + get is ArmResourceRead< + RedisCacheResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + RedisCacheResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + RedisCacheResource, + RedisCacheProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + RedisCacheResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + RedisCacheResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("Lists secrets values for the specified RedisCache resource") + @action("listSecrets") + listSecrets is ArmResourceActionSync< + RedisCacheResource, + {}, + RedisCacheListSecretsResult, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Datastores/sqlDatabases.tsp b/typespec/Applications.Datastores/sqlDatabases.tsp new file mode 100644 index 0000000000..64cdcdfcea --- /dev/null +++ b/typespec/Applications.Datastores/sqlDatabases.tsp @@ -0,0 +1,123 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Datastores; + +@doc("SqlDatabase portable resource") +model SqlDatabaseResource is TrackedResource { + @doc("The name of the SqlDatabase portable resource resource") + @key("sqlDatabaseName") + @path + @segment("sqlDatabases") + name: ResourceNameString; +} + +@doc("SqlDatabase properties") +model SqlDatabaseProperties { + ...EnvironmentScopedResource; + + @doc("The name of the Sql database.") + database?: string; + + @doc("The fully qualified domain name of the Sql database.") + server?: string; + + @doc("Port value of the target Sql database") + port?: int32; + + @doc("Username to use when connecting to the target Sql database") + username?: string; + + @doc("List of the resource IDs that support the SqlDatabase resource") + resources?: ResourceReference[]; + + @doc("Secret values provided for the resource") + secrets?: SqlDatabaseSecrets; + + ...RecipeBaseProperties; +} + +@doc("The secret values for the given SqlDatabase resource") +model SqlDatabaseListSecretsResult is SqlDatabaseSecrets; + +@doc("The secret values for the given SqlDatabase resource") +model SqlDatabaseSecrets { + @doc("Password to use when connecting to the target Sql database") + password?: string; + + @doc("Connection string used to connect to the target Sql database") + connectionString?: string; +} + +#suppress "@azure-tools/typespec-azure-core/casing-style" +@armResourceOperations +interface SqlDatabases { + get is ArmResourceRead< + SqlDatabaseResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + SqlDatabaseResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + SqlDatabaseResource, + SqlDatabaseProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + SqlDatabaseResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + SqlDatabaseResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("Lists secrets values for the specified SqlDatabase resource") + @action("listSecrets") + listSecrets is ArmResourceActionSync< + SqlDatabaseResource, + {}, + SqlDatabaseListSecretsResult, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Datastores/tspconfig.yaml b/typespec/Applications.Datastores/tspconfig.yaml new file mode 100644 index 0000000000..38f0dc630d --- /dev/null +++ b/typespec/Applications.Datastores/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + azure-resource-provider-folder: "resource-manager" + examples-directory: "examples" + emitter-output-dir: "{project-root}/../../swagger/specification/applications" + arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/Applications.Messaging/common.tsp b/typespec/Applications.Messaging/common.tsp new file mode 100644 index 0000000000..13aac0cadd --- /dev/null +++ b/typespec/Applications.Messaging/common.tsp @@ -0,0 +1,19 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/openapi"; + +using OpenAPI; diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json new file mode 100644 index 0000000000..c60399c934 --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json @@ -0,0 +1,59 @@ +{ + "operationId": "RabbitMQQueues_CreateOrUpdate", + "title": "Create Or Update a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "rabbitMQQueueName": "rabbitmq0", + "api-version": "2022-03-15-privatepreview", + "RabbitMQQueueParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json new file mode 100644 index 0000000000..7e6d3f6569 --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "RabbitMQQueues_Delete", + "title": "Delete a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "rabbitMQQueueName": "rabbitmq0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json new file mode 100644 index 0000000000..891b0e32bf --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json @@ -0,0 +1,29 @@ +{ + "operationId": "RabbitMQQueues_Get", + "title": "Get a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "rabbitMQQueueName": "rabbitmq0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json new file mode 100644 index 0000000000..7c9cb9e8dc --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json @@ -0,0 +1,47 @@ +{ + "operationId": "RabbitMQQueues_ListByScope", + "title": "List RabbitMQQueue resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json new file mode 100644 index 0000000000..8937ce7e5d --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json @@ -0,0 +1,50 @@ +{ + "operationId": "RabbitMQQueues_ListByScope", + "title": "List RabbitMQQueue resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Messaging/rabbitMQQueues?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json new file mode 100644 index 0000000000..10bbe289fa --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json @@ -0,0 +1,17 @@ +{ + "operationId": "RabbitMQQueues_ListSecrets", + "title": "List the secrets of a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "resourceGroupName": "testGroup", + "api-version": "2022-03-15-privatepreview", + "rabbitMQQueueName": "rabbitmq0" + }, + "responses": { + "200": { + "body": { + "connectionString": "connection://string" + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json new file mode 100644 index 0000000000..3391d2a046 --- /dev/null +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json @@ -0,0 +1,59 @@ +{ + "operationId": "RabbitMQQueues_Update", + "title": "Update a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "rabbitMQQueueName": "rabbitmq0", + "api-version": "2022-03-15-privatepreview", + "rabbitMQQueueParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Messaging/main.tsp b/typespec/Applications.Messaging/main.tsp new file mode 100644 index 0000000000..1ce5c8f874 --- /dev/null +++ b/typespec/Applications.Messaging/main.tsp @@ -0,0 +1,41 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-resource-manager"; + +import "./rabbitMQQueues.tsp"; + +using TypeSpec.Versioning; +using Azure.ResourceManager; + +@armProviderNamespace +@service({ + title: "Applications.Messaging Resource Management APIs", +}) +@doc("REST APIs for Applications.Messaging") +@versioned(Versions) +namespace Applications.Messaging; + +interface Operations extends Azure.ResourceManager.Operations {} + +@doc("Supported API versions for the Applications.Messaging resource provider.") +enum Versions { + @doc("2022-03-15-privatepreview") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2022_03_15_privatepreview: "2022-03-15-privatepreview", +} diff --git a/typespec/Applications.Messaging/rabbitMQQueues.tsp b/typespec/Applications.Messaging/rabbitMQQueues.tsp new file mode 100644 index 0000000000..4f9e1c7de8 --- /dev/null +++ b/typespec/Applications.Messaging/rabbitMQQueues.tsp @@ -0,0 +1,133 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.ResourceManager; +using OpenAPI; + +namespace Applications.Messaging; + +#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use PascalCase" +@doc("RabbitMQQueue portable resource") +model RabbitMQQueueResource is TrackedResource { + @doc("The name of the RabbitMQQueue portable resource resource") + @key("rabbitMQQueueName") + @segment("rabbitMQQueues") + @path + name: ResourceNameString; +} + +#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use PascalCase" +@doc("The secret values for the given RabbitMQQueue resource") +model RabbitMQListSecretsResult is RabbitMQSecrets; + +#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use PascalCase" +@doc("The connection secrets properties to the RabbitMQ instance") +model RabbitMQSecrets { + @doc("The password used to connect to the RabbitMQ instance") + password?: string; + + @doc("The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value") + uri?: string; +} + +#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use PascalCase" +@doc("RabbitMQQueue portable resource properties") +model RabbitMQQueueProperties { + ...EnvironmentScopedResource; + + @doc("The secrets to connect to the RabbitMQ instance") + secrets?: RabbitMQSecrets; + + @doc("The name of the queue") + queue?: string; + + @doc("The hostname of the RabbitMQ instance") + host?: string; + + @doc("The port of the RabbitMQ instance. Defaults to 5672") + port?: int32; + + @doc("The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost.") + vHost?: string; + + @doc("The username to use when connecting to the RabbitMQ instance") + username?: string; + + @doc("List of the resource IDs that support the rabbitMQ resource") + resources?: ResourceReference[]; + + @doc("Specifies whether to use SSL when connecting to the RabbitMQ instance") + tls?: boolean; + + ...RecipeBaseProperties; +} + +#suppress "@azure-tools/typespec-azure-core/casing-style" "The names of Model types must use PascalCase" +@armResourceOperations +interface RabbitMQQueues { + get is ArmResourceRead< + RabbitMQQueueResource, + UCPBaseParameters + >; + + createOrUpdate is ArmResourceCreateOrReplaceAsync< + RabbitMQQueueResource, + UCPBaseParameters + >; + + update is ArmResourcePatchAsync< + RabbitMQQueueResource, + RabbitMQQueueProperties, + UCPBaseParameters + >; + + delete is ArmResourceDeleteAsync< + RabbitMQQueueResource, + UCPBaseParameters + >; + + listByScope is ArmResourceListByParent< + RabbitMQQueueResource, + UCPBaseParameters, + "Scope", + "Scope" + >; + + @doc("Lists secrets values for the specified RabbitMQQueue resource") + @action("listSecrets") + listSecrets is ArmResourceActionSync< + RabbitMQQueueResource, + {}, + RabbitMQListSecretsResult, + UCPBaseParameters + >; +} diff --git a/typespec/Applications.Messaging/tspconfig.yaml b/typespec/Applications.Messaging/tspconfig.yaml new file mode 100644 index 0000000000..38f0dc630d --- /dev/null +++ b/typespec/Applications.Messaging/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + azure-resource-provider-folder: "resource-manager" + examples-directory: "examples" + emitter-output-dir: "{project-root}/../../swagger/specification/applications" + arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json" diff --git a/typespec/Test.Resource/main.tsp b/typespec/Test.Resource/main.tsp index 3676b08b53..eee535caff 100644 --- a/typespec/Test.Resource/main.tsp +++ b/typespec/Test.Resource/main.tsp @@ -29,7 +29,7 @@ using Azure.ResourceManager; @service({ title: "Test.Resource Resource Management APIs", }) -@doc("REST API for Test.Resource") +@doc("REST APIs for Test.Resource") @versioned(Versions) namespace Test.Resource; diff --git a/typespec/radius/v1/resources.tsp b/typespec/radius/v1/resources.tsp index 64912069e0..0d9f1e9812 100644 --- a/typespec/radius/v1/resources.tsp +++ b/typespec/radius/v1/resources.tsp @@ -166,7 +166,7 @@ enum ResourceProvisioning { manual, } -@doc("The recipe used to automatically deploy underlying infrastructure for a link") +@doc("The recipe used to automatically deploy underlying infrastructure for a portable resource") model Recipe { @doc("The name of the recipe within the environment to use") name: string; From b64885f27f6402a00cd199709abe092d43430e64 Mon Sep 17 00:00:00 2001 From: Vishwanath Hiremath <100623239+vishwahiremat@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:35:17 -0700 Subject: [PATCH 12/57] Updating terraform functional tests to verify kubernetes secret (#6120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description - Adding changes to verify kubernetes secret verification as part of the k8s object validation - Adding ResourceName to K8s objects so we can validate the secrets object when validate labels is set to false. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 73aaeb5 ### Summary :lock::recycle::sparkles: This pull request adds support for custom resource names for secrets created by the gateway and terraform recipe resources in the `test` and `validation` packages. It updates the `NewK8sSecretForResource` function and the related test cases to use and check the new resource names. It also fixes some code formatting issues in the `resource_test` package. > _This pull request has a goal_ > _To let secrets have custom names whole_ > _It changes `K8sObject`_ > _And some tests to reflect_ > _The new logic for `NewK8sSecretForResource`'s role_ ### Walkthrough * Add a second argument to `NewK8sSecretForResource` function to accept the expected resource name of the secret ([link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-e7ffe4ed826fe5315273a52a1d08ae63390701a6fe9109c832bd2f76ff6c35cdL338-R338), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L112-R123), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-086700e8808d9dc05513929e8d129e18b71c7441c7f197ca1297efe15a0b8dd0L59-R60), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-a52153bfeb452a3dd497767a98db0dc1a0621e012f6e6d8dd9d4b5ec758b4dc2L115-R116), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-a52153bfeb452a3dd497767a98db0dc1a0621e012f6e6d8dd9d4b5ec758b4dc2L122-R125)) * Add a new field to `K8sObject` type to store the expected resource name of the secret ([link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-a52153bfeb452a3dd497767a98db0dc1a0621e012f6e6d8dd9d4b5ec758b4dc2R63)) * Modify the label validation logic for secrets to match the expected resource name ([link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-a52153bfeb452a3dd497767a98db0dc1a0621e012f6e6d8dd9d4b5ec758b4dc2L525-R527), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-a52153bfeb452a3dd497767a98db0dc1a0621e012f6e6d8dd9d4b5ec758b4dc2R536-R541)) * Implement a new function to generate a unique suffix for the secret resource name based on the resource ID, environment name, and application name in `recipe_terraform_test.go` ([link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995R209-R231)) * Add new imports, variables, and expected resources to the terraform recipe tests in `recipe_terraform_test.go` to use and validate the secret suffix ([link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L29-R31), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L52-R57), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995R84-R86), [link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L91-R100)) * Remove an empty line from the `resource_test` package in `gateway_test.go` for code formatting ([link](https://github.com/project-radius/radius/pull/6120/files?diff=unified&w=0#diff-e7ffe4ed826fe5315273a52a1d08ae63390701a6fe9109c832bd2f76ff6c35cdL457)) --- .../shared/resources/gateway_test.go | 1 - .../shared/resources/recipe_terraform_test.go | 12 ++++++++-- test/validation/k8s.go | 22 ++++++++++++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/test/functional/shared/resources/gateway_test.go b/test/functional/shared/resources/gateway_test.go index c7fa8edfc1..954b15a285 100644 --- a/test/functional/shared/resources/gateway_test.go +++ b/test/functional/shared/resources/gateway_test.go @@ -454,4 +454,3 @@ func newTestHTTPClient(isHttps bool, hostname string) *http.Client { Transport: transport, } } - diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 085632c7b8..18babdc08d 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -55,7 +55,8 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { appName := "corerp-resources-terraform-redis-app" envName := "corerp-resources-terraform-redis-env" redisCacheName := "tf-redis-cache" - + secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/"+name, envName, appName) + require.NoError(t, err) test := shared.NewRPTest(t, name, []shared.TestStep{ { Executor: step.NewDeployExecutor(template, functional.GetTerraformRecipeModuleServerURL(), "appName="+appName, "redisCacheName="+redisCacheName), @@ -82,6 +83,9 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { appName: { validation.NewK8sServiceForResource(appName, redisCacheName).ValidateLabels(false), }, + "radius-system": { + validation.NewK8sSecretForResourceWithResourceName("tfstate-default-" + secret).ValidateLabels(false), + }, }, }, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { @@ -97,7 +101,8 @@ func Test_TerraformRecipe_Context(t *testing.T) { template := "testdata/corerp-resources-terraform-context.bicep" name := "corerp-resources-terraform-context" appNamespace := "corerp-resources-terraform-context-app" - + secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/"+name, name, name) + require.NoError(t, err) test := shared.NewRPTest(t, name, []shared.TestStep{ { Executor: step.NewDeployExecutor(template, functional.GetTerraformRecipeModuleServerURL()), @@ -118,6 +123,9 @@ func Test_TerraformRecipe_Context(t *testing.T) { appNamespace: { validation.NewK8sSecretForResource(name, name), }, + "radius-system": { + validation.NewK8sSecretForResourceWithResourceName("tfstate-default-" + secret).ValidateLabels(false), + }, }, }, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { diff --git a/test/validation/k8s.go b/test/validation/k8s.go index 77835c49c2..b4f0255543 100644 --- a/test/validation/k8s.go +++ b/test/validation/k8s.go @@ -60,6 +60,7 @@ type K8sObject struct { Labels map[string]string Kind string SkipLabelValidation bool + ResourceName string } // NewK8sPodForResource creates a new K8sObject with Kind set to "Pod" and the selector labels for the pod @@ -124,6 +125,19 @@ func NewK8sSecretForResource(application string, name string) K8sObject { } } +// NewK8sSecretForResourceWithResourceName creates a K8sObject for a secret with the Labels set to the application and name. +func NewK8sSecretForResourceWithResourceName(resourceName string) K8sObject { + return K8sObject{ + GroupVersionResource: schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "secrets", + }, + Kind: "Secret", + ResourceName: resourceName, + } +} + // ValidateDeploymentsRunning checks if the expected deployments have been created in the given namespace and logs any // unrecognized deployments. If all expected deployments have been created, it returns, otherwise it retries until the // context is done. @@ -522,7 +536,7 @@ func matchesActualLabels(expectedResources []K8sObject, actualResources []unstru remaining := []K8sObject{} for _, expectedResource := range expectedResources { - if expectedResource.SkipLabelValidation { + if expectedResource.SkipLabelValidation && expectedResource.Kind != "Secret" { continue } resourceExists := false @@ -531,6 +545,12 @@ func matchesActualLabels(expectedResources []K8sObject, actualResources []unstru resourceExists = true actualResources = append(actualResources[:idx], actualResources[idx+1:]...) break + } else if expectedResource.Kind == "Secret" && expectedResource.SkipLabelValidation { + if actualResource.GetName() == expectedResource.ResourceName { + resourceExists = true + actualResources = append(actualResources[:idx], actualResources[idx+1:]...) + break + } } } if !resourceExists { From d0eddd3577f0bc2b9dacf5ee5717d6d592ab38fb Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Fri, 25 Aug 2023 16:55:07 -0700 Subject: [PATCH 13/57] Initial commit of YAML manifest based container deployment (frontend controller) (#6119) --- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 9 + hack/bicep-types-radius/generated/index.json | 2 +- pkg/armrpc/api/v1/errorresponse.go | 5 + .../container_conversion.go | 28 ++ .../container_conversion_test.go | 24 +- .../testdata/containerresource-runtimes.json | 81 ++++ .../containerresourcedatamodel-runtime.json | 100 +++++ .../zz_generated_models.go | 19 + .../zz_generated_models_serde.go | 62 +++ pkg/corerp/datamodel/container.go | 13 + .../controller/containers/validator.go | 128 +++++++ .../controller/containers/validator_test.go | 356 ++++++++++++++++++ pkg/kubeutil/manifest.go | 73 ++++ pkg/kubeutil/manifest_test.go | 165 ++++++++ ...ontainers_CreateOrUpdate_BaseManifest.json | 76 ++++ .../2022-03-15-privatepreview/openapi.json | 33 +- .../resources/container_runtimes_test.go | 60 +++ .../corerp-resources-container-manifest.bicep | 52 +++ .../testdata/manifest/basemanifest.yaml | 33 ++ typespec/Applications.Core/containers.tsp | 15 + ...ontainers_CreateOrUpdate_BaseManifest.json | 76 ++++ typespec/Applications.Core/main.tsp | 2 +- 23 files changed, 1408 insertions(+), 6 deletions(-) create mode 100644 pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json create mode 100644 pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json create mode 100644 pkg/kubeutil/manifest.go create mode 100644 pkg/kubeutil/manifest_test.go create mode 100644 swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate_BaseManifest.json create mode 100644 test/functional/shared/resources/container_runtimes_test.go create mode 100644 test/functional/shared/resources/testdata/corerp-resources-container-manifest.bicep create mode 100644 test/functional/shared/resources/testdata/manifest/basemanifest.yaml create mode 100644 typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate_BaseManifest.json diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index 89d578a0dd..eb19fb4633 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":105,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":107,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":108,"Flags":10,"Description":"The resource api version"},"properties":{"Type":110,"Flags":0,"Description":"Environment properties"},"tags":{"Type":130,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":118,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":119,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":128,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":129,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[111,112,113,114,115,116,117]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":120,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":121,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":123,"terraform":125}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":124,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":122}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":127}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":109}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":132,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":133,"Flags":10,"Description":"The resource api version"},"properties":{"Type":135,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":148,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":143,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":144,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":147,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[136,137,138,139,140,141,142]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[145,146]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":134}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":150,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":151,"Flags":10,"Description":"The resource api version"},"properties":{"Type":153,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":169,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":161,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":162,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":164,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":165,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[154,155,156,157,158,159,160]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":163}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":168,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[166,167]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":152}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":171,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":172,"Flags":10,"Description":"The resource api version"},"properties":{"Type":174,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":183,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":182,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[175,176,177,178,179,180,181]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":173}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":185,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":186,"Flags":10,"Description":"The resource api version"},"properties":{"Type":188,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":206,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":196,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":199,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":205,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[189,190,191,192,193,194,195]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[197,198]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":203,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":204,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[201,202]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":200}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":187}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":208,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":209,"Flags":10,"Description":"The resource api version"},"properties":{"Type":211,"Flags":0,"Description":"Volume properties"},"tags":{"Type":243,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":219,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":220}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[212,213,214,215,216,217,218]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":233,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":235,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":241,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":242,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":225,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":228,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":232,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[222,223,224]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[226,227]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[229,230,231]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":221}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":234}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":240,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[237,238,239]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":236}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":210}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":249,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":250,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[247,248]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":200}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":246,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":107,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":105,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":106,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":109,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":110,"Flags":10,"Description":"The resource api version"},"properties":{"Type":112,"Flags":0,"Description":"Environment properties"},"tags":{"Type":132,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":120,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":121,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":130,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":131,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[113,114,115,116,117,118,119]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":122,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":123,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":125,"terraform":127}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":128,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":124}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":129}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":111}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":134,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":135,"Flags":10,"Description":"The resource api version"},"properties":{"Type":137,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":150,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":145,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":146,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":149,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[138,139,140,141,142,143,144]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[147,148]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":136}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":152,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":153,"Flags":10,"Description":"The resource api version"},"properties":{"Type":155,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":171,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":163,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":164,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":166,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":167,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[156,157,158,159,160,161,162]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":165}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":170,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[168,169]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":154}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":173,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":174,"Flags":10,"Description":"The resource api version"},"properties":{"Type":176,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":185,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":184,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[177,178,179,180,181,182,183]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":175}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":187,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":188,"Flags":10,"Description":"The resource api version"},"properties":{"Type":190,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":208,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":198,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":201,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":207,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[191,192,193,194,195,196,197]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[199,200]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":205,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":206,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[203,204]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":202}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":189}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":210,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":211,"Flags":10,"Description":"The resource api version"},"properties":{"Type":213,"Flags":0,"Description":"Volume properties"},"tags":{"Type":245,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":221,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":222}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[214,215,216,217,218,219,220]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":235,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":237,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":243,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":244,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":227,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":230,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":234,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[224,225,226]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[228,229]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[231,232,233]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":223}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":236}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":242,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[239,240,241]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":238}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":212}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":251,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":252,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[249,250]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":202}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":248,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index 97d9686c9e..f60b833734 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -206,6 +206,7 @@ * **extensions**: [Extension](#extension)[]: Extensions spec of the resource * **identity**: [IdentitySettings](#identitysettings): IdentitySettings is the external identity setting. * **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the portable resource at the time the operation was called +* **runtimes**: [RuntimesProperties](#runtimesproperties): The properties for runtime configuration * **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. ## ContainerPropertiesConnections @@ -307,6 +308,14 @@ * **source**: string (Required): The source of the volume +## RuntimesProperties +### Properties +* **kubernetes**: [KubernetesRuntimeProperties](#kubernetesruntimeproperties): The runtime configuration properties for Kubernetes + +## KubernetesRuntimeProperties +### Properties +* **base**: string: The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps. + ## TrackedResourceTags ### Properties ### Additional Properties diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 79d0324450..163c53f1d0 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":106},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":131},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":149},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":170},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":184},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":207},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":244},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":245}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":108},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":133},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":151},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":172},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":186},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":209},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":246},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":247}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":253}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file diff --git a/pkg/armrpc/api/v1/errorresponse.go b/pkg/armrpc/api/v1/errorresponse.go index 5aaab9ccce..9ece54b6ae 100644 --- a/pkg/armrpc/api/v1/errorresponse.go +++ b/pkg/armrpc/api/v1/errorresponse.go @@ -32,6 +32,11 @@ type ErrorDetails struct { Details []ErrorDetails `json:"details,omitempty"` } +// Error returns error message in ErrorDetails to implement error interface. +func (e ErrorDetails) Error() string { + return e.Message +} + // ErrorAdditionalInfo represents abritrary additional information as part of an error as defined by the ARM API. type ErrorAdditionalInfo struct { Type string `json:"type"` diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion.go b/pkg/corerp/api/v20220315privatepreview/container_conversion.go index 207f112c76..be96d31fd0 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion.go @@ -131,6 +131,7 @@ func (src *ContainerResource) ConvertTo() (v1.DataModelInterface, error) { WorkingDir: to.String(src.Properties.Container.WorkingDir), }, Extensions: extensions, + Runtimes: toRuntimeProperties(src.Properties.Runtimes), }, } @@ -255,6 +256,7 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { }, Extensions: extensions, Identity: identity, + Runtimes: fromRuntimeProperties(c.Properties.Runtimes), } return nil @@ -468,6 +470,32 @@ func fromManagedStoreDataModel(managedStore datamodel.ManagedStore) *ManagedStor return &m } +func toRuntimeProperties(runtime *RuntimesProperties) *datamodel.RuntimeProperties { + if runtime == nil { + return nil + } + r := &datamodel.RuntimeProperties{} + if runtime.Kubernetes != nil { + r.Kubernetes = &datamodel.KubernetesRuntime{ + Base: to.String(runtime.Kubernetes.Base), + } + } + return r +} + +func fromRuntimeProperties(runtime *datamodel.RuntimeProperties) *RuntimesProperties { + if runtime == nil { + return nil + } + r := &RuntimesProperties{} + if runtime.Kubernetes != nil { + r.Kubernetes = &KubernetesRuntimeProperties{ + Base: to.Ptr(runtime.Kubernetes.Base), + } + } + return r +} + func toPermissionDataModel(rbac *VolumePermission) datamodel.VolumePermission { if rbac == nil { return datamodel.VolumePermissionRead diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go index d90fb7264d..f8e3ef17b1 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go @@ -41,6 +41,11 @@ func TestContainerConvertVersionedToDataModel(t *testing.T) { err: nil, emptyExt: false, }, + { + filename: "containerresource-runtimes.json", + err: nil, + emptyExt: false, + }, { filename: "containerresourceemptyext.json", err: nil, @@ -67,7 +72,6 @@ func TestContainerConvertVersionedToDataModel(t *testing.T) { if tt.err != nil { require.ErrorIs(t, err, tt.err) } else { - // assert require.NoError(t, err) ct := dm.(*datamodel.ContainerResource) @@ -98,13 +102,18 @@ func TestContainerConvertVersionedToDataModel(t *testing.T) { } else { require.Equal(t, getTestContainerExtensions(t), ct.Properties.Extensions) } + + if r.Properties.Runtimes != nil { + require.NotNil(t, ct.Properties.Runtimes.Kubernetes) + require.NotEmpty(t, ct.Properties.Runtimes.Kubernetes.Base) + require.Equal(t, *r.Properties.Runtimes.Kubernetes.Base, ct.Properties.Runtimes.Kubernetes.Base) + } } }) } } func TestContainerConvertDataModelToVersioned(t *testing.T) { - conversionTests := []struct { filename string err error @@ -115,6 +124,11 @@ func TestContainerConvertDataModelToVersioned(t *testing.T) { err: nil, emptyExt: false, }, + { + filename: "containerresourcedatamodel-runtime.json", + err: nil, + emptyExt: false, + }, { filename: "containerresourcedatamodelemptyext.json", err: nil, @@ -154,6 +168,12 @@ func TestContainerConvertDataModelToVersioned(t *testing.T) { require.Equal(t, to.SliceOfPtrs([]string{"/bin/sh"}...), versioned.Properties.Container.Command) require.Equal(t, to.SliceOfPtrs([]string{"-c", "while true; do echo hello; sleep 10;done"}...), versioned.Properties.Container.Args) require.Equal(t, to.Ptr("/app"), versioned.Properties.Container.WorkingDir) + + if r.Properties.Runtimes != nil { + require.NotNil(t, versioned.Properties.Runtimes) + require.NotEmpty(t, *versioned.Properties.Runtimes.Kubernetes.Base) + require.Equal(t, r.Properties.Runtimes.Kubernetes.Base, *versioned.Properties.Runtimes.Kubernetes.Base) + } } }) } diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json new file mode 100644 index 0000000000..085162bd13 --- /dev/null +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json @@ -0,0 +1,81 @@ +{ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "provisioningState": "Succeeded", + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "source": "inventory_route_id", + "disableDefaultEnvVars": true, + "iam": { + "kind": "azure", + "roles": [ + "read" + ] + } + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5, + "timeoutSeconds": 5, + "containerPort": 8080 + }, + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcuri/id", + "resource": "resourceid" + }, + "extensions": [ + { + "kind": "manualScaling", + "replicas": 2 + }, + { + "kind": "daprSidecar", + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" + }, + { + "kind": "kubernetesMetadata", + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + ], + "runtimes": { + "kubernetes": { + "base": "apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app.kubernetes.io/name: MyApp\n ports:\n - protocol: TCP\n port: 80\n targetPort: 9376" + } + } + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json new file mode 100644 index 0000000000..24e9ca4fb5 --- /dev/null +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json @@ -0,0 +1,100 @@ +{ + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "provisioningState": "Succeeded", + "properties": { + "status": { + "outputResources": [ + { + "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" + } + ] + }, + "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "source": "inventory_route_id", + "iam": { + "kind": "azure", + "roles": [ + "read" + ] + } + } + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcuri/id", + "resource": "resourceid" + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "livenessProbe": { + "kind": "tcp", + "tcp": { + "healthProbeBase": { + "failureThreshold": 5, + "initialDelaySeconds": 5, + "periodSeconds": 5 + }, + "containerPort": 8080 + } + }, + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "extensions": [ + { + "kind": "manualScaling", + "manualScaling": { + "replicas": 2 + } + }, + { + "kind": "daprSidecar", + "daprSidecar": { + "appId": "app-id", + "appPort": 80, + "config": "config", + "protocol": "http" + } + }, + { + "kind": "kubernetesMetadata", + "kubernetesmetadata": { + "annotations": { + "prometheus.io/scrape": "true", + "prometheus.io/port": "80" + }, + "labels": { + "foo/bar/team": "credit", + "foo/bar/contact": "radiususer" + } + } + } + ], + "runtimes": { + "kubernetes": { + "base": "apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app.kubernetes.io/name: MyApp\n ports:\n - protocol: TCP\n port: 80\n targetPort: 9376" + } + } + } +} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index b6ad447ba9..cd10cd0dac 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -297,6 +297,9 @@ type ContainerProperties struct { // Configuration for supported external identity providers Identity *IdentitySettings + // Specifies Runtime-specific functionality + Runtimes *RuntimesProperties + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState @@ -365,6 +368,9 @@ type ContainerResourceUpdateProperties struct { // Configuration for supported external identity providers Identity *IdentitySettingsUpdate + + // Specifies Runtime-specific functionality + Runtimes *RuntimesProperties } // ContainerUpdate - Definition of a container @@ -1118,6 +1124,13 @@ func (k *KubernetesNamespaceExtension) GetExtension() *Extension { } } +// KubernetesRuntimeProperties - The runtime configuration properties for Kubernetes +type KubernetesRuntimeProperties struct { + // The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, +// Secrets, and ConfigMaps. + Base *string +} + // ManualScalingExtension - ManualScaling Extension type ManualScalingExtension struct { // REQUIRED; Discriminator property for Extension. @@ -1359,6 +1372,12 @@ type ResourceStatus struct { OutputResources []*OutputResource } +// RuntimesProperties - The properties for runtime configuration +type RuntimesProperties struct { + // The runtime configuration properties for Kubernetes + Kubernetes *KubernetesRuntimeProperties +} + // SecretObjectProperties - Represents secret object properties type SecretObjectProperties struct { // REQUIRED; The name of the secret diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index 7f73eba0d1..0c33c6bbfa 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -617,6 +617,7 @@ func (c ContainerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "extensions", c.Extensions) populate(objectMap, "identity", c.Identity) populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "runtimes", c.Runtimes) populate(objectMap, "status", c.Status) return json.Marshal(objectMap) } @@ -651,6 +652,9 @@ func (c *ContainerProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) + case "runtimes": + err = unpopulate(val, "Runtimes", &c.Runtimes) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) @@ -784,6 +788,7 @@ func (c ContainerResourceUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "environment", c.Environment) populate(objectMap, "extensions", c.Extensions) populate(objectMap, "identity", c.Identity) + populate(objectMap, "runtimes", c.Runtimes) return json.Marshal(objectMap) } @@ -814,6 +819,9 @@ func (c *ContainerResourceUpdateProperties) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) + case "runtimes": + err = unpopulate(val, "Runtimes", &c.Runtimes) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2579,6 +2587,33 @@ func (k *KubernetesNamespaceExtension) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type KubernetesRuntimeProperties. +func (k KubernetesRuntimeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "base", k.Base) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesRuntimeProperties. +func (k *KubernetesRuntimeProperties) 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", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "base": + err = unpopulate(val, "Base", &k.Base) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManualScalingExtension. func (m ManualScalingExtension) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3239,6 +3274,33 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RuntimesProperties. +func (r RuntimesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kubernetes", r.Kubernetes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimesProperties. +func (r *RuntimesProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kubernetes": + err = unpopulate(val, "Kubernetes", &r.Kubernetes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SecretObjectProperties. func (s SecretObjectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/pkg/corerp/datamodel/container.go b/pkg/corerp/datamodel/container.go index baa4a89801..006801b2df 100644 --- a/pkg/corerp/datamodel/container.go +++ b/pkg/corerp/datamodel/container.go @@ -75,6 +75,19 @@ type ContainerProperties struct { Container Container `json:"container,omitempty"` Extensions []Extension `json:"extensions,omitempty"` Identity *rpv1.IdentitySettings `json:"identity,omitempty"` + Runtimes *RuntimeProperties `json:"runtimes,omitempty"` +} + +// KubernetesRuntime represents the Kubernetes runtime configuration. +type KubernetesRuntime struct { + // Base represents the Kubernetes resource definition in the serialized YAML format + Base string `json:"base,omitempty"` +} + +// RuntimeProperties represents the runtime configuration for the platform-specific functionalities. +type RuntimeProperties struct { + // Kubernetes represents the Kubernetes runtime configuration. + Kubernetes *KubernetesRuntime `json:"kubernetes,omitempty"` } // ConnectionProperties represents the properties of Connection. diff --git a/pkg/corerp/frontend/controller/containers/validator.go b/pkg/corerp/frontend/controller/containers/validator.go index 12d76950a6..ec59831c79 100644 --- a/pkg/corerp/frontend/controller/containers/validator.go +++ b/pkg/corerp/frontend/controller/containers/validator.go @@ -18,10 +18,22 @@ package containers import ( "context" + "fmt" + appv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/project-radius/radius/pkg/kubeutil" +) + +const ( + manifestTargetProperty = "$.properties.runtimes.kubernetes.base" ) // ValidateAndMutateRequest checks if the newResource has a user-defined identity and if so, returns a bad request @@ -38,5 +50,121 @@ func ValidateAndMutateRequest(ctx context.Context, newResource, oldResource *dat newResource.Properties.Identity = oldResource.Properties.Identity } + runtimes := newResource.Properties.Runtimes + if runtimes != nil && runtimes.Kubernetes != nil && runtimes.Kubernetes.Base != "" { + err := validateBaseManifest([]byte(runtimes.Kubernetes.Base), newResource) + if err != nil { + return rest.NewBadRequestARMResponse(v1.ErrorResponse{Error: err.(v1.ErrorDetails)}), nil + } + } + return nil, nil } + +func errMultipleResources(typeName string, num int) v1.ErrorDetails { + return v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: "$.properties.runtimes.kubernetes.base", + Message: fmt.Sprintf("only one %s is allowed, but the manifest includes %d resources.", typeName, num), + } +} + +func errUnmatchedName(obj runtime.Object, name string) v1.ErrorDetails { + meta := obj.(metav1.ObjectMetaAccessor) + typeName := obj.GetObjectKind().GroupVersionKind().Kind + resourceName := meta.GetObjectMeta().GetName() + + return v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: "$.properties.runtimes.kubernetes.base", + Message: fmt.Sprintf("%s name %s in manifest does not match resource name %s.", typeName, resourceName, name), + } +} + +// validateBaseManifest deserializes the given YAML manifest and validates the allowed number of resources +// and ensures that the resource names of allowed resources match the name of the container resource. +// +// Allowed resource numbers in the manifest: +// - Deployment : 0-1 +// - Service : 0-1 +// - ServiceAccount : 0-1 +// - ConfigMap : 0-N +// - Secret : 0-N +func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResource) error { + errDetails := []v1.ErrorDetails{} + + resourceMap, err := kubeutil.ParseManifest(manifest) + if err != nil { + return v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: err.Error(), + } + } + + for k, resources := range resourceMap { + // Currently, it returns error immediately if namespaces in resources are set. We may need to override + // the namespace of the resources in the manifest. + for _, resource := range resources { + meta := resource.(metav1.ObjectMetaAccessor) + if meta.GetObjectMeta().GetNamespace() != "" { + errDetails = append(errDetails, v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: fmt.Sprintf("namespace is not allowed in resources: %s.", meta.GetObjectMeta().GetNamespace()), + }) + } + } + + switch k { + case "apps/v1/deployment": + if len(resources) != 1 { + errDetails = append(errDetails, errMultipleResources("Deployment", len(resources))) + } + deployment := resources[0].(*appv1.Deployment) + if deployment.Name != newResource.Name { + errDetails = append(errDetails, errUnmatchedName(deployment, newResource.Name)) + } + + case "core/v1/service": + if len(resources) != 1 { + errDetails = append(errDetails, errMultipleResources("Service", len(resources))) + } + srv := resources[0].(*corev1.Service) + if srv.Name != newResource.Name { + errDetails = append(errDetails, errUnmatchedName(srv, newResource.Name)) + } + + case "core/v1/serviceaccount": + if len(resources) != 1 { + errDetails = append(errDetails, errMultipleResources("ServiceAccount", len(resources))) + } + sa := resources[0].(*corev1.ServiceAccount) + if sa.Name != newResource.Name { + errDetails = append(errDetails, errUnmatchedName(sa, newResource.Name)) + } + + // No limitations for ConfigMap and Secret resources. + case "core/v1/configmap": + case "core/v1/secret": + + default: + errDetails = append(errDetails, v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: fmt.Sprintf("%s is not supported.", k), + }) + } + } + + if len(errDetails) > 0 { + return v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: errDetails, + } + } + + return nil +} diff --git a/pkg/corerp/frontend/controller/containers/validator_test.go b/pkg/corerp/frontend/controller/containers/validator_test.go index 82534da6dc..f8843d1f2f 100644 --- a/pkg/corerp/frontend/controller/containers/validator_test.go +++ b/pkg/corerp/frontend/controller/containers/validator_test.go @@ -18,15 +18,97 @@ package containers import ( "context" + "fmt" + "strings" "testing" + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/corerp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/stretchr/testify/require" ) +const fakeDeploymentTemplate = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: %s + %s + labels: + app: magpie +spec: + replicas: 3 + selector: + matchLabels: + app: magpie + template: + metadata: + labels: + app: magpie + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +` + +const fakeServiceTemplate = ` +apiVersion: v1 +kind: Service +metadata: + name: %s + %s +spec: + selector: + app.kubernetes.io/name: magpie + ports: + - protocol: TCP + port: 80 + targetPort: 9376 +` + +const fakeServiceAccountTemplate = ` +apiVersion: v1 +kind: ServiceAccount +metadata: + name: %s + labels: + app.kubernetes.io/name: magpie + app.kubernetes.io/part-of: radius +` + +const yamlSeparater = "\n---\n" + +const fakeSecretTemplate = ` +apiVersion: v1 +kind: Secret +metadata: + name: %s +type: Opaque +stringData: + username: admin + password: password +` + +const fakeConfigMapTemplate = ` +apiVersion: v1 +kind: ConfigMap +metadata: + name: %s + labels: + app.kubernetes.io/name: magpie + app.kubernetes.io/part-of: radius +data: + appsettings.Production.json: config +` + func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { + fakeDeployment := fmt.Sprintf(fakeDeploymentTemplate, "magpie", "") + fakeService := fmt.Sprintf(fakeServiceTemplate, "magpie", "") + fakeServiceAccount := fmt.Sprintf(fakeServiceAccountTemplate, "magpie") + requestTests := []struct { desc string newResource *datamodel.ContainerResource @@ -84,6 +166,88 @@ func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { }, resp: nil, }, + { + desc: "valid runtime.kubernetes.base", + newResource: &datamodel.ContainerResource{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + Name: "magpie", + }, + }, + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, yamlSeparater), + }, + }, + }, + }, + mutatedResource: &datamodel.ContainerResource{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + Name: "magpie", + }, + }, + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, yamlSeparater), + }, + }, + }, + }, + resp: nil, + }, + { + desc: "empty runtime.kubernetes.base", + newResource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: "", + }, + }, + }, + }, + mutatedResource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: "", + }, + }, + }, + }, + resp: nil, + }, + { + desc: "invalid runtime.kubernetes.base", + newResource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: "invalid", + }, + }, + }, + }, + mutatedResource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: "invalid", + }, + }, + }, + }, + resp: rest.NewBadRequestARMResponse(v1.ErrorResponse{ + Error: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: "$.properties.runtimes.kubernetes.base", + Message: "couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string \"json:\\\"apiVersion,omitempty\\\"\"; Kind string \"json:\\\"kind,omitempty\\\"\" }", + }, + }), + }, } for _, tc := range requestTests { @@ -100,3 +264,195 @@ func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { }) } } + +func TestValidateManifest(t *testing.T) { + fakeDeployment := fmt.Sprintf(fakeDeploymentTemplate, "magpie", "") + fakeService := fmt.Sprintf(fakeServiceTemplate, "magpie", "") + fakeServiceAccount := fmt.Sprintf(fakeServiceAccountTemplate, "magpie") + fakeSecret := fmt.Sprintf(fakeSecretTemplate, "magpie") + fakeConfigMap := fmt.Sprintf(fakeConfigMapTemplate, "magpie") + fakeServiceWithNamespace := fmt.Sprintf(fakeServiceTemplate, "magpie", "namespace: app-scoped") + + validResource := &datamodel.ContainerResource{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + Name: "magpie", + }, + }, + Properties: datamodel.ContainerProperties{}, + } + + manifestTests := []struct { + name string + manifest string + resource *datamodel.ContainerResource + err error + }{ + { + name: "valid manifest with deployments/services/serviceaccounts", + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, yamlSeparater), + resource: validResource, + err: nil, + }, + { + name: "valid manifest with deployments/services/secrets/configmaps", + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeSecret, fakeSecret}, yamlSeparater), + resource: validResource, + err: nil, + }, + { + name: "valid manifest with multiple secrets and multiple configmaps", + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeSecret, fakeSecret, fakeSecret, fakeConfigMap, fakeConfigMap}, yamlSeparater), + resource: validResource, + err: nil, + }, + { + name: "invalid manifest with multiple deployments", + manifest: strings.Join([]string{fakeDeployment, fakeDeployment}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "only one Deployment is allowed, but the manifest includes 2 resources.", + }, + }, + }, + }, + { + name: "invalid manifest with multiple services", + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeService}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "only one Service is allowed, but the manifest includes 2 resources.", + }, + }, + }, + }, + { + name: "invalid manifest with multiple serviceaccounts", + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount, fakeServiceAccount}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "only one ServiceAccount is allowed, but the manifest includes 2 resources.", + }, + }, + }, + }, + { + name: "invalid manifest with resource including namespace", + manifest: strings.Join([]string{fakeDeployment, fakeServiceWithNamespace, fakeServiceAccount}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "namespace is not allowed in resources: app-scoped.", + }, + }, + }, + }, + { + name: "invalid manifest with unmatched deployment name", + manifest: strings.Join([]string{fmt.Sprintf(fakeDeploymentTemplate, "pie", ""), fakeService, fakeServiceAccount}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "Deployment name pie in manifest does not match resource name magpie.", + }, + }, + }, + }, + { + name: "invalid manifest with unmatched service name", + manifest: strings.Join([]string{fakeDeployment, fmt.Sprintf(fakeServiceTemplate, "pie", ""), fakeServiceAccount}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "Service name pie in manifest does not match resource name magpie.", + }, + }, + }, + }, + { + name: "invalid manifest with unmatched serviceaccount name", + manifest: strings.Join([]string{fakeDeployment, fakeService, fmt.Sprintf(fakeServiceAccountTemplate, "pie")}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "ServiceAccount name pie in manifest does not match resource name magpie.", + }, + }, + }, + }, + { + name: "invalid manifest with multiple errors", + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeService, fmt.Sprintf(fakeServiceAccountTemplate, "pie")}, yamlSeparater), + resource: validResource, + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "The manifest includes invalid resources.", + Details: []v1.ErrorDetails{ + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "only one Service is allowed, but the manifest includes 2 resources.", + }, + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "ServiceAccount name pie in manifest does not match resource name magpie.", + }, + }, + }, + }, + } + + for _, tc := range manifestTests { + t.Run(tc.name, func(t *testing.T) { + err := validateBaseManifest([]byte(tc.manifest), tc.resource) + require.Equal(t, tc.err, err) + }) + } +} diff --git a/pkg/kubeutil/manifest.go b/pkg/kubeutil/manifest.go new file mode 100644 index 0000000000..73e63182ca --- /dev/null +++ b/pkg/kubeutil/manifest.go @@ -0,0 +1,73 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubeutil + +import ( + "bytes" + "fmt" + "io" + "strings" + + "k8s.io/apimachinery/pkg/runtime" + + "k8s.io/apimachinery/pkg/util/yaml" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// GetObjectKey returns a object key that uniquely identifies the given Kubernetes object. +// The returned key is in the format of "group/version/kind". +func GetObjectKey(obj runtime.Object) string { + gvk := obj.GetObjectKind().GroupVersionKind() + group := gvk.Group + if group == "" { + group = "core" + } + return strings.ToLower(fmt.Sprintf("%s/%s/%s", group, gvk.Version, gvk.Kind)) +} + +// ParseManifest parses the given manifest and returns a map of runtime.Object slice where +// the key is in the format of "group/version/kind". +// It returns an error if the given manifest is invalid. +func ParseManifest(data []byte) (map[string][]runtime.Object, error) { + decoder := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(data), 4096) + deser := scheme.Codecs.UniversalDeserializer() + + objects := map[string][]runtime.Object{} + for { + ext := runtime.RawExtension{} + if err := decoder.Decode(&ext); err != nil { + if err == io.EOF { + break + } + return nil, err + } + + obj, _, err := deser.Decode([]byte(ext.Raw), nil, nil) + if err != nil { + return nil, err + } + + key := GetObjectKey(obj) + if v, ok := objects[key]; ok { + objects[key] = append(v, obj) + } else { + objects[key] = []runtime.Object{obj} + } + } + + return objects, nil +} diff --git a/pkg/kubeutil/manifest_test.go b/pkg/kubeutil/manifest_test.go new file mode 100644 index 0000000000..c1ddcf95c5 --- /dev/null +++ b/pkg/kubeutil/manifest_test.go @@ -0,0 +1,165 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubeutil + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +const validManifest = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + namespace: app-scoped + labels: + app: nginx +spec: + replicas: 3 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: my-service +spec: + selector: + app.kubernetes.io/name: MyApp + ports: + - protocol: TCP + port: 80 + targetPort: 9376 +` + +const validManifestWithSecrets = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + namespace: app-scoped + labels: + app: nginx +spec: + replicas: 3 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Secret +metadata: + name: secret-admin +type: Opaque +stringData: + username: admin + password: password +--- +apiVersion: v1 +kind: Secret +metadata: + name: secret-user +type: Opaque +stringData: + username: user + password: password +` + +const invalidManifest = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx-deployment + namespace: app-scoped + labels: + app: nginx +spec: + replicas: 3 + sele +` + +func TestParseManifest(t *testing.T) { + manifestTests := []struct { + name string + manifest string + types map[string]int + errString string + }{ + { + name: "valid manifest with deployments and services", + manifest: validManifest, + types: map[string]int{ + "apps/v1/deployment": 1, + "core/v1/service": 1, + }, + errString: "", + }, + { + name: "valid manifest with deployments and secrets", + manifest: validManifestWithSecrets, + types: map[string]int{ + "apps/v1/deployment": 1, + "core/v1/secret": 2, + }, + errString: "", + }, + { + name: "invalid manifest", + manifest: invalidManifest, + errString: "error converting YAML to JSON: yaml: line 12: could not find expected ':'", + }, + } + + for _, tc := range manifestTests { + t.Run(tc.name, func(t *testing.T) { + objects, err := ParseManifest([]byte(tc.manifest)) + if tc.errString != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.errString) + return + } + + require.NoError(t, err) + for k := range objects { + require.Equal(t, tc.types[k], len(objects[k])) + } + }) + } +} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate_BaseManifest.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate_BaseManifest.json new file mode 100644 index 0000000000..c9198a6a57 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Containers_CreateOrUpdate_BaseManifest.json @@ -0,0 +1,76 @@ +{ + "operationId": "Containers_CreateOrUpdate", + "title": "Create or update an container resource with base manifest", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "containerName": "app0", + "api-version": "2022-03-15-privatepreview", + "ContainerResource": { + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "runtimes": { + "kubernetes": { + "base": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: webserver\n namespace: app-scoped\n labels:\n app: webserver\nspec:\n replicas: 3\n selector:\n matchLabels:\n app: webserver\n template:\n metadata:\n labels:\n app: webserver\n spec:\n containers:\n - name: nginx\n image: nginx:1.14.2\n ports:\n - containerPort: 80\n" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "runtimes": { + "kubernetes": { + "base": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: webserver\n namespace: app-scoped\n labels:\n app: webserver\nspec:\n replicas: 3\n selector:\n matchLabels:\n app: webserver\n template:\n metadata:\n labels:\n app: webserver\n spec:\n containers:\n - name: nginx\n image: nginx:1.14.2\n ports:\n - containerPort: 80\n" + } + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index 03ed579d48..58b59cf6a3 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "Applications.Core Management APIs", "version": "2022-03-15-privatepreview", - "description": "REST API for Applications.Core", + "description": "REST APIs for Applications.Core", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" @@ -456,6 +456,9 @@ "x-ms-examples": { "Create or update an container resource": { "$ref": "./examples/Containers_CreateOrUpdate.json" + }, + "Create or update an container resource with base manifest": { + "$ref": "./examples/Containers_CreateOrUpdate_BaseManifest.json" } }, "x-ms-long-running-operation-options": { @@ -2942,6 +2945,10 @@ "$ref": "#/definitions/Extension" }, "x-ms-identifiers": [] + }, + "runtimes": { + "$ref": "#/definitions/RuntimesProperties", + "description": "Specifies Runtime-specific functionality" } }, "required": [ @@ -3041,6 +3048,10 @@ "$ref": "#/definitions/Extension" }, "x-ms-identifiers": [] + }, + "runtimes": { + "$ref": "#/definitions/RuntimesProperties", + "description": "Specifies Runtime-specific functionality" } } }, @@ -4132,6 +4143,16 @@ ], "x-ms-discriminator-value": "kubernetesNamespace" }, + "KubernetesRuntimeProperties": { + "type": "object", + "description": "The runtime configuration properties for Kubernetes", + "properties": { + "base": { + "type": "string", + "description": "The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps." + } + } + }, "ManagedStore": { "type": "string", "description": "The managed store for the ephemeral volume", @@ -4538,6 +4559,16 @@ } } }, + "RuntimesProperties": { + "type": "object", + "description": "The properties for runtime configuration", + "properties": { + "kubernetes": { + "$ref": "#/definitions/KubernetesRuntimeProperties", + "description": "The runtime configuration properties for Kubernetes" + } + } + }, "SecretObjectProperties": { "type": "object", "description": "Represents secret object properties", diff --git a/test/functional/shared/resources/container_runtimes_test.go b/test/functional/shared/resources/container_runtimes_test.go new file mode 100644 index 0000000000..556438df6b --- /dev/null +++ b/test/functional/shared/resources/container_runtimes_test.go @@ -0,0 +1,60 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resource_test + +import ( + "testing" + + "github.com/project-radius/radius/test/functional" + "github.com/project-radius/radius/test/functional/shared" + "github.com/project-radius/radius/test/step" + "github.com/project-radius/radius/test/validation" +) + +func Test_Container_YAMLManifest(t *testing.T) { + template := "testdata/corerp-resources-container-manifest.bicep" + name := "corerp-resources-container-manifest" + appNamespace := "corerp-resources-container-manifest" + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: "ctnr-manifest", + Type: validation.ContainersResource, + App: name, + }, + }, + }, + K8sObjects: &validation.K8sObjectSet{ + Namespaces: map[string][]validation.K8sObject{ + appNamespace: { + validation.NewK8sPodForResource(name, "ctnr-manifest"), + }, + }, + }, + }, + }) + + test.Test(t) +} diff --git a/test/functional/shared/resources/testdata/corerp-resources-container-manifest.bicep b/test/functional/shared/resources/testdata/corerp-resources-container-manifest.bicep new file mode 100644 index 0000000000..513c5a1d53 --- /dev/null +++ b/test/functional/shared/resources/testdata/corerp-resources-container-manifest.bicep @@ -0,0 +1,52 @@ +import radius as radius + +@description('Specifies the location for resources.') +param location string = 'global' + +@description('Specifies the image of the container resource.') +param magpieimage string + +@description('Specifies the port of the container resource.') +param port int = 3000 + +@description('Specifies the environment for resources.') +param environment string + +var manifest = loadTextContent('manifest/basemanifest.yaml') + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'corerp-resources-container-manifest' + location: location + properties: { + environment: environment + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: 'corerp-resources-container-manifest' + } + ] + } +} + +resource container 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ctnr-manifest' + location: location + properties: { + application: app.id + container: { + image: magpieimage + ports: { + web: { + containerPort: port + } + } + } + connections: {} + runtimes: { + kubernetes: { + base: manifest + } + } + } +} + diff --git a/test/functional/shared/resources/testdata/manifest/basemanifest.yaml b/test/functional/shared/resources/testdata/manifest/basemanifest.yaml new file mode 100644 index 0000000000..2428c5bd0c --- /dev/null +++ b/test/functional/shared/resources/testdata/manifest/basemanifest.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ctnr-manifest + labels: + app: ctnr-manifest +spec: + replicas: 3 + selector: + matchLabels: + app: ctnr-manifest + template: + metadata: + labels: + app: ctnr-manifest + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: ctnr-manifest +spec: + selector: + app.kubernetes.io/name: ctnr-manifest + ports: + - protocol: TCP + port: 80 + targetPort: 9376 \ No newline at end of file diff --git a/typespec/Applications.Core/containers.tsp b/typespec/Applications.Core/containers.tsp index dd028635be..e952fcfecb 100644 --- a/typespec/Applications.Core/containers.tsp +++ b/typespec/Applications.Core/containers.tsp @@ -61,6 +61,21 @@ model ContainerProperties { @doc("Extensions spec of the resource") @extension("x-ms-identifiers", []) extensions?: Extension[]; + + @doc("Specifies Runtime-specific functionality") + runtimes?: RuntimesProperties; +} + +@doc("The properties for runtime configuration") +model RuntimesProperties { + @doc("The runtime configuration properties for Kubernetes") + kubernetes?: KubernetesRuntimeProperties; +} + +@doc("The runtime configuration properties for Kubernetes") +model KubernetesRuntimeProperties { + @doc("The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps.") + base?: string; } @doc("Specifies a listening port for the container") diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate_BaseManifest.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate_BaseManifest.json new file mode 100644 index 0000000000..c9198a6a57 --- /dev/null +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Containers_CreateOrUpdate_BaseManifest.json @@ -0,0 +1,76 @@ +{ + "operationId": "Containers_CreateOrUpdate", + "title": "Create or update an container resource with base manifest", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "containerName": "app0", + "api-version": "2022-03-15-privatepreview", + "ContainerResource": { + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "runtimes": { + "kubernetes": { + "base": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: webserver\n namespace: app-scoped\n labels:\n app: webserver\nspec:\n replicas: 3\n selector:\n matchLabels:\n app: webserver\n template:\n metadata:\n labels:\n app: webserver\n spec:\n containers:\n - name: nginx\n image: nginx:1.14.2\n ports:\n - containerPort: 80\n" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/containers/container0", + "name": "container0", + "type": "Applications.Core/containers", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "connections": { + "inventory": { + "kind": "dapr.io/InvokeHttp", + "source": "inventory_route_id" + } + }, + "container": { + "image": "radius.azurecr.io/webapptutorial-todoapp", + "command": [ + "/bin/sh" + ], + "args": [ + "-c", + "while true; do echo hello; sleep 10;done" + ], + "workingDir": "/app" + }, + "runtimes": { + "kubernetes": { + "base": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: webserver\n namespace: app-scoped\n labels:\n app: webserver\nspec:\n replicas: 3\n selector:\n matchLabels:\n app: webserver\n template:\n metadata:\n labels:\n app: webserver\n spec:\n containers:\n - name: nginx\n image: nginx:1.14.2\n ports:\n - containerPort: 80\n" + } + }, + "identity": { + "kind": "azure.com.workload", + "oidcIssuer": "https://oidcissuer/oidc", + "resource": "/subscriptions/testSub/resourcegroups/testGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/app0-container0" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/Applications.Core/main.tsp b/typespec/Applications.Core/main.tsp index 9862c3dc57..376431ea99 100644 --- a/typespec/Applications.Core/main.tsp +++ b/typespec/Applications.Core/main.tsp @@ -33,7 +33,7 @@ using Azure.ResourceManager; @service({ title: "Applications.Core Management APIs", }) -@doc("REST API for Applications.Core") +@doc("REST APIs for Applications.Core") @versioned(Versions) namespace Applications.Core; From 9602bb031fa8ae5df8697cdef42e26a3519eb2b1 Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Sat, 26 Aug 2023 02:48:43 -0700 Subject: [PATCH 14/57] Adding a check to the Error.Code before adding as an attribute (#6145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding a check to the Error.Code before adding as an attribute ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: #6144 ## Auto-generated summary ### 🤖 Generated by Copilot at 2f63662 ### Summary 🛠️📊🚀 Refactor async operation metrics and logging to handle error codes better. Avoid setting `error_code` attribute to empty string in `pkg/metrics/asyncoperationmetrics.go`. > _`error_code` checked_ > _refactor for better metrics_ > _autumn of async_ ### Walkthrough * Add a condition to check for error codes in async operation responses ([link](https://github.com/project-radius/radius/pull/6145/files?diff=unified&w=0#diff-0746ff3ed894513244b3843837993bc5f1de5716bb72e8114c0020cc6821a03bR141-R143)) --- pkg/metrics/asyncoperationmetrics.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/metrics/asyncoperationmetrics.go b/pkg/metrics/asyncoperationmetrics.go index fa048f9f15..1d5dd48df2 100644 --- a/pkg/metrics/asyncoperationmetrics.go +++ b/pkg/metrics/asyncoperationmetrics.go @@ -138,6 +138,9 @@ func newAsyncOperationCommonAttributes(req *ctrl.Request, res *ctrl.Result) []at if res != nil && res.ProvisioningState() != "" { attrs = append(attrs, OperationStateAttrKey.String(normalizeAttrValue(string(res.ProvisioningState())))) + } + + if res != nil && res.Error != nil && res.Error.Code != "" { attrs = append(attrs, operationErrorCodeAttrKey.String(normalizeAttrValue(string(res.Error.Code)))) } From 6813c293f4f5d5bdfe77da911dde72e739c7f9e3 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Mon, 28 Aug 2023 11:05:52 -0700 Subject: [PATCH 15/57] Fix the flakiness of validateBaseManifest test (#6143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description validateBaseManifest test is failed intermittently due to the ordering of elements when comparing error details. This is to fix this flakiness. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 5ca3f08 ### Summary 🧪🔧🚨 Update validator test case to compare error details more precisely. This improves the error handling and reporting of the `validator` package. > _`Error` details_ > _More precise in test case_ > _Autumn of bugs ends_ ### Walkthrough * Improve error handling and reporting of the validator package ([link](https://github.com/project-radius/radius/pull/6143/files?diff=unified&w=0#diff-fc19d513d0bf2fdd0bc405a7bbfe1ca9ce18e1bb6219d27675e807d46ef3de01L455-R464)) - Update test case for validating the base manifest to compare error details more precisely ([link](https://github.com/project-radius/radius/pull/6143/files?diff=unified&w=0#diff-fc19d513d0bf2fdd0bc405a7bbfe1ca9ce18e1bb6219d27675e807d46ef3de01L455-R464)) - Check individual fields of the error details struct instead of the whole error object ([link](https://github.com/project-radius/radius/pull/6143/files?diff=unified&w=0#diff-fc19d513d0bf2fdd0bc405a7bbfe1ca9ce18e1bb6219d27675e807d46ef3de01L455-R464)) - Use `require.NoError` to assert no error when expected ([link](https://github.com/project-radius/radius/pull/6143/files?diff=unified&w=0#diff-fc19d513d0bf2fdd0bc405a7bbfe1ca9ce18e1bb6219d27675e807d46ef3de01L455-R464)) - Update file `pkg/corerp/frontend/controller/containers/validator_test.go` to reflect the changes ([link](https://github.com/project-radius/radius/pull/6143/files?diff=unified&w=0#diff-fc19d513d0bf2fdd0bc405a7bbfe1ca9ce18e1bb6219d27675e807d46ef3de01L455-R464)) --- .../frontend/controller/containers/validator_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/corerp/frontend/controller/containers/validator_test.go b/pkg/corerp/frontend/controller/containers/validator_test.go index f8843d1f2f..b068343faa 100644 --- a/pkg/corerp/frontend/controller/containers/validator_test.go +++ b/pkg/corerp/frontend/controller/containers/validator_test.go @@ -452,7 +452,16 @@ func TestValidateManifest(t *testing.T) { for _, tc := range manifestTests { t.Run(tc.name, func(t *testing.T) { err := validateBaseManifest([]byte(tc.manifest), tc.resource) - require.Equal(t, tc.err, err) + if tc.err != nil { + expected := tc.err.(v1.ErrorDetails) + actual := err.(v1.ErrorDetails) + require.Equal(t, expected.Code, actual.Code) + require.Equal(t, expected.Target, actual.Target) + require.Equal(t, expected.Message, actual.Message) + require.ElementsMatch(t, expected.Details, actual.Details) + } else { + require.NoError(t, err) + } }) } } From e90c7b99b46adb606d83a5dfcd805b1dd220a465 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Mon, 28 Aug 2023 12:24:07 -0700 Subject: [PATCH 16/57] Fix security vulnerability in npm packages (#6142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is to fix security vulnerable npm packages by upgrading pkg version. I also regen autorest client because newer autorest generator generated client code, but no impact to the other codes. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 65be32e ### Summary 🆙🆕🐛 This pull request updates various files related to the `bicep-types-radius`, `cli`, `daprrp`, and `datastoresrp` projects to use the latest version of the `@autorest/go` package and the new features of Go 1.18. It also adds new files and types to support client factories, interfaces, and polymorphic types for Dapr and Datastore resources and operations. > _We updated the `@autorest/go` package_ > _To get the latest features and fix the snags_ > _We added new files and tags_ > _And refactored some clients and flags_ > _And used the `any` type to handle more bags_ ### Walkthrough * Add new files for client factory, interfaces, and time_rfc3339 in the `v20220315privatepreview` module of the `daprrp` package ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-aa326ca559f06b7230e1aadfbce9b3b982202d3a6638613552cf1312789d7a51R1-R60), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-baa677a4158ba4d9c8fcfaed080236d8717a48aa14307b7be6b4b3481e21ae75R1-R18), ) * Update the `statestores` client to use the `internal.Endpoint()` method and handle errors from `runtime.MarshalAsJSON` ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-7eb5defb887d575d2238e1ca0146d0067934a3f65edcbcb8df2bf465b23ea5fdL322-R334), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-7eb5defb887d575d2238e1ca0146d0067934a3f65edcbcb8df2bf465b23ea5fdL330-R346)) * Replace the `interface{}` type with the `any` type in the `time_rfc3339` file and the `zz_generated_models` and `zz_generated_models_serde` files in the `v20220315privatepreview` module of the `daprrp` package ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-501295b2d467ecd6ad28983441969556af25a6322711107deaea12086290f967L69-R68), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL16-R46), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL53-R70), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL77-R79), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL86-R88), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL95-R115), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL122-R149), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL156-R173), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL180-R182), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL352-R345), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL361-R363), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL380-R370), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL386-R382), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-87e865764fc98211550404c0827227ef093b0124ae30aa4b07280d993aec0ea5L20-R19), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-87e865764fc98211550404c0827227ef093b0124ae30aa4b07280d993aec0ea5L87-R86)) * Add new fields and methods to the types in the `zz_generated_models` file in the `v20220315privatepreview` module of the `daprrp` package ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL189-R191), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL198-R215), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL222-R252), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL259-R276), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL283-R285), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL292-R294), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL301-R333), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL398-R397), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL413-R405), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL422-R427), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL443-R445), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL462-R478), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL528-R487), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL537-R502), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL552-R508), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL558-R538), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL647-R560)) * Update the `use` directive in the `README.md` files to use the latest version of the `@autorest/go` package ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-2c80cff24f8409b4ace1d93aae9e72fe0245398a137e056279b4fba9a788b99eL1625-R1627), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-2c80cff24f8409b4ace1d93aae9e72fe0245398a137e056279b4fba9a788b99eL1894-R1896), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-2c80cff24f8409b4ace1d93aae9e72fe0245398a137e056279b4fba9a788b99eL3145-R3147), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-2c80cff24f8409b4ace1d93aae9e72fe0245398a137e056279b4fba9a788b99eL3333-R3335), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-4115fc19b9080b46ab3059da7e80873df1358c1729ebff85f944ac8ee55b5512L32-R32), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-1721e9402a626b6a1e209138aa3e45d019f21192c699513f489ab1c238592651L47-R47), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-8b73696025f4e7374778bf5b819f4d63d0ebd1c279d1ba20ae1b5d46f4bdc881L47-R47)) * Update the comment headers in the `constants` and `time_rfc3339` files to remove the redundant line `// DO NOT EDIT.` ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-501295b2d467ecd6ad28983441969556af25a6322711107deaea12086290f967L5-R6), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-339974a9cc633498cdd577ce7e9875882f0194d13e4b4048518f30910597e201L5-R6)) * Update the version of the `semver` package in various dependencies in the `package-lock.json` file in the `autorest.bicep` folder ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L155-R157), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L205-R207), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L3168-R3170), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L4028-R4030), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R4456-R4461), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L4640-R4654), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L5495-R5520), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L5534-R5559), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L7779-R7804), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L8448-R8473), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L8889-R8926)) * Update the version of the `json5` package in various dependencies in the `package-lock.json` file in the `autorest.bicep` folder ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L3924-R3926), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L8371-R8396)) * Add new dependencies for the `querystringify`, `requires-port`, `url-parse`, `tough-cookie`, and `universalify` packages in the `package-lock.json` file in the `autorest.bicep` folder ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R4456-R4461), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R4509-R4514), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L4923-R4943), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L5120-R5135), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R5150-R5159), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L5264-R5289), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R8797-R8802), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R8827-R8832), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L9102-R9145), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L9218-R9256), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203R9268-R9277), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-075b4bbd5a7ae383d7c25934867346d6019accb02b5c5830c2fe6854ce420203L9337-R9385)) * Add a new build tag `go1.18` to the `zz_generated_constants`, `zz_generated_models`, and `zz_generated_models_serde` files in the `v20220315privatepreview` module of the `daprrp` package ([link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-b804ec5ef8042851d82953f5d090ded3321cf37e91535040eadeb2a9f4dca3e2L5-R6), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-350c1609cacc0d7f6f7034b714d816c2839046e2771247b92e62601ed4163c7aL5-R6), [link](https://github.com/project-radius/radius/pull/6142/files?diff=unified&w=0#diff-87e865764fc98211550404c0827227ef093b0124ae30aa4b07280d993aec0ea5L5-R6)) --- .../src/autorest.bicep/package-lock.json | 158 +++-- .../src/generator/package-lock.json | 24 +- pkg/daprrp/api/README.md | 2 +- .../zz_generated_client_factory.go | 60 ++ .../zz_generated_constants.go | 3 +- .../zz_generated_interfaces.go | 18 + .../zz_generated_models.go | 392 ++++------- .../zz_generated_models_serde.go | 359 +++++----- .../zz_generated_operations_client.go | 31 +- .../zz_generated_options.go | 102 +++ .../zz_generated_polymorphic_helpers.go | 10 +- .../zz_generated_pubsubbrokers_client.go | 146 ++-- .../zz_generated_response_types.go | 42 +- .../zz_generated_secretstores_client.go | 146 ++-- .../zz_generated_statestores_client.go | 141 ++-- .../zz_generated_time_rfc3339.go | 5 +- pkg/datastoresrp/api/README.md | 2 +- .../zz_generated_client_factory.go | 60 ++ .../zz_generated_constants.go | 3 +- .../zz_generated_interfaces.go | 18 + .../zz_generated_models.go | 457 +++++------- .../zz_generated_models_serde.go | 421 ++++++----- .../zz_generated_mongodatabases_client.go | 177 ++--- .../zz_generated_operations_client.go | 31 +- .../zz_generated_options.go | 117 ++++ .../zz_generated_polymorphic_helpers.go | 10 +- .../zz_generated_rediscaches_client.go | 170 +++-- .../zz_generated_response_types.go | 45 +- .../zz_generated_sqldatabases_client.go | 177 ++--- .../zz_generated_time_rfc3339.go | 5 +- pkg/linkrp/api/README.md | 2 +- .../zz_generated_client_factory.go | 83 +++ .../zz_generated_constants.go | 3 +- .../zz_generated_daprpubsubbroker_client.go | 105 +-- .../zz_generated_daprsecretstore_client.go | 98 +-- .../zz_generated_daprstatestore_client.go | 105 +-- .../zz_generated_extenders_client.go | 113 +-- .../zz_generated_models.go | 659 ++++++------------ .../zz_generated_models_serde.go | 553 ++++++++------- .../zz_generated_mongodatabases_client.go | 125 ++-- .../zz_generated_operations_client.go | 31 +- .../zz_generated_options.go | 216 ++++++ ..._generated_rabbitmqmessagequeues_client.go | 122 ++-- .../zz_generated_rediscaches_client.go | 116 +-- .../zz_generated_response_types.go | 65 +- .../zz_generated_sqldatabases_client.go | 118 ++-- .../zz_generated_time_rfc3339.go | 5 +- pkg/messagingrp/api/README.md | 2 +- .../zz_generated_client_factory.go | 50 ++ .../zz_generated_constants.go | 3 +- .../zz_generated_interfaces.go | 18 + .../zz_generated_models.go | 245 +++---- .../zz_generated_models_serde.go | 249 ++++--- .../zz_generated_operations_client.go | 31 +- .../zz_generated_options.go | 49 ++ .../zz_generated_polymorphic_helpers.go | 10 +- .../zz_generated_rabbitmqqueues_client.go | 177 ++--- .../zz_generated_response_types.go | 19 +- .../zz_generated_time_rfc3339.go | 5 +- pkg/ucp/api/README.md | 2 +- .../zz_generated_awscredential_client.go | 104 +-- .../zz_generated_azurecredential_client.go | 104 +-- .../zz_generated_client_factory.go | 61 ++ .../zz_generated_constants.go | 3 +- .../zz_generated_interfaces.go | 36 + .../zz_generated_models.go | 286 +++----- .../zz_generated_models_serde.go | 225 +++--- .../zz_generated_options.go | 99 +++ .../zz_generated_planes_client.go | 99 +-- .../zz_generated_planetypes_client.go | 42 +- .../zz_generated_polymorphic_helpers.go | 24 +- .../zz_generated_resourcegroups_client.go | 112 +-- .../zz_generated_response_types.go | 28 +- .../zz_generated_time_rfc3339.go | 5 +- 74 files changed, 4305 insertions(+), 3634 deletions(-) create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_client_factory.go create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_interfaces.go create mode 100644 pkg/daprrp/api/v20220315privatepreview/zz_generated_options.go create mode 100644 pkg/datastoresrp/api/v20220315privatepreview/zz_generated_client_factory.go create mode 100644 pkg/datastoresrp/api/v20220315privatepreview/zz_generated_interfaces.go create mode 100644 pkg/datastoresrp/api/v20220315privatepreview/zz_generated_options.go create mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go create mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go create mode 100644 pkg/messagingrp/api/v20220315privatepreview/zz_generated_client_factory.go create mode 100644 pkg/messagingrp/api/v20220315privatepreview/zz_generated_interfaces.go create mode 100644 pkg/messagingrp/api/v20220315privatepreview/zz_generated_options.go create mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go create mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go create mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_options.go diff --git a/hack/bicep-types-radius/src/autorest.bicep/package-lock.json b/hack/bicep-types-radius/src/autorest.bicep/package-lock.json index d5720f8236..96793d329e 100644 --- a/hack/bicep-types-radius/src/autorest.bicep/package-lock.json +++ b/hack/bicep-types-radius/src/autorest.bicep/package-lock.json @@ -152,9 +152,9 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -202,9 +202,9 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3165,9 +3165,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3921,9 +3921,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -4025,9 +4025,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -4453,6 +4453,12 @@ "node": ">=6" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4500,6 +4506,12 @@ "node": ">=0.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, "node_modules/resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -4637,9 +4649,9 @@ } }, "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -4920,14 +4932,15 @@ } }, "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "engines": { "node": ">=6" @@ -5117,9 +5130,9 @@ } }, "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true, "engines": { "node": ">= 4.0.0" @@ -5134,6 +5147,16 @@ "punycode": "^2.1.0" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -5261,9 +5284,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5492,9 +5515,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -5531,9 +5554,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -7776,9 +7799,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -8368,9 +8391,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "kleur": { @@ -8445,9 +8468,9 @@ }, "dependencies": { "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true } } @@ -8771,6 +8794,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -8795,6 +8824,12 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, "resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -8886,9 +8921,9 @@ } }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -9099,14 +9134,15 @@ } }, "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" } }, "tr46": { @@ -9215,9 +9251,9 @@ "dev": true }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "dev": true }, "uri-js": { @@ -9229,6 +9265,16 @@ "punycode": "^2.1.0" } }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -9334,9 +9380,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "wrap-ansi": { diff --git a/hack/bicep-types-radius/src/generator/package-lock.json b/hack/bicep-types-radius/src/generator/package-lock.json index fb29c34066..8e09f9e7c3 100644 --- a/hack/bicep-types-radius/src/generator/package-lock.json +++ b/hack/bicep-types-radius/src/generator/package-lock.json @@ -1622,9 +1622,9 @@ } }, "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1891,9 +1891,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3142,9 +3142,9 @@ } }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -3330,9 +3330,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "wrap-ansi": { diff --git a/pkg/daprrp/api/README.md b/pkg/daprrp/api/README.md index 639ddffa04..9aa57fe675 100644 --- a/pkg/daprrp/api/README.md +++ b/pkg/daprrp/api/README.md @@ -44,7 +44,7 @@ The following configuration generates track2 go models and client. ```yaml $(tag) != '' version: 3.*.* -use: "@autorest/go@4.0.0-preview.44" +use: "@autorest/go@4.0.0-preview.55" module-version: 0.0.1 file-prefix: zz_generated_ license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_client_factory.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_client_factory.go new file mode 100644 index 0000000000..b288e5d860 --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_client_factory.go @@ -0,0 +1,60 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + rootScope string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + rootScope: rootScope, credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPubSubBrokersClient() *PubSubBrokersClient { + subClient, _ := NewPubSubBrokersClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSecretStoresClient() *SecretStoresClient { + subClient, _ := NewSecretStoresClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewStateStoresClient() *StateStoresClient { + subClient, _ := NewStateStoresClient(c.rootScope, c.credential, c.options) + return subClient +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go index 807ed22086..b0c3e1f1e9 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_constants.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_interfaces.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_interfaces.go new file mode 100644 index 0000000000..104e8355bd --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_interfaces.go @@ -0,0 +1,18 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// EnvironmentComputeClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnvironmentCompute, *KubernetesCompute +type EnvironmentComputeClassification interface { + // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. + GetEnvironmentCompute() *EnvironmentCompute +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go index 2d50850306..0ccb1a0477 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,334 +12,325 @@ import "time" // DaprPubSubBrokerProperties - Dapr PubSubBroker portable resource properties type DaprPubSubBrokerProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The metadata for Dapr resource which must match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // A collection of references to resources associated with the pubSubBroker - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Dapr component type which must matches the format used by Dapr Kubernetes configuration format - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // DaprPubSubBrokerResource - Dapr PubSubBroker portable resource type DaprPubSubBrokerResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *DaprPubSubBrokerProperties `json:"properties,omitempty"` + Properties *DaprPubSubBrokerProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DaprPubSubBrokerResourceListResult - The response of a DaprPubSubBrokerResource list operation. type DaprPubSubBrokerResourceListResult struct { // REQUIRED; The DaprPubSubBrokerResource items on this page - Value []*DaprPubSubBrokerResource `json:"value,omitempty"` + Value []*DaprPubSubBrokerResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // DaprPubSubBrokerResourceUpdate - The type used for update operations of the DaprPubSubBrokerResource. type DaprPubSubBrokerResourceUpdate struct { // The updatable properties of the DaprPubSubBrokerResource. - Properties *DaprPubSubBrokerResourceUpdateProperties `json:"properties,omitempty"` + Properties *DaprPubSubBrokerResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // DaprPubSubBrokerResourceUpdateProperties - The updatable properties of the DaprPubSubBrokerResource. type DaprPubSubBrokerResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // The metadata for Dapr resource which must match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // A collection of references to resources associated with the pubSubBroker - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Dapr component type which must matches the format used by Dapr Kubernetes configuration format - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string } // DaprSecretStoreProperties - Dapr SecretStore portable resource properties type DaprSecretStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The metadata for Dapr resource which must match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // Dapr component type which must matches the format used by Dapr Kubernetes configuration format - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // DaprSecretStoreResource - Dapr SecretStore portable resource type DaprSecretStoreResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *DaprSecretStoreProperties `json:"properties,omitempty"` + Properties *DaprSecretStoreProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DaprSecretStoreResourceListResult - The response of a DaprSecretStoreResource list operation. type DaprSecretStoreResourceListResult struct { // REQUIRED; The DaprSecretStoreResource items on this page - Value []*DaprSecretStoreResource `json:"value,omitempty"` + Value []*DaprSecretStoreResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // DaprSecretStoreResourceUpdate - The type used for update operations of the DaprSecretStoreResource. type DaprSecretStoreResourceUpdate struct { // The updatable properties of the DaprSecretStoreResource. - Properties *DaprSecretStoreResourceUpdateProperties `json:"properties,omitempty"` + Properties *DaprSecretStoreResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // DaprSecretStoreResourceUpdateProperties - The updatable properties of the DaprSecretStoreResource. type DaprSecretStoreResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // The metadata for Dapr resource which must match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // Dapr component type which must matches the format used by Dapr Kubernetes configuration format - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string } // DaprStateStoreProperties - Dapr StateStore portable resource properties type DaprStateStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The metadata for Dapr resource which must match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // A collection of references to resources associated with the state store - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Dapr component type which must matches the format used by Dapr Kubernetes configuration format - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // DaprStateStoreResource - Dapr StateStore portable resource type DaprStateStoreResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *DaprStateStoreProperties `json:"properties,omitempty"` + Properties *DaprStateStoreProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DaprStateStoreResourceListResult - The response of a DaprStateStoreResource list operation. type DaprStateStoreResourceListResult struct { // REQUIRED; The DaprStateStoreResource items on this page - Value []*DaprStateStoreResource `json:"value,omitempty"` + Value []*DaprStateStoreResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // DaprStateStoreResourceUpdate - The type used for update operations of the DaprStateStoreResource. type DaprStateStoreResourceUpdate struct { // The updatable properties of the DaprStateStoreResource. - Properties *DaprStateStoreResourceUpdateProperties `json:"properties,omitempty"` + Properties *DaprStateStoreResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // DaprStateStoreResourceUpdateProperties - The updatable properties of the DaprStateStoreResource. type DaprStateStoreResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // The metadata for Dapr resource which must match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // A collection of references to resources associated with the state store - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Dapr component type which must matches the format used by Dapr Kubernetes configuration format - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` -} - -// EnvironmentComputeClassification provides polymorphic access to related types. -// Call the interface's GetEnvironmentCompute() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EnvironmentCompute, *KubernetesCompute -type EnvironmentComputeClassification interface { - // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. - GetEnvironmentCompute() *EnvironmentCompute + Version *string } // EnvironmentCompute - Represents backing compute resource type EnvironmentCompute struct { // REQUIRED; Discriminator property for EnvironmentCompute. - Kind *string `json:"kind,omitempty"` + Kind *string // Configuration for supported external identity providers - Identity *IdentitySettings `json:"identity,omitempty"` + Identity *IdentitySettings // The resource id of the compute resource for application environment. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. @@ -349,316 +339,224 @@ func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { retur // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info map[string]any // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ErrorDetail - The error detail. type ErrorDetail struct { // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + Details []*ErrorDetail // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { // The error object. - Error *ErrorDetail `json:"error,omitempty"` + Error *ErrorDetail } // IdentitySettings is the external identity setting. type IdentitySettings struct { // REQUIRED; kind of identity setting - Kind *IdentitySettingKind `json:"kind,omitempty"` + Kind *IdentitySettingKind // The URI for your compute platform's OIDC issuer - OidcIssuer *string `json:"oidcIssuer,omitempty"` + OidcIssuer *string // The resource ID of the provisioned identity - Resource *string `json:"resource,omitempty"` + Resource *string } // KubernetesCompute - The Kubernetes compute configuration type KubernetesCompute struct { // REQUIRED; Discriminator property for EnvironmentCompute. - Kind *string `json:"kind,omitempty"` + Kind *string // REQUIRED; The namespace to use for the environment. - Namespace *string `json:"namespace,omitempty"` + Namespace *string // Configuration for supported external identity providers - Identity *IdentitySettings `json:"identity,omitempty"` + Identity *IdentitySettings // The resource id of the compute resource for application environment. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type KubernetesCompute. func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { return &EnvironmentCompute{ + Identity: k.Identity, Kind: k.Kind, ResourceID: k.ResourceID, - Identity: k.Identity, } } // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + ActionType *ActionType // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. - IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" - Origin *Origin `json:"origin,omitempty" azure:"ro"` + Origin *Origin } // OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to // get the next set of results. type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; List of operations supported by the resource provider - Value []*Operation `json:"value,omitempty" azure:"ro"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters + Value []*Operation } // OutputResource - Properties of an output resource. type OutputResource struct { // The UCP resource ID of the underlying resource. - ID *string `json:"id,omitempty"` + ID *string // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency // relationship. LocalIDs do not have any particular format or meaning beyond // being compared to determine dependency relationships. - LocalID *string `json:"localId,omitempty"` + LocalID *string // Determines whether Radius manages the lifecycle of the underlying resource. - RadiusManaged *bool `json:"radiusManaged,omitempty"` -} - -// PubSubBrokersClientBeginCreateOrUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginCreateOrUpdate -// method. -type PubSubBrokersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PubSubBrokersClientBeginDeleteOptions contains the optional parameters for the PubSubBrokersClient.BeginDelete method. -type PubSubBrokersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PubSubBrokersClientBeginUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginUpdate method. -type PubSubBrokersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PubSubBrokersClientGetOptions contains the optional parameters for the PubSubBrokersClient.Get method. -type PubSubBrokersClientGetOptions struct { - // placeholder for future optional parameters -} - -// PubSubBrokersClientListByScopeOptions contains the optional parameters for the PubSubBrokersClient.ListByScope method. -type PubSubBrokersClientListByScopeOptions struct { - // placeholder for future optional parameters + RadiusManaged *bool } // Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource type Recipe struct { // REQUIRED; The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource type RecipeUpdate struct { // The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceReference - Describes a reference to an existing resource type ResourceReference struct { // REQUIRED; Resource id of an existing resource - ID *string `json:"id,omitempty"` + ID *string } // ResourceStatus - Status of a resource. type ResourceStatus struct { // The compute resource associated with the resource. - Compute EnvironmentComputeClassification `json:"compute,omitempty"` + Compute EnvironmentComputeClassification // Properties of an output resource - OutputResources []*OutputResource `json:"outputResources,omitempty"` -} - -// SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate -// method. -type SecretStoresClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete method. -type SecretStoresClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate method. -type SecretStoresClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. -type SecretStoresClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.ListByScope method. -type SecretStoresClientListByScopeOptions struct { - // placeholder for future optional parameters -} - -// StateStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the StateStoresClient.BeginCreateOrUpdate -// method. -type StateStoresClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StateStoresClientBeginDeleteOptions contains the optional parameters for the StateStoresClient.BeginDelete method. -type StateStoresClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StateStoresClientBeginUpdateOptions contains the optional parameters for the StateStoresClient.BeginUpdate method. -type StateStoresClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StateStoresClientGetOptions contains the optional parameters for the StateStoresClient.Get method. -type StateStoresClientGetOptions struct { - // placeholder for future optional parameters -} - -// StateStoresClientListByScopeOptions contains the optional parameters for the StateStoresClient.ListByScope method. -type StateStoresClientListByScopeOptions struct { - // placeholder for future optional parameters + OutputResources []*OutputResource } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go index cd518b142f..47bba80983 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -17,7 +16,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerProperties. func (d DaprPubSubBrokerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "componentName", d.ComponentName) populate(objectMap, "environment", d.Environment) @@ -43,37 +42,37 @@ func (d *DaprPubSubBrokerProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -84,7 +83,7 @@ func (d *DaprPubSubBrokerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResource. func (d DaprPubSubBrokerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -106,25 +105,25 @@ func (d *DaprPubSubBrokerResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -135,7 +134,7 @@ func (d *DaprPubSubBrokerResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceListResult. func (d DaprPubSubBrokerResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -152,10 +151,10 @@ func (d *DaprPubSubBrokerResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -166,7 +165,7 @@ func (d *DaprPubSubBrokerResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceUpdate. func (d DaprPubSubBrokerResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", d.Properties) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) @@ -183,10 +182,10 @@ func (d *DaprPubSubBrokerResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -197,7 +196,7 @@ func (d *DaprPubSubBrokerResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceUpdateProperties. func (d DaprPubSubBrokerResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "environment", d.Environment) populate(objectMap, "metadata", d.Metadata) @@ -220,28 +219,28 @@ func (d *DaprPubSubBrokerResourceUpdateProperties) UnmarshalJSON(data []byte) er switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -252,7 +251,7 @@ func (d *DaprPubSubBrokerResourceUpdateProperties) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreProperties. func (d DaprSecretStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "componentName", d.ComponentName) populate(objectMap, "environment", d.Environment) @@ -277,34 +276,34 @@ func (d *DaprSecretStoreProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -315,7 +314,7 @@ func (d *DaprSecretStoreProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResource. func (d DaprSecretStoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -337,25 +336,25 @@ func (d *DaprSecretStoreResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -366,7 +365,7 @@ func (d *DaprSecretStoreResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceListResult. func (d DaprSecretStoreResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -383,10 +382,10 @@ func (d *DaprSecretStoreResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -397,7 +396,7 @@ func (d *DaprSecretStoreResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceUpdate. func (d DaprSecretStoreResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", d.Properties) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) @@ -414,10 +413,10 @@ func (d *DaprSecretStoreResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -428,7 +427,7 @@ func (d *DaprSecretStoreResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceUpdateProperties. func (d DaprSecretStoreResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "environment", d.Environment) populate(objectMap, "metadata", d.Metadata) @@ -450,25 +449,25 @@ func (d *DaprSecretStoreResourceUpdateProperties) UnmarshalJSON(data []byte) err switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -479,7 +478,7 @@ func (d *DaprSecretStoreResourceUpdateProperties) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreProperties. func (d DaprStateStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "componentName", d.ComponentName) populate(objectMap, "environment", d.Environment) @@ -505,37 +504,37 @@ func (d *DaprStateStoreProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -546,7 +545,7 @@ func (d *DaprStateStoreProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResource. func (d DaprStateStoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -568,25 +567,25 @@ func (d *DaprStateStoreResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -597,7 +596,7 @@ func (d *DaprStateStoreResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceListResult. func (d DaprStateStoreResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -614,10 +613,10 @@ func (d *DaprStateStoreResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -628,7 +627,7 @@ func (d *DaprStateStoreResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceUpdate. func (d DaprStateStoreResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", d.Properties) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) @@ -645,10 +644,10 @@ func (d *DaprStateStoreResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -659,7 +658,7 @@ func (d *DaprStateStoreResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceUpdateProperties. func (d DaprStateStoreResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "environment", d.Environment) populate(objectMap, "metadata", d.Metadata) @@ -682,28 +681,28 @@ func (d *DaprStateStoreResourceUpdateProperties) UnmarshalJSON(data []byte) erro switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -714,7 +713,7 @@ func (d *DaprStateStoreResourceUpdateProperties) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", e.Identity) objectMap["kind"] = e.Kind populate(objectMap, "resourceId", e.ResourceID) @@ -732,13 +731,13 @@ func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { switch key { case "identity": err = unpopulate(val, "Identity", &e.Identity) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &e.ResourceID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -749,7 +748,7 @@ func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -766,10 +765,10 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { switch key { case "info": err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -780,7 +779,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -800,19 +799,19 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) + delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) + delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -823,7 +822,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -839,7 +838,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { switch key { case "error": err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -850,7 +849,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IdentitySettings. func (i IdentitySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "kind", i.Kind) populate(objectMap, "oidcIssuer", i.OidcIssuer) populate(objectMap, "resource", i.Resource) @@ -868,13 +867,13 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "oidcIssuer": err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &i.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -885,7 +884,7 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KubernetesCompute. func (k KubernetesCompute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", k.Identity) objectMap["kind"] = "kubernetes" populate(objectMap, "namespace", k.Namespace) @@ -904,16 +903,16 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { switch key { case "identity": err = unpopulate(val, "Identity", &k.Identity) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &k.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "namespace": err = unpopulate(val, "Namespace", &k.Namespace) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &k.ResourceID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) @@ -924,7 +923,7 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -944,19 +943,19 @@ func (o *Operation) UnmarshalJSON(data []byte) error { switch key { case "actionType": err = unpopulate(val, "ActionType", &o.ActionType) - delete(rawMsg, key) + delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) + delete(rawMsg, key) case "isDataAction": err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "origin": err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -967,7 +966,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -986,16 +985,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { switch key { case "description": err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) + delete(rawMsg, key) case "operation": err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) + delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1006,7 +1005,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -1023,10 +1022,10 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1037,7 +1036,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutputResource. func (o OutputResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", o.ID) populate(objectMap, "localId", o.LocalID) populate(objectMap, "radiusManaged", o.RadiusManaged) @@ -1055,13 +1054,13 @@ func (o *OutputResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "localId": err = unpopulate(val, "LocalID", &o.LocalID) - delete(rawMsg, key) + delete(rawMsg, key) case "radiusManaged": err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1072,7 +1071,7 @@ func (o *OutputResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -1089,10 +1088,10 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1103,7 +1102,7 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. func (r RecipeUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -1120,10 +1119,10 @@ func (r *RecipeUpdate) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1134,7 +1133,7 @@ func (r *RecipeUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -1153,16 +1152,16 @@ func (r *Resource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1173,7 +1172,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceReference. func (r ResourceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } @@ -1189,7 +1188,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1200,7 +1199,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "compute", r.Compute) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) @@ -1216,11 +1215,11 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { var err error switch key { case "compute": - r.Compute, err = unmarshalEnvironmentComputeClassification(val) - delete(rawMsg, key) + r.Compute, err = unmarshalEnvironmentComputeClassification(val) + delete(rawMsg, key) case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1231,7 +1230,7 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -1252,22 +1251,22 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { switch key { case "createdAt": err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedAt": err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1278,7 +1277,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -1299,22 +1298,22 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -1323,7 +1322,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -1333,7 +1332,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go index 0a3d4f6185..e31434b814 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -12,8 +11,6 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,35 +19,27 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &OperationsClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // NewListPager - List the operations for the provider +// // Generated from API version 2022-03-15-privatepreview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -67,7 +56,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption if err != nil { return OperationsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } @@ -82,7 +71,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption // listCreateRequest creates the List request. func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Applications.Dapr/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_options.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_options.go new file mode 100644 index 0000000000..0cdf9f2458 --- /dev/null +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_options.go @@ -0,0 +1,102 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PubSubBrokersClientBeginCreateOrUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginCreateOrUpdate +// method. +type PubSubBrokersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PubSubBrokersClientBeginDeleteOptions contains the optional parameters for the PubSubBrokersClient.BeginDelete method. +type PubSubBrokersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PubSubBrokersClientBeginUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginUpdate method. +type PubSubBrokersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PubSubBrokersClientGetOptions contains the optional parameters for the PubSubBrokersClient.Get method. +type PubSubBrokersClientGetOptions struct { + // placeholder for future optional parameters +} + +// PubSubBrokersClientListByScopeOptions contains the optional parameters for the PubSubBrokersClient.NewListByScopePager +// method. +type PubSubBrokersClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate +// method. +type SecretStoresClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete method. +type SecretStoresClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate method. +type SecretStoresClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. +type SecretStoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.NewListByScopePager method. +type SecretStoresClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// StateStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the StateStoresClient.BeginCreateOrUpdate +// method. +type StateStoresClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StateStoresClientBeginDeleteOptions contains the optional parameters for the StateStoresClient.BeginDelete method. +type StateStoresClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StateStoresClientBeginUpdateOptions contains the optional parameters for the StateStoresClient.BeginUpdate method. +type StateStoresClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StateStoresClientGetOptions contains the optional parameters for the StateStoresClient.Get method. +type StateStoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// StateStoresClientListByScopeOptions contains the optional parameters for the StateStoresClient.NewListByScopePager method. +type StateStoresClientListByScopeOptions struct { + // placeholder for future optional parameters +} + diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index cba5e61f5a..83f13ff53e 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -14,7 +13,7 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -25,6 +24,9 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm default: b = &EnvironmentCompute{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go index 4e08b0a194..8ce667a260 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_pubsubbrokers_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // PubSubBrokersClient contains the methods for the PubSubBrokers group. // Don't use this type directly, use NewPubSubBrokersClient() instead. type PubSubBrokersClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewPubSubBrokersClient creates a new instance of PubSubBrokersClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPubSubBrokersClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PubSubBrokersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".PubSubBrokersClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &PubSubBrokersClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// pubSubBrokerName - PubSubBroker name -// resource - Resource create parameters. -// options - PubSubBrokersClientBeginCreateOrUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginCreateOrUpdate -// method. +// - pubSubBrokerName - PubSubBroker name +// - resource - Resource create parameters. +// - options - PubSubBrokersClientBeginCreateOrUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginCreateOrUpdate +// method. func (client *PubSubBrokersClient) BeginCreateOrUpdate(ctx context.Context, pubSubBrokerName string, resource DaprPubSubBrokerResource, options *PubSubBrokersClientBeginCreateOrUpdateOptions) (*runtime.Poller[PubSubBrokersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, pubSubBrokerName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PubSubBrokersClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PubSubBrokersClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[PubSubBrokersClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PubSubBrokersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *PubSubBrokersClient) createOrUpdate(ctx context.Context, pubSubBrokerName string, resource DaprPubSubBrokerResource, options *PubSubBrokersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, pubSubBrokerName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *PubSubBrokersClient) createOrUpdateCreateRequest(ctx context.Conte return nil, errors.New("parameter pubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,45 +104,53 @@ func (client *PubSubBrokersClient) createOrUpdateCreateRequest(ctx context.Conte reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// pubSubBrokerName - PubSubBroker name -// options - PubSubBrokersClientBeginDeleteOptions contains the optional parameters for the PubSubBrokersClient.BeginDelete -// method. +// - pubSubBrokerName - PubSubBroker name +// - options - PubSubBrokersClientBeginDeleteOptions contains the optional parameters for the PubSubBrokersClient.BeginDelete +// method. func (client *PubSubBrokersClient) BeginDelete(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientBeginDeleteOptions) (*runtime.Poller[PubSubBrokersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, pubSubBrokerName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PubSubBrokersClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PubSubBrokersClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[PubSubBrokersClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PubSubBrokersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *PubSubBrokersClient) deleteOperation(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, pubSubBrokerName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -160,7 +161,7 @@ func (client *PubSubBrokersClient) deleteCreateRequest(ctx context.Context, pubS return nil, errors.New("parameter pubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -173,22 +174,26 @@ func (client *PubSubBrokersClient) deleteCreateRequest(ctx context.Context, pubS // Get - Get a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// pubSubBrokerName - PubSubBroker name -// options - PubSubBrokersClientGetOptions contains the optional parameters for the PubSubBrokersClient.Get method. +// - pubSubBrokerName - PubSubBroker name +// - options - PubSubBrokersClientGetOptions contains the optional parameters for the PubSubBrokersClient.Get method. func (client *PubSubBrokersClient) Get(ctx context.Context, pubSubBrokerName string, options *PubSubBrokersClientGetOptions) (PubSubBrokersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, pubSubBrokerName, options) if err != nil { return PubSubBrokersClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PubSubBrokersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PubSubBrokersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PubSubBrokersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -199,7 +204,7 @@ func (client *PubSubBrokersClient) getCreateRequest(ctx context.Context, pubSubB return nil, errors.New("parameter pubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -220,9 +225,10 @@ func (client *PubSubBrokersClient) getHandleResponse(resp *http.Response) (PubSu } // NewListByScopePager - List DaprPubSubBrokerResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - PubSubBrokersClientListByScopeOptions contains the optional parameters for the PubSubBrokersClient.ListByScope -// method. +// - options - PubSubBrokersClientListByScopeOptions contains the optional parameters for the PubSubBrokersClient.NewListByScopePager +// method. func (client *PubSubBrokersClient) NewListByScopePager(options *PubSubBrokersClientListByScopeOptions) (*runtime.Pager[PubSubBrokersClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[PubSubBrokersClientListByScopeResponse]{ More: func(page PubSubBrokersClientListByScopeResponse) bool { @@ -239,7 +245,7 @@ func (client *PubSubBrokersClient) NewListByScopePager(options *PubSubBrokersCli if err != nil { return PubSubBrokersClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return PubSubBrokersClientListByScopeResponse{}, err } @@ -255,7 +261,7 @@ func (client *PubSubBrokersClient) NewListByScopePager(options *PubSubBrokersCli func (client *PubSubBrokersClient) listByScopeCreateRequest(ctx context.Context, options *PubSubBrokersClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Dapr/pubSubBrokers" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -277,41 +283,46 @@ func (client *PubSubBrokersClient) listByScopeHandleResponse(resp *http.Response // BeginUpdate - Update a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// pubSubBrokerName - PubSubBroker name -// properties - The resource properties to be updated. -// options - PubSubBrokersClientBeginUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginUpdate -// method. +// - pubSubBrokerName - PubSubBroker name +// - properties - The resource properties to be updated. +// - options - PubSubBrokersClientBeginUpdateOptions contains the optional parameters for the PubSubBrokersClient.BeginUpdate +// method. func (client *PubSubBrokersClient) BeginUpdate(ctx context.Context, pubSubBrokerName string, properties DaprPubSubBrokerResourceUpdate, options *PubSubBrokersClientBeginUpdateOptions) (*runtime.Poller[PubSubBrokersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, pubSubBrokerName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PubSubBrokersClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PubSubBrokersClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[PubSubBrokersClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[PubSubBrokersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *PubSubBrokersClient) update(ctx context.Context, pubSubBrokerName string, properties DaprPubSubBrokerResourceUpdate, options *PubSubBrokersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, pubSubBrokerName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -322,7 +333,7 @@ func (client *PubSubBrokersClient) updateCreateRequest(ctx context.Context, pubS return nil, errors.New("parameter pubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{pubSubBrokerName}", url.PathEscape(pubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -330,6 +341,9 @@ func (client *PubSubBrokersClient) updateCreateRequest(ctx context.Context, pubS reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go index 1261376958..a2a70b8613 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -2,89 +2,101 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } -// PubSubBrokersClientCreateOrUpdateResponse contains the response from method PubSubBrokersClient.CreateOrUpdate. +// PubSubBrokersClientCreateOrUpdateResponse contains the response from method PubSubBrokersClient.BeginCreateOrUpdate. type PubSubBrokersClientCreateOrUpdateResponse struct { + // Dapr PubSubBroker portable resource DaprPubSubBrokerResource } -// PubSubBrokersClientDeleteResponse contains the response from method PubSubBrokersClient.Delete. +// PubSubBrokersClientDeleteResponse contains the response from method PubSubBrokersClient.BeginDelete. type PubSubBrokersClientDeleteResponse struct { // placeholder for future response values } // PubSubBrokersClientGetResponse contains the response from method PubSubBrokersClient.Get. type PubSubBrokersClientGetResponse struct { + // Dapr PubSubBroker portable resource DaprPubSubBrokerResource } -// PubSubBrokersClientListByScopeResponse contains the response from method PubSubBrokersClient.ListByScope. +// PubSubBrokersClientListByScopeResponse contains the response from method PubSubBrokersClient.NewListByScopePager. type PubSubBrokersClientListByScopeResponse struct { + // The response of a DaprPubSubBrokerResource list operation. DaprPubSubBrokerResourceListResult } -// PubSubBrokersClientUpdateResponse contains the response from method PubSubBrokersClient.Update. +// PubSubBrokersClientUpdateResponse contains the response from method PubSubBrokersClient.BeginUpdate. type PubSubBrokersClientUpdateResponse struct { + // Dapr PubSubBroker portable resource DaprPubSubBrokerResource } -// SecretStoresClientCreateOrUpdateResponse contains the response from method SecretStoresClient.CreateOrUpdate. +// SecretStoresClientCreateOrUpdateResponse contains the response from method SecretStoresClient.BeginCreateOrUpdate. type SecretStoresClientCreateOrUpdateResponse struct { + // Dapr SecretStore portable resource DaprSecretStoreResource } -// SecretStoresClientDeleteResponse contains the response from method SecretStoresClient.Delete. +// SecretStoresClientDeleteResponse contains the response from method SecretStoresClient.BeginDelete. type SecretStoresClientDeleteResponse struct { // placeholder for future response values } // SecretStoresClientGetResponse contains the response from method SecretStoresClient.Get. type SecretStoresClientGetResponse struct { + // Dapr SecretStore portable resource DaprSecretStoreResource } -// SecretStoresClientListByScopeResponse contains the response from method SecretStoresClient.ListByScope. +// SecretStoresClientListByScopeResponse contains the response from method SecretStoresClient.NewListByScopePager. type SecretStoresClientListByScopeResponse struct { + // The response of a DaprSecretStoreResource list operation. DaprSecretStoreResourceListResult } -// SecretStoresClientUpdateResponse contains the response from method SecretStoresClient.Update. +// SecretStoresClientUpdateResponse contains the response from method SecretStoresClient.BeginUpdate. type SecretStoresClientUpdateResponse struct { + // Dapr SecretStore portable resource DaprSecretStoreResource } -// StateStoresClientCreateOrUpdateResponse contains the response from method StateStoresClient.CreateOrUpdate. +// StateStoresClientCreateOrUpdateResponse contains the response from method StateStoresClient.BeginCreateOrUpdate. type StateStoresClientCreateOrUpdateResponse struct { + // Dapr StateStore portable resource DaprStateStoreResource } -// StateStoresClientDeleteResponse contains the response from method StateStoresClient.Delete. +// StateStoresClientDeleteResponse contains the response from method StateStoresClient.BeginDelete. type StateStoresClientDeleteResponse struct { // placeholder for future response values } // StateStoresClientGetResponse contains the response from method StateStoresClient.Get. type StateStoresClientGetResponse struct { + // Dapr StateStore portable resource DaprStateStoreResource } -// StateStoresClientListByScopeResponse contains the response from method StateStoresClient.ListByScope. +// StateStoresClientListByScopeResponse contains the response from method StateStoresClient.NewListByScopePager. type StateStoresClientListByScopeResponse struct { + // The response of a DaprStateStoreResource list operation. DaprStateStoreResourceListResult } -// StateStoresClientUpdateResponse contains the response from method StateStoresClient.Update. +// StateStoresClientUpdateResponse contains the response from method StateStoresClient.BeginUpdate. type StateStoresClientUpdateResponse struct { + // Dapr StateStore portable resource DaprStateStoreResource } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go index 76c5ff57ce..5e3692b242 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_secretstores_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // SecretStoresClient contains the methods for the SecretStores group. // Don't use this type directly, use NewSecretStoresClient() instead. type SecretStoresClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewSecretStoresClient creates a new instance of SecretStoresClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecretStoresClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecretStoresClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".SecretStoresClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &SecretStoresClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// secretStoreName - SecretStore name -// resource - Resource create parameters. -// options - SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate -// method. +// - secretStoreName - SecretStore name +// - resource - Resource create parameters. +// - options - SecretStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the SecretStoresClient.BeginCreateOrUpdate +// method. func (client *SecretStoresClient) BeginCreateOrUpdate(ctx context.Context, secretStoreName string, resource DaprSecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[SecretStoresClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, secretStoreName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecretStoresClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretStoresClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SecretStoresClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SecretStoresClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *SecretStoresClient) createOrUpdate(ctx context.Context, secretStoreName string, resource DaprSecretStoreResource, options *SecretStoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, secretStoreName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *SecretStoresClient) createOrUpdateCreateRequest(ctx context.Contex return nil, errors.New("parameter secretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,45 +104,53 @@ func (client *SecretStoresClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// secretStoreName - SecretStore name -// options - SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete -// method. +// - secretStoreName - SecretStore name +// - options - SecretStoresClientBeginDeleteOptions contains the optional parameters for the SecretStoresClient.BeginDelete +// method. func (client *SecretStoresClient) BeginDelete(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*runtime.Poller[SecretStoresClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, secretStoreName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecretStoresClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretStoresClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SecretStoresClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SecretStoresClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *SecretStoresClient) deleteOperation(ctx context.Context, secretStoreName string, options *SecretStoresClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, secretStoreName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -160,7 +161,7 @@ func (client *SecretStoresClient) deleteCreateRequest(ctx context.Context, secre return nil, errors.New("parameter secretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -173,22 +174,26 @@ func (client *SecretStoresClient) deleteCreateRequest(ctx context.Context, secre // Get - Get a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// secretStoreName - SecretStore name -// options - SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. +// - secretStoreName - SecretStore name +// - options - SecretStoresClientGetOptions contains the optional parameters for the SecretStoresClient.Get method. func (client *SecretStoresClient) Get(ctx context.Context, secretStoreName string, options *SecretStoresClientGetOptions) (SecretStoresClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, secretStoreName, options) if err != nil { return SecretStoresClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SecretStoresClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecretStoresClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecretStoresClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -199,7 +204,7 @@ func (client *SecretStoresClient) getCreateRequest(ctx context.Context, secretSt return nil, errors.New("parameter secretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -220,9 +225,10 @@ func (client *SecretStoresClient) getHandleResponse(resp *http.Response) (Secret } // NewListByScopePager - List DaprSecretStoreResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.ListByScope -// method. +// - options - SecretStoresClientListByScopeOptions contains the optional parameters for the SecretStoresClient.NewListByScopePager +// method. func (client *SecretStoresClient) NewListByScopePager(options *SecretStoresClientListByScopeOptions) (*runtime.Pager[SecretStoresClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[SecretStoresClientListByScopeResponse]{ More: func(page SecretStoresClientListByScopeResponse) bool { @@ -239,7 +245,7 @@ func (client *SecretStoresClient) NewListByScopePager(options *SecretStoresClien if err != nil { return SecretStoresClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SecretStoresClientListByScopeResponse{}, err } @@ -255,7 +261,7 @@ func (client *SecretStoresClient) NewListByScopePager(options *SecretStoresClien func (client *SecretStoresClient) listByScopeCreateRequest(ctx context.Context, options *SecretStoresClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Dapr/secretStores" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -277,41 +283,46 @@ func (client *SecretStoresClient) listByScopeHandleResponse(resp *http.Response) // BeginUpdate - Update a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// secretStoreName - SecretStore name -// properties - The resource properties to be updated. -// options - SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate -// method. +// - secretStoreName - SecretStore name +// - properties - The resource properties to be updated. +// - options - SecretStoresClientBeginUpdateOptions contains the optional parameters for the SecretStoresClient.BeginUpdate +// method. func (client *SecretStoresClient) BeginUpdate(ctx context.Context, secretStoreName string, properties DaprSecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*runtime.Poller[SecretStoresClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, secretStoreName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SecretStoresClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SecretStoresClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SecretStoresClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SecretStoresClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *SecretStoresClient) update(ctx context.Context, secretStoreName string, properties DaprSecretStoreResourceUpdate, options *SecretStoresClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, secretStoreName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -322,7 +333,7 @@ func (client *SecretStoresClient) updateCreateRequest(ctx context.Context, secre return nil, errors.New("parameter secretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{secretStoreName}", url.PathEscape(secretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -330,6 +341,9 @@ func (client *SecretStoresClient) updateCreateRequest(ctx context.Context, secre reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go index bdb2431438..3e46684413 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_statestores_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // StateStoresClient contains the methods for the StateStores group. // Don't use this type directly, use NewStateStoresClient() instead. type StateStoresClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewStateStoresClient creates a new instance of StateStoresClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewStateStoresClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StateStoresClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".StateStoresClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &StateStoresClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// stateStoreName - StateStore name -// resource - Resource create parameters. -// options - StateStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the StateStoresClient.BeginCreateOrUpdate -// method. +// - stateStoreName - StateStore name +// - resource - Resource create parameters. +// - options - StateStoresClientBeginCreateOrUpdateOptions contains the optional parameters for the StateStoresClient.BeginCreateOrUpdate +// method. func (client *StateStoresClient) BeginCreateOrUpdate(ctx context.Context, stateStoreName string, resource DaprStateStoreResource, options *StateStoresClientBeginCreateOrUpdateOptions) (*runtime.Poller[StateStoresClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, stateStoreName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[StateStoresClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StateStoresClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[StateStoresClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[StateStoresClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *StateStoresClient) createOrUpdate(ctx context.Context, stateStoreName string, resource DaprStateStoreResource, options *StateStoresClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, stateStoreName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *StateStoresClient) createOrUpdateCreateRequest(ctx context.Context return nil, errors.New("parameter stateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,44 +104,52 @@ func (client *StateStoresClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// stateStoreName - StateStore name -// options - StateStoresClientBeginDeleteOptions contains the optional parameters for the StateStoresClient.BeginDelete method. +// - stateStoreName - StateStore name +// - options - StateStoresClientBeginDeleteOptions contains the optional parameters for the StateStoresClient.BeginDelete method. func (client *StateStoresClient) BeginDelete(ctx context.Context, stateStoreName string, options *StateStoresClientBeginDeleteOptions) (*runtime.Poller[StateStoresClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, stateStoreName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[StateStoresClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StateStoresClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[StateStoresClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[StateStoresClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *StateStoresClient) deleteOperation(ctx context.Context, stateStoreName string, options *StateStoresClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, stateStoreName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -159,7 +160,7 @@ func (client *StateStoresClient) deleteCreateRequest(ctx context.Context, stateS return nil, errors.New("parameter stateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -172,22 +173,26 @@ func (client *StateStoresClient) deleteCreateRequest(ctx context.Context, stateS // Get - Get a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// stateStoreName - StateStore name -// options - StateStoresClientGetOptions contains the optional parameters for the StateStoresClient.Get method. +// - stateStoreName - StateStore name +// - options - StateStoresClientGetOptions contains the optional parameters for the StateStoresClient.Get method. func (client *StateStoresClient) Get(ctx context.Context, stateStoreName string, options *StateStoresClientGetOptions) (StateStoresClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, stateStoreName, options) if err != nil { return StateStoresClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return StateStoresClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return StateStoresClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return StateStoresClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -198,7 +203,7 @@ func (client *StateStoresClient) getCreateRequest(ctx context.Context, stateStor return nil, errors.New("parameter stateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -219,8 +224,10 @@ func (client *StateStoresClient) getHandleResponse(resp *http.Response) (StateSt } // NewListByScopePager - List DaprStateStoreResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - StateStoresClientListByScopeOptions contains the optional parameters for the StateStoresClient.ListByScope method. +// - options - StateStoresClientListByScopeOptions contains the optional parameters for the StateStoresClient.NewListByScopePager +// method. func (client *StateStoresClient) NewListByScopePager(options *StateStoresClientListByScopeOptions) (*runtime.Pager[StateStoresClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[StateStoresClientListByScopeResponse]{ More: func(page StateStoresClientListByScopeResponse) bool { @@ -237,7 +244,7 @@ func (client *StateStoresClient) NewListByScopePager(options *StateStoresClientL if err != nil { return StateStoresClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return StateStoresClientListByScopeResponse{}, err } @@ -253,7 +260,7 @@ func (client *StateStoresClient) NewListByScopePager(options *StateStoresClientL func (client *StateStoresClient) listByScopeCreateRequest(ctx context.Context, options *StateStoresClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Dapr/stateStores" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -275,40 +282,45 @@ func (client *StateStoresClient) listByScopeHandleResponse(resp *http.Response) // BeginUpdate - Update a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// stateStoreName - StateStore name -// properties - The resource properties to be updated. -// options - StateStoresClientBeginUpdateOptions contains the optional parameters for the StateStoresClient.BeginUpdate method. +// - stateStoreName - StateStore name +// - properties - The resource properties to be updated. +// - options - StateStoresClientBeginUpdateOptions contains the optional parameters for the StateStoresClient.BeginUpdate method. func (client *StateStoresClient) BeginUpdate(ctx context.Context, stateStoreName string, properties DaprStateStoreResourceUpdate, options *StateStoresClientBeginUpdateOptions) (*runtime.Poller[StateStoresClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, stateStoreName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[StateStoresClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[StateStoresClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[StateStoresClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[StateStoresClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *StateStoresClient) update(ctx context.Context, stateStoreName string, properties DaprStateStoreResourceUpdate, options *StateStoresClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, stateStoreName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -319,7 +331,7 @@ func (client *StateStoresClient) updateCreateRequest(ctx context.Context, stateS return nil, errors.New("parameter stateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{stateStoreName}", url.PathEscape(stateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -327,6 +339,9 @@ func (client *StateStoresClient) updateCreateRequest(ctx context.Context, stateS reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index cea28fe8b6..30ea6fa1d0 100644 --- a/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/daprrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -66,7 +65,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/pkg/datastoresrp/api/README.md b/pkg/datastoresrp/api/README.md index 04cc3c2468..6d33e0b779 100644 --- a/pkg/datastoresrp/api/README.md +++ b/pkg/datastoresrp/api/README.md @@ -44,7 +44,7 @@ The following configuration generates track2 go models and client. ```yaml $(tag) != '' version: 3.*.* -use: "@autorest/go@4.0.0-preview.44" +use: "@autorest/go@4.0.0-preview.55" module-version: 0.0.1 file-prefix: zz_generated_ license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_client_factory.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_client_factory.go new file mode 100644 index 0000000000..0ee75d4bda --- /dev/null +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_client_factory.go @@ -0,0 +1,60 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + rootScope string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + rootScope: rootScope, credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewMongoDatabasesClient() *MongoDatabasesClient { + subClient, _ := NewMongoDatabasesClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRedisCachesClient() *RedisCachesClient { + subClient, _ := NewRedisCachesClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSQLDatabasesClient() *SQLDatabasesClient { + subClient, _ := NewSQLDatabasesClient(c.rootScope, c.credential, c.options) + return subClient +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go index e87c3c361a..68682f4151 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_constants.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_interfaces.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_interfaces.go new file mode 100644 index 0000000000..104e8355bd --- /dev/null +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_interfaces.go @@ -0,0 +1,18 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// EnvironmentComputeClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnvironmentCompute, *KubernetesCompute +type EnvironmentComputeClassification interface { + // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. + GetEnvironmentCompute() *EnvironmentCompute +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go index a9e9d28dd5..4efff8b902 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models.go @@ -2,33 +2,23 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview import "time" -// EnvironmentComputeClassification provides polymorphic access to related types. -// Call the interface's GetEnvironmentCompute() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EnvironmentCompute, *KubernetesCompute -type EnvironmentComputeClassification interface { - // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. - GetEnvironmentCompute() *EnvironmentCompute -} - // EnvironmentCompute - Represents backing compute resource type EnvironmentCompute struct { // REQUIRED; Discriminator property for EnvironmentCompute. - Kind *string `json:"kind,omitempty"` + Kind *string // Configuration for supported external identity providers - Identity *IdentitySettings `json:"identity,omitempty"` + Identity *IdentitySettings // The resource id of the compute resource for application environment. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. @@ -37,733 +27,626 @@ func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { retur // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info map[string]any // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ErrorDetail - The error detail. type ErrorDetail struct { // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + Details []*ErrorDetail // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { // The error object. - Error *ErrorDetail `json:"error,omitempty"` + Error *ErrorDetail } // IdentitySettings is the external identity setting. type IdentitySettings struct { // REQUIRED; kind of identity setting - Kind *IdentitySettingKind `json:"kind,omitempty"` + Kind *IdentitySettingKind // The URI for your compute platform's OIDC issuer - OidcIssuer *string `json:"oidcIssuer,omitempty"` + OidcIssuer *string // The resource ID of the provisioned identity - Resource *string `json:"resource,omitempty"` + Resource *string } // KubernetesCompute - The Kubernetes compute configuration type KubernetesCompute struct { // REQUIRED; Discriminator property for EnvironmentCompute. - Kind *string `json:"kind,omitempty"` + Kind *string // REQUIRED; The namespace to use for the environment. - Namespace *string `json:"namespace,omitempty"` + Namespace *string // Configuration for supported external identity providers - Identity *IdentitySettings `json:"identity,omitempty"` + Identity *IdentitySettings // The resource id of the compute resource for application environment. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type KubernetesCompute. func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { return &EnvironmentCompute{ + Identity: k.Identity, Kind: k.Kind, ResourceID: k.ResourceID, - Identity: k.Identity, } } // MongoDatabaseListSecretsResult - The secret values for the given MongoDatabase resource type MongoDatabaseListSecretsResult struct { // Connection string used to connect to the target Mongo database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Mongo database - Password *string `json:"password,omitempty"` + Password *string } // MongoDatabaseProperties - MongoDatabase portable resource properties type MongoDatabaseProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Database name of the target Mongo database - Database *string `json:"database,omitempty"` + Database *string // Host name of the target Mongo database - Host *string `json:"host,omitempty"` + Host *string // Port value of the target Mongo database - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the MongoDB resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secret values provided for the resource - Secrets *MongoDatabaseSecrets `json:"secrets,omitempty"` + Secrets *MongoDatabaseSecrets // Username to use when connecting to the target Mongo database - Username *string `json:"username,omitempty"` + Username *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // MongoDatabaseResource - MongoDatabase portable resource type MongoDatabaseResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *MongoDatabaseProperties `json:"properties,omitempty"` + Properties *MongoDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // MongoDatabaseResourceListResult - The response of a MongoDatabaseResource list operation. type MongoDatabaseResourceListResult struct { // REQUIRED; The MongoDatabaseResource items on this page - Value []*MongoDatabaseResource `json:"value,omitempty"` + Value []*MongoDatabaseResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // MongoDatabaseResourceUpdate - The type used for update operations of the MongoDatabaseResource. type MongoDatabaseResourceUpdate struct { // The updatable properties of the MongoDatabaseResource. - Properties *MongoDatabaseResourceUpdateProperties `json:"properties,omitempty"` + Properties *MongoDatabaseResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // MongoDatabaseResourceUpdateProperties - The updatable properties of the MongoDatabaseResource. type MongoDatabaseResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Database name of the target Mongo database - Database *string `json:"database,omitempty"` + Database *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Host name of the target Mongo database - Host *string `json:"host,omitempty"` + Host *string // Port value of the target Mongo database - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the MongoDB resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secret values provided for the resource - Secrets *MongoDatabaseSecrets `json:"secrets,omitempty"` + Secrets *MongoDatabaseSecrets // Username to use when connecting to the target Mongo database - Username *string `json:"username,omitempty"` + Username *string } // MongoDatabaseSecrets - The secret values for the given MongoDatabase resource type MongoDatabaseSecrets struct { // Connection string used to connect to the target Mongo database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Mongo database - Password *string `json:"password,omitempty"` -} - -// MongoDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginCreateOrUpdate -// method. -type MongoDatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete method. -type MongoDatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDatabasesClientBeginUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginUpdate method. -type MongoDatabasesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. -type MongoDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientListByScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByScope method. -type MongoDatabasesClientListByScopeOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets method. -type MongoDatabasesClientListSecretsOptions struct { - // placeholder for future optional parameters + Password *string } // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + ActionType *ActionType // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. - IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" - Origin *Origin `json:"origin,omitempty" azure:"ro"` + Origin *Origin } // OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to // get the next set of results. type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; List of operations supported by the resource provider - Value []*Operation `json:"value,omitempty" azure:"ro"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters + Value []*Operation } // OutputResource - Properties of an output resource. type OutputResource struct { // The UCP resource ID of the underlying resource. - ID *string `json:"id,omitempty"` + ID *string // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency // relationship. LocalIDs do not have any particular format or meaning beyond // being compared to determine dependency relationships. - LocalID *string `json:"localId,omitempty"` + LocalID *string // Determines whether Radius manages the lifecycle of the underlying resource. - RadiusManaged *bool `json:"radiusManaged,omitempty"` + RadiusManaged *bool } // Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource type Recipe struct { // REQUIRED; The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource type RecipeUpdate struct { // The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // RedisCacheListSecretsResult - The secret values for the given RedisCache resource type RedisCacheListSecretsResult struct { // The connection string used to connect to the Redis cache - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // The password for this Redis cache instance - Password *string `json:"password,omitempty"` + Password *string // The URL used to connect to the Redis cache - URL *string `json:"url,omitempty"` + URL *string } // RedisCacheProperties - RedisCache portable resource properties type RedisCacheProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The host name of the target Redis cache - Host *string `json:"host,omitempty"` + Host *string // The port value of the target Redis cache - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the Redis resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secrets provided by resource - Secrets *RedisCacheSecrets `json:"secrets,omitempty"` + Secrets *RedisCacheSecrets // Specifies whether to enable SSL connections to the Redis cache - TLS *bool `json:"tls,omitempty"` + TLS *bool // The username for Redis cache - Username *string `json:"username,omitempty"` + Username *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // RedisCacheResource - RedisCache portable resource type RedisCacheResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *RedisCacheProperties `json:"properties,omitempty"` + Properties *RedisCacheProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RedisCacheResourceListResult - The response of a RedisCacheResource list operation. type RedisCacheResourceListResult struct { // REQUIRED; The RedisCacheResource items on this page - Value []*RedisCacheResource `json:"value,omitempty"` + Value []*RedisCacheResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // RedisCacheResourceUpdate - The type used for update operations of the RedisCacheResource. type RedisCacheResourceUpdate struct { // The updatable properties of the RedisCacheResource. - Properties *RedisCacheResourceUpdateProperties `json:"properties,omitempty"` + Properties *RedisCacheResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // RedisCacheResourceUpdateProperties - The updatable properties of the RedisCacheResource. type RedisCacheResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // The host name of the target Redis cache - Host *string `json:"host,omitempty"` + Host *string // The port value of the target Redis cache - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the Redis resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secrets provided by resource - Secrets *RedisCacheSecrets `json:"secrets,omitempty"` + Secrets *RedisCacheSecrets // Specifies whether to enable SSL connections to the Redis cache - TLS *bool `json:"tls,omitempty"` + TLS *bool // The username for Redis cache - Username *string `json:"username,omitempty"` + Username *string } // RedisCacheSecrets - The secret values for the given RedisCache resource type RedisCacheSecrets struct { // The connection string used to connect to the Redis cache - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // The password for this Redis cache instance - Password *string `json:"password,omitempty"` + Password *string // The URL used to connect to the Redis cache - URL *string `json:"url,omitempty"` -} - -// RedisCachesClientBeginCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.BeginCreateOrUpdate -// method. -type RedisCachesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RedisCachesClientBeginDeleteOptions contains the optional parameters for the RedisCachesClient.BeginDelete method. -type RedisCachesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RedisCachesClientBeginUpdateOptions contains the optional parameters for the RedisCachesClient.BeginUpdate method. -type RedisCachesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. -type RedisCachesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientListByScopeOptions contains the optional parameters for the RedisCachesClient.ListByScope method. -type RedisCachesClientListByScopeOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. -type RedisCachesClientListSecretsOptions struct { - // placeholder for future optional parameters + URL *string } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceReference - Describes a reference to an existing resource type ResourceReference struct { // REQUIRED; Resource id of an existing resource - ID *string `json:"id,omitempty"` + ID *string } // ResourceStatus - Status of a resource. type ResourceStatus struct { // The compute resource associated with the resource. - Compute EnvironmentComputeClassification `json:"compute,omitempty"` + Compute EnvironmentComputeClassification // Properties of an output resource - OutputResources []*OutputResource `json:"outputResources,omitempty"` + OutputResources []*OutputResource } // SQLDatabaseListSecretsResult - The secret values for the given SqlDatabase resource type SQLDatabaseListSecretsResult struct { // Connection string used to connect to the target Sql database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Sql database - Password *string `json:"password,omitempty"` + Password *string } // SQLDatabaseProperties - SqlDatabase properties type SQLDatabaseProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The name of the Sql database. - Database *string `json:"database,omitempty"` + Database *string // Port value of the target Sql database - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the SqlDatabase resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secret values provided for the resource - Secrets *SQLDatabaseSecrets `json:"secrets,omitempty"` + Secrets *SQLDatabaseSecrets // The fully qualified domain name of the Sql database. - Server *string `json:"server,omitempty"` + Server *string // Username to use when connecting to the target Sql database - Username *string `json:"username,omitempty"` + Username *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // SQLDatabaseResource - SqlDatabase portable resource type SQLDatabaseResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *SQLDatabaseProperties `json:"properties,omitempty"` + Properties *SQLDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SQLDatabaseResourceListResult - The response of a SqlDatabaseResource list operation. type SQLDatabaseResourceListResult struct { // REQUIRED; The SqlDatabaseResource items on this page - Value []*SQLDatabaseResource `json:"value,omitempty"` + Value []*SQLDatabaseResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // SQLDatabaseResourceUpdate - The type used for update operations of the SqlDatabaseResource. type SQLDatabaseResourceUpdate struct { // The updatable properties of the SqlDatabaseResource. - Properties *SQLDatabaseResourceUpdateProperties `json:"properties,omitempty"` + Properties *SQLDatabaseResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // SQLDatabaseResourceUpdateProperties - The updatable properties of the SqlDatabaseResource. type SQLDatabaseResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The name of the Sql database. - Database *string `json:"database,omitempty"` + Database *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Port value of the target Sql database - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the SqlDatabase resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secret values provided for the resource - Secrets *SQLDatabaseSecrets `json:"secrets,omitempty"` + Secrets *SQLDatabaseSecrets // The fully qualified domain name of the Sql database. - Server *string `json:"server,omitempty"` + Server *string // Username to use when connecting to the target Sql database - Username *string `json:"username,omitempty"` + Username *string } // SQLDatabaseSecrets - The secret values for the given SqlDatabase resource type SQLDatabaseSecrets struct { // Connection string used to connect to the target Sql database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Sql database - Password *string `json:"password,omitempty"` -} - -// SQLDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginCreateOrUpdate -// method. -type SQLDatabasesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SQLDatabasesClientBeginDeleteOptions contains the optional parameters for the SQLDatabasesClient.BeginDelete method. -type SQLDatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SQLDatabasesClientBeginUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginUpdate method. -type SQLDatabasesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. -type SQLDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientListByScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByScope method. -type SQLDatabasesClientListByScopeOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets method. -type SQLDatabasesClientListSecretsOptions struct { - // placeholder for future optional parameters + Password *string } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go index 53f9070d42..1d92cf1ddd 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -17,7 +16,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", e.Identity) objectMap["kind"] = e.Kind populate(objectMap, "resourceId", e.ResourceID) @@ -35,13 +34,13 @@ func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { switch key { case "identity": err = unpopulate(val, "Identity", &e.Identity) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &e.ResourceID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -52,7 +51,7 @@ func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -69,10 +68,10 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { switch key { case "info": err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -83,7 +82,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -103,19 +102,19 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) + delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) + delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -126,7 +125,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -142,7 +141,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { switch key { case "error": err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -153,7 +152,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IdentitySettings. func (i IdentitySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "kind", i.Kind) populate(objectMap, "oidcIssuer", i.OidcIssuer) populate(objectMap, "resource", i.Resource) @@ -171,13 +170,13 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "oidcIssuer": err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &i.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -188,7 +187,7 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KubernetesCompute. func (k KubernetesCompute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", k.Identity) objectMap["kind"] = "kubernetes" populate(objectMap, "namespace", k.Namespace) @@ -207,16 +206,16 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { switch key { case "identity": err = unpopulate(val, "Identity", &k.Identity) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &k.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "namespace": err = unpopulate(val, "Namespace", &k.Namespace) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &k.ResourceID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) @@ -227,7 +226,7 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseListSecretsResult. func (m MongoDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", m.ConnectionString) populate(objectMap, "password", m.Password) return json.Marshal(objectMap) @@ -244,10 +243,10 @@ func (m *MongoDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -258,7 +257,7 @@ func (m *MongoDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseProperties. func (m MongoDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", m.Application) populate(objectMap, "database", m.Database) populate(objectMap, "environment", m.Environment) @@ -285,40 +284,40 @@ func (m *MongoDatabaseProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &m.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &m.Database) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &m.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &m.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &m.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &m.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &m.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &m.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &m.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &m.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -329,7 +328,7 @@ func (m *MongoDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResource. func (m MongoDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) @@ -351,25 +350,25 @@ func (m *MongoDatabaseResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -380,7 +379,7 @@ func (m *MongoDatabaseResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceListResult. func (m MongoDatabaseResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -397,10 +396,10 @@ func (m *MongoDatabaseResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -411,7 +410,7 @@ func (m *MongoDatabaseResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceUpdate. func (m MongoDatabaseResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", m.Properties) populate(objectMap, "tags", m.Tags) return json.Marshal(objectMap) @@ -428,10 +427,10 @@ func (m *MongoDatabaseResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -442,7 +441,7 @@ func (m *MongoDatabaseResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceUpdateProperties. func (m MongoDatabaseResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", m.Application) populate(objectMap, "database", m.Database) populate(objectMap, "environment", m.Environment) @@ -467,34 +466,34 @@ func (m *MongoDatabaseResourceUpdateProperties) UnmarshalJSON(data []byte) error switch key { case "application": err = unpopulate(val, "Application", &m.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &m.Database) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &m.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &m.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &m.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &m.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &m.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &m.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &m.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &m.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -505,7 +504,7 @@ func (m *MongoDatabaseResourceUpdateProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseSecrets. func (m MongoDatabaseSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", m.ConnectionString) populate(objectMap, "password", m.Password) return json.Marshal(objectMap) @@ -522,10 +521,10 @@ func (m *MongoDatabaseSecrets) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -536,7 +535,7 @@ func (m *MongoDatabaseSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -556,19 +555,19 @@ func (o *Operation) UnmarshalJSON(data []byte) error { switch key { case "actionType": err = unpopulate(val, "ActionType", &o.ActionType) - delete(rawMsg, key) + delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) + delete(rawMsg, key) case "isDataAction": err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "origin": err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -579,7 +578,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -598,16 +597,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { switch key { case "description": err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) + delete(rawMsg, key) case "operation": err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) + delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -618,7 +617,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -635,10 +634,10 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -649,7 +648,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutputResource. func (o OutputResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", o.ID) populate(objectMap, "localId", o.LocalID) populate(objectMap, "radiusManaged", o.RadiusManaged) @@ -667,13 +666,13 @@ func (o *OutputResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "localId": err = unpopulate(val, "LocalID", &o.LocalID) - delete(rawMsg, key) + delete(rawMsg, key) case "radiusManaged": err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -684,7 +683,7 @@ func (o *OutputResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -701,10 +700,10 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -715,7 +714,7 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. func (r RecipeUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -732,10 +731,10 @@ func (r *RecipeUpdate) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -746,7 +745,7 @@ func (r *RecipeUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheListSecretsResult. func (r RedisCacheListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", r.ConnectionString) populate(objectMap, "password", r.Password) populate(objectMap, "url", r.URL) @@ -764,13 +763,13 @@ func (r *RedisCacheListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &r.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -781,7 +780,7 @@ func (r *RedisCacheListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheProperties. func (r RedisCacheProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", r.Application) populate(objectMap, "environment", r.Environment) populate(objectMap, "host", r.Host) @@ -808,40 +807,40 @@ func (r *RedisCacheProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -852,7 +851,7 @@ func (r *RedisCacheProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheResource. func (r RedisCacheResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) @@ -874,25 +873,25 @@ func (r *RedisCacheResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -903,7 +902,7 @@ func (r *RedisCacheResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceListResult. func (r RedisCacheResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -920,10 +919,10 @@ func (r *RedisCacheResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -934,7 +933,7 @@ func (r *RedisCacheResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceUpdate. func (r RedisCacheResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", r.Properties) populate(objectMap, "tags", r.Tags) return json.Marshal(objectMap) @@ -951,10 +950,10 @@ func (r *RedisCacheResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -965,7 +964,7 @@ func (r *RedisCacheResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceUpdateProperties. func (r RedisCacheResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", r.Application) populate(objectMap, "environment", r.Environment) populate(objectMap, "host", r.Host) @@ -990,34 +989,34 @@ func (r *RedisCacheResourceUpdateProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1028,7 +1027,7 @@ func (r *RedisCacheResourceUpdateProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheSecrets. func (r RedisCacheSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", r.ConnectionString) populate(objectMap, "password", r.Password) populate(objectMap, "url", r.URL) @@ -1046,13 +1045,13 @@ func (r *RedisCacheSecrets) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &r.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1063,7 +1062,7 @@ func (r *RedisCacheSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -1082,16 +1081,16 @@ func (r *Resource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1102,7 +1101,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceReference. func (r ResourceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } @@ -1118,7 +1117,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1129,7 +1128,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "compute", r.Compute) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) @@ -1145,11 +1144,11 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { var err error switch key { case "compute": - r.Compute, err = unmarshalEnvironmentComputeClassification(val) - delete(rawMsg, key) + r.Compute, err = unmarshalEnvironmentComputeClassification(val) + delete(rawMsg, key) case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1160,7 +1159,7 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseListSecretsResult. func (s SQLDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", s.ConnectionString) populate(objectMap, "password", s.Password) return json.Marshal(objectMap) @@ -1177,10 +1176,10 @@ func (s *SQLDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &s.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1191,7 +1190,7 @@ func (s *SQLDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseProperties. func (s SQLDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", s.Application) populate(objectMap, "database", s.Database) populate(objectMap, "environment", s.Environment) @@ -1218,40 +1217,40 @@ func (s *SQLDatabaseProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &s.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &s.Database) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &s.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &s.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &s.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &s.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &s.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &s.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "server": err = unpopulate(val, "Server", &s.Server) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &s.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1262,7 +1261,7 @@ func (s *SQLDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResource. func (s SQLDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -1284,25 +1283,25 @@ func (s *SQLDatabaseResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1313,7 +1312,7 @@ func (s *SQLDatabaseResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceListResult. func (s SQLDatabaseResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -1330,10 +1329,10 @@ func (s *SQLDatabaseResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1344,7 +1343,7 @@ func (s *SQLDatabaseResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceUpdate. func (s SQLDatabaseResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", s.Properties) populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) @@ -1361,10 +1360,10 @@ func (s *SQLDatabaseResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1375,7 +1374,7 @@ func (s *SQLDatabaseResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceUpdateProperties. func (s SQLDatabaseResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", s.Application) populate(objectMap, "database", s.Database) populate(objectMap, "environment", s.Environment) @@ -1400,34 +1399,34 @@ func (s *SQLDatabaseResourceUpdateProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &s.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &s.Database) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &s.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &s.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &s.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &s.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &s.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &s.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "server": err = unpopulate(val, "Server", &s.Server) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &s.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1438,7 +1437,7 @@ func (s *SQLDatabaseResourceUpdateProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseSecrets. func (s SQLDatabaseSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", s.ConnectionString) populate(objectMap, "password", s.Password) return json.Marshal(objectMap) @@ -1455,10 +1454,10 @@ func (s *SQLDatabaseSecrets) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &s.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1469,7 +1468,7 @@ func (s *SQLDatabaseSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -1490,22 +1489,22 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { switch key { case "createdAt": err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedAt": err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1516,7 +1515,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -1537,22 +1536,22 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -1561,7 +1560,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -1571,7 +1570,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go index 1036870efc..41037e6aca 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // MongoDatabasesClient contains the methods for the MongoDatabases group. // Don't use this type directly, use NewMongoDatabasesClient() instead. type MongoDatabasesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewMongoDatabasesClient creates a new instance of MongoDatabasesClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMongoDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoDatabasesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".MongoDatabasesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &MongoDatabasesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase portable resource resource -// resource - Resource create parameters. -// options - MongoDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginCreateOrUpdate -// method. +// - mongoDatabaseName - The name of the MongoDatabase portable resource resource +// - resource - Resource create parameters. +// - options - MongoDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginCreateOrUpdate +// method. func (client *MongoDatabasesClient) BeginCreateOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[MongoDatabasesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, mongoDatabaseName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDatabasesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[MongoDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MongoDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *MongoDatabasesClient) createOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, mongoDatabaseName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,45 +104,53 @@ func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase portable resource resource -// options - MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete -// method. +// - mongoDatabaseName - The name of the MongoDatabase portable resource resource +// - options - MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete +// method. func (client *MongoDatabasesClient) BeginDelete(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*runtime.Poller[MongoDatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, mongoDatabaseName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDatabasesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[MongoDatabasesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MongoDatabasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *MongoDatabasesClient) deleteOperation(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, mongoDatabaseName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -160,7 +161,7 @@ func (client *MongoDatabasesClient) deleteCreateRequest(ctx context.Context, mon return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -173,22 +174,26 @@ func (client *MongoDatabasesClient) deleteCreateRequest(ctx context.Context, mon // Get - Get a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase portable resource resource -// options - MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. +// - mongoDatabaseName - The name of the MongoDatabase portable resource resource +// - options - MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. func (client *MongoDatabasesClient) Get(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientGetOptions) (MongoDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, mongoDatabaseName, options) if err != nil { return MongoDatabasesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MongoDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -199,7 +204,7 @@ func (client *MongoDatabasesClient) getCreateRequest(ctx context.Context, mongoD return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -220,9 +225,10 @@ func (client *MongoDatabasesClient) getHandleResponse(resp *http.Response) (Mong } // NewListByScopePager - List MongoDatabaseResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - MongoDatabasesClientListByScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByScope -// method. +// - options - MongoDatabasesClientListByScopeOptions contains the optional parameters for the MongoDatabasesClient.NewListByScopePager +// method. func (client *MongoDatabasesClient) NewListByScopePager(options *MongoDatabasesClientListByScopeOptions) (*runtime.Pager[MongoDatabasesClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[MongoDatabasesClientListByScopeResponse]{ More: func(page MongoDatabasesClientListByScopeResponse) bool { @@ -239,7 +245,7 @@ func (client *MongoDatabasesClient) NewListByScopePager(options *MongoDatabasesC if err != nil { return MongoDatabasesClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientListByScopeResponse{}, err } @@ -255,7 +261,7 @@ func (client *MongoDatabasesClient) NewListByScopePager(options *MongoDatabasesC func (client *MongoDatabasesClient) listByScopeCreateRequest(ctx context.Context, options *MongoDatabasesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/mongoDatabases" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -277,35 +283,39 @@ func (client *MongoDatabasesClient) listByScopeHandleResponse(resp *http.Respons // ListSecrets - Lists secrets values for the specified MongoDatabases resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase portable resource resource -// body - The content of the action request -// options - MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets -// method. -func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDatabaseName string, body map[string]interface{}, options *MongoDatabasesClientListSecretsOptions) (MongoDatabasesClientListSecretsResponse, error) { +// - mongoDatabaseName - The name of the MongoDatabase portable resource resource +// - body - The content of the action request +// - options - MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets +// method. +func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDatabaseName string, body map[string]any, options *MongoDatabasesClientListSecretsOptions) (MongoDatabasesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, mongoDatabaseName, body, options) if err != nil { return MongoDatabasesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDatabasesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MongoDatabasesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. -func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context, mongoDatabaseName string, body map[string]interface{}, options *MongoDatabasesClientListSecretsOptions) (*policy.Request, error) { +func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context, mongoDatabaseName string, body map[string]any, options *MongoDatabasesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if mongoDatabaseName == "" { return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -313,7 +323,10 @@ func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err +} + return req, nil } // listSecretsHandleResponse handles the ListSecrets response. @@ -327,41 +340,46 @@ func (client *MongoDatabasesClient) listSecretsHandleResponse(resp *http.Respons // BeginUpdate - Update a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase portable resource resource -// properties - The resource properties to be updated. -// options - MongoDatabasesClientBeginUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginUpdate -// method. +// - mongoDatabaseName - The name of the MongoDatabase portable resource resource +// - properties - The resource properties to be updated. +// - options - MongoDatabasesClientBeginUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginUpdate +// method. func (client *MongoDatabasesClient) BeginUpdate(ctx context.Context, mongoDatabaseName string, properties MongoDatabaseResourceUpdate, options *MongoDatabasesClientBeginUpdateOptions) (*runtime.Poller[MongoDatabasesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, mongoDatabaseName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDatabasesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[MongoDatabasesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MongoDatabasesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *MongoDatabasesClient) update(ctx context.Context, mongoDatabaseName string, properties MongoDatabaseResourceUpdate, options *MongoDatabasesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, mongoDatabaseName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -372,7 +390,7 @@ func (client *MongoDatabasesClient) updateCreateRequest(ctx context.Context, mon return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -380,6 +398,9 @@ func (client *MongoDatabasesClient) updateCreateRequest(ctx context.Context, mon reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go index 12faffca8c..fb8362f3a5 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -12,8 +11,6 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,35 +19,27 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &OperationsClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // NewListPager - List the operations for the provider +// // Generated from API version 2022-03-15-privatepreview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -67,7 +56,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption if err != nil { return OperationsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } @@ -82,7 +71,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption // listCreateRequest creates the List request. func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Applications.Datastores/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_options.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_options.go new file mode 100644 index 0000000000..e7dcc2d24f --- /dev/null +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_options.go @@ -0,0 +1,117 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// MongoDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginCreateOrUpdate +// method. +type MongoDatabasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete method. +type MongoDatabasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDatabasesClientBeginUpdateOptions contains the optional parameters for the MongoDatabasesClient.BeginUpdate method. +type MongoDatabasesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. +type MongoDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// MongoDatabasesClientListByScopeOptions contains the optional parameters for the MongoDatabasesClient.NewListByScopePager +// method. +type MongoDatabasesClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets method. +type MongoDatabasesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientBeginCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.BeginCreateOrUpdate +// method. +type RedisCachesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RedisCachesClientBeginDeleteOptions contains the optional parameters for the RedisCachesClient.BeginDelete method. +type RedisCachesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RedisCachesClientBeginUpdateOptions contains the optional parameters for the RedisCachesClient.BeginUpdate method. +type RedisCachesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. +type RedisCachesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientListByScopeOptions contains the optional parameters for the RedisCachesClient.NewListByScopePager method. +type RedisCachesClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. +type RedisCachesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginCreateOrUpdate +// method. +type SQLDatabasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLDatabasesClientBeginDeleteOptions contains the optional parameters for the SQLDatabasesClient.BeginDelete method. +type SQLDatabasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLDatabasesClientBeginUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginUpdate method. +type SQLDatabasesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. +type SQLDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientListByScopeOptions contains the optional parameters for the SQLDatabasesClient.NewListByScopePager method. +type SQLDatabasesClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets method. +type SQLDatabasesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index cba5e61f5a..83f13ff53e 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -14,7 +13,7 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -25,6 +24,9 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm default: b = &EnvironmentCompute{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go index 455ca92bb6..5966046dea 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // RedisCachesClient contains the methods for the RedisCaches group. // Don't use this type directly, use NewRedisCachesClient() instead. type RedisCachesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewRedisCachesClient creates a new instance of RedisCachesClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRedisCachesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RedisCachesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".RedisCachesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &RedisCachesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache portable resource resource -// resource - Resource create parameters. -// options - RedisCachesClientBeginCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.BeginCreateOrUpdate -// method. +// - redisCacheName - The name of the RedisCache portable resource resource +// - resource - Resource create parameters. +// - options - RedisCachesClientBeginCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.BeginCreateOrUpdate +// method. func (client *RedisCachesClient) BeginCreateOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RedisCachesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, redisCacheName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RedisCachesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RedisCachesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[RedisCachesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[RedisCachesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *RedisCachesClient) createOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, redisCacheName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,44 +104,52 @@ func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache portable resource resource -// options - RedisCachesClientBeginDeleteOptions contains the optional parameters for the RedisCachesClient.BeginDelete method. +// - redisCacheName - The name of the RedisCache portable resource resource +// - options - RedisCachesClientBeginDeleteOptions contains the optional parameters for the RedisCachesClient.BeginDelete method. func (client *RedisCachesClient) BeginDelete(ctx context.Context, redisCacheName string, options *RedisCachesClientBeginDeleteOptions) (*runtime.Poller[RedisCachesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, redisCacheName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RedisCachesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RedisCachesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[RedisCachesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[RedisCachesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *RedisCachesClient) deleteOperation(ctx context.Context, redisCacheName string, options *RedisCachesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, redisCacheName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -159,7 +160,7 @@ func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisC return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -172,22 +173,26 @@ func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisC // Get - Get a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache portable resource resource -// options - RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. +// - redisCacheName - The name of the RedisCache portable resource resource +// - options - RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. func (client *RedisCachesClient) Get(ctx context.Context, redisCacheName string, options *RedisCachesClientGetOptions) (RedisCachesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, redisCacheName, options) if err != nil { return RedisCachesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RedisCachesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RedisCachesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -198,7 +203,7 @@ func (client *RedisCachesClient) getCreateRequest(ctx context.Context, redisCach return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -219,8 +224,10 @@ func (client *RedisCachesClient) getHandleResponse(resp *http.Response) (RedisCa } // NewListByScopePager - List RedisCacheResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - RedisCachesClientListByScopeOptions contains the optional parameters for the RedisCachesClient.ListByScope method. +// - options - RedisCachesClientListByScopeOptions contains the optional parameters for the RedisCachesClient.NewListByScopePager +// method. func (client *RedisCachesClient) NewListByScopePager(options *RedisCachesClientListByScopeOptions) (*runtime.Pager[RedisCachesClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[RedisCachesClientListByScopeResponse]{ More: func(page RedisCachesClientListByScopeResponse) bool { @@ -237,7 +244,7 @@ func (client *RedisCachesClient) NewListByScopePager(options *RedisCachesClientL if err != nil { return RedisCachesClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientListByScopeResponse{}, err } @@ -253,7 +260,7 @@ func (client *RedisCachesClient) NewListByScopePager(options *RedisCachesClientL func (client *RedisCachesClient) listByScopeCreateRequest(ctx context.Context, options *RedisCachesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -275,34 +282,38 @@ func (client *RedisCachesClient) listByScopeHandleResponse(resp *http.Response) // ListSecrets - Lists secrets values for the specified RedisCache resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache portable resource resource -// body - The content of the action request -// options - RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. -func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName string, body map[string]interface{}, options *RedisCachesClientListSecretsOptions) (RedisCachesClientListSecretsResponse, error) { +// - redisCacheName - The name of the RedisCache portable resource resource +// - body - The content of the action request +// - options - RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. +func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName string, body map[string]any, options *RedisCachesClientListSecretsOptions) (RedisCachesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, redisCacheName, body, options) if err != nil { return RedisCachesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RedisCachesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RedisCachesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. -func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, redisCacheName string, body map[string]interface{}, options *RedisCachesClientListSecretsOptions) (*policy.Request, error) { +func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, redisCacheName string, body map[string]any, options *RedisCachesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if redisCacheName == "" { return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -310,7 +321,10 @@ func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err +} + return req, nil } // listSecretsHandleResponse handles the ListSecrets response. @@ -324,40 +338,45 @@ func (client *RedisCachesClient) listSecretsHandleResponse(resp *http.Response) // BeginUpdate - Update a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache portable resource resource -// properties - The resource properties to be updated. -// options - RedisCachesClientBeginUpdateOptions contains the optional parameters for the RedisCachesClient.BeginUpdate method. +// - redisCacheName - The name of the RedisCache portable resource resource +// - properties - The resource properties to be updated. +// - options - RedisCachesClientBeginUpdateOptions contains the optional parameters for the RedisCachesClient.BeginUpdate method. func (client *RedisCachesClient) BeginUpdate(ctx context.Context, redisCacheName string, properties RedisCacheResourceUpdate, options *RedisCachesClientBeginUpdateOptions) (*runtime.Poller[RedisCachesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, redisCacheName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RedisCachesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RedisCachesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[RedisCachesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[RedisCachesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *RedisCachesClient) update(ctx context.Context, redisCacheName string, properties RedisCacheResourceUpdate, options *RedisCachesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, redisCacheName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -368,7 +387,7 @@ func (client *RedisCachesClient) updateCreateRequest(ctx context.Context, redisC return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -376,6 +395,9 @@ func (client *RedisCachesClient) updateCreateRequest(ctx context.Context, redisC reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go index 489c6a2e0c..6f319c8a24 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -2,104 +2,119 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview -// MongoDatabasesClientCreateOrUpdateResponse contains the response from method MongoDatabasesClient.CreateOrUpdate. +// MongoDatabasesClientCreateOrUpdateResponse contains the response from method MongoDatabasesClient.BeginCreateOrUpdate. type MongoDatabasesClientCreateOrUpdateResponse struct { + // MongoDatabase portable resource MongoDatabaseResource } -// MongoDatabasesClientDeleteResponse contains the response from method MongoDatabasesClient.Delete. +// MongoDatabasesClientDeleteResponse contains the response from method MongoDatabasesClient.BeginDelete. type MongoDatabasesClientDeleteResponse struct { // placeholder for future response values } // MongoDatabasesClientGetResponse contains the response from method MongoDatabasesClient.Get. type MongoDatabasesClientGetResponse struct { + // MongoDatabase portable resource MongoDatabaseResource } -// MongoDatabasesClientListByScopeResponse contains the response from method MongoDatabasesClient.ListByScope. +// MongoDatabasesClientListByScopeResponse contains the response from method MongoDatabasesClient.NewListByScopePager. type MongoDatabasesClientListByScopeResponse struct { + // The response of a MongoDatabaseResource list operation. MongoDatabaseResourceListResult } // MongoDatabasesClientListSecretsResponse contains the response from method MongoDatabasesClient.ListSecrets. type MongoDatabasesClientListSecretsResponse struct { + // The secret values for the given MongoDatabase resource MongoDatabaseListSecretsResult } -// MongoDatabasesClientUpdateResponse contains the response from method MongoDatabasesClient.Update. +// MongoDatabasesClientUpdateResponse contains the response from method MongoDatabasesClient.BeginUpdate. type MongoDatabasesClientUpdateResponse struct { + // MongoDatabase portable resource MongoDatabaseResource } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } -// RedisCachesClientCreateOrUpdateResponse contains the response from method RedisCachesClient.CreateOrUpdate. +// RedisCachesClientCreateOrUpdateResponse contains the response from method RedisCachesClient.BeginCreateOrUpdate. type RedisCachesClientCreateOrUpdateResponse struct { + // RedisCache portable resource RedisCacheResource } -// RedisCachesClientDeleteResponse contains the response from method RedisCachesClient.Delete. +// RedisCachesClientDeleteResponse contains the response from method RedisCachesClient.BeginDelete. type RedisCachesClientDeleteResponse struct { // placeholder for future response values } // RedisCachesClientGetResponse contains the response from method RedisCachesClient.Get. type RedisCachesClientGetResponse struct { + // RedisCache portable resource RedisCacheResource } -// RedisCachesClientListByScopeResponse contains the response from method RedisCachesClient.ListByScope. +// RedisCachesClientListByScopeResponse contains the response from method RedisCachesClient.NewListByScopePager. type RedisCachesClientListByScopeResponse struct { + // The response of a RedisCacheResource list operation. RedisCacheResourceListResult } // RedisCachesClientListSecretsResponse contains the response from method RedisCachesClient.ListSecrets. type RedisCachesClientListSecretsResponse struct { + // The secret values for the given RedisCache resource RedisCacheListSecretsResult } -// RedisCachesClientUpdateResponse contains the response from method RedisCachesClient.Update. +// RedisCachesClientUpdateResponse contains the response from method RedisCachesClient.BeginUpdate. type RedisCachesClientUpdateResponse struct { + // RedisCache portable resource RedisCacheResource } -// SQLDatabasesClientCreateOrUpdateResponse contains the response from method SQLDatabasesClient.CreateOrUpdate. +// SQLDatabasesClientCreateOrUpdateResponse contains the response from method SQLDatabasesClient.BeginCreateOrUpdate. type SQLDatabasesClientCreateOrUpdateResponse struct { + // SqlDatabase portable resource SQLDatabaseResource } -// SQLDatabasesClientDeleteResponse contains the response from method SQLDatabasesClient.Delete. +// SQLDatabasesClientDeleteResponse contains the response from method SQLDatabasesClient.BeginDelete. type SQLDatabasesClientDeleteResponse struct { // placeholder for future response values } // SQLDatabasesClientGetResponse contains the response from method SQLDatabasesClient.Get. type SQLDatabasesClientGetResponse struct { + // SqlDatabase portable resource SQLDatabaseResource } -// SQLDatabasesClientListByScopeResponse contains the response from method SQLDatabasesClient.ListByScope. +// SQLDatabasesClientListByScopeResponse contains the response from method SQLDatabasesClient.NewListByScopePager. type SQLDatabasesClientListByScopeResponse struct { + // The response of a SqlDatabaseResource list operation. SQLDatabaseResourceListResult } // SQLDatabasesClientListSecretsResponse contains the response from method SQLDatabasesClient.ListSecrets. type SQLDatabasesClientListSecretsResponse struct { + // The secret values for the given SqlDatabase resource SQLDatabaseListSecretsResult } -// SQLDatabasesClientUpdateResponse contains the response from method SQLDatabasesClient.Update. +// SQLDatabasesClientUpdateResponse contains the response from method SQLDatabasesClient.BeginUpdate. type SQLDatabasesClientUpdateResponse struct { + // SqlDatabase portable resource SQLDatabaseResource } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go index 16286650a6..4dd5e60343 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // SQLDatabasesClient contains the methods for the SQLDatabases group. // Don't use this type directly, use NewSQLDatabasesClient() instead. type SQLDatabasesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewSQLDatabasesClient creates a new instance of SQLDatabasesClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSQLDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLDatabasesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".SQLDatabasesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &SQLDatabasesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase portable resource resource -// resource - Resource create parameters. -// options - SQLDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginCreateOrUpdate -// method. +// - sqlDatabaseName - The name of the SqlDatabase portable resource resource +// - resource - Resource create parameters. +// - options - SQLDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginCreateOrUpdate +// method. func (client *SQLDatabasesClient) BeginCreateOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SQLDatabasesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, sqlDatabaseName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLDatabasesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLDatabasesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SQLDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SQLDatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *SQLDatabasesClient) createOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, sqlDatabaseName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,45 +104,53 @@ func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase portable resource resource -// options - SQLDatabasesClientBeginDeleteOptions contains the optional parameters for the SQLDatabasesClient.BeginDelete -// method. +// - sqlDatabaseName - The name of the SqlDatabase portable resource resource +// - options - SQLDatabasesClientBeginDeleteOptions contains the optional parameters for the SQLDatabasesClient.BeginDelete +// method. func (client *SQLDatabasesClient) BeginDelete(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientBeginDeleteOptions) (*runtime.Poller[SQLDatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, sqlDatabaseName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLDatabasesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLDatabasesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SQLDatabasesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SQLDatabasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *SQLDatabasesClient) deleteOperation(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, sqlDatabaseName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -160,7 +161,7 @@ func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDa return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -173,22 +174,26 @@ func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDa // Get - Get a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase portable resource resource -// options - SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. +// - sqlDatabaseName - The name of the SqlDatabase portable resource resource +// - options - SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. func (client *SQLDatabasesClient) Get(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientGetOptions) (SQLDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, sqlDatabaseName, options) if err != nil { return SQLDatabasesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -199,7 +204,7 @@ func (client *SQLDatabasesClient) getCreateRequest(ctx context.Context, sqlDatab return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -220,9 +225,10 @@ func (client *SQLDatabasesClient) getHandleResponse(resp *http.Response) (SQLDat } // NewListByScopePager - List SqlDatabaseResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - SQLDatabasesClientListByScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByScope -// method. +// - options - SQLDatabasesClientListByScopeOptions contains the optional parameters for the SQLDatabasesClient.NewListByScopePager +// method. func (client *SQLDatabasesClient) NewListByScopePager(options *SQLDatabasesClientListByScopeOptions) (*runtime.Pager[SQLDatabasesClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[SQLDatabasesClientListByScopeResponse]{ More: func(page SQLDatabasesClientListByScopeResponse) bool { @@ -239,7 +245,7 @@ func (client *SQLDatabasesClient) NewListByScopePager(options *SQLDatabasesClien if err != nil { return SQLDatabasesClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientListByScopeResponse{}, err } @@ -255,7 +261,7 @@ func (client *SQLDatabasesClient) NewListByScopePager(options *SQLDatabasesClien func (client *SQLDatabasesClient) listByScopeCreateRequest(ctx context.Context, options *SQLDatabasesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -277,35 +283,39 @@ func (client *SQLDatabasesClient) listByScopeHandleResponse(resp *http.Response) // ListSecrets - Lists secrets values for the specified SqlDatabase resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase portable resource resource -// body - The content of the action request -// options - SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets -// method. -func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseName string, body map[string]interface{}, options *SQLDatabasesClientListSecretsOptions) (SQLDatabasesClientListSecretsResponse, error) { +// - sqlDatabaseName - The name of the SqlDatabase portable resource resource +// - body - The content of the action request +// - options - SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets +// method. +func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseName string, body map[string]any, options *SQLDatabasesClientListSecretsOptions) (SQLDatabasesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, sqlDatabaseName, body, options) if err != nil { return SQLDatabasesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLDatabasesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLDatabasesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. -func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, sqlDatabaseName string, body map[string]interface{}, options *SQLDatabasesClientListSecretsOptions) (*policy.Request, error) { +func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, sqlDatabaseName string, body map[string]any, options *SQLDatabasesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if sqlDatabaseName == "" { return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -313,7 +323,10 @@ func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err +} + return req, nil } // listSecretsHandleResponse handles the ListSecrets response. @@ -327,41 +340,46 @@ func (client *SQLDatabasesClient) listSecretsHandleResponse(resp *http.Response) // BeginUpdate - Update a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase portable resource resource -// properties - The resource properties to be updated. -// options - SQLDatabasesClientBeginUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginUpdate -// method. +// - sqlDatabaseName - The name of the SqlDatabase portable resource resource +// - properties - The resource properties to be updated. +// - options - SQLDatabasesClientBeginUpdateOptions contains the optional parameters for the SQLDatabasesClient.BeginUpdate +// method. func (client *SQLDatabasesClient) BeginUpdate(ctx context.Context, sqlDatabaseName string, properties SQLDatabaseResourceUpdate, options *SQLDatabasesClientBeginUpdateOptions) (*runtime.Poller[SQLDatabasesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, sqlDatabaseName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLDatabasesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SQLDatabasesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[SQLDatabasesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[SQLDatabasesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *SQLDatabasesClient) update(ctx context.Context, sqlDatabaseName string, properties SQLDatabaseResourceUpdate, options *SQLDatabasesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, sqlDatabaseName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -372,7 +390,7 @@ func (client *SQLDatabasesClient) updateCreateRequest(ctx context.Context, sqlDa return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -380,6 +398,9 @@ func (client *SQLDatabasesClient) updateCreateRequest(ctx context.Context, sqlDa reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index cea28fe8b6..30ea6fa1d0 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -66,7 +65,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/pkg/linkrp/api/README.md b/pkg/linkrp/api/README.md index 2dcfada3ef..4f28dfb8ed 100644 --- a/pkg/linkrp/api/README.md +++ b/pkg/linkrp/api/README.md @@ -45,7 +45,7 @@ The following configuration generates track2 go models and client. ```yaml $(tag) != '' version: 3.*.* -use: "@autorest/go@4.0.0-preview.44" +use: "@autorest/go@4.0.0-preview.55" module-version: 0.0.1 file-prefix: zz_generated_ license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go new file mode 100644 index 0000000000..ea4eb09f0d --- /dev/null +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go @@ -0,0 +1,83 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + rootScope string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + rootScope: rootScope, credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewDaprPubSubBrokerClient() *DaprPubSubBrokerClient { + subClient, _ := NewDaprPubSubBrokerClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDaprSecretStoreClient() *DaprSecretStoreClient { + subClient, _ := NewDaprSecretStoreClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDaprStateStoreClient() *DaprStateStoreClient { + subClient, _ := NewDaprStateStoreClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewExtendersClient() *ExtendersClient { + subClient, _ := NewExtendersClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewMongoDatabasesClient() *MongoDatabasesClient { + subClient, _ := NewMongoDatabasesClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRabbitMqMessageQueuesClient() *RabbitMqMessageQueuesClient { + subClient, _ := NewRabbitMqMessageQueuesClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRedisCachesClient() *RedisCachesClient { + subClient, _ := NewRedisCachesClient(c.rootScope, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSQLDatabasesClient() *SQLDatabasesClient { + subClient, _ := NewSQLDatabasesClient(c.rootScope, c.credential, c.options) + return subClient +} + diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go index 8a415ad733..5ad2b299c0 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go index f4be06d752..d04a66f008 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // DaprPubSubBrokerClient contains the methods for the DaprPubSubBroker group. // Don't use this type directly, use NewDaprPubSubBrokerClient() instead. type DaprPubSubBrokerClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewDaprPubSubBrokerClient creates a new instance of DaprPubSubBrokerClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDaprPubSubBrokerClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprPubSubBrokerClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".DaprPubSubBrokerClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &DaprPubSubBrokerClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprPubSubBrokerName - DaprPubSubBroker name -// resource - Resource create parameters. -// options - DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate -// method. +// - daprPubSubBrokerName - DaprPubSubBroker name +// - resource - Resource create parameters. +// - options - DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate +// method. func (client *DaprPubSubBrokerClient) CreateOrUpdate(ctx context.Context, daprPubSubBrokerName string, resource DaprPubSubBrokerResource, options *DaprPubSubBrokerClientCreateOrUpdateOptions) (DaprPubSubBrokerClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, daprPubSubBrokerName, resource, options) if err != nil { return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *DaprPubSubBrokerClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *DaprPubSubBrokerClient) createOrUpdateCreateRequest(ctx context.Co reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,40 +110,45 @@ func (client *DaprPubSubBrokerClient) createOrUpdateHandleResponse(resp *http.Re // BeginDelete - Deletes an existing DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprPubSubBrokerName - DaprPubSubBroker name -// options - DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete -// method. +// - daprPubSubBrokerName - DaprPubSubBroker name +// - options - DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete +// method. func (client *DaprPubSubBrokerClient) BeginDelete(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*runtime.Poller[DaprPubSubBrokerClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, daprPubSubBrokerName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DaprPubSubBrokerClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DaprPubSubBrokerClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[DaprPubSubBrokerClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[DaprPubSubBrokerClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Deletes an existing DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *DaprPubSubBrokerClient) deleteOperation(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, daprPubSubBrokerName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -159,7 +159,7 @@ func (client *DaprPubSubBrokerClient) deleteCreateRequest(ctx context.Context, d return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -172,22 +172,26 @@ func (client *DaprPubSubBrokerClient) deleteCreateRequest(ctx context.Context, d // Get - Retrieves information about a DaprPubSubBrokerResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprPubSubBrokerName - DaprPubSubBroker name -// options - DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. +// - daprPubSubBrokerName - DaprPubSubBroker name +// - options - DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. func (client *DaprPubSubBrokerClient) Get(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientGetOptions) (DaprPubSubBrokerClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, daprPubSubBrokerName, options) if err != nil { return DaprPubSubBrokerClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprPubSubBrokerClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprPubSubBrokerClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DaprPubSubBrokerClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -198,7 +202,7 @@ func (client *DaprPubSubBrokerClient) getCreateRequest(ctx context.Context, dapr return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -219,9 +223,10 @@ func (client *DaprPubSubBrokerClient) getHandleResponse(resp *http.Response) (Da } // NewListByRootScopePager - Lists information about all DaprPubSubBrokerResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.ListByRootScope -// method. +// - options - DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.NewListByRootScopePager +// method. func (client *DaprPubSubBrokerClient) NewListByRootScopePager(options *DaprPubSubBrokerClientListByRootScopeOptions) (*runtime.Pager[DaprPubSubBrokerClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[DaprPubSubBrokerClientListByRootScopeResponse]{ More: func(page DaprPubSubBrokerClientListByRootScopeResponse) bool { @@ -238,7 +243,7 @@ func (client *DaprPubSubBrokerClient) NewListByRootScopePager(options *DaprPubSu if err != nil { return DaprPubSubBrokerClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprPubSubBrokerClientListByRootScopeResponse{}, err } @@ -254,7 +259,7 @@ func (client *DaprPubSubBrokerClient) NewListByRootScopePager(options *DaprPubSu func (client *DaprPubSubBrokerClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprPubSubBrokerClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/daprPubSubBrokers" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go index 0f8e3e1959..40e31237eb 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // DaprSecretStoreClient contains the methods for the DaprSecretStore group. // Don't use this type directly, use NewDaprSecretStoreClient() instead. type DaprSecretStoreClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewDaprSecretStoreClient creates a new instance of DaprSecretStoreClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDaprSecretStoreClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprSecretStoreClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".DaprSecretStoreClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &DaprSecretStoreClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprSecretStoreName - DaprSecretStore name -// resource - Resource create parameters. -// options - DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate -// method. +// - daprSecretStoreName - DaprSecretStore name +// - resource - Resource create parameters. +// - options - DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate +// method. func (client *DaprSecretStoreClient) CreateOrUpdate(ctx context.Context, daprSecretStoreName string, resource DaprSecretStoreResource, options *DaprSecretStoreClientCreateOrUpdateOptions) (DaprSecretStoreClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, daprSecretStoreName, resource, options) if err != nil { return DaprSecretStoreClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprSecretStoreClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DaprSecretStoreClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DaprSecretStoreClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *DaprSecretStoreClient) createOrUpdateCreateRequest(ctx context.Con return nil, errors.New("parameter daprSecretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *DaprSecretStoreClient) createOrUpdateCreateRequest(ctx context.Con reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,22 +110,26 @@ func (client *DaprSecretStoreClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes an existing DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprSecretStoreName - DaprSecretStore name -// options - DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. +// - daprSecretStoreName - DaprSecretStore name +// - options - DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. func (client *DaprSecretStoreClient) Delete(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientDeleteOptions) (DaprSecretStoreClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, daprSecretStoreName, options) if err != nil { return DaprSecretStoreClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprSecretStoreClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return DaprSecretStoreClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DaprSecretStoreClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -141,7 +140,7 @@ func (client *DaprSecretStoreClient) deleteCreateRequest(ctx context.Context, da return nil, errors.New("parameter daprSecretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -168,22 +167,26 @@ func (client *DaprSecretStoreClient) deleteHandleResponse(resp *http.Response) ( // Get - Retrieves information about a DaprSecretStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprSecretStoreName - DaprSecretStore name -// options - DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. +// - daprSecretStoreName - DaprSecretStore name +// - options - DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. func (client *DaprSecretStoreClient) Get(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientGetOptions) (DaprSecretStoreClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, daprSecretStoreName, options) if err != nil { return DaprSecretStoreClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprSecretStoreClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprSecretStoreClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DaprSecretStoreClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -194,7 +197,7 @@ func (client *DaprSecretStoreClient) getCreateRequest(ctx context.Context, daprS return nil, errors.New("parameter daprSecretStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -215,9 +218,10 @@ func (client *DaprSecretStoreClient) getHandleResponse(resp *http.Response) (Dap } // NewListByRootScopePager - Lists information about all DaprSecretStoreResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.ListByRootScope -// method. +// - options - DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.NewListByRootScopePager +// method. func (client *DaprSecretStoreClient) NewListByRootScopePager(options *DaprSecretStoreClientListByRootScopeOptions) (*runtime.Pager[DaprSecretStoreClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[DaprSecretStoreClientListByRootScopeResponse]{ More: func(page DaprSecretStoreClientListByRootScopeResponse) bool { @@ -234,7 +238,7 @@ func (client *DaprSecretStoreClient) NewListByRootScopePager(options *DaprSecret if err != nil { return DaprSecretStoreClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprSecretStoreClientListByRootScopeResponse{}, err } @@ -250,7 +254,7 @@ func (client *DaprSecretStoreClient) NewListByRootScopePager(options *DaprSecret func (client *DaprSecretStoreClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprSecretStoreClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/daprSecretStores" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go index 0b6ea85741..532e180bf3 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // DaprStateStoreClient contains the methods for the DaprStateStore group. // Don't use this type directly, use NewDaprStateStoreClient() instead. type DaprStateStoreClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewDaprStateStoreClient creates a new instance of DaprStateStoreClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDaprStateStoreClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprStateStoreClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".DaprStateStoreClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &DaprStateStoreClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprStateStoreName - DaprStateStore name -// resource - Resource create parameters. -// options - DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate -// method. +// - daprStateStoreName - DaprStateStore name +// - resource - Resource create parameters. +// - options - DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate +// method. func (client *DaprStateStoreClient) CreateOrUpdate(ctx context.Context, daprStateStoreName string, resource DaprStateStoreResource, options *DaprStateStoreClientCreateOrUpdateOptions) (DaprStateStoreClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, daprStateStoreName, resource, options) if err != nil { return DaprStateStoreClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprStateStoreClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DaprStateStoreClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DaprStateStoreClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *DaprStateStoreClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter daprStateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *DaprStateStoreClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,40 +110,45 @@ func (client *DaprStateStoreClient) createOrUpdateHandleResponse(resp *http.Resp // BeginDelete - Deletes an existing DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprStateStoreName - DaprStateStore name -// options - DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete -// method. +// - daprStateStoreName - DaprStateStore name +// - options - DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete +// method. func (client *DaprStateStoreClient) BeginDelete(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*runtime.Poller[DaprStateStoreClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, daprStateStoreName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DaprStateStoreClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DaprStateStoreClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[DaprStateStoreClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[DaprStateStoreClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Deletes an existing DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *DaprStateStoreClient) deleteOperation(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, daprStateStoreName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -159,7 +159,7 @@ func (client *DaprStateStoreClient) deleteCreateRequest(ctx context.Context, dap return nil, errors.New("parameter daprStateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -172,22 +172,26 @@ func (client *DaprStateStoreClient) deleteCreateRequest(ctx context.Context, dap // Get - Retrieves information about a DaprStateStoreResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// daprStateStoreName - DaprStateStore name -// options - DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. +// - daprStateStoreName - DaprStateStore name +// - options - DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. func (client *DaprStateStoreClient) Get(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientGetOptions) (DaprStateStoreClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, daprStateStoreName, options) if err != nil { return DaprStateStoreClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprStateStoreClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprStateStoreClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DaprStateStoreClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -198,7 +202,7 @@ func (client *DaprStateStoreClient) getCreateRequest(ctx context.Context, daprSt return nil, errors.New("parameter daprStateStoreName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -219,9 +223,10 @@ func (client *DaprStateStoreClient) getHandleResponse(resp *http.Response) (Dapr } // NewListByRootScopePager - Lists information about all DaprStateStoreResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.ListByRootScope -// method. +// - options - DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.NewListByRootScopePager +// method. func (client *DaprStateStoreClient) NewListByRootScopePager(options *DaprStateStoreClientListByRootScopeOptions) (*runtime.Pager[DaprStateStoreClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[DaprStateStoreClientListByRootScopeResponse]{ More: func(page DaprStateStoreClientListByRootScopeResponse) bool { @@ -238,7 +243,7 @@ func (client *DaprStateStoreClient) NewListByRootScopePager(options *DaprStateSt if err != nil { return DaprStateStoreClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return DaprStateStoreClientListByRootScopeResponse{}, err } @@ -254,7 +259,7 @@ func (client *DaprStateStoreClient) NewListByRootScopePager(options *DaprStateSt func (client *DaprStateStoreClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprStateStoreClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/daprStateStores" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go index 3fd40b233f..eddddc6088 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,55 +22,50 @@ import ( // ExtendersClient contains the methods for the Extenders group. // Don't use this type directly, use NewExtendersClient() instead. type ExtendersClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewExtendersClient creates a new instance of ExtendersClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExtendersClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtendersClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".ExtendersClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &ExtendersClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a Extender resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// extenderName - The name of the Extender link resource -// extenderParameters - extender create parameters -// options - ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate -// method. +// - extenderName - The name of the Extender link resource +// - extenderParameters - extender create parameters +// - options - ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate +// method. func (client *ExtendersClient) CreateOrUpdate(ctx context.Context, extenderName string, extenderParameters ExtenderResource, options *ExtendersClientCreateOrUpdateOptions) (ExtendersClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, extenderName, extenderParameters, options) if err != nil { return ExtendersClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendersClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ExtendersClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ExtendersClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -84,7 +76,7 @@ func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, errors.New("parameter extenderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -92,7 +84,10 @@ func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, extenderParameters) + if err := runtime.MarshalAsJSON(req, extenderParameters); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -106,20 +101,23 @@ func (client *ExtendersClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes an existing extender resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// extenderName - The name of the Extender link resource -// options - ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. +// - extenderName - The name of the Extender link resource +// - options - ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. func (client *ExtendersClient) Delete(ctx context.Context, extenderName string, options *ExtendersClientDeleteOptions) (ExtendersClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, extenderName, options) if err != nil { return ExtendersClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return ExtendersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ExtendersClientDeleteResponse{}, err } return ExtendersClientDeleteResponse{}, nil } @@ -132,7 +130,7 @@ func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extender return nil, errors.New("parameter extenderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -145,22 +143,26 @@ func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extender // Get - Retrieves information about a extender resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// extenderName - The name of the Extender link resource -// options - ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. +// - extenderName - The name of the Extender link resource +// - options - ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. func (client *ExtendersClient) Get(ctx context.Context, extenderName string, options *ExtendersClientGetOptions) (ExtendersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, extenderName, options) if err != nil { return ExtendersClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtendersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtendersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -171,7 +173,7 @@ func (client *ExtendersClient) getCreateRequest(ctx context.Context, extenderNam return nil, errors.New("parameter extenderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -192,9 +194,10 @@ func (client *ExtendersClient) getHandleResponse(resp *http.Response) (Extenders } // NewListByRootScopePager - Lists information about all extender resources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.ListByRootScope -// method. +// - options - ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.NewListByRootScopePager +// method. func (client *ExtendersClient) NewListByRootScopePager(options *ExtendersClientListByRootScopeOptions) (*runtime.Pager[ExtendersClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[ExtendersClientListByRootScopeResponse]{ More: func(page ExtendersClientListByRootScopeResponse) bool { @@ -211,7 +214,7 @@ func (client *ExtendersClient) NewListByRootScopePager(options *ExtendersClientL if err != nil { return ExtendersClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendersClientListByRootScopeResponse{}, err } @@ -227,7 +230,7 @@ func (client *ExtendersClient) NewListByRootScopePager(options *ExtendersClientL func (client *ExtendersClient) listByRootScopeCreateRequest(ctx context.Context, options *ExtendersClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/extenders" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -249,22 +252,26 @@ func (client *ExtendersClient) listByRootScopeHandleResponse(resp *http.Response // ListSecrets - Lists secrets values for the specified Extender resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// extenderName - The name of the Extender link resource -// options - ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. +// - extenderName - The name of the Extender link resource +// - options - ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName string, options *ExtendersClientListSecretsOptions) (ExtendersClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, extenderName, options) if err != nil { return ExtendersClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtendersClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtendersClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtendersClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -275,7 +282,7 @@ func (client *ExtendersClient) listSecretsCreateRequest(ctx context.Context, ext return nil, errors.New("parameter extenderName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go index 972ad17b70..5a7ad2e22f 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,1035 +12,831 @@ import "time" // BasicDaprResourceProperties - Basic properties of a Dapr component object. type BasicDaprResourceProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // BasicResourceProperties - Basic properties of a Radius resource. type BasicResourceProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` -} - -// DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete method. -type DaprPubSubBrokerClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate -// method. -type DaprPubSubBrokerClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. -type DaprPubSubBrokerClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.ListByRootScope -// method. -type DaprPubSubBrokerClientListByRootScopeOptions struct { - // placeholder for future optional parameters + Status *ResourceStatus } // DaprPubSubBrokerProperties - DaprPubSubBroker link properties type DaprPubSubBrokerProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // Metadata for the daprPubSubBroker resource. This should match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the daprPubSubBroker link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // A collection of references to resources associated with the daprPubSubBroker - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // DaprPubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format. - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; Provisioning state of the daprPubSubBroker resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // DaprPubSubBrokerResource - DaprPubSubBroker link type DaprPubSubBrokerResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *DaprPubSubBrokerProperties `json:"properties,omitempty"` + Properties *DaprPubSubBrokerProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DaprPubSubBrokerResourceListResult - The response of a DaprPubSubBrokerResource list operation. type DaprPubSubBrokerResourceListResult struct { // REQUIRED; The DaprPubSubBrokerResource items on this page - Value []*DaprPubSubBrokerResource `json:"value,omitempty"` + Value []*DaprPubSubBrokerResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` -} - -// DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate -// method. -type DaprSecretStoreClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. -type DaprSecretStoreClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. -type DaprSecretStoreClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.ListByRootScope -// method. -type DaprSecretStoreClientListByRootScopeOptions struct { - // placeholder for future optional parameters + NextLink *string } // DaprSecretStoreProperties - DaprSecretStore link properties type DaprSecretStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // Metadata for the Secret Store resource. This should match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the daprSecretStore link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // Dapr Secret Store type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/ - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; Provisioning state of the dapr secret store link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // DaprSecretStoreResource - DaprSecretStore link type DaprSecretStoreResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *DaprSecretStoreProperties `json:"properties,omitempty"` + Properties *DaprSecretStoreProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DaprSecretStoreResourceListResult - The response of a DaprSecretStoreResource list operation. type DaprSecretStoreResourceListResult struct { // REQUIRED; The DaprSecretStoreResource items on this page - Value []*DaprSecretStoreResource `json:"value,omitempty"` + Value []*DaprSecretStoreResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` -} - -// DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete method. -type DaprStateStoreClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate -// method. -type DaprStateStoreClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. -type DaprStateStoreClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.ListByRootScope -// method. -type DaprStateStoreClientListByRootScopeOptions struct { - // placeholder for future optional parameters + NextLink *string } // DaprStateStoreProperties - DaprStateStore link properties type DaprStateStoreProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // Metadata for the state store resource. This should match the values specified in Dapr component spec - Metadata map[string]interface{} `json:"metadata,omitempty"` + Metadata map[string]any // The recipe used to automatically deploy underlying infrastructure for the daprStateStore link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // A collection of references to resources associated with the state store - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format. - Type *string `json:"type,omitempty"` + Type *string // Dapr component version - Version *string `json:"version,omitempty"` + Version *string // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to // use the Dapr component. - ComponentName *string `json:"componentName,omitempty" azure:"ro"` + ComponentName *string // READ-ONLY; Provisioning state of the DaprStateStore link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // DaprStateStoreResource - DaprStateStore link type DaprStateStoreResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *DaprStateStoreProperties `json:"properties,omitempty"` + Properties *DaprStateStoreProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DaprStateStoreResourceListResult - The response of a DaprStateStoreResource list operation. type DaprStateStoreResourceListResult struct { // REQUIRED; The DaprStateStoreResource items on this page - Value []*DaprStateStoreResource `json:"value,omitempty"` + Value []*DaprStateStoreResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info map[string]any // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ErrorDetail - The error detail. type ErrorDetail struct { // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + Details []*ErrorDetail // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { // The error object. - Error *ErrorDetail `json:"error,omitempty"` + Error *ErrorDetail } // ExtenderList - Object that includes an array of Extender and a possible link for next set type ExtenderList struct { // The link used to fetch the next page of Extender list. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // List of Extender resources - Value []*ExtenderResource `json:"value,omitempty"` + Value []*ExtenderResource } // ExtenderProperties - Extender link properties type ExtenderProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // The recipe used to automatically deploy underlying infrastructure for the Extender link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // The secret values for the given Extender resource - Secrets map[string]interface{} `json:"secrets,omitempty"` + Secrets map[string]any // READ-ONLY; Provisioning state of the extender link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // ExtenderResource - Extender link type ExtenderResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // REQUIRED; Extender link properties - Properties *ExtenderProperties `json:"properties,omitempty"` + Properties *ExtenderProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate method. -type ExtendersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. -type ExtendersClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. -type ExtendersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.ListByRootScope method. -type ExtendersClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. -type ExtendersClientListSecretsOptions struct { - // placeholder for future optional parameters + Type *string } // MongoDatabaseListSecretsResult - The secret values for the given MongoDatabase resource type MongoDatabaseListSecretsResult struct { // Connection string used to connect to the target Mongo database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Mongo database - Password *string `json:"password,omitempty"` + Password *string } // MongoDatabaseProperties - MongoDatabase link properties type MongoDatabaseProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // Database name of the target Mongo database - Database *string `json:"database,omitempty"` + Database *string // Host name of the target Mongo database - Host *string `json:"host,omitempty"` + Host *string // Port value of the target Mongo database - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the MongoDB link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the MongoDB resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secret values provided for the resource - Secrets *MongoDatabaseSecrets `json:"secrets,omitempty"` + Secrets *MongoDatabaseSecrets // Username to use when connecting to the target Mongo database - Username *string `json:"username,omitempty"` + Username *string // READ-ONLY; Provisioning state of the mongo database link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // MongoDatabaseResource - MongoDatabase link type MongoDatabaseResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *MongoDatabaseProperties `json:"properties,omitempty"` + Properties *MongoDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // MongoDatabaseResourceListResult - The response of a MongoDatabaseResource list operation. type MongoDatabaseResourceListResult struct { // REQUIRED; The MongoDatabaseResource items on this page - Value []*MongoDatabaseResource `json:"value,omitempty"` + Value []*MongoDatabaseResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // MongoDatabaseSecrets - The secret values for the given MongoDatabase resource type MongoDatabaseSecrets struct { // Connection string used to connect to the target Mongo database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Mongo database - Password *string `json:"password,omitempty"` -} - -// MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete method. -type MongoDatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate -// method. -type MongoDatabasesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. -type MongoDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByRootScope -// method. -type MongoDatabasesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets method. -type MongoDatabasesClientListSecretsOptions struct { - // placeholder for future optional parameters + Password *string } // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + ActionType *ActionType // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. - IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" - Origin *Origin `json:"origin,omitempty" azure:"ro"` + Origin *Origin } // OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to // get the next set of results. type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; List of operations supported by the resource provider - Value []*Operation `json:"value,omitempty" azure:"ro"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters + Value []*Operation } // RabbitMQListSecretsResult - The secret values for the given RabbitMQMessageQueue resource type RabbitMQListSecretsResult struct { // The password used to connect to the RabbitMQ instance - Password *string `json:"password,omitempty"` + Password *string // The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. // Can be overridden with a custom value - URI *string `json:"uri,omitempty"` + URI *string } // RabbitMQMessageQueueProperties - RabbitMQMessageQueue link properties type RabbitMQMessageQueueProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // The hostname of the RabbitMQ instance - Host *string `json:"host,omitempty"` + Host *string // The port of the RabbitMQ instance. Defaults to 5672 - Port *int32 `json:"port,omitempty"` + Port *int32 // The name of the queue - Queue *string `json:"queue,omitempty"` + Queue *string // The recipe used to automatically deploy underlying infrastructure for the rabbitMQ link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the rabbitMQ resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secrets provided by resources, - Secrets *RabbitMQSecrets `json:"secrets,omitempty"` + Secrets *RabbitMQSecrets // Specifies whether to use SSL when connecting to the RabbitMQ instance - TLS *bool `json:"tls,omitempty"` + TLS *bool // The username to use when connecting to the RabbitMQ instance - Username *string `json:"username,omitempty"` + Username *string // The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. - VHost *string `json:"vHost,omitempty"` + VHost *string // READ-ONLY; Provisioning state of the rabbitMQ message queue link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // RabbitMQMessageQueueResource - RabbitMQMessageQueue link type RabbitMQMessageQueueResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *RabbitMQMessageQueueProperties `json:"properties,omitempty"` + Properties *RabbitMQMessageQueueProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RabbitMQMessageQueueResourceListResult - The response of a RabbitMQMessageQueueResource list operation. type RabbitMQMessageQueueResourceListResult struct { // REQUIRED; The RabbitMQMessageQueueResource items on this page - Value []*RabbitMQMessageQueueResource `json:"value,omitempty"` + Value []*RabbitMQMessageQueueResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // RabbitMQSecrets - The secret values for the given RabbitMQMessageQueue resource type RabbitMQSecrets struct { // The password used to connect to the RabbitMQ instance - Password *string `json:"password,omitempty"` + Password *string // The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. // Can be overridden with a custom value - URI *string `json:"uri,omitempty"` -} - -// RabbitMqMessageQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqMessageQueuesClient.CreateOrUpdate -// method. -type RabbitMqMessageQueuesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientDeleteOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Delete method. -type RabbitMqMessageQueuesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientGetOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Get method. -type RabbitMqMessageQueuesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListByRootScope -// method. -type RabbitMqMessageQueuesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListSecrets -// method. -type RabbitMqMessageQueuesClientListSecretsOptions struct { - // placeholder for future optional parameters + URI *string } // Recipe - The recipe used to automatically deploy underlying infrastructure for a link type Recipe struct { // REQUIRED; The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // RedisCacheListSecretsResult - The secret values for the given RedisCache resource type RedisCacheListSecretsResult struct { // The connection string used to connect to the Redis cache - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // The password for this Redis cache instance - Password *string `json:"password,omitempty"` + Password *string // The URL used to connect to the Redis cache - URL *string `json:"url,omitempty"` + URL *string } // RedisCacheProperties - RedisCache link properties type RedisCacheProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // The host name of the target Redis cache - Host *string `json:"host,omitempty"` + Host *string // The port value of the target Redis cache - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the Redis caches link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the Redis resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secrets provided by resource - Secrets *RedisCacheSecrets `json:"secrets,omitempty"` + Secrets *RedisCacheSecrets // Specifies whether to enable SSL connections to the Redis cache - TLS *bool `json:"tls,omitempty"` + TLS *bool // The username for Redis cache - Username *string `json:"username,omitempty"` + Username *string // READ-ONLY; Provisioning state of the redis cache link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // RedisCacheResource - RedisCache link type RedisCacheResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *RedisCacheProperties `json:"properties,omitempty"` + Properties *RedisCacheProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RedisCacheResourceListResult - The response of a RedisCacheResource list operation. type RedisCacheResourceListResult struct { // REQUIRED; The RedisCacheResource items on this page - Value []*RedisCacheResource `json:"value,omitempty"` + Value []*RedisCacheResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // RedisCacheSecrets - The secret values for the given RedisCache resource type RedisCacheSecrets struct { // The connection string used to connect to the Redis cache - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // The password for this Redis cache instance - Password *string `json:"password,omitempty"` + Password *string // The URL used to connect to the Redis cache - URL *string `json:"url,omitempty"` -} - -// RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate method. -type RedisCachesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. -type RedisCachesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. -type RedisCachesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.ListByRootScope method. -type RedisCachesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. -type RedisCachesClientListSecretsOptions struct { - // placeholder for future optional parameters + URL *string } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceReference - Describes a reference to an existing resource type ResourceReference struct { // REQUIRED; Resource id of an existing resource - ID *string `json:"id,omitempty"` + ID *string } // ResourceStatus - Status of a resource. type ResourceStatus struct { // Properties of an output resource - OutputResources []map[string]interface{} `json:"outputResources,omitempty"` + OutputResources []map[string]any } // SQLDatabaseListSecretsResult - The secret values for the given SqlDatabase resource type SQLDatabaseListSecretsResult struct { // Connection string used to connect to the target Sql database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Sql database - Password *string `json:"password,omitempty"` + Password *string } // SQLDatabaseProperties - SqlDatabase properties type SQLDatabaseProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the link is consumed by - Application *string `json:"application,omitempty"` + Application *string // The name of the Sql database. - Database *string `json:"database,omitempty"` + Database *string // Port value of the target Sql database - Port *int32 `json:"port,omitempty"` + Port *int32 // The recipe used to automatically deploy underlying infrastructure for the sqldatabases link - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the SqlDatabase resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // Secret values provided for the resource - Secrets *SQLDatabaseSecrets `json:"secrets,omitempty"` + Secrets *SQLDatabaseSecrets // The fully qualified domain name of the Sql database. - Server *string `json:"server,omitempty"` + Server *string // Username to use when connecting to the target Sql database - Username *string `json:"username,omitempty"` + Username *string // READ-ONLY; Provisioning state of the Sql database link at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // SQLDatabaseResource - SqlDatabase link type SQLDatabaseResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *SQLDatabaseProperties `json:"properties,omitempty"` + Properties *SQLDatabaseProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SQLDatabaseResourceListResult - The response of a SqlDatabaseResource list operation. type SQLDatabaseResourceListResult struct { // REQUIRED; The SqlDatabaseResource items on this page - Value []*SQLDatabaseResource `json:"value,omitempty"` + Value []*SQLDatabaseResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // SQLDatabaseSecrets - The secret values for the given SqlDatabase resource type SQLDatabaseSecrets struct { // Connection string used to connect to the target Sql database - ConnectionString *string `json:"connectionString,omitempty"` + ConnectionString *string // Password to use when connecting to the target Sql database - Password *string `json:"password,omitempty"` -} - -// SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate method. -type SQLDatabasesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. -type SQLDatabasesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. -type SQLDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByRootScope method. -type SQLDatabasesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets method. -type SQLDatabasesClientListSecretsOptions struct { - // placeholder for future optional parameters + Password *string } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go index 81f556a64a..8e5b7ed185 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -17,7 +16,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type BasicDaprResourceProperties. func (b BasicDaprResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", b.Application) populate(objectMap, "componentName", b.ComponentName) populate(objectMap, "environment", b.Environment) @@ -36,16 +35,16 @@ func (b *BasicDaprResourceProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &b.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -56,7 +55,7 @@ func (b *BasicDaprResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", b.Application) populate(objectMap, "environment", b.Environment) populate(objectMap, "status", b.Status) @@ -74,13 +73,13 @@ func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -91,7 +90,7 @@ func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerProperties. func (d DaprPubSubBrokerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "componentName", d.ComponentName) populate(objectMap, "environment", d.Environment) @@ -117,37 +116,37 @@ func (d *DaprPubSubBrokerProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -158,7 +157,7 @@ func (d *DaprPubSubBrokerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResource. func (d DaprPubSubBrokerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -180,25 +179,25 @@ func (d *DaprPubSubBrokerResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -209,7 +208,7 @@ func (d *DaprPubSubBrokerResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceListResult. func (d DaprPubSubBrokerResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -226,10 +225,10 @@ func (d *DaprPubSubBrokerResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -240,7 +239,7 @@ func (d *DaprPubSubBrokerResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreProperties. func (d DaprSecretStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "componentName", d.ComponentName) populate(objectMap, "environment", d.Environment) @@ -265,34 +264,34 @@ func (d *DaprSecretStoreProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -303,7 +302,7 @@ func (d *DaprSecretStoreProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResource. func (d DaprSecretStoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -325,25 +324,25 @@ func (d *DaprSecretStoreResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -354,7 +353,7 @@ func (d *DaprSecretStoreResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceListResult. func (d DaprSecretStoreResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -371,10 +370,10 @@ func (d *DaprSecretStoreResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -385,7 +384,7 @@ func (d *DaprSecretStoreResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreProperties. func (d DaprStateStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", d.Application) populate(objectMap, "componentName", d.ComponentName) populate(objectMap, "environment", d.Environment) @@ -411,37 +410,37 @@ func (d *DaprStateStoreProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "componentName": err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -452,7 +451,7 @@ func (d *DaprStateStoreProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResource. func (d DaprStateStoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -474,25 +473,25 @@ func (d *DaprStateStoreResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -503,7 +502,7 @@ func (d *DaprStateStoreResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceListResult. func (d DaprStateStoreResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -520,10 +519,10 @@ func (d *DaprStateStoreResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -534,7 +533,7 @@ func (d *DaprStateStoreResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -551,10 +550,10 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { switch key { case "info": err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -565,7 +564,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -585,19 +584,19 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) + delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) + delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -608,7 +607,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -624,7 +623,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { switch key { case "error": err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -635,7 +634,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExtenderList. func (e ExtenderList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) @@ -652,10 +651,10 @@ func (e *ExtenderList) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &e.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -666,7 +665,7 @@ func (e *ExtenderList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExtenderProperties. func (e ExtenderProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", e.Application) populate(objectMap, "environment", e.Environment) populate(objectMap, "provisioningState", e.ProvisioningState) @@ -693,31 +692,31 @@ func (e *ExtenderProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &e.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &e.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &e.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &e.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &e.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) + delete(rawMsg, key) default: if e.AdditionalProperties == nil { - e.AdditionalProperties = map[string]interface{}{} + e.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) e.AdditionalProperties[key] = aux } @@ -732,7 +731,7 @@ func (e *ExtenderProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExtenderResource. func (e ExtenderResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "location", e.Location) populate(objectMap, "name", e.Name) @@ -754,25 +753,25 @@ func (e *ExtenderResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &e.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -783,7 +782,7 @@ func (e *ExtenderResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseListSecretsResult. func (m MongoDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", m.ConnectionString) populate(objectMap, "password", m.Password) return json.Marshal(objectMap) @@ -800,10 +799,10 @@ func (m *MongoDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -814,7 +813,7 @@ func (m *MongoDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseProperties. func (m MongoDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", m.Application) populate(objectMap, "database", m.Database) populate(objectMap, "environment", m.Environment) @@ -841,40 +840,40 @@ func (m *MongoDatabaseProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &m.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &m.Database) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &m.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &m.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &m.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &m.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &m.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &m.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &m.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &m.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -885,7 +884,7 @@ func (m *MongoDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResource. func (m MongoDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) @@ -907,25 +906,25 @@ func (m *MongoDatabaseResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -936,7 +935,7 @@ func (m *MongoDatabaseResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceListResult. func (m MongoDatabaseResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -953,10 +952,10 @@ func (m *MongoDatabaseResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -967,7 +966,7 @@ func (m *MongoDatabaseResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MongoDatabaseSecrets. func (m MongoDatabaseSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", m.ConnectionString) populate(objectMap, "password", m.Password) return json.Marshal(objectMap) @@ -984,10 +983,10 @@ func (m *MongoDatabaseSecrets) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -998,7 +997,7 @@ func (m *MongoDatabaseSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -1018,19 +1017,19 @@ func (o *Operation) UnmarshalJSON(data []byte) error { switch key { case "actionType": err = unpopulate(val, "ActionType", &o.ActionType) - delete(rawMsg, key) + delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) + delete(rawMsg, key) case "isDataAction": err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "origin": err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1041,7 +1040,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -1060,16 +1059,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { switch key { case "description": err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) + delete(rawMsg, key) case "operation": err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) + delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1080,7 +1079,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -1097,10 +1096,10 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -1111,7 +1110,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQListSecretsResult. func (r RabbitMQListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "password", r.Password) populate(objectMap, "uri", r.URI) return json.Marshal(objectMap) @@ -1128,10 +1127,10 @@ func (r *RabbitMQListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "uri": err = unpopulate(val, "URI", &r.URI) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1142,7 +1141,7 @@ func (r *RabbitMQListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQMessageQueueProperties. func (r RabbitMQMessageQueueProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", r.Application) populate(objectMap, "environment", r.Environment) populate(objectMap, "host", r.Host) @@ -1171,46 +1170,46 @@ func (r *RabbitMQMessageQueueProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "queue": err = unpopulate(val, "Queue", &r.Queue) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) + delete(rawMsg, key) case "vHost": err = unpopulate(val, "VHost", &r.VHost) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1221,7 +1220,7 @@ func (r *RabbitMQMessageQueueProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQMessageQueueResource. func (r RabbitMQMessageQueueResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) @@ -1243,25 +1242,25 @@ func (r *RabbitMQMessageQueueResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1272,7 +1271,7 @@ func (r *RabbitMQMessageQueueResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQMessageQueueResourceListResult. func (r RabbitMQMessageQueueResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -1289,10 +1288,10 @@ func (r *RabbitMQMessageQueueResourceListResult) UnmarshalJSON(data []byte) erro switch key { case "nextLink": err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1303,7 +1302,7 @@ func (r *RabbitMQMessageQueueResourceListResult) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type RabbitMQSecrets. func (r RabbitMQSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "password", r.Password) populate(objectMap, "uri", r.URI) return json.Marshal(objectMap) @@ -1320,10 +1319,10 @@ func (r *RabbitMQSecrets) UnmarshalJSON(data []byte) error { switch key { case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "uri": err = unpopulate(val, "URI", &r.URI) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1334,7 +1333,7 @@ func (r *RabbitMQSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -1351,10 +1350,10 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1365,7 +1364,7 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheListSecretsResult. func (r RedisCacheListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", r.ConnectionString) populate(objectMap, "password", r.Password) populate(objectMap, "url", r.URL) @@ -1383,13 +1382,13 @@ func (r *RedisCacheListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &r.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1400,7 +1399,7 @@ func (r *RedisCacheListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheProperties. func (r RedisCacheProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", r.Application) populate(objectMap, "environment", r.Environment) populate(objectMap, "host", r.Host) @@ -1427,40 +1426,40 @@ func (r *RedisCacheProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1471,7 +1470,7 @@ func (r *RedisCacheProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheResource. func (r RedisCacheResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) @@ -1493,25 +1492,25 @@ func (r *RedisCacheResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1522,7 +1521,7 @@ func (r *RedisCacheResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceListResult. func (r RedisCacheResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -1539,10 +1538,10 @@ func (r *RedisCacheResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1553,7 +1552,7 @@ func (r *RedisCacheResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RedisCacheSecrets. func (r RedisCacheSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", r.ConnectionString) populate(objectMap, "password", r.Password) populate(objectMap, "url", r.URL) @@ -1571,13 +1570,13 @@ func (r *RedisCacheSecrets) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &r.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1588,7 +1587,7 @@ func (r *RedisCacheSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -1607,16 +1606,16 @@ func (r *Resource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1627,7 +1626,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceReference. func (r ResourceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } @@ -1643,7 +1642,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1654,7 +1653,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) } @@ -1670,7 +1669,7 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { switch key { case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1681,7 +1680,7 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseListSecretsResult. func (s SQLDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", s.ConnectionString) populate(objectMap, "password", s.Password) return json.Marshal(objectMap) @@ -1698,10 +1697,10 @@ func (s *SQLDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &s.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1712,7 +1711,7 @@ func (s *SQLDatabaseListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseProperties. func (s SQLDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", s.Application) populate(objectMap, "database", s.Database) populate(objectMap, "environment", s.Environment) @@ -1739,40 +1738,40 @@ func (s *SQLDatabaseProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &s.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "database": err = unpopulate(val, "Database", &s.Database) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &s.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &s.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &s.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &s.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &s.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &s.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "server": err = unpopulate(val, "Server", &s.Server) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &s.Username) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1783,7 +1782,7 @@ func (s *SQLDatabaseProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResource. func (s SQLDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -1805,25 +1804,25 @@ func (s *SQLDatabaseResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1834,7 +1833,7 @@ func (s *SQLDatabaseResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceListResult. func (s SQLDatabaseResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -1851,10 +1850,10 @@ func (s *SQLDatabaseResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1865,7 +1864,7 @@ func (s *SQLDatabaseResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseSecrets. func (s SQLDatabaseSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectionString", s.ConnectionString) populate(objectMap, "password", s.Password) return json.Marshal(objectMap) @@ -1882,10 +1881,10 @@ func (s *SQLDatabaseSecrets) UnmarshalJSON(data []byte) error { switch key { case "connectionString": err = unpopulate(val, "ConnectionString", &s.ConnectionString) - delete(rawMsg, key) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1896,7 +1895,7 @@ func (s *SQLDatabaseSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -1917,22 +1916,22 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { switch key { case "createdAt": err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedAt": err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1943,7 +1942,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -1964,22 +1963,22 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -1988,7 +1987,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -1998,7 +1997,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go index 2a3ca06251..36b40eca4b 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // MongoDatabasesClient contains the methods for the MongoDatabases group. // Don't use this type directly, use NewMongoDatabasesClient() instead. type MongoDatabasesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewMongoDatabasesClient creates a new instance of MongoDatabasesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMongoDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoDatabasesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".MongoDatabasesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &MongoDatabasesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase link resource -// resource - Resource create parameters. -// options - MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate -// method. +// - mongoDatabaseName - The name of the MongoDatabase link resource +// - resource - Resource create parameters. +// - options - MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate +// method. func (client *MongoDatabasesClient) CreateOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientCreateOrUpdateOptions) (MongoDatabasesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, mongoDatabaseName, resource, options) if err != nil { return MongoDatabasesClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return MongoDatabasesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return MongoDatabasesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,40 +110,45 @@ func (client *MongoDatabasesClient) createOrUpdateHandleResponse(resp *http.Resp // BeginDelete - Deletes an existing MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase link resource -// options - MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete -// method. +// - mongoDatabaseName - The name of the MongoDatabase link resource +// - options - MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete +// method. func (client *MongoDatabasesClient) BeginDelete(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*runtime.Poller[MongoDatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, mongoDatabaseName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDatabasesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDatabasesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[MongoDatabasesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[MongoDatabasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Deletes an existing MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *MongoDatabasesClient) deleteOperation(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, mongoDatabaseName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -159,7 +159,7 @@ func (client *MongoDatabasesClient) deleteCreateRequest(ctx context.Context, mon return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -172,22 +172,26 @@ func (client *MongoDatabasesClient) deleteCreateRequest(ctx context.Context, mon // Get - Retrieves information about a MongoDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase link resource -// options - MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. +// - mongoDatabaseName - The name of the MongoDatabase link resource +// - options - MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. func (client *MongoDatabasesClient) Get(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientGetOptions) (MongoDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, mongoDatabaseName, options) if err != nil { return MongoDatabasesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MongoDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -198,7 +202,7 @@ func (client *MongoDatabasesClient) getCreateRequest(ctx context.Context, mongoD return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -219,9 +223,10 @@ func (client *MongoDatabasesClient) getHandleResponse(resp *http.Response) (Mong } // NewListByRootScopePager - Lists information about all MongoDatabaseResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.ListByRootScope -// method. +// - options - MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.NewListByRootScopePager +// method. func (client *MongoDatabasesClient) NewListByRootScopePager(options *MongoDatabasesClientListByRootScopeOptions) (*runtime.Pager[MongoDatabasesClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[MongoDatabasesClientListByRootScopeResponse]{ More: func(page MongoDatabasesClientListByRootScopeResponse) bool { @@ -238,7 +243,7 @@ func (client *MongoDatabasesClient) NewListByRootScopePager(options *MongoDataba if err != nil { return MongoDatabasesClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientListByRootScopeResponse{}, err } @@ -254,7 +259,7 @@ func (client *MongoDatabasesClient) NewListByRootScopePager(options *MongoDataba func (client *MongoDatabasesClient) listByRootScopeCreateRequest(ctx context.Context, options *MongoDatabasesClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/mongoDatabases" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -276,23 +281,27 @@ func (client *MongoDatabasesClient) listByRootScopeHandleResponse(resp *http.Res // ListSecrets - Lists secrets values for the specified MongoDatabase resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// mongoDatabaseName - The name of the MongoDatabase link resource -// options - MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets -// method. +// - mongoDatabaseName - The name of the MongoDatabase link resource +// - options - MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets +// method. func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientListSecretsOptions) (MongoDatabasesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, mongoDatabaseName, options) if err != nil { return MongoDatabasesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MongoDatabasesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDatabasesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MongoDatabasesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -303,7 +312,7 @@ func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context return nil, errors.New("parameter mongoDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go index 015d4b59bd..8954f5730b 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -12,8 +11,6 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,35 +19,27 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &OperationsClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // NewListPager - List the operations for the provider +// // Generated from API version 2022-03-15-privatepreview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -67,7 +56,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption if err != nil { return OperationsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } @@ -82,7 +71,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption // listCreateRequest creates the List request. func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Applications.Link/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go new file mode 100644 index 0000000000..3c131dadda --- /dev/null +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go @@ -0,0 +1,216 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete method. +type DaprPubSubBrokerClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate +// method. +type DaprPubSubBrokerClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. +type DaprPubSubBrokerClientGetOptions struct { + // placeholder for future optional parameters +} + +// DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.NewListByRootScopePager +// method. +type DaprPubSubBrokerClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate +// method. +type DaprSecretStoreClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. +type DaprSecretStoreClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. +type DaprSecretStoreClientGetOptions struct { + // placeholder for future optional parameters +} + +// DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.NewListByRootScopePager +// method. +type DaprSecretStoreClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete method. +type DaprStateStoreClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate +// method. +type DaprStateStoreClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. +type DaprStateStoreClientGetOptions struct { + // placeholder for future optional parameters +} + +// DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.NewListByRootScopePager +// method. +type DaprStateStoreClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate method. +type ExtendersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. +type ExtendersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. +type ExtendersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.NewListByRootScopePager +// method. +type ExtendersClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. +type ExtendersClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete method. +type MongoDatabasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate +// method. +type MongoDatabasesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. +type MongoDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.NewListByRootScopePager +// method. +type MongoDatabasesClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets method. +type MongoDatabasesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqMessageQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqMessageQueuesClient.CreateOrUpdate +// method. +type RabbitMqMessageQueuesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqMessageQueuesClientDeleteOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Delete method. +type RabbitMqMessageQueuesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqMessageQueuesClientGetOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Get method. +type RabbitMqMessageQueuesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqMessageQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqMessageQueuesClient.NewListByRootScopePager +// method. +type RabbitMqMessageQueuesClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqMessageQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListSecrets +// method. +type RabbitMqMessageQueuesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate method. +type RedisCachesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. +type RedisCachesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. +type RedisCachesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.NewListByRootScopePager +// method. +type RedisCachesClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. +type RedisCachesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate method. +type SQLDatabasesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. +type SQLDatabasesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. +type SQLDatabasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.NewListByRootScopePager +// method. +type SQLDatabasesClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets method. +type SQLDatabasesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go index 00ff5aa150..46ad8fb156 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // RabbitMqMessageQueuesClient contains the methods for the RabbitMqMessageQueues group. // Don't use this type directly, use NewRabbitMqMessageQueuesClient() instead. type RabbitMqMessageQueuesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewRabbitMqMessageQueuesClient creates a new instance of RabbitMqMessageQueuesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRabbitMqMessageQueuesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RabbitMqMessageQueuesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".RabbitMqMessageQueuesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &RabbitMqMessageQueuesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a RabbitMQMessageQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// resource - Resource create parameters. -// options - RabbitMqMessageQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqMessageQueuesClient.CreateOrUpdate -// method. +// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource +// - resource - Resource create parameters. +// - options - RabbitMqMessageQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqMessageQueuesClient.CreateOrUpdate +// method. func (client *RabbitMqMessageQueuesClient) CreateOrUpdate(ctx context.Context, rabbitMQMessageQueueName string, resource RabbitMQMessageQueueResource, options *RabbitMqMessageQueuesClientCreateOrUpdateOptions) (RabbitMqMessageQueuesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, rabbitMQMessageQueueName, resource, options) if err != nil { return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *RabbitMqMessageQueuesClient) createOrUpdateCreateRequest(ctx conte return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *RabbitMqMessageQueuesClient) createOrUpdateCreateRequest(ctx conte reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,23 +110,27 @@ func (client *RabbitMqMessageQueuesClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes an existing RabbitMQMessageQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// options - RabbitMqMessageQueuesClientDeleteOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Delete -// method. +// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource +// - options - RabbitMqMessageQueuesClientDeleteOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Delete +// method. func (client *RabbitMqMessageQueuesClient) Delete(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientDeleteOptions) (RabbitMqMessageQueuesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, rabbitMQMessageQueueName, options) if err != nil { return RabbitMqMessageQueuesClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqMessageQueuesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return RabbitMqMessageQueuesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return RabbitMqMessageQueuesClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -142,7 +141,7 @@ func (client *RabbitMqMessageQueuesClient) deleteCreateRequest(ctx context.Conte return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -169,23 +168,27 @@ func (client *RabbitMqMessageQueuesClient) deleteHandleResponse(resp *http.Respo // Get - Retrieves information about a RabbitMQMessageQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// options - RabbitMqMessageQueuesClientGetOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Get -// method. +// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource +// - options - RabbitMqMessageQueuesClientGetOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Get +// method. func (client *RabbitMqMessageQueuesClient) Get(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientGetOptions) (RabbitMqMessageQueuesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, rabbitMQMessageQueueName, options) if err != nil { return RabbitMqMessageQueuesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqMessageQueuesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RabbitMqMessageQueuesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RabbitMqMessageQueuesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -196,7 +199,7 @@ func (client *RabbitMqMessageQueuesClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -217,9 +220,10 @@ func (client *RabbitMqMessageQueuesClient) getHandleResponse(resp *http.Response } // NewListByRootScopePager - Lists information about all RabbitMQMessageQueueResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - RabbitMqMessageQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListByRootScope -// method. +// - options - RabbitMqMessageQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqMessageQueuesClient.NewListByRootScopePager +// method. func (client *RabbitMqMessageQueuesClient) NewListByRootScopePager(options *RabbitMqMessageQueuesClientListByRootScopeOptions) (*runtime.Pager[RabbitMqMessageQueuesClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[RabbitMqMessageQueuesClientListByRootScopeResponse]{ More: func(page RabbitMqMessageQueuesClientListByRootScopeResponse) bool { @@ -236,7 +240,7 @@ func (client *RabbitMqMessageQueuesClient) NewListByRootScopePager(options *Rabb if err != nil { return RabbitMqMessageQueuesClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqMessageQueuesClientListByRootScopeResponse{}, err } @@ -252,7 +256,7 @@ func (client *RabbitMqMessageQueuesClient) NewListByRootScopePager(options *Rabb func (client *RabbitMqMessageQueuesClient) listByRootScopeCreateRequest(ctx context.Context, options *RabbitMqMessageQueuesClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -274,23 +278,27 @@ func (client *RabbitMqMessageQueuesClient) listByRootScopeHandleResponse(resp *h // ListSecrets - Lists secrets values for the specified RabbitMQMessageQueue resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// options - RabbitMqMessageQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListSecrets -// method. +// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource +// - options - RabbitMqMessageQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListSecrets +// method. func (client *RabbitMqMessageQueuesClient) ListSecrets(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientListSecretsOptions) (RabbitMqMessageQueuesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, rabbitMQMessageQueueName, options) if err != nil { return RabbitMqMessageQueuesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqMessageQueuesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RabbitMqMessageQueuesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RabbitMqMessageQueuesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -301,7 +309,7 @@ func (client *RabbitMqMessageQueuesClient) listSecretsCreateRequest(ctx context. return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go index 8f4785fe13..ce1861a050 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // RedisCachesClient contains the methods for the RedisCaches group. // Don't use this type directly, use NewRedisCachesClient() instead. type RedisCachesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewRedisCachesClient creates a new instance of RedisCachesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRedisCachesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RedisCachesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".RedisCachesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &RedisCachesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache link resource -// resource - Resource create parameters. -// options - RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate -// method. +// - redisCacheName - The name of the RedisCache link resource +// - resource - Resource create parameters. +// - options - RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate +// method. func (client *RedisCachesClient) CreateOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientCreateOrUpdateOptions) (RedisCachesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, redisCacheName, resource, options) if err != nil { return RedisCachesClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return RedisCachesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return RedisCachesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,22 +110,26 @@ func (client *RedisCachesClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes an existing RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache link resource -// options - RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. +// - redisCacheName - The name of the RedisCache link resource +// - options - RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. func (client *RedisCachesClient) Delete(ctx context.Context, redisCacheName string, options *RedisCachesClientDeleteOptions) (RedisCachesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, redisCacheName, options) if err != nil { return RedisCachesClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return RedisCachesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return RedisCachesClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -141,7 +140,7 @@ func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisC return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -168,22 +167,26 @@ func (client *RedisCachesClient) deleteHandleResponse(resp *http.Response) (Redi // Get - Retrieves information about a RedisCacheResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache link resource -// options - RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. +// - redisCacheName - The name of the RedisCache link resource +// - options - RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. func (client *RedisCachesClient) Get(ctx context.Context, redisCacheName string, options *RedisCachesClientGetOptions) (RedisCachesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, redisCacheName, options) if err != nil { return RedisCachesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RedisCachesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RedisCachesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -194,7 +197,7 @@ func (client *RedisCachesClient) getCreateRequest(ctx context.Context, redisCach return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -215,9 +218,10 @@ func (client *RedisCachesClient) getHandleResponse(resp *http.Response) (RedisCa } // NewListByRootScopePager - Lists information about all RedisCacheResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.ListByRootScope -// method. +// - options - RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.NewListByRootScopePager +// method. func (client *RedisCachesClient) NewListByRootScopePager(options *RedisCachesClientListByRootScopeOptions) (*runtime.Pager[RedisCachesClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[RedisCachesClientListByRootScopeResponse]{ More: func(page RedisCachesClientListByRootScopeResponse) bool { @@ -234,7 +238,7 @@ func (client *RedisCachesClient) NewListByRootScopePager(options *RedisCachesCli if err != nil { return RedisCachesClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientListByRootScopeResponse{}, err } @@ -250,7 +254,7 @@ func (client *RedisCachesClient) NewListByRootScopePager(options *RedisCachesCli func (client *RedisCachesClient) listByRootScopeCreateRequest(ctx context.Context, options *RedisCachesClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/redisCaches" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -272,22 +276,26 @@ func (client *RedisCachesClient) listByRootScopeHandleResponse(resp *http.Respon // ListSecrets - Lists secrets values for the specified RedisCache resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// redisCacheName - The name of the RedisCache link resource -// options - RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. +// - redisCacheName - The name of the RedisCache link resource +// - options - RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName string, options *RedisCachesClientListSecretsOptions) (RedisCachesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, redisCacheName, options) if err != nil { return RedisCachesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RedisCachesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RedisCachesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RedisCachesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -298,7 +306,7 @@ func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, r return nil, errors.New("parameter redisCacheName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go index 85821cf6f9..b37d36fcf0 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -2,37 +2,42 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview // DaprPubSubBrokerClientCreateOrUpdateResponse contains the response from method DaprPubSubBrokerClient.CreateOrUpdate. type DaprPubSubBrokerClientCreateOrUpdateResponse struct { + // DaprPubSubBroker link DaprPubSubBrokerResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } -// DaprPubSubBrokerClientDeleteResponse contains the response from method DaprPubSubBrokerClient.Delete. +// DaprPubSubBrokerClientDeleteResponse contains the response from method DaprPubSubBrokerClient.BeginDelete. type DaprPubSubBrokerClientDeleteResponse struct { // placeholder for future response values } // DaprPubSubBrokerClientGetResponse contains the response from method DaprPubSubBrokerClient.Get. type DaprPubSubBrokerClientGetResponse struct { + // DaprPubSubBroker link DaprPubSubBrokerResource } -// DaprPubSubBrokerClientListByRootScopeResponse contains the response from method DaprPubSubBrokerClient.ListByRootScope. +// DaprPubSubBrokerClientListByRootScopeResponse contains the response from method DaprPubSubBrokerClient.NewListByRootScopePager. type DaprPubSubBrokerClientListByRootScopeResponse struct { + // The response of a DaprPubSubBrokerResource list operation. DaprPubSubBrokerResourceListResult } // DaprSecretStoreClientCreateOrUpdateResponse contains the response from method DaprSecretStoreClient.CreateOrUpdate. type DaprSecretStoreClientCreateOrUpdateResponse struct { + // DaprSecretStore link DaprSecretStoreResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -45,38 +50,45 @@ type DaprSecretStoreClientDeleteResponse struct { // DaprSecretStoreClientGetResponse contains the response from method DaprSecretStoreClient.Get. type DaprSecretStoreClientGetResponse struct { + // DaprSecretStore link DaprSecretStoreResource } -// DaprSecretStoreClientListByRootScopeResponse contains the response from method DaprSecretStoreClient.ListByRootScope. +// DaprSecretStoreClientListByRootScopeResponse contains the response from method DaprSecretStoreClient.NewListByRootScopePager. type DaprSecretStoreClientListByRootScopeResponse struct { + // The response of a DaprSecretStoreResource list operation. DaprSecretStoreResourceListResult } // DaprStateStoreClientCreateOrUpdateResponse contains the response from method DaprStateStoreClient.CreateOrUpdate. type DaprStateStoreClientCreateOrUpdateResponse struct { + // DaprStateStore link DaprStateStoreResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } -// DaprStateStoreClientDeleteResponse contains the response from method DaprStateStoreClient.Delete. +// DaprStateStoreClientDeleteResponse contains the response from method DaprStateStoreClient.BeginDelete. type DaprStateStoreClientDeleteResponse struct { // placeholder for future response values } // DaprStateStoreClientGetResponse contains the response from method DaprStateStoreClient.Get. type DaprStateStoreClientGetResponse struct { + // DaprStateStore link DaprStateStoreResource } -// DaprStateStoreClientListByRootScopeResponse contains the response from method DaprStateStoreClient.ListByRootScope. +// DaprStateStoreClientListByRootScopeResponse contains the response from method DaprStateStoreClient.NewListByRootScopePager. type DaprStateStoreClientListByRootScopeResponse struct { + // The response of a DaprStateStoreResource list operation. DaprStateStoreResourceListResult } // ExtendersClientCreateOrUpdateResponse contains the response from method ExtendersClient.CreateOrUpdate. type ExtendersClientCreateOrUpdateResponse struct { + // Extender link ExtenderResource } @@ -87,55 +99,65 @@ type ExtendersClientDeleteResponse struct { // ExtendersClientGetResponse contains the response from method ExtendersClient.Get. type ExtendersClientGetResponse struct { + // Extender link ExtenderResource } -// ExtendersClientListByRootScopeResponse contains the response from method ExtendersClient.ListByRootScope. +// ExtendersClientListByRootScopeResponse contains the response from method ExtendersClient.NewListByRootScopePager. type ExtendersClientListByRootScopeResponse struct { + // Object that includes an array of Extender and a possible link for next set ExtenderList } // ExtendersClientListSecretsResponse contains the response from method ExtendersClient.ListSecrets. type ExtendersClientListSecretsResponse struct { // The secret values for the given Extender resource - Value map[string]interface{} + Value map[string]any } // MongoDatabasesClientCreateOrUpdateResponse contains the response from method MongoDatabasesClient.CreateOrUpdate. type MongoDatabasesClientCreateOrUpdateResponse struct { + // MongoDatabase link MongoDatabaseResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } -// MongoDatabasesClientDeleteResponse contains the response from method MongoDatabasesClient.Delete. +// MongoDatabasesClientDeleteResponse contains the response from method MongoDatabasesClient.BeginDelete. type MongoDatabasesClientDeleteResponse struct { // placeholder for future response values } // MongoDatabasesClientGetResponse contains the response from method MongoDatabasesClient.Get. type MongoDatabasesClientGetResponse struct { + // MongoDatabase link MongoDatabaseResource } -// MongoDatabasesClientListByRootScopeResponse contains the response from method MongoDatabasesClient.ListByRootScope. +// MongoDatabasesClientListByRootScopeResponse contains the response from method MongoDatabasesClient.NewListByRootScopePager. type MongoDatabasesClientListByRootScopeResponse struct { + // The response of a MongoDatabaseResource list operation. MongoDatabaseResourceListResult } // MongoDatabasesClientListSecretsResponse contains the response from method MongoDatabasesClient.ListSecrets. type MongoDatabasesClientListSecretsResponse struct { + // The secret values for the given MongoDatabase resource MongoDatabaseListSecretsResult } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } // RabbitMqMessageQueuesClientCreateOrUpdateResponse contains the response from method RabbitMqMessageQueuesClient.CreateOrUpdate. type RabbitMqMessageQueuesClientCreateOrUpdateResponse struct { + // RabbitMQMessageQueue link RabbitMQMessageQueueResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -148,22 +170,27 @@ type RabbitMqMessageQueuesClientDeleteResponse struct { // RabbitMqMessageQueuesClientGetResponse contains the response from method RabbitMqMessageQueuesClient.Get. type RabbitMqMessageQueuesClientGetResponse struct { + // RabbitMQMessageQueue link RabbitMQMessageQueueResource } -// RabbitMqMessageQueuesClientListByRootScopeResponse contains the response from method RabbitMqMessageQueuesClient.ListByRootScope. +// RabbitMqMessageQueuesClientListByRootScopeResponse contains the response from method RabbitMqMessageQueuesClient.NewListByRootScopePager. type RabbitMqMessageQueuesClientListByRootScopeResponse struct { + // The response of a RabbitMQMessageQueueResource list operation. RabbitMQMessageQueueResourceListResult } // RabbitMqMessageQueuesClientListSecretsResponse contains the response from method RabbitMqMessageQueuesClient.ListSecrets. type RabbitMqMessageQueuesClientListSecretsResponse struct { + // The secret values for the given RabbitMQMessageQueue resource RabbitMQListSecretsResult } // RedisCachesClientCreateOrUpdateResponse contains the response from method RedisCachesClient.CreateOrUpdate. type RedisCachesClientCreateOrUpdateResponse struct { + // RedisCache link RedisCacheResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -176,22 +203,27 @@ type RedisCachesClientDeleteResponse struct { // RedisCachesClientGetResponse contains the response from method RedisCachesClient.Get. type RedisCachesClientGetResponse struct { + // RedisCache link RedisCacheResource } -// RedisCachesClientListByRootScopeResponse contains the response from method RedisCachesClient.ListByRootScope. +// RedisCachesClientListByRootScopeResponse contains the response from method RedisCachesClient.NewListByRootScopePager. type RedisCachesClientListByRootScopeResponse struct { + // The response of a RedisCacheResource list operation. RedisCacheResourceListResult } // RedisCachesClientListSecretsResponse contains the response from method RedisCachesClient.ListSecrets. type RedisCachesClientListSecretsResponse struct { + // The secret values for the given RedisCache resource RedisCacheListSecretsResult } // SQLDatabasesClientCreateOrUpdateResponse contains the response from method SQLDatabasesClient.CreateOrUpdate. type SQLDatabasesClientCreateOrUpdateResponse struct { + // SqlDatabase link SQLDatabaseResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -204,16 +236,19 @@ type SQLDatabasesClientDeleteResponse struct { // SQLDatabasesClientGetResponse contains the response from method SQLDatabasesClient.Get. type SQLDatabasesClientGetResponse struct { + // SqlDatabase link SQLDatabaseResource } -// SQLDatabasesClientListByRootScopeResponse contains the response from method SQLDatabasesClient.ListByRootScope. +// SQLDatabasesClientListByRootScopeResponse contains the response from method SQLDatabasesClient.NewListByRootScopePager. type SQLDatabasesClientListByRootScopeResponse struct { + // The response of a SqlDatabaseResource list operation. SQLDatabaseResourceListResult } // SQLDatabasesClientListSecretsResponse contains the response from method SQLDatabasesClient.ListSecrets. type SQLDatabasesClientListSecretsResponse struct { + // The secret values for the given SqlDatabase resource SQLDatabaseListSecretsResult } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go index d69b970ac4..7a4b38e117 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,55 +23,50 @@ import ( // SQLDatabasesClient contains the methods for the SQLDatabases group. // Don't use this type directly, use NewSQLDatabasesClient() instead. type SQLDatabasesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewSQLDatabasesClient creates a new instance of SQLDatabasesClient with the specified values. -// rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSQLDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLDatabasesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".SQLDatabasesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &SQLDatabasesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase link resource -// resource - Resource create parameters. -// options - SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate -// method. +// - sqlDatabaseName - The name of the SqlDatabase link resource +// - resource - Resource create parameters. +// - options - SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate +// method. func (client *SQLDatabasesClient) CreateOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientCreateOrUpdateOptions) (SQLDatabasesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, sqlDatabaseName, resource, options) if err != nil { return SQLDatabasesClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SQLDatabasesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SQLDatabasesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -85,7 +77,7 @@ func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -93,7 +85,10 @@ func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,22 +110,26 @@ func (client *SQLDatabasesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes an existing SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase link resource -// options - SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. +// - sqlDatabaseName - The name of the SqlDatabase link resource +// - options - SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. func (client *SQLDatabasesClient) Delete(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientDeleteOptions) (SQLDatabasesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, sqlDatabaseName, options) if err != nil { return SQLDatabasesClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return SQLDatabasesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SQLDatabasesClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -141,7 +140,7 @@ func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDa return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -168,22 +167,26 @@ func (client *SQLDatabasesClient) deleteHandleResponse(resp *http.Response) (SQL // Get - Retrieves information about a SqlDatabaseResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase link resource -// options - SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. +// - sqlDatabaseName - The name of the SqlDatabase link resource +// - options - SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. func (client *SQLDatabasesClient) Get(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientGetOptions) (SQLDatabasesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, sqlDatabaseName, options) if err != nil { return SQLDatabasesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLDatabasesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLDatabasesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -194,7 +197,7 @@ func (client *SQLDatabasesClient) getCreateRequest(ctx context.Context, sqlDatab return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -215,9 +218,10 @@ func (client *SQLDatabasesClient) getHandleResponse(resp *http.Response) (SQLDat } // NewListByRootScopePager - Lists information about all SqlDatabaseResources in the given root scope +// // Generated from API version 2022-03-15-privatepreview -// options - SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.ListByRootScope -// method. +// - options - SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.NewListByRootScopePager +// method. func (client *SQLDatabasesClient) NewListByRootScopePager(options *SQLDatabasesClientListByRootScopeOptions) (*runtime.Pager[SQLDatabasesClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[SQLDatabasesClientListByRootScopeResponse]{ More: func(page SQLDatabasesClientListByRootScopeResponse) bool { @@ -234,7 +238,7 @@ func (client *SQLDatabasesClient) NewListByRootScopePager(options *SQLDatabasesC if err != nil { return SQLDatabasesClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientListByRootScopeResponse{}, err } @@ -250,7 +254,7 @@ func (client *SQLDatabasesClient) NewListByRootScopePager(options *SQLDatabasesC func (client *SQLDatabasesClient) listByRootScopeCreateRequest(ctx context.Context, options *SQLDatabasesClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Link/sqlDatabases" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -272,23 +276,27 @@ func (client *SQLDatabasesClient) listByRootScopeHandleResponse(resp *http.Respo // ListSecrets - Lists secrets values for the specified SqlDatabase resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// sqlDatabaseName - The name of the SqlDatabase link resource -// options - SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets -// method. +// - sqlDatabaseName - The name of the SqlDatabase link resource +// - options - SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets +// method. func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientListSecretsOptions) (SQLDatabasesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, sqlDatabaseName, options) if err != nil { return SQLDatabasesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLDatabasesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLDatabasesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLDatabasesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -299,7 +307,7 @@ func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, return nil, errors.New("parameter sqlDatabaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index cea28fe8b6..30ea6fa1d0 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -66,7 +65,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/pkg/messagingrp/api/README.md b/pkg/messagingrp/api/README.md index 263318771a..5f850ef4b6 100644 --- a/pkg/messagingrp/api/README.md +++ b/pkg/messagingrp/api/README.md @@ -44,7 +44,7 @@ The following configuration generates track2 go models and client. ```yaml $(tag) != '' version: 3.*.* -use: "@autorest/go@4.0.0-preview.44" +use: "@autorest/go@4.0.0-preview.55" module-version: 0.0.1 file-prefix: zz_generated_ license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_client_factory.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_client_factory.go new file mode 100644 index 0000000000..d1e4153def --- /dev/null +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_client_factory.go @@ -0,0 +1,50 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + rootScope string + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + rootScope: rootScope, credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRabbitMqQueuesClient() *RabbitMqQueuesClient { + subClient, _ := NewRabbitMqQueuesClient(c.rootScope, c.credential, c.options) + return subClient +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go index b6c5e512d4..870ca85337 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_constants.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_interfaces.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_interfaces.go new file mode 100644 index 0000000000..104e8355bd --- /dev/null +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_interfaces.go @@ -0,0 +1,18 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// EnvironmentComputeClassification provides polymorphic access to related types. +// Call the interface's GetEnvironmentCompute() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *EnvironmentCompute, *KubernetesCompute +type EnvironmentComputeClassification interface { + // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. + GetEnvironmentCompute() *EnvironmentCompute +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go index 0f414bc068..58a8cd4afb 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models.go @@ -2,33 +2,23 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview import "time" -// EnvironmentComputeClassification provides polymorphic access to related types. -// Call the interface's GetEnvironmentCompute() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *EnvironmentCompute, *KubernetesCompute -type EnvironmentComputeClassification interface { - // GetEnvironmentCompute returns the EnvironmentCompute content of the underlying type. - GetEnvironmentCompute() *EnvironmentCompute -} - // EnvironmentCompute - Represents backing compute resource type EnvironmentCompute struct { // REQUIRED; Discriminator property for EnvironmentCompute. - Kind *string `json:"kind,omitempty"` + Kind *string // Configuration for supported external identity providers - Identity *IdentitySettings `json:"identity,omitempty"` + Identity *IdentitySettings // The resource id of the compute resource for application environment. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type EnvironmentCompute. @@ -37,409 +27,370 @@ func (e *EnvironmentCompute) GetEnvironmentCompute() *EnvironmentCompute { retur // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info map[string]any // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ErrorDetail - The error detail. type ErrorDetail struct { // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + Details []*ErrorDetail // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { // The error object. - Error *ErrorDetail `json:"error,omitempty"` + Error *ErrorDetail } // IdentitySettings is the external identity setting. type IdentitySettings struct { // REQUIRED; kind of identity setting - Kind *IdentitySettingKind `json:"kind,omitempty"` + Kind *IdentitySettingKind // The URI for your compute platform's OIDC issuer - OidcIssuer *string `json:"oidcIssuer,omitempty"` + OidcIssuer *string // The resource ID of the provisioned identity - Resource *string `json:"resource,omitempty"` + Resource *string } // KubernetesCompute - The Kubernetes compute configuration type KubernetesCompute struct { // REQUIRED; Discriminator property for EnvironmentCompute. - Kind *string `json:"kind,omitempty"` + Kind *string // REQUIRED; The namespace to use for the environment. - Namespace *string `json:"namespace,omitempty"` + Namespace *string // Configuration for supported external identity providers - Identity *IdentitySettings `json:"identity,omitempty"` + Identity *IdentitySettings // The resource id of the compute resource for application environment. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string } // GetEnvironmentCompute implements the EnvironmentComputeClassification interface for type KubernetesCompute. func (k *KubernetesCompute) GetEnvironmentCompute() *EnvironmentCompute { return &EnvironmentCompute{ + Identity: k.Identity, Kind: k.Kind, ResourceID: k.ResourceID, - Identity: k.Identity, } } // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + ActionType *ActionType // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane // operations. - IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", // "Microsoft.Compute/virtualMachines/capture/action" - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" - Origin *Origin `json:"origin,omitempty" azure:"ro"` + Origin *Origin } // OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual // Machine", "Restart Virtual Machine". - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft // Compute". - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job // Schedule Collections". - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to // get the next set of results. type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; List of operations supported by the resource provider - Value []*Operation `json:"value,omitempty" azure:"ro"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters + Value []*Operation } // OutputResource - Properties of an output resource. type OutputResource struct { // The UCP resource ID of the underlying resource. - ID *string `json:"id,omitempty"` + ID *string // The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency // relationship. LocalIDs do not have any particular format or meaning beyond // being compared to determine dependency relationships. - LocalID *string `json:"localId,omitempty"` + LocalID *string // Determines whether Radius manages the lifecycle of the underlying resource. - RadiusManaged *bool `json:"radiusManaged,omitempty"` + RadiusManaged *bool } // RabbitMQListSecretsResult - The secret values for the given RabbitMQQueue resource type RabbitMQListSecretsResult struct { // The password used to connect to the RabbitMQ instance - Password *string `json:"password,omitempty"` + Password *string // The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. // Can be overridden with a custom value - URI *string `json:"uri,omitempty"` + URI *string } // RabbitMQQueueProperties - RabbitMQQueue portable resource properties type RabbitMQQueueProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // The hostname of the RabbitMQ instance - Host *string `json:"host,omitempty"` + Host *string // The port of the RabbitMQ instance. Defaults to 5672 - Port *int32 `json:"port,omitempty"` + Port *int32 // The name of the queue - Queue *string `json:"queue,omitempty"` + Queue *string // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *Recipe `json:"recipe,omitempty"` + Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the rabbitMQ resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // The secrets to connect to the RabbitMQ instance - Secrets *RabbitMQSecrets `json:"secrets,omitempty"` + Secrets *RabbitMQSecrets // Specifies whether to use SSL when connecting to the RabbitMQ instance - TLS *bool `json:"tls,omitempty"` + TLS *bool // The username to use when connecting to the RabbitMQ instance - Username *string `json:"username,omitempty"` + Username *string // The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. - VHost *string `json:"vHost,omitempty"` + VHost *string // READ-ONLY; The status of the asynchronous operation. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; Status of a resource. - Status *ResourceStatus `json:"status,omitempty" azure:"ro"` + Status *ResourceStatus } // RabbitMQQueueResource - RabbitMQQueue portable resource type RabbitMQQueueResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *RabbitMQQueueProperties `json:"properties,omitempty"` + Properties *RabbitMQQueueProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RabbitMQQueueResourceListResult - The response of a RabbitMQQueueResource list operation. type RabbitMQQueueResourceListResult struct { // REQUIRED; The RabbitMQQueueResource items on this page - Value []*RabbitMQQueueResource `json:"value,omitempty"` + Value []*RabbitMQQueueResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // RabbitMQQueueResourceUpdate - The type used for update operations of the RabbitMQQueueResource. type RabbitMQQueueResourceUpdate struct { // The updatable properties of the RabbitMQQueueResource. - Properties *RabbitMQQueueResourceUpdateProperties `json:"properties,omitempty"` + Properties *RabbitMQQueueResourceUpdateProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // RabbitMQQueueResourceUpdateProperties - The updatable properties of the RabbitMQQueueResource. type RabbitMQQueueResourceUpdateProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) - Application *string `json:"application,omitempty"` + Application *string // Fully qualified resource ID for the environment that the portable resource is linked to - Environment *string `json:"environment,omitempty"` + Environment *string // The hostname of the RabbitMQ instance - Host *string `json:"host,omitempty"` + Host *string // The port of the RabbitMQ instance. Defaults to 5672 - Port *int32 `json:"port,omitempty"` + Port *int32 // The name of the queue - Queue *string `json:"queue,omitempty"` + Queue *string // The recipe used to automatically deploy underlying infrastructure for the resource - Recipe *RecipeUpdate `json:"recipe,omitempty"` + Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning *ResourceProvisioning // List of the resource IDs that support the rabbitMQ resource - Resources []*ResourceReference `json:"resources,omitempty"` + Resources []*ResourceReference // The secrets to connect to the RabbitMQ instance - Secrets *RabbitMQSecrets `json:"secrets,omitempty"` + Secrets *RabbitMQSecrets // Specifies whether to use SSL when connecting to the RabbitMQ instance - TLS *bool `json:"tls,omitempty"` + TLS *bool // The username to use when connecting to the RabbitMQ instance - Username *string `json:"username,omitempty"` + Username *string // The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. - VHost *string `json:"vHost,omitempty"` + VHost *string } // RabbitMQSecrets - The connection secrets properties to the RabbitMQ instance type RabbitMQSecrets struct { // The password used to connect to the RabbitMQ instance - Password *string `json:"password,omitempty"` + Password *string // The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. // Can be overridden with a custom value - URI *string `json:"uri,omitempty"` -} - -// RabbitMqQueuesClientBeginCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginCreateOrUpdate -// method. -type RabbitMqQueuesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RabbitMqQueuesClientBeginDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.BeginDelete method. -type RabbitMqQueuesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RabbitMqQueuesClientBeginUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginUpdate method. -type RabbitMqQueuesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RabbitMqQueuesClientGetOptions contains the optional parameters for the RabbitMqQueuesClient.Get method. -type RabbitMqQueuesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqQueuesClientListByScopeOptions contains the optional parameters for the RabbitMqQueuesClient.ListByScope method. -type RabbitMqQueuesClientListByScopeOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqQueuesClient.ListSecrets method. -type RabbitMqQueuesClientListSecretsOptions struct { - // placeholder for future optional parameters + URI *string } // Recipe - The recipe used to automatically deploy underlying infrastructure for a portable resource type Recipe struct { // REQUIRED; The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // RecipeUpdate - The recipe used to automatically deploy underlying infrastructure for a portable resource type RecipeUpdate struct { // The name of the recipe within the environment to use - Name *string `json:"name,omitempty"` + Name *string // Key/value parameters to pass into the recipe at deployment - Parameters map[string]interface{} `json:"parameters,omitempty"` + Parameters map[string]any } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceReference - Describes a reference to an existing resource type ResourceReference struct { // REQUIRED; Resource id of an existing resource - ID *string `json:"id,omitempty"` + ID *string } // ResourceStatus - Status of a resource. type ResourceStatus struct { // The compute resource associated with the resource. - Compute EnvironmentComputeClassification `json:"compute,omitempty"` + Compute EnvironmentComputeClassification // Properties of an output resource - OutputResources []*OutputResource `json:"outputResources,omitempty"` + OutputResources []*OutputResource } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go index 292d76a42b..f3bb6ae9f5 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -17,7 +16,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type EnvironmentCompute. func (e EnvironmentCompute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", e.Identity) objectMap["kind"] = e.Kind populate(objectMap, "resourceId", e.ResourceID) @@ -35,13 +34,13 @@ func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { switch key { case "identity": err = unpopulate(val, "Identity", &e.Identity) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &e.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &e.ResourceID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -52,7 +51,7 @@ func (e *EnvironmentCompute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -69,10 +68,10 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { switch key { case "info": err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -83,7 +82,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -103,19 +102,19 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) + delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) + delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -126,7 +125,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -142,7 +141,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { switch key { case "error": err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -153,7 +152,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IdentitySettings. func (i IdentitySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "kind", i.Kind) populate(objectMap, "oidcIssuer", i.OidcIssuer) populate(objectMap, "resource", i.Resource) @@ -171,13 +170,13 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "oidcIssuer": err = unpopulate(val, "OidcIssuer", &i.OidcIssuer) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &i.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -188,7 +187,7 @@ func (i *IdentitySettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type KubernetesCompute. func (k KubernetesCompute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", k.Identity) objectMap["kind"] = "kubernetes" populate(objectMap, "namespace", k.Namespace) @@ -207,16 +206,16 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { switch key { case "identity": err = unpopulate(val, "Identity", &k.Identity) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &k.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "namespace": err = unpopulate(val, "Namespace", &k.Namespace) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &k.ResourceID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) @@ -227,7 +226,7 @@ func (k *KubernetesCompute) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) @@ -247,19 +246,19 @@ func (o *Operation) UnmarshalJSON(data []byte) error { switch key { case "actionType": err = unpopulate(val, "ActionType", &o.ActionType) - delete(rawMsg, key) + delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) + delete(rawMsg, key) case "isDataAction": err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "origin": err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -270,7 +269,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -289,16 +288,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { switch key { case "description": err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) + delete(rawMsg, key) case "operation": err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) + delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) + delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -309,7 +308,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -326,10 +325,10 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -340,7 +339,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OutputResource. func (o OutputResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", o.ID) populate(objectMap, "localId", o.LocalID) populate(objectMap, "radiusManaged", o.RadiusManaged) @@ -358,13 +357,13 @@ func (o *OutputResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "localId": err = unpopulate(val, "LocalID", &o.LocalID) - delete(rawMsg, key) + delete(rawMsg, key) case "radiusManaged": err = unpopulate(val, "RadiusManaged", &o.RadiusManaged) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -375,7 +374,7 @@ func (o *OutputResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQListSecretsResult. func (r RabbitMQListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "password", r.Password) populate(objectMap, "uri", r.URI) return json.Marshal(objectMap) @@ -392,10 +391,10 @@ func (r *RabbitMQListSecretsResult) UnmarshalJSON(data []byte) error { switch key { case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "uri": err = unpopulate(val, "URI", &r.URI) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -406,7 +405,7 @@ func (r *RabbitMQListSecretsResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueProperties. func (r RabbitMQQueueProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", r.Application) populate(objectMap, "environment", r.Environment) populate(objectMap, "host", r.Host) @@ -435,46 +434,46 @@ func (r *RabbitMQQueueProperties) UnmarshalJSON(data []byte) error { switch key { case "application": err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "queue": err = unpopulate(val, "Queue", &r.Queue) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) + delete(rawMsg, key) case "vHost": err = unpopulate(val, "VHost", &r.VHost) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -485,7 +484,7 @@ func (r *RabbitMQQueueProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueResource. func (r RabbitMQQueueResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) @@ -507,25 +506,25 @@ func (r *RabbitMQQueueResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -536,7 +535,7 @@ func (r *RabbitMQQueueResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueResourceListResult. func (r RabbitMQQueueResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -553,10 +552,10 @@ func (r *RabbitMQQueueResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -567,7 +566,7 @@ func (r *RabbitMQQueueResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueResourceUpdate. func (r RabbitMQQueueResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", r.Properties) populate(objectMap, "tags", r.Tags) return json.Marshal(objectMap) @@ -584,10 +583,10 @@ func (r *RabbitMQQueueResourceUpdate) UnmarshalJSON(data []byte) error { switch key { case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -598,7 +597,7 @@ func (r *RabbitMQQueueResourceUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RabbitMQQueueResourceUpdateProperties. func (r RabbitMQQueueResourceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "application", r.Application) populate(objectMap, "environment", r.Environment) populate(objectMap, "host", r.Host) @@ -625,40 +624,40 @@ func (r *RabbitMQQueueResourceUpdateProperties) UnmarshalJSON(data []byte) error switch key { case "application": err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) + delete(rawMsg, key) case "environment": err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) + delete(rawMsg, key) case "host": err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) + delete(rawMsg, key) case "port": err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) + delete(rawMsg, key) case "queue": err = unpopulate(val, "Queue", &r.Queue) - delete(rawMsg, key) + delete(rawMsg, key) case "recipe": err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProvisioning": err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) + delete(rawMsg, key) case "resources": err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) + delete(rawMsg, key) case "tls": err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) + delete(rawMsg, key) case "username": err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) + delete(rawMsg, key) case "vHost": err = unpopulate(val, "VHost", &r.VHost) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -669,7 +668,7 @@ func (r *RabbitMQQueueResourceUpdateProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type RabbitMQSecrets. func (r RabbitMQSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "password", r.Password) populate(objectMap, "uri", r.URI) return json.Marshal(objectMap) @@ -686,10 +685,10 @@ func (r *RabbitMQSecrets) UnmarshalJSON(data []byte) error { switch key { case "password": err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) + delete(rawMsg, key) case "uri": err = unpopulate(val, "URI", &r.URI) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -700,7 +699,7 @@ func (r *RabbitMQSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Recipe. func (r Recipe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -717,10 +716,10 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -731,7 +730,7 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RecipeUpdate. func (r RecipeUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "parameters", r.Parameters) return json.Marshal(objectMap) @@ -748,10 +747,10 @@ func (r *RecipeUpdate) UnmarshalJSON(data []byte) error { switch key { case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -762,7 +761,7 @@ func (r *RecipeUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -781,16 +780,16 @@ func (r *Resource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -801,7 +800,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceReference. func (r ResourceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) return json.Marshal(objectMap) } @@ -817,7 +816,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -828,7 +827,7 @@ func (r *ResourceReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceStatus. func (r ResourceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "compute", r.Compute) populate(objectMap, "outputResources", r.OutputResources) return json.Marshal(objectMap) @@ -844,11 +843,11 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { var err error switch key { case "compute": - r.Compute, err = unmarshalEnvironmentComputeClassification(val) - delete(rawMsg, key) + r.Compute, err = unmarshalEnvironmentComputeClassification(val) + delete(rawMsg, key) case "outputResources": err = unpopulate(val, "OutputResources", &r.OutputResources) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -859,7 +858,7 @@ func (r *ResourceStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -880,22 +879,22 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { switch key { case "createdAt": err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedAt": err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -906,7 +905,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -927,22 +926,22 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -951,7 +950,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -961,7 +960,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go index d7100cd3fe..10aac8e976 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_operations_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -12,8 +11,6 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,35 +19,27 @@ import ( // OperationsClient contains the methods for the Operations group. // Don't use this type directly, use NewOperationsClient() instead. type OperationsClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &OperationsClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // NewListPager - List the operations for the provider +// // Generated from API version 2022-03-15-privatepreview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -67,7 +56,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption if err != nil { return OperationsClientListResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationsClientListResponse{}, err } @@ -82,7 +71,7 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption // listCreateRequest creates the List request. func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Applications.Messaging/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_options.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_options.go new file mode 100644 index 0000000000..105b2c29cf --- /dev/null +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_options.go @@ -0,0 +1,49 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220315privatepreview + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqQueuesClientBeginCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginCreateOrUpdate +// method. +type RabbitMqQueuesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RabbitMqQueuesClientBeginDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.BeginDelete method. +type RabbitMqQueuesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RabbitMqQueuesClientBeginUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginUpdate method. +type RabbitMqQueuesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RabbitMqQueuesClientGetOptions contains the optional parameters for the RabbitMqQueuesClient.Get method. +type RabbitMqQueuesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqQueuesClientListByScopeOptions contains the optional parameters for the RabbitMqQueuesClient.NewListByScopePager +// method. +type RabbitMqQueuesClientListByScopeOptions struct { + // placeholder for future optional parameters +} + +// RabbitMqQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqQueuesClient.ListSecrets method. +type RabbitMqQueuesClientListSecretsOptions struct { + // placeholder for future optional parameters +} + diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go index cba5e61f5a..83f13ff53e 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_polymorphic_helpers.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -14,7 +13,7 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -25,6 +24,9 @@ func unmarshalEnvironmentComputeClassification(rawMsg json.RawMessage) (Environm default: b = &EnvironmentCompute{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go index 785ec94514..3f473894c6 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_rabbitmqqueues_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,74 +22,70 @@ import ( // RabbitMqQueuesClient contains the methods for the RabbitMqQueues group. // Don't use this type directly, use NewRabbitMqQueuesClient() instead. type RabbitMqQueuesClient struct { - host string + internal *arm.Client rootScope string - pl runtime.Pipeline } // NewRabbitMqQueuesClient creates a new instance of RabbitMqQueuesClient with the specified values. -// rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} -// and Azure resource scope is -// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - rootScope - The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} +// and Azure resource scope is +// /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRabbitMqQueuesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RabbitMqQueuesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".RabbitMqQueuesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &RabbitMqQueuesClient{ rootScope: rootScope, - host: ep, -pl: pl, + internal: cl, } return client, nil } // BeginCreateOrUpdate - Create a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource -// resource - Resource create parameters. -// options - RabbitMqQueuesClientBeginCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginCreateOrUpdate -// method. +// - rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// - resource - Resource create parameters. +// - options - RabbitMqQueuesClientBeginCreateOrUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginCreateOrUpdate +// method. func (client *RabbitMqQueuesClient) BeginCreateOrUpdate(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientBeginCreateOrUpdateOptions) (*runtime.Poller[RabbitMqQueuesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, rabbitMQQueueName, resource, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RabbitMqQueuesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RabbitMqQueuesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // CreateOrUpdate - Create a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *RabbitMqQueuesClient) createOrUpdate(ctx context.Context, rabbitMQQueueName string, resource RabbitMQQueueResource, options *RabbitMqQueuesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, rabbitMQQueueName, resource, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -103,7 +96,7 @@ func (client *RabbitMqQueuesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter rabbitMQQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQQueueName}", url.PathEscape(rabbitMQQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -111,45 +104,53 @@ func (client *RabbitMqQueuesClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // BeginDelete - Delete a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource -// options - RabbitMqQueuesClientBeginDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.BeginDelete -// method. +// - rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// - options - RabbitMqQueuesClientBeginDeleteOptions contains the optional parameters for the RabbitMqQueuesClient.BeginDelete +// method. func (client *RabbitMqQueuesClient) BeginDelete(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientBeginDeleteOptions) (*runtime.Poller[RabbitMqQueuesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, rabbitMQQueueName, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RabbitMqQueuesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RabbitMqQueuesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientDeleteResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Delete - Delete a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *RabbitMqQueuesClient) deleteOperation(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, rabbitMQQueueName, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -160,7 +161,7 @@ func (client *RabbitMqQueuesClient) deleteCreateRequest(ctx context.Context, rab return nil, errors.New("parameter rabbitMQQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQQueueName}", url.PathEscape(rabbitMQQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -173,22 +174,26 @@ func (client *RabbitMqQueuesClient) deleteCreateRequest(ctx context.Context, rab // Get - Get a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource -// options - RabbitMqQueuesClientGetOptions contains the optional parameters for the RabbitMqQueuesClient.Get method. +// - rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// - options - RabbitMqQueuesClientGetOptions contains the optional parameters for the RabbitMqQueuesClient.Get method. func (client *RabbitMqQueuesClient) Get(ctx context.Context, rabbitMQQueueName string, options *RabbitMqQueuesClientGetOptions) (RabbitMqQueuesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, rabbitMQQueueName, options) if err != nil { return RabbitMqQueuesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqQueuesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RabbitMqQueuesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RabbitMqQueuesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -199,7 +204,7 @@ func (client *RabbitMqQueuesClient) getCreateRequest(ctx context.Context, rabbit return nil, errors.New("parameter rabbitMQQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQQueueName}", url.PathEscape(rabbitMQQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -220,9 +225,10 @@ func (client *RabbitMqQueuesClient) getHandleResponse(resp *http.Response) (Rabb } // NewListByScopePager - List RabbitMQQueueResource resources by Scope +// // Generated from API version 2022-03-15-privatepreview -// options - RabbitMqQueuesClientListByScopeOptions contains the optional parameters for the RabbitMqQueuesClient.ListByScope -// method. +// - options - RabbitMqQueuesClientListByScopeOptions contains the optional parameters for the RabbitMqQueuesClient.NewListByScopePager +// method. func (client *RabbitMqQueuesClient) NewListByScopePager(options *RabbitMqQueuesClientListByScopeOptions) (*runtime.Pager[RabbitMqQueuesClientListByScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[RabbitMqQueuesClientListByScopeResponse]{ More: func(page RabbitMqQueuesClientListByScopeResponse) bool { @@ -239,7 +245,7 @@ func (client *RabbitMqQueuesClient) NewListByScopePager(options *RabbitMqQueuesC if err != nil { return RabbitMqQueuesClientListByScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqQueuesClientListByScopeResponse{}, err } @@ -255,7 +261,7 @@ func (client *RabbitMqQueuesClient) NewListByScopePager(options *RabbitMqQueuesC func (client *RabbitMqQueuesClient) listByScopeCreateRequest(ctx context.Context, options *RabbitMqQueuesClientListByScopeOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -277,35 +283,39 @@ func (client *RabbitMqQueuesClient) listByScopeHandleResponse(resp *http.Respons // ListSecrets - Lists secrets values for the specified RabbitMQQueue resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource -// body - The content of the action request -// options - RabbitMqQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqQueuesClient.ListSecrets -// method. -func (client *RabbitMqQueuesClient) ListSecrets(ctx context.Context, rabbitMQQueueName string, body map[string]interface{}, options *RabbitMqQueuesClientListSecretsOptions) (RabbitMqQueuesClientListSecretsResponse, error) { +// - rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// - body - The content of the action request +// - options - RabbitMqQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqQueuesClient.ListSecrets +// method. +func (client *RabbitMqQueuesClient) ListSecrets(ctx context.Context, rabbitMQQueueName string, body map[string]any, options *RabbitMqQueuesClientListSecretsOptions) (RabbitMqQueuesClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, rabbitMQQueueName, body, options) if err != nil { return RabbitMqQueuesClientListSecretsResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RabbitMqQueuesClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RabbitMqQueuesClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RabbitMqQueuesClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. -func (client *RabbitMqQueuesClient) listSecretsCreateRequest(ctx context.Context, rabbitMQQueueName string, body map[string]interface{}, options *RabbitMqQueuesClientListSecretsOptions) (*policy.Request, error) { +func (client *RabbitMqQueuesClient) listSecretsCreateRequest(ctx context.Context, rabbitMQQueueName string, body map[string]any, options *RabbitMqQueuesClientListSecretsOptions) (*policy.Request, error) { urlPath := "/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}/listSecrets" urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) if rabbitMQQueueName == "" { return nil, errors.New("parameter rabbitMQQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQQueueName}", url.PathEscape(rabbitMQQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -313,7 +323,10 @@ func (client *RabbitMqQueuesClient) listSecretsCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err +} + return req, nil } // listSecretsHandleResponse handles the ListSecrets response. @@ -327,41 +340,46 @@ func (client *RabbitMqQueuesClient) listSecretsHandleResponse(resp *http.Respons // BeginUpdate - Update a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview -// rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource -// properties - The resource properties to be updated. -// options - RabbitMqQueuesClientBeginUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginUpdate -// method. +// - rabbitMQQueueName - The name of the RabbitMQQueue portable resource resource +// - properties - The resource properties to be updated. +// - options - RabbitMqQueuesClientBeginUpdateOptions contains the optional parameters for the RabbitMqQueuesClient.BeginUpdate +// method. func (client *RabbitMqQueuesClient) BeginUpdate(ctx context.Context, rabbitMQQueueName string, properties RabbitMQQueueResourceUpdate, options *RabbitMqQueuesClientBeginUpdateOptions) (*runtime.Poller[RabbitMqQueuesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, rabbitMQQueueName, properties, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[RabbitMqQueuesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RabbitMqQueuesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { - return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientUpdateResponse](options.ResumeToken, client.pl, nil) + return runtime.NewPollerFromResumeToken[RabbitMqQueuesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } } // Update - Update a RabbitMQQueueResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-15-privatepreview func (client *RabbitMqQueuesClient) update(ctx context.Context, rabbitMQQueueName string, properties RabbitMQQueueResourceUpdate, options *RabbitMqQueuesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, rabbitMQQueueName, properties, options) if err != nil { return nil, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -372,7 +390,7 @@ func (client *RabbitMqQueuesClient) updateCreateRequest(ctx context.Context, rab return nil, errors.New("parameter rabbitMQQueueName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rabbitMQQueueName}", url.PathEscape(rabbitMQQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -380,6 +398,9 @@ func (client *RabbitMqQueuesClient) updateCreateRequest(ctx context.Context, rab reqQP.Set("api-version", "2022-03-15-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil } diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go index 6d9628da03..a9996c7a59 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_response_types.go @@ -2,44 +2,49 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } -// RabbitMqQueuesClientCreateOrUpdateResponse contains the response from method RabbitMqQueuesClient.CreateOrUpdate. +// RabbitMqQueuesClientCreateOrUpdateResponse contains the response from method RabbitMqQueuesClient.BeginCreateOrUpdate. type RabbitMqQueuesClientCreateOrUpdateResponse struct { + // RabbitMQQueue portable resource RabbitMQQueueResource } -// RabbitMqQueuesClientDeleteResponse contains the response from method RabbitMqQueuesClient.Delete. +// RabbitMqQueuesClientDeleteResponse contains the response from method RabbitMqQueuesClient.BeginDelete. type RabbitMqQueuesClientDeleteResponse struct { // placeholder for future response values } // RabbitMqQueuesClientGetResponse contains the response from method RabbitMqQueuesClient.Get. type RabbitMqQueuesClientGetResponse struct { + // RabbitMQQueue portable resource RabbitMQQueueResource } -// RabbitMqQueuesClientListByScopeResponse contains the response from method RabbitMqQueuesClient.ListByScope. +// RabbitMqQueuesClientListByScopeResponse contains the response from method RabbitMqQueuesClient.NewListByScopePager. type RabbitMqQueuesClientListByScopeResponse struct { + // The response of a RabbitMQQueueResource list operation. RabbitMQQueueResourceListResult } // RabbitMqQueuesClientListSecretsResponse contains the response from method RabbitMqQueuesClient.ListSecrets. type RabbitMqQueuesClientListSecretsResponse struct { + // The secret values for the given RabbitMQQueue resource RabbitMQListSecretsResult } -// RabbitMqQueuesClientUpdateResponse contains the response from method RabbitMqQueuesClient.Update. +// RabbitMqQueuesClientUpdateResponse contains the response from method RabbitMqQueuesClient.BeginUpdate. type RabbitMqQueuesClientUpdateResponse struct { + // RabbitMQQueue portable resource RabbitMQQueueResource } diff --git a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go index cea28fe8b6..30ea6fa1d0 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/messagingrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220315privatepreview @@ -66,7 +65,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/pkg/ucp/api/README.md b/pkg/ucp/api/README.md index 1f554f6660..a862f353ad 100644 --- a/pkg/ucp/api/README.md +++ b/pkg/ucp/api/README.md @@ -45,7 +45,7 @@ The following configuration generates track2 go models and client. ```yaml $(tag) != '' version: 3.*.* -use: "@autorest/go@4.0.0-preview.44" +use: "@autorest/go@4.0.0-preview.55" module-version: 0.0.1 file-prefix: zz_generated_ license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go index 27ef27fe17..a29cf4884c 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,53 +23,48 @@ import ( // AwsCredentialClient contains the methods for the AwsCredential group. // Don't use this type directly, use NewAwsCredentialClient() instead. type AwsCredentialClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewAwsCredentialClient creates a new instance of AwsCredentialClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAwsCredentialClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AwsCredentialClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".AwsCredentialClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &AwsCredentialClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a AWSCredentialResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// credentialName - The AWS credential name. -// resource - Resource create parameters. -// options - AwsCredentialClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialClient.CreateOrUpdate -// method. +// - planeName - The name of the plane +// - credentialName - The AWS credential name. +// - resource - Resource create parameters. +// - options - AwsCredentialClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialClient.CreateOrUpdate +// method. func (client *AwsCredentialClient) CreateOrUpdate(ctx context.Context, planeName string, credentialName string, resource AWSCredentialResource, options *AwsCredentialClientCreateOrUpdateOptions) (AwsCredentialClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, planeName, credentialName, resource, options) if err != nil { return AwsCredentialClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AwsCredentialClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AwsCredentialClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -83,7 +75,7 @@ func (client *AwsCredentialClient) createOrUpdateCreateRequest(ctx context.Conte return nil, errors.New("parameter credentialName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -91,7 +83,10 @@ func (client *AwsCredentialClient) createOrUpdateCreateRequest(ctx context.Conte reqQP.Set("api-version", "2022-09-01-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -113,23 +108,27 @@ func (client *AwsCredentialClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes an existing AWSCredentialResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// credentialName - The AWS credential name. -// options - AwsCredentialClientDeleteOptions contains the optional parameters for the AwsCredentialClient.Delete method. +// - planeName - The name of the plane +// - credentialName - The AWS credential name. +// - options - AwsCredentialClientDeleteOptions contains the optional parameters for the AwsCredentialClient.Delete method. func (client *AwsCredentialClient) Delete(ctx context.Context, planeName string, credentialName string, options *AwsCredentialClientDeleteOptions) (AwsCredentialClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, planeName, credentialName, options) if err != nil { return AwsCredentialClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AwsCredentialClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return AwsCredentialClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -140,7 +139,7 @@ func (client *AwsCredentialClient) deleteCreateRequest(ctx context.Context, plan return nil, errors.New("parameter credentialName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -167,23 +166,27 @@ func (client *AwsCredentialClient) deleteHandleResponse(resp *http.Response) (Aw // Get - Retrieves information about a AWSCredentialResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// credentialName - The AWS credential name. -// options - AwsCredentialClientGetOptions contains the optional parameters for the AwsCredentialClient.Get method. +// - planeName - The name of the plane +// - credentialName - The AWS credential name. +// - options - AwsCredentialClientGetOptions contains the optional parameters for the AwsCredentialClient.Get method. func (client *AwsCredentialClient) Get(ctx context.Context, planeName string, credentialName string, options *AwsCredentialClientGetOptions) (AwsCredentialClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, planeName, credentialName, options) if err != nil { return AwsCredentialClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AwsCredentialClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AwsCredentialClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -194,7 +197,7 @@ func (client *AwsCredentialClient) getCreateRequest(ctx context.Context, planeNa return nil, errors.New("parameter credentialName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -215,10 +218,11 @@ func (client *AwsCredentialClient) getHandleResponse(resp *http.Response) (AwsCr } // NewListByRootScopePager - Lists information about all AWSCredentialResource +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// options - AwsCredentialClientListByRootScopeOptions contains the optional parameters for the AwsCredentialClient.ListByRootScope -// method. +// - planeName - The name of the plane +// - options - AwsCredentialClientListByRootScopeOptions contains the optional parameters for the AwsCredentialClient.NewListByRootScopePager +// method. func (client *AwsCredentialClient) NewListByRootScopePager(planeName string, options *AwsCredentialClientListByRootScopeOptions) (*runtime.Pager[AwsCredentialClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[AwsCredentialClientListByRootScopeResponse]{ More: func(page AwsCredentialClientListByRootScopeResponse) bool { @@ -235,7 +239,7 @@ func (client *AwsCredentialClient) NewListByRootScopePager(planeName string, opt if err != nil { return AwsCredentialClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AwsCredentialClientListByRootScopeResponse{}, err } @@ -251,7 +255,7 @@ func (client *AwsCredentialClient) NewListByRootScopePager(planeName string, opt func (client *AwsCredentialClient) listByRootScopeCreateRequest(ctx context.Context, planeName string, options *AwsCredentialClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials" urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go index 4dc395e4d5..0ffa5c2a82 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,53 +23,48 @@ import ( // AzureCredentialClient contains the methods for the AzureCredential group. // Don't use this type directly, use NewAzureCredentialClient() instead. type AzureCredentialClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewAzureCredentialClient creates a new instance of AzureCredentialClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAzureCredentialClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureCredentialClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".AzureCredentialClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &AzureCredentialClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a AzureCredentialResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// credentialName - The Azure credential name. -// resource - Resource create parameters. -// options - AzureCredentialClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialClient.CreateOrUpdate -// method. +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - resource - Resource create parameters. +// - options - AzureCredentialClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialClient.CreateOrUpdate +// method. func (client *AzureCredentialClient) CreateOrUpdate(ctx context.Context, planeName string, credentialName string, resource AzureCredentialResource, options *AzureCredentialClientCreateOrUpdateOptions) (AzureCredentialClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, planeName, credentialName, resource, options) if err != nil { return AzureCredentialClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AzureCredentialClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AzureCredentialClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -83,7 +75,7 @@ func (client *AzureCredentialClient) createOrUpdateCreateRequest(ctx context.Con return nil, errors.New("parameter credentialName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -91,7 +83,10 @@ func (client *AzureCredentialClient) createOrUpdateCreateRequest(ctx context.Con reqQP.Set("api-version", "2022-09-01-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -113,23 +108,27 @@ func (client *AzureCredentialClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes an existing AzureCredentialResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// credentialName - The Azure credential name. -// options - AzureCredentialClientDeleteOptions contains the optional parameters for the AzureCredentialClient.Delete method. +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - options - AzureCredentialClientDeleteOptions contains the optional parameters for the AzureCredentialClient.Delete method. func (client *AzureCredentialClient) Delete(ctx context.Context, planeName string, credentialName string, options *AzureCredentialClientDeleteOptions) (AzureCredentialClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, planeName, credentialName, options) if err != nil { return AzureCredentialClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AzureCredentialClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return AzureCredentialClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -140,7 +139,7 @@ func (client *AzureCredentialClient) deleteCreateRequest(ctx context.Context, pl return nil, errors.New("parameter credentialName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -167,23 +166,27 @@ func (client *AzureCredentialClient) deleteHandleResponse(resp *http.Response) ( // Get - Retrieves information about a AzureCredentialResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// credentialName - The Azure credential name. -// options - AzureCredentialClientGetOptions contains the optional parameters for the AzureCredentialClient.Get method. +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - options - AzureCredentialClientGetOptions contains the optional parameters for the AzureCredentialClient.Get method. func (client *AzureCredentialClient) Get(ctx context.Context, planeName string, credentialName string, options *AzureCredentialClientGetOptions) (AzureCredentialClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, planeName, credentialName, options) if err != nil { return AzureCredentialClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AzureCredentialClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureCredentialClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -194,7 +197,7 @@ func (client *AzureCredentialClient) getCreateRequest(ctx context.Context, plane return nil, errors.New("parameter credentialName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -215,10 +218,11 @@ func (client *AzureCredentialClient) getHandleResponse(resp *http.Response) (Azu } // NewListByRootScopePager - Lists information about all AzureCredentialResource +// // Generated from API version 2022-09-01-privatepreview -// planeName - The name of the plane -// options - AzureCredentialClientListByRootScopeOptions contains the optional parameters for the AzureCredentialClient.ListByRootScope -// method. +// - planeName - The name of the plane +// - options - AzureCredentialClientListByRootScopeOptions contains the optional parameters for the AzureCredentialClient.NewListByRootScopePager +// method. func (client *AzureCredentialClient) NewListByRootScopePager(planeName string, options *AzureCredentialClientListByRootScopeOptions) (*runtime.Pager[AzureCredentialClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[AzureCredentialClientListByRootScopeResponse]{ More: func(page AzureCredentialClientListByRootScopeResponse) bool { @@ -235,7 +239,7 @@ func (client *AzureCredentialClient) NewListByRootScopePager(planeName string, o if err != nil { return AzureCredentialClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return AzureCredentialClientListByRootScopeResponse{}, err } @@ -251,7 +255,7 @@ func (client *AzureCredentialClient) NewListByRootScopePager(planeName string, o func (client *AzureCredentialClient) listByRootScopeCreateRequest(ctx context.Context, planeName string, options *AzureCredentialClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials" urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go new file mode 100644 index 0000000000..0bb90a5d64 --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go @@ -0,0 +1,61 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220901privatepreview + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" +) + +// ClientFactory is a client factory used to create any client in this module. +// Don't use this type directly, use NewClientFactory instead. +type ClientFactory struct { + credential azcore.TokenCredential + options *arm.ClientOptions +} + +// NewClientFactory creates a new instance of ClientFactory with the specified values. +// The parameter values will be propagated to any client created from this factory. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewClientFactory( credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { + _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) + if err != nil { + return nil, err + } + return &ClientFactory{ + credential: credential, + options: options.Clone(), + }, nil +} + +func (c *ClientFactory) NewAwsCredentialClient() *AwsCredentialClient { + subClient, _ := NewAwsCredentialClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAzureCredentialClient() *AzureCredentialClient { + subClient, _ := NewAzureCredentialClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPlaneTypesClient() *PlaneTypesClient { + subClient, _ := NewPlaneTypesClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPlanesClient() *PlanesClient { + subClient, _ := NewPlanesClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewResourceGroupsClient() *ResourceGroupsClient { + subClient, _ := NewResourceGroupsClient(c.credential, c.options) + return subClient +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go index 571aa684d2..8384d93941 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go new file mode 100644 index 0000000000..489d86ea82 --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go @@ -0,0 +1,36 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220901privatepreview + +// 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 +type AWSCredentialPropertiesClassification interface { + // GetAWSCredentialProperties returns the AWSCredentialProperties content of the underlying type. + GetAWSCredentialProperties() *AWSCredentialProperties +} + +// AzureCredentialPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetAzureCredentialProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureCredentialProperties, *AzureServicePrincipalProperties +type AzureCredentialPropertiesClassification interface { + // GetAzureCredentialProperties returns the AzureCredentialProperties content of the underlying type. + GetAzureCredentialProperties() *AzureCredentialProperties +} + +// CredentialStoragePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetCredentialStorageProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CredentialStorageProperties, *InternalCredentialStorageProperties +type CredentialStoragePropertiesClassification interface { + // GetCredentialStorageProperties returns the CredentialStorageProperties content of the underlying type. + GetCredentialStorageProperties() *CredentialStorageProperties +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go index e737c80f87..2b019ea2e7 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -13,19 +12,19 @@ import "time" // AWSAccessKeyCredentialProperties - AWS credential storage properties type AWSAccessKeyCredentialProperties struct { // REQUIRED; Access key ID for AWS identity - AccessKeyID *string `json:"accessKeyId,omitempty"` + AccessKeyID *string // REQUIRED; Discriminator property for AWSCredentialProperties. - Kind *string `json:"kind,omitempty"` + Kind *string // REQUIRED; Secret Access Key for AWS identity - SecretAccessKey *string `json:"secretAccessKey,omitempty"` + SecretAccessKey *string // REQUIRED; The storage properties - Storage CredentialStoragePropertiesClassification `json:"storage,omitempty"` + Storage CredentialStoragePropertiesClassification // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // GetAWSCredentialProperties implements the AWSCredentialPropertiesClassification interface for type AWSAccessKeyCredentialProperties. @@ -36,22 +35,13 @@ func (a *AWSAccessKeyCredentialProperties) GetAWSCredentialProperties() *AWSCred } } -// 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 -type AWSCredentialPropertiesClassification interface { - // GetAWSCredentialProperties returns the AWSCredentialProperties content of the underlying type. - GetAWSCredentialProperties() *AWSCredentialProperties -} - // AWSCredentialProperties - AWS Credential properties type AWSCredentialProperties struct { // REQUIRED; Discriminator property for AWSCredentialProperties. - Kind *string `json:"kind,omitempty"` + Kind *string // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // GetAWSCredentialProperties implements the AWSCredentialPropertiesClassification interface for type AWSCredentialProperties. @@ -61,95 +51,43 @@ func (a *AWSCredentialProperties) GetAWSCredentialProperties() *AWSCredentialPro // type. type AWSCredentialResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties AWSCredentialPropertiesClassification `json:"properties,omitempty"` + Properties AWSCredentialPropertiesClassification // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AWSCredentialResourceListResult - The response of a AWSCredentialResource list operation. type AWSCredentialResourceListResult struct { // REQUIRED; The AWSCredentialResource items on this page - Value []*AWSCredentialResource `json:"value,omitempty"` + Value []*AWSCredentialResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` -} - -// AwsCredentialClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialClient.CreateOrUpdate method. -type AwsCredentialClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AwsCredentialClientDeleteOptions contains the optional parameters for the AwsCredentialClient.Delete method. -type AwsCredentialClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AwsCredentialClientGetOptions contains the optional parameters for the AwsCredentialClient.Get method. -type AwsCredentialClientGetOptions struct { - // placeholder for future optional parameters -} - -// AwsCredentialClientListByRootScopeOptions contains the optional parameters for the AwsCredentialClient.ListByRootScope -// method. -type AwsCredentialClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// AzureCredentialClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialClient.CreateOrUpdate -// method. -type AzureCredentialClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AzureCredentialClientDeleteOptions contains the optional parameters for the AzureCredentialClient.Delete method. -type AzureCredentialClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AzureCredentialClientGetOptions contains the optional parameters for the AzureCredentialClient.Get method. -type AzureCredentialClientGetOptions struct { - // placeholder for future optional parameters -} - -// AzureCredentialClientListByRootScopeOptions contains the optional parameters for the AzureCredentialClient.ListByRootScope -// method. -type AzureCredentialClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// AzureCredentialPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetAzureCredentialProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureCredentialProperties, *AzureServicePrincipalProperties -type AzureCredentialPropertiesClassification interface { - // GetAzureCredentialProperties returns the AzureCredentialProperties content of the underlying type. - GetAzureCredentialProperties() *AzureCredentialProperties + NextLink *string } // AzureCredentialProperties - Azure Credential properties type AzureCredentialProperties struct { // REQUIRED; Discriminator property for AzureCredentialProperties. - Kind *string `json:"kind,omitempty"` + Kind *string // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // GetAzureCredentialProperties implements the AzureCredentialPropertiesClassification interface for type AzureCredentialProperties. @@ -159,55 +97,55 @@ func (a *AzureCredentialProperties) GetAzureCredentialProperties() *AzureCredent // type. type AzureCredentialResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties AzureCredentialPropertiesClassification `json:"properties,omitempty"` + Properties AzureCredentialPropertiesClassification // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AzureCredentialResourceListResult - The response of a AzureCredentialResource list operation. type AzureCredentialResourceListResult struct { // REQUIRED; The AzureCredentialResource items on this page - Value []*AzureCredentialResource `json:"value,omitempty"` + Value []*AzureCredentialResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // AzureServicePrincipalProperties - Service Principal credential storage properties type AzureServicePrincipalProperties struct { // REQUIRED; clientId for ServicePrincipal - ClientID *string `json:"clientId,omitempty"` + ClientID *string // REQUIRED; secret for ServicePrincipal - ClientSecret *string `json:"clientSecret,omitempty"` + ClientSecret *string // REQUIRED; Discriminator property for AzureCredentialProperties. - Kind *string `json:"kind,omitempty"` + Kind *string // REQUIRED; The storage properties - Storage CredentialStoragePropertiesClassification `json:"storage,omitempty"` + Storage CredentialStoragePropertiesClassification // REQUIRED; tenantId for ServicePrincipal - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // GetAzureCredentialProperties implements the AzureCredentialPropertiesClassification interface for type AzureServicePrincipalProperties. @@ -221,22 +159,13 @@ func (a *AzureServicePrincipalProperties) GetAzureCredentialProperties() *AzureC // BasicResourceProperties - Basic properties of a UCP resource. type BasicResourceProperties struct { // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// CredentialStoragePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetCredentialStorageProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CredentialStorageProperties, *InternalCredentialStorageProperties -type CredentialStoragePropertiesClassification interface { - // GetCredentialStorageProperties returns the CredentialStorageProperties content of the underlying type. - GetCredentialStorageProperties() *CredentialStorageProperties + ProvisioningState *ProvisioningState } // CredentialStorageProperties - Credential storage properties type CredentialStorageProperties struct { // REQUIRED; Discriminator property for CredentialStorageProperties. - Kind *string `json:"kind,omitempty"` + Kind *string } // GetCredentialStorageProperties implements the CredentialStoragePropertiesClassification interface for type CredentialStorageProperties. @@ -245,44 +174,44 @@ func (c *CredentialStorageProperties) GetCredentialStorageProperties() *Credenti // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info map[string]any // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ErrorDetail - The error detail. type ErrorDetail struct { // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The error details. - Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + Details []*ErrorDetail // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { // The error object. - Error *ErrorDetail `json:"error,omitempty"` + Error *ErrorDetail } // InternalCredentialStorageProperties - Internal credential storage properties type InternalCredentialStorageProperties struct { // REQUIRED; Discriminator property for CredentialStorageProperties. - Kind *string `json:"kind,omitempty"` + Kind *string // READ-ONLY; The name of secret stored. - SecretName *string `json:"secretName,omitempty" azure:"ro"` + SecretName *string } // GetCredentialStorageProperties implements the CredentialStoragePropertiesClassification interface for type InternalCredentialStorageProperties. @@ -295,186 +224,139 @@ func (i *InternalCredentialStorageProperties) GetCredentialStorageProperties() * // PlaneResource - UCP PlaneResource. type PlaneResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *PlaneResourceProperties `json:"properties,omitempty"` + Properties *PlaneResourceProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PlaneResourceListResult - The response of a PlaneResource list operation. type PlaneResourceListResult struct { // REQUIRED; The PlaneResource items on this page - Value []*PlaneResource `json:"value,omitempty"` + Value []*PlaneResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` + NextLink *string } // PlaneResourceProperties - Plane properties. type PlaneResourceProperties struct { // REQUIRED; The kind of plane - Kind *PlaneKind `json:"kind,omitempty"` + Kind *PlaneKind // Resource Providers for UCP Native Plane - ResourceProviders map[string]*string `json:"resourceProviders,omitempty"` + ResourceProviders map[string]*string // URL to forward requests to for non UCP Native Plane - URL *string `json:"url,omitempty"` + URL *string // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// PlaneTypesClientGetOptions contains the optional parameters for the PlaneTypesClient.Get method. -type PlaneTypesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PlanesClientCreateOrUpdateOptions contains the optional parameters for the PlanesClient.CreateOrUpdate method. -type PlanesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// PlanesClientDeleteOptions contains the optional parameters for the PlanesClient.Delete method. -type PlanesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// PlanesClientGetOptions contains the optional parameters for the PlanesClient.Get method. -type PlanesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PlanesClientListByRootScopeOptions contains the optional parameters for the PlanesClient.ListByRootScope method. -type PlanesClientListByRootScopeOptions struct { - // placeholder for future optional parameters + ProvisioningState *ProvisioningState } // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceGroupResource - UCP ResourceGroup. type ResourceGroupResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // The resource-specific properties for this resource. - Properties *BasicResourceProperties `json:"properties,omitempty"` + Properties *BasicResourceProperties // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceGroupResourceListResult - The response of a ResourceGroupResource list operation. type ResourceGroupResourceListResult struct { // REQUIRED; The ResourceGroupResource items on this page - Value []*ResourceGroupResource `json:"value,omitempty"` + Value []*ResourceGroupResource // The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate -// method. -type ResourceGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ResourceGroupsClientDeleteOptions contains the optional parameters for the ResourceGroupsClient.Delete method. -type ResourceGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method. -type ResourceGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ResourceGroupsClientListByRootScopeOptions contains the optional parameters for the ResourceGroupsClient.ListByRootScope -// method. -type ResourceGroupsClientListByRootScopeOptions struct { - // placeholder for future optional parameters + NextLink *string } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { // REQUIRED; The geo-location where the resource lives - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go index 509be1052d..d1e4245b92 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -17,7 +16,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AWSAccessKeyCredentialProperties. func (a AWSAccessKeyCredentialProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessKeyId", a.AccessKeyID) objectMap["kind"] = "AccessKey" populate(objectMap, "provisioningState", a.ProvisioningState) @@ -37,19 +36,19 @@ func (a *AWSAccessKeyCredentialProperties) UnmarshalJSON(data []byte) error { switch key { case "accessKeyId": err = unpopulate(val, "AccessKeyID", &a.AccessKeyID) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "secretAccessKey": err = unpopulate(val, "SecretAccessKey", &a.SecretAccessKey) - delete(rawMsg, key) + delete(rawMsg, key) case "storage": - a.Storage, err = unmarshalCredentialStoragePropertiesClassification(val) - delete(rawMsg, key) + a.Storage, err = unmarshalCredentialStoragePropertiesClassification(val) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -60,7 +59,7 @@ func (a *AWSAccessKeyCredentialProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AWSCredentialProperties. func (a AWSCredentialProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["kind"] = a.Kind populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) @@ -77,10 +76,10 @@ func (a *AWSCredentialProperties) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -91,7 +90,7 @@ func (a *AWSCredentialProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AWSCredentialResource. func (a AWSCredentialResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -113,25 +112,25 @@ func (a *AWSCredentialResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": - a.Properties, err = unmarshalAWSCredentialPropertiesClassification(val) - delete(rawMsg, key) + a.Properties, err = unmarshalAWSCredentialPropertiesClassification(val) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -142,7 +141,7 @@ func (a *AWSCredentialResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AWSCredentialResourceListResult. func (a AWSCredentialResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -159,10 +158,10 @@ func (a *AWSCredentialResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -173,7 +172,7 @@ func (a *AWSCredentialResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureCredentialProperties. func (a AzureCredentialProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["kind"] = a.Kind populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) @@ -190,10 +189,10 @@ func (a *AzureCredentialProperties) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -204,7 +203,7 @@ func (a *AzureCredentialProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureCredentialResource. func (a AzureCredentialResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -226,25 +225,25 @@ func (a *AzureCredentialResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": - a.Properties, err = unmarshalAzureCredentialPropertiesClassification(val) - delete(rawMsg, key) + a.Properties, err = unmarshalAzureCredentialPropertiesClassification(val) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &a.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -255,7 +254,7 @@ func (a *AzureCredentialResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureCredentialResourceListResult. func (a AzureCredentialResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -272,10 +271,10 @@ func (a *AzureCredentialResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -286,7 +285,7 @@ func (a *AzureCredentialResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureServicePrincipalProperties. func (a AzureServicePrincipalProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", a.ClientID) populate(objectMap, "clientSecret", a.ClientSecret) objectMap["kind"] = "ServicePrincipal" @@ -307,22 +306,22 @@ func (a *AzureServicePrincipalProperties) UnmarshalJSON(data []byte) error { switch key { case "clientId": err = unpopulate(val, "ClientID", &a.ClientID) - delete(rawMsg, key) + delete(rawMsg, key) case "clientSecret": err = unpopulate(val, "ClientSecret", &a.ClientSecret) - delete(rawMsg, key) + delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &a.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "storage": - a.Storage, err = unmarshalCredentialStoragePropertiesClassification(val) - delete(rawMsg, key) + a.Storage, err = unmarshalCredentialStoragePropertiesClassification(val) + delete(rawMsg, key) case "tenantId": err = unpopulate(val, "TenantID", &a.TenantID) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -333,7 +332,7 @@ func (a *AzureServicePrincipalProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningState", b.ProvisioningState) return json.Marshal(objectMap) } @@ -349,7 +348,7 @@ func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { switch key { case "provisioningState": err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -360,7 +359,7 @@ func (b *BasicResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CredentialStorageProperties. func (c CredentialStorageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["kind"] = c.Kind return json.Marshal(objectMap) } @@ -376,7 +375,7 @@ func (c *CredentialStorageProperties) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &c.Kind) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -387,7 +386,7 @@ func (c *CredentialStorageProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -404,10 +403,10 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { switch key { case "info": err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -418,7 +417,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -438,19 +437,19 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) + delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) + delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) + delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) + delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -461,7 +460,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -477,7 +476,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { switch key { case "error": err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -488,7 +487,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InternalCredentialStorageProperties. func (i InternalCredentialStorageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["kind"] = "Internal" populate(objectMap, "secretName", i.SecretName) return json.Marshal(objectMap) @@ -505,10 +504,10 @@ func (i *InternalCredentialStorageProperties) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &i.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "secretName": err = unpopulate(val, "SecretName", &i.SecretName) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -519,7 +518,7 @@ func (i *InternalCredentialStorageProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PlaneResource. func (p PlaneResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) @@ -541,25 +540,25 @@ func (p *PlaneResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -570,7 +569,7 @@ func (p *PlaneResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PlaneResourceListResult. func (p PlaneResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) @@ -587,10 +586,10 @@ func (p *PlaneResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -601,7 +600,7 @@ func (p *PlaneResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PlaneResourceProperties. func (p PlaneResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "kind", p.Kind) populate(objectMap, "provisioningState", p.ProvisioningState) populate(objectMap, "resourceProviders", p.ResourceProviders) @@ -620,16 +619,16 @@ func (p *PlaneResourceProperties) UnmarshalJSON(data []byte) error { switch key { case "kind": err = unpopulate(val, "Kind", &p.Kind) - delete(rawMsg, key) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) - delete(rawMsg, key) + delete(rawMsg, key) case "resourceProviders": err = unpopulate(val, "ResourceProviders", &p.ResourceProviders) - delete(rawMsg, key) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &p.URL) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -640,7 +639,7 @@ func (p *PlaneResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -659,16 +658,16 @@ func (r *Resource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -679,7 +678,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceGroupResource. func (r ResourceGroupResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "location", r.Location) populate(objectMap, "name", r.Name) @@ -701,25 +700,25 @@ func (r *ResourceGroupResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -730,7 +729,7 @@ func (r *ResourceGroupResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceGroupResourceListResult. func (r ResourceGroupResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -747,10 +746,10 @@ func (r *ResourceGroupResourceListResult) UnmarshalJSON(data []byte) error { switch key { case "nextLink": err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -761,7 +760,7 @@ func (r *ResourceGroupResourceListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -782,22 +781,22 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { switch key { case "createdAt": err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedAt": err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) + delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -808,7 +807,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -829,22 +828,22 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { switch key { case "id": err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) + delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -853,7 +852,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -863,7 +862,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go new file mode 100644 index 0000000000..0c01e6deaa --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go @@ -0,0 +1,99 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220901privatepreview + +// AwsCredentialClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialClient.CreateOrUpdate method. +type AwsCredentialClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AwsCredentialClientDeleteOptions contains the optional parameters for the AwsCredentialClient.Delete method. +type AwsCredentialClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AwsCredentialClientGetOptions contains the optional parameters for the AwsCredentialClient.Get method. +type AwsCredentialClientGetOptions struct { + // placeholder for future optional parameters +} + +// AwsCredentialClientListByRootScopeOptions contains the optional parameters for the AwsCredentialClient.NewListByRootScopePager +// method. +type AwsCredentialClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// AzureCredentialClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialClient.CreateOrUpdate +// method. +type AzureCredentialClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AzureCredentialClientDeleteOptions contains the optional parameters for the AzureCredentialClient.Delete method. +type AzureCredentialClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AzureCredentialClientGetOptions contains the optional parameters for the AzureCredentialClient.Get method. +type AzureCredentialClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureCredentialClientListByRootScopeOptions contains the optional parameters for the AzureCredentialClient.NewListByRootScopePager +// method. +type AzureCredentialClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// PlaneTypesClientGetOptions contains the optional parameters for the PlaneTypesClient.Get method. +type PlaneTypesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PlanesClientCreateOrUpdateOptions contains the optional parameters for the PlanesClient.CreateOrUpdate method. +type PlanesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PlanesClientDeleteOptions contains the optional parameters for the PlanesClient.Delete method. +type PlanesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PlanesClientGetOptions contains the optional parameters for the PlanesClient.Get method. +type PlanesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PlanesClientListByRootScopeOptions contains the optional parameters for the PlanesClient.NewListByRootScopePager method. +type PlanesClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + +// ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate +// method. +type ResourceGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ResourceGroupsClientDeleteOptions contains the optional parameters for the ResourceGroupsClient.Delete method. +type ResourceGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method. +type ResourceGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ResourceGroupsClientListByRootScopeOptions contains the optional parameters for the ResourceGroupsClient.NewListByRootScopePager +// method. +type ResourceGroupsClientListByRootScopeOptions struct { + // placeholder for future optional parameters +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go index 4c91db0eb3..b45b537b29 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,52 +23,47 @@ import ( // PlanesClient contains the methods for the Planes group. // Don't use this type directly, use NewPlanesClient() instead. type PlanesClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewPlanesClient creates a new instance of PlanesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPlanesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PlanesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".PlanesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &PlanesClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a PlaneResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// resource - Resource create parameters. -// options - PlanesClientCreateOrUpdateOptions contains the optional parameters for the PlanesClient.CreateOrUpdate method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - resource - Resource create parameters. +// - options - PlanesClientCreateOrUpdateOptions contains the optional parameters for the PlanesClient.CreateOrUpdate method. func (client *PlanesClient) CreateOrUpdate(ctx context.Context, planeType string, planeName string, resource PlaneResource, options *PlanesClientCreateOrUpdateOptions) (PlanesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, planeType, planeName, resource, options) if err != nil { return PlanesClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PlanesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return PlanesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return PlanesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -82,7 +74,7 @@ func (client *PlanesClient) createOrUpdateCreateRequest(ctx context.Context, pla } urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -90,7 +82,10 @@ func (client *PlanesClient) createOrUpdateCreateRequest(ctx context.Context, pla reqQP.Set("api-version", "2022-09-01-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -112,23 +107,27 @@ func (client *PlanesClient) createOrUpdateHandleResponse(resp *http.Response) (P // Delete - Deletes an existing PlaneResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// options - PlanesClientDeleteOptions contains the optional parameters for the PlanesClient.Delete method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - options - PlanesClientDeleteOptions contains the optional parameters for the PlanesClient.Delete method. func (client *PlanesClient) Delete(ctx context.Context, planeType string, planeName string, options *PlanesClientDeleteOptions) (PlanesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, planeType, planeName, options) if err != nil { return PlanesClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PlanesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return PlanesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PlanesClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -139,7 +138,7 @@ func (client *PlanesClient) deleteCreateRequest(ctx context.Context, planeType s } urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -166,23 +165,27 @@ func (client *PlanesClient) deleteHandleResponse(resp *http.Response) (PlanesCli // Get - Retrieves information about a PlaneResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// options - PlanesClientGetOptions contains the optional parameters for the PlanesClient.Get method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - options - PlanesClientGetOptions contains the optional parameters for the PlanesClient.Get method. func (client *PlanesClient) Get(ctx context.Context, planeType string, planeName string, options *PlanesClientGetOptions) (PlanesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, planeType, planeName, options) if err != nil { return PlanesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PlanesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PlanesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PlanesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -193,7 +196,7 @@ func (client *PlanesClient) getCreateRequest(ctx context.Context, planeType stri } urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -214,8 +217,10 @@ func (client *PlanesClient) getHandleResponse(resp *http.Response) (PlanesClient } // NewListByRootScopePager - Lists information about all PlaneResources in the given plane +// // Generated from API version 2022-09-01-privatepreview -// options - PlanesClientListByRootScopeOptions contains the optional parameters for the PlanesClient.ListByRootScope method. +// - options - PlanesClientListByRootScopeOptions contains the optional parameters for the PlanesClient.NewListByRootScopePager +// method. func (client *PlanesClient) NewListByRootScopePager(options *PlanesClientListByRootScopeOptions) (*runtime.Pager[PlanesClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[PlanesClientListByRootScopeResponse]{ More: func(page PlanesClientListByRootScopeResponse) bool { @@ -232,7 +237,7 @@ func (client *PlanesClient) NewListByRootScopePager(options *PlanesClientListByR if err != nil { return PlanesClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return PlanesClientListByRootScopeResponse{}, err } @@ -247,7 +252,7 @@ func (client *PlanesClient) NewListByRootScopePager(options *PlanesClientListByR // listByRootScopeCreateRequest creates the ListByRootScope request. func (client *PlanesClient) listByRootScopeCreateRequest(ctx context.Context, options *PlanesClientListByRootScopeOptions) (*policy.Request, error) { urlPath := "/planes" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go index e02755f5ed..7e21bebaba 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -25,50 +22,45 @@ import ( // PlaneTypesClient contains the methods for the PlaneTypes group. // Don't use this type directly, use NewPlaneTypesClient() instead. type PlaneTypesClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewPlaneTypesClient creates a new instance of PlaneTypesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPlaneTypesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PlaneTypesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".PlaneTypesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &PlaneTypesClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // Get - Retrieves information about a PlaneResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// options - PlaneTypesClientGetOptions contains the optional parameters for the PlaneTypesClient.Get method. +// - planeType - The plane type. +// - options - PlaneTypesClientGetOptions contains the optional parameters for the PlaneTypesClient.Get method. func (client *PlaneTypesClient) Get(ctx context.Context, planeType string, options *PlaneTypesClientGetOptions) (PlaneTypesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, planeType, options) if err != nil { return PlaneTypesClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PlaneTypesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PlaneTypesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PlaneTypesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -78,7 +70,7 @@ func (client *PlaneTypesClient) getCreateRequest(ctx context.Context, planeType return nil, errors.New("parameter planeType cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go index 31f7f6d40b..2927839360 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -14,7 +13,7 @@ func unmarshalAWSCredentialPropertiesClassification(rawMsg json.RawMessage) (AWS if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -25,14 +24,17 @@ func unmarshalAWSCredentialPropertiesClassification(rawMsg json.RawMessage) (AWS default: b = &AWSCredentialProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAzureCredentialPropertiesClassification(rawMsg json.RawMessage) (AzureCredentialPropertiesClassification, error) { if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -43,14 +45,17 @@ func unmarshalAzureCredentialPropertiesClassification(rawMsg json.RawMessage) (A default: b = &AzureCredentialProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCredentialStoragePropertiesClassification(rawMsg json.RawMessage) (CredentialStoragePropertiesClassification, error) { if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -61,6 +66,9 @@ func unmarshalCredentialStoragePropertiesClassification(rawMsg json.RawMessage) default: b = &CredentialStorageProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go index eea99477d9..5e6065b8c8 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -13,8 +12,6 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -26,54 +23,49 @@ import ( // ResourceGroupsClient contains the methods for the ResourceGroups group. // Don't use this type directly, use NewResourceGroupsClient() instead. type ResourceGroupsClient struct { - host string - pl runtime.Pipeline + internal *arm.Client } // NewResourceGroupsClient creates a new instance of ResourceGroupsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewResourceGroupsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceGroupsClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + cl, err := arm.NewClient(moduleName+".ResourceGroupsClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &ResourceGroupsClient{ - host: ep, -pl: pl, + internal: cl, } return client, nil } // CreateOrUpdate - Creates or updates a ResourceGroupResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// resourceGroupName - UCP resourcegroup name -// resource - Resource create parameters. -// options - ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate -// method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - resourceGroupName - UCP resourcegroup name +// - resource - Resource create parameters. +// - options - ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate +// method. func (client *ResourceGroupsClient) CreateOrUpdate(ctx context.Context, planeType string, planeName string, resourceGroupName string, resource ResourceGroupResource, options *ResourceGroupsClientCreateOrUpdateOptions) (ResourceGroupsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, planeType, planeName, resourceGroupName, resource, options) if err != nil { return ResourceGroupsClientCreateOrUpdateResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGroupsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ResourceGroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ResourceGroupsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -88,7 +80,7 @@ func (client *ResourceGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -96,7 +88,10 @@ func (client *ResourceGroupsClient) createOrUpdateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2022-09-01-privatepreview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +113,28 @@ func (client *ResourceGroupsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes an existing ResourceGroupResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// resourceGroupName - UCP resourcegroup name -// options - ResourceGroupsClientDeleteOptions contains the optional parameters for the ResourceGroupsClient.Delete method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - resourceGroupName - UCP resourcegroup name +// - options - ResourceGroupsClientDeleteOptions contains the optional parameters for the ResourceGroupsClient.Delete method. func (client *ResourceGroupsClient) Delete(ctx context.Context, planeType string, planeName string, resourceGroupName string, options *ResourceGroupsClientDeleteOptions) (ResourceGroupsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, planeType, planeName, resourceGroupName, options) if err != nil { return ResourceGroupsClientDeleteResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGroupsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return ResourceGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ResourceGroupsClientDeleteResponse{}, err } - return client.deleteHandleResponse(resp) + resp, err := client.deleteHandleResponse(httpResp) + return resp, err } // deleteCreateRequest creates the Delete request. @@ -150,7 +149,7 @@ func (client *ResourceGroupsClient) deleteCreateRequest(ctx context.Context, pla return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -177,24 +176,28 @@ func (client *ResourceGroupsClient) deleteHandleResponse(resp *http.Response) (R // Get - Retrieves information about a ResourceGroupResource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// resourceGroupName - UCP resourcegroup name -// options - ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - resourceGroupName - UCP resourcegroup name +// - options - ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method. func (client *ResourceGroupsClient) Get(ctx context.Context, planeType string, planeName string, resourceGroupName string, options *ResourceGroupsClientGetOptions) (ResourceGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, planeType, planeName, resourceGroupName, options) if err != nil { return ResourceGroupsClientGetResponse{}, err } - resp, err := client.pl.Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -209,7 +212,7 @@ func (client *ResourceGroupsClient) getCreateRequest(ctx context.Context, planeT return nil, errors.New("parameter resourceGroupName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -230,11 +233,12 @@ func (client *ResourceGroupsClient) getHandleResponse(resp *http.Response) (Reso } // NewListByRootScopePager - Lists information about all ResourceGroupResource +// // Generated from API version 2022-09-01-privatepreview -// planeType - The plane type. -// planeName - The name of the plane -// options - ResourceGroupsClientListByRootScopeOptions contains the optional parameters for the ResourceGroupsClient.ListByRootScope -// method. +// - planeType - The plane type. +// - planeName - The name of the plane +// - options - ResourceGroupsClientListByRootScopeOptions contains the optional parameters for the ResourceGroupsClient.NewListByRootScopePager +// method. func (client *ResourceGroupsClient) NewListByRootScopePager(planeType string, planeName string, options *ResourceGroupsClientListByRootScopeOptions) (*runtime.Pager[ResourceGroupsClientListByRootScopeResponse]) { return runtime.NewPager(runtime.PagingHandler[ResourceGroupsClientListByRootScopeResponse]{ More: func(page ResourceGroupsClientListByRootScopeResponse) bool { @@ -251,7 +255,7 @@ func (client *ResourceGroupsClient) NewListByRootScopePager(planeType string, pl if err != nil { return ResourceGroupsClientListByRootScopeResponse{}, err } - resp, err := client.pl.Do(req) + resp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGroupsClientListByRootScopeResponse{}, err } @@ -271,7 +275,7 @@ func (client *ResourceGroupsClient) listByRootScopeCreateRequest(ctx context.Con } urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go index 59d4496701..2fa1dc8547 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go @@ -2,15 +2,16 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview // AwsCredentialClientCreateOrUpdateResponse contains the response from method AwsCredentialClient.CreateOrUpdate. type AwsCredentialClientCreateOrUpdateResponse struct { + // Concrete tracked resource types can be created by aliasing this type using a specific property type. AWSCredentialResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -23,17 +24,21 @@ type AwsCredentialClientDeleteResponse struct { // AwsCredentialClientGetResponse contains the response from method AwsCredentialClient.Get. type AwsCredentialClientGetResponse struct { + // Concrete tracked resource types can be created by aliasing this type using a specific property type. AWSCredentialResource } -// AwsCredentialClientListByRootScopeResponse contains the response from method AwsCredentialClient.ListByRootScope. +// AwsCredentialClientListByRootScopeResponse contains the response from method AwsCredentialClient.NewListByRootScopePager. type AwsCredentialClientListByRootScopeResponse struct { + // The response of a AWSCredentialResource list operation. AWSCredentialResourceListResult } // AzureCredentialClientCreateOrUpdateResponse contains the response from method AzureCredentialClient.CreateOrUpdate. type AzureCredentialClientCreateOrUpdateResponse struct { + // Concrete tracked resource types can be created by aliasing this type using a specific property type. AzureCredentialResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -46,22 +51,27 @@ type AzureCredentialClientDeleteResponse struct { // AzureCredentialClientGetResponse contains the response from method AzureCredentialClient.Get. type AzureCredentialClientGetResponse struct { + // Concrete tracked resource types can be created by aliasing this type using a specific property type. AzureCredentialResource } -// AzureCredentialClientListByRootScopeResponse contains the response from method AzureCredentialClient.ListByRootScope. +// AzureCredentialClientListByRootScopeResponse contains the response from method AzureCredentialClient.NewListByRootScopePager. type AzureCredentialClientListByRootScopeResponse struct { + // The response of a AzureCredentialResource list operation. AzureCredentialResourceListResult } // PlaneTypesClientGetResponse contains the response from method PlaneTypesClient.Get. type PlaneTypesClientGetResponse struct { + // UCP PlaneResource. PlaneResource } // PlanesClientCreateOrUpdateResponse contains the response from method PlanesClient.CreateOrUpdate. type PlanesClientCreateOrUpdateResponse struct { + // UCP PlaneResource. PlaneResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -74,17 +84,21 @@ type PlanesClientDeleteResponse struct { // PlanesClientGetResponse contains the response from method PlanesClient.Get. type PlanesClientGetResponse struct { + // UCP PlaneResource. PlaneResource } -// PlanesClientListByRootScopeResponse contains the response from method PlanesClient.ListByRootScope. +// PlanesClientListByRootScopeResponse contains the response from method PlanesClient.NewListByRootScopePager. type PlanesClientListByRootScopeResponse struct { + // The response of a PlaneResource list operation. PlaneResourceListResult } // ResourceGroupsClientCreateOrUpdateResponse contains the response from method ResourceGroupsClient.CreateOrUpdate. type ResourceGroupsClientCreateOrUpdateResponse struct { + // UCP ResourceGroup. ResourceGroupResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } @@ -97,11 +111,13 @@ type ResourceGroupsClientDeleteResponse struct { // ResourceGroupsClientGetResponse contains the response from method ResourceGroupsClient.Get. type ResourceGroupsClientGetResponse struct { + // UCP ResourceGroup. ResourceGroupResource } -// ResourceGroupsClientListByRootScopeResponse contains the response from method ResourceGroupsClient.ListByRootScope. +// ResourceGroupsClientListByRootScopeResponse contains the response from method ResourceGroupsClient.NewListByRootScopePager. type ResourceGroupsClientListByRootScopeResponse struct { + // The response of a ResourceGroupResource list operation. ResourceGroupResourceListResult } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_time_rfc3339.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_time_rfc3339.go index b900804ef3..10046752d2 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_time_rfc3339.go @@ -2,9 +2,8 @@ // +build go1.18 // Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package v20220901privatepreview @@ -66,7 +65,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { From 44deaecf43b392817631e97779101a250112d707 Mon Sep 17 00:00:00 2001 From: vinayada1 <28875764+vinayada1@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:05:05 -0700 Subject: [PATCH 17/57] Add image pull policy to containers (#6093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Add image pull policy field to containers ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: #5293 ## Auto-generated summary ### 🤖 Generated by Copilot at d6dd8be ### Summary 🐳🛠️🧪 This pull request adds support for customizing the image pull policy for containers in the Applications.Core service. It updates the `Container` model in the CADL, the API, the data model, and the Swagger specification to include a new field `imagePullPolicy`. It also implements the conversion and rendering logic for the new field, and adds a test case to verify the functionality. > _`ImagePullPolicy`_ > _A new field for containers_ > _Spring of Kubernetes_ ### Walkthrough * Add support for customizing the image pull policy for containers in the Applications.Core service ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-20c4922e41d80daa40180463fa5d935c358a54b3fb8f4d3cd0c295a82a4de045R184-R185), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL123-R132), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL246-R256), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbR265-R294), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-97a8e2123c5e5278472232e48dba9d7a5083bf8cae9bca3386591319977d6770R33-R50), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-256a0f1ad5114a905914c6f931e4b42cc7f4c6cab143fcaebd4a77c48b2fdebeR241-R243), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-f404ae8ea064968eea9fa6e167913acc73be478dd3f36f7840767c9e7cd0d84dR449), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-f404ae8ea064968eea9fa6e167913acc73be478dd3f36f7840767c9e7cd0d84dR479-R481), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-5275155acd7f7a59f0301cfc95f8dd38f72f22795e3197c6a150bae13dd5d5f3L89-R98), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R367-R371), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R1589-R1625), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-46f82ce5894ea72002dfdafceaa367b04650efac307bd067b150b296804e4549R597-R605)) * Add a new field `imagePullPolicy` to the `Container` model in the `cadl/Applications.Core/containers.cadl` file, which specifies the pull policy for the container image ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-20c4922e41d80daa40180463fa5d935c358a54b3fb8f4d3cd0c295a82a4de045R184-R185)) * Generate the API models, constants, serialization, and deserialization code from the CADL model, using the enum type `ContainerImagePullPolicy` for the `ImagePullPolicy` field ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-97a8e2123c5e5278472232e48dba9d7a5083bf8cae9bca3386591319977d6770R33-R50), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-256a0f1ad5114a905914c6f931e4b42cc7f4c6cab143fcaebd4a77c48b2fdebeR241-R243), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-f404ae8ea064968eea9fa6e167913acc73be478dd3f36f7840767c9e7cd0d84dR449), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-f404ae8ea064968eea9fa6e167913acc73be478dd3f36f7840767c9e7cd0d84dR479-R481)) * Generate the Swagger specification for the Applications.Core service API from the CADL model, adding the `imagePullPolicy` property to the `Container` schema with a description and an enum of possible values ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-46f82ce5894ea72002dfdafceaa367b04650efac307bd067b150b296804e4549R597-R605)) * Modify the data model version of the `Container` type in the `pkg/corerp/datamodel/container.go` file, adding a new field `ImagePullPolicy` of type `string` with a JSON tag ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-5275155acd7f7a59f0301cfc95f8dd38f72f22795e3197c6a150bae13dd5d5f3L89-R98)) * Modify the conversion functions between the API version and the data model version of the `Container` type in the `pkg/corerp/api/v20220315privatepreview/container_conversion.go` file, adding lines to convert the `ImagePullPolicy` field using helper functions that map the enum values to strings and vice versa ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL123-R132), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbL246-R256), [link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbR265-R294)) * Modify the container renderer in the `pkg/corerp/renderers/container/render.go` file, adding a conditional block to set the `ImagePullPolicy` field of the container spec in the Kubernetes deployment resource, using the value from the data model or the Kubernetes default policy ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R367-R371)) * Add a test case to the container renderer test in the `pkg/corerp/renderers/container/render_test.go` file, testing the scenario where the user has specified an image pull policy for the container and verifying that the deployment resource has the same policy ([link](https://github.com/project-radius/radius/pull/6093/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R1589-R1625)) --- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 1 + hack/bicep-types-radius/generated/index.json | 2 +- .../container_conversion.go | 68 ++++++++++++++----- .../zz_generated_constants.go | 21 ++++++ .../zz_generated_models.go | 6 ++ .../zz_generated_models_serde.go | 8 +++ pkg/corerp/datamodel/container.go | 19 +++--- pkg/corerp/renderers/container/render.go | 5 ++ pkg/corerp/renderers/container/render_test.go | 37 ++++++++++ .../2022-03-15-privatepreview/openapi.json | 38 +++++++++++ typespec/Applications.Core/containers.tsp | 15 ++++ 12 files changed, 193 insertions(+), 29 deletions(-) diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index eb19fb4633..014d0f0ed0 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":107,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":103,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":104,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":105,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"env":{"Type":71,"Flags":0,"Description":"environment"},"ports":{"Type":76,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":77,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":96,"Flags":0,"Description":"container volumes"},"command":{"Type":97,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":98,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":75,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[73,74]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":72}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":78,"httpGet":80,"tcp":83}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":79,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":81,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":82,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":84,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":86,"persistent":91}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":89,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":90,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[87,88]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":94,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":95,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[92,93]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":85}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":100,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":101,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":102,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":99}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":106,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":109,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":110,"Flags":10,"Description":"The resource api version"},"properties":{"Type":112,"Flags":0,"Description":"Environment properties"},"tags":{"Type":132,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":120,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":121,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":130,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":131,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[113,114,115,116,117,118,119]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":122,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":123,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":125,"terraform":127}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":126,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":128,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":124}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":129}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":111}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":134,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":135,"Flags":10,"Description":"The resource api version"},"properties":{"Type":137,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":150,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":145,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":146,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":149,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[138,139,140,141,142,143,144]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[147,148]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":136}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":152,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":153,"Flags":10,"Description":"The resource api version"},"properties":{"Type":155,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":171,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":163,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":164,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":166,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":167,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[156,157,158,159,160,161,162]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":165}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":170,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[168,169]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":154}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":173,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":174,"Flags":10,"Description":"The resource api version"},"properties":{"Type":176,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":185,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":184,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[177,178,179,180,181,182,183]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":175}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":187,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":188,"Flags":10,"Description":"The resource api version"},"properties":{"Type":190,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":208,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":198,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":201,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":207,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[191,192,193,194,195,196,197]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[199,200]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":205,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":206,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[203,204]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":202}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":189}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":210,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":211,"Flags":10,"Description":"The resource api version"},"properties":{"Type":213,"Flags":0,"Description":"Volume properties"},"tags":{"Type":245,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":221,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":222}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[214,215,216,217,218,219,220]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":235,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":237,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":243,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":244,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":227,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":230,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":234,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[224,225,226]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[228,229]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[231,232,233]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":223}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":236}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":242,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[239,240,241]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":238}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":212}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":251,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":252,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[249,250]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":202}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":248,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":111,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":107,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":108,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":109,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":74,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":75,"Flags":0,"Description":"environment"},"ports":{"Type":80,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":100,"Flags":0,"Description":"container volumes"},"command":{"Type":101,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":102,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[71,72,73]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":79,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[77,78]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":76}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":82,"httpGet":84,"tcp":87}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":83,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":85,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":86,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":88,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":90,"persistent":95}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":93,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":94,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[91,92]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":98,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":99,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[96,97]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":89}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":104,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":105,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":106,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":103}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":110,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":113,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":114,"Flags":10,"Description":"The resource api version"},"properties":{"Type":116,"Flags":0,"Description":"Environment properties"},"tags":{"Type":136,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":124,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":125,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":134,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":135,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[117,118,119,120,121,122,123]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":126,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":127,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":129,"terraform":131}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":130,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":132,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":128}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":133}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":115}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":138,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":139,"Flags":10,"Description":"The resource api version"},"properties":{"Type":141,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":154,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":149,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":150,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":153,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[142,143,144,145,146,147,148]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[151,152]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":140}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":156,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":157,"Flags":10,"Description":"The resource api version"},"properties":{"Type":159,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":175,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":167,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":168,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":170,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":171,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[160,161,162,163,164,165,166]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":169}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":174,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[172,173]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":158}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":177,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":178,"Flags":10,"Description":"The resource api version"},"properties":{"Type":180,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":189,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":188,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[181,182,183,184,185,186,187]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":179}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":191,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":192,"Flags":10,"Description":"The resource api version"},"properties":{"Type":194,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":212,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":202,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":205,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":211,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[195,196,197,198,199,200,201]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[203,204]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":209,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":210,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[207,208]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":206}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":193}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":214,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":215,"Flags":10,"Description":"The resource api version"},"properties":{"Type":217,"Flags":0,"Description":"Volume properties"},"tags":{"Type":249,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":225,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":226}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[218,219,220,221,222,223,224]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":239,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":241,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":247,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":248,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":231,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":234,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":238,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[228,229,230]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[232,233]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[235,236,237]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":227}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":240}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":246,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[243,244,245]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":242}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":216}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":255,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":256,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[253,254]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":206}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":252,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index f60b833734..d5fd5f851b 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -231,6 +231,7 @@ * **command**: string[]: Entrypoint array. Overrides the container image's ENTRYPOINT * **env**: [ContainerEnv](#containerenv): environment * **image**: string (Required): The registry and image to download and run in your container +* **imagePullPolicy**: 'Always' | 'IfNotPresent' | 'Never': The image pull policy for the container * **livenessProbe**: [HealthProbeProperties](#healthprobeproperties): Properties for readiness/liveness probe * **ports**: [ContainerPorts](#containerports): container ports * **readinessProbe**: [HealthProbeProperties](#healthprobeproperties): Properties for readiness/liveness probe diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 163c53f1d0..6afc79a0de 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":108},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":133},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":151},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":172},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":186},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":209},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":246},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":247}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":253}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":112},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":137},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":155},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":176},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":190},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":213},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":250},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":257}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion.go b/pkg/corerp/api/v20220315privatepreview/container_conversion.go index be96d31fd0..f49e3488ea 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion.go @@ -120,15 +120,16 @@ func (src *ContainerResource) ConvertTo() (v1.DataModelInterface, error) { }, Connections: connections, Container: datamodel.Container{ - Image: to.String(src.Properties.Container.Image), - Env: to.StringMap(src.Properties.Container.Env), - LivenessProbe: livenessProbe, - Ports: ports, - ReadinessProbe: readinessProbe, - Volumes: volumes, - Command: stringSlice(src.Properties.Container.Command), - Args: stringSlice(src.Properties.Container.Args), - WorkingDir: to.String(src.Properties.Container.WorkingDir), + Image: to.String(src.Properties.Container.Image), + ImagePullPolicy: toImagePullPolicyDataModel(src.Properties.Container.ImagePullPolicy), + Env: to.StringMap(src.Properties.Container.Env), + LivenessProbe: livenessProbe, + Ports: ports, + ReadinessProbe: readinessProbe, + Volumes: volumes, + Command: stringSlice(src.Properties.Container.Command), + Args: stringSlice(src.Properties.Container.Args), + WorkingDir: to.String(src.Properties.Container.WorkingDir), }, Extensions: extensions, Runtimes: toRuntimeProperties(src.Properties.Runtimes), @@ -244,15 +245,16 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { Application: to.Ptr(c.Properties.Application), Connections: connections, Container: &Container{ - Image: to.Ptr(c.Properties.Container.Image), - Env: *to.StringMapPtr(c.Properties.Container.Env), - LivenessProbe: livenessProbe, - Ports: ports, - ReadinessProbe: readinessProbe, - Volumes: volumes, - Command: to.SliceOfPtrs(c.Properties.Container.Command...), - Args: to.SliceOfPtrs(c.Properties.Container.Args...), - WorkingDir: to.Ptr(c.Properties.Container.WorkingDir), + Image: to.Ptr(c.Properties.Container.Image), + ImagePullPolicy: fromImagePullPolicyDataModel(c.Properties.Container.ImagePullPolicy), + Env: *to.StringMapPtr(c.Properties.Container.Env), + LivenessProbe: livenessProbe, + Ports: ports, + ReadinessProbe: readinessProbe, + Volumes: volumes, + Command: to.SliceOfPtrs(c.Properties.Container.Command...), + Args: to.SliceOfPtrs(c.Properties.Container.Args...), + WorkingDir: to.Ptr(c.Properties.Container.WorkingDir), }, Extensions: extensions, Identity: identity, @@ -262,6 +264,36 @@ func (dst *ContainerResource) ConvertFrom(src v1.DataModelInterface) error { return nil } +func toImagePullPolicyDataModel(pullPolicy *ImagePullPolicy) string { + if pullPolicy == nil { + return "" + } + + switch *pullPolicy { + case ImagePullPolicyAlways: + return "Always" + case ImagePullPolicyIfNotPresent: + return "IfNotPresent" + case ImagePullPolicyNever: + return "Never" + default: + return "" + } +} + +func fromImagePullPolicyDataModel(pullPolicy string) *ImagePullPolicy { + switch pullPolicy { + case "Always": + return to.Ptr(ImagePullPolicyAlways) + case "IfNotPresent": + return to.Ptr(ImagePullPolicyIfNotPresent) + case "Never": + return to.Ptr(ImagePullPolicyNever) + default: + return nil + } +} + func toHealthProbePropertiesDataModel(h HealthProbePropertiesClassification) datamodel.HealthProbeProperties { switch c := h.(type) { case *ExecHealthProbeProperties: diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go index 5ec139eee6..de80b30323 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_constants.go @@ -136,6 +136,27 @@ func PossibleIdentitySettingKindValues() []IdentitySettingKind { } } +// ImagePullPolicy - The image pull policy for the container +type ImagePullPolicy string + +const ( + // ImagePullPolicyAlways - Always + ImagePullPolicyAlways ImagePullPolicy = "Always" + // ImagePullPolicyIfNotPresent - IfNotPresent + ImagePullPolicyIfNotPresent ImagePullPolicy = "IfNotPresent" + // ImagePullPolicyNever - Never + ImagePullPolicyNever ImagePullPolicy = "Never" +) + +// PossibleImagePullPolicyValues returns the possible values for the ImagePullPolicy const type. +func PossibleImagePullPolicyValues() []ImagePullPolicy { + return []ImagePullPolicy{ + ImagePullPolicyAlways, + ImagePullPolicyIfNotPresent, + ImagePullPolicyNever, + } +} + // ManagedStore - The managed store for the ephemeral volume type ManagedStore string diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index cd10cd0dac..a906f1275c 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -223,6 +223,9 @@ type Container struct { // environment Env map[string]*string + // The pull policy for the container image + ImagePullPolicy *ImagePullPolicy + // liveness probe properties LivenessProbe HealthProbePropertiesClassification @@ -387,6 +390,9 @@ type ContainerUpdate struct { // The registry and image to download and run in your container Image *string + // The pull policy for the container image + ImagePullPolicy *ImagePullPolicy + // liveness probe properties LivenessProbe HealthProbePropertiesClassification diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index 0c33c6bbfa..31b4f61a7c 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -469,6 +469,7 @@ func (c Container) MarshalJSON() ([]byte, error) { populate(objectMap, "command", c.Command) populate(objectMap, "env", c.Env) populate(objectMap, "image", c.Image) + populate(objectMap, "imagePullPolicy", c.ImagePullPolicy) populate(objectMap, "livenessProbe", c.LivenessProbe) populate(objectMap, "ports", c.Ports) populate(objectMap, "readinessProbe", c.ReadinessProbe) @@ -498,6 +499,9 @@ func (c *Container) UnmarshalJSON(data []byte) error { case "image": err = unpopulate(val, "Image", &c.Image) delete(rawMsg, key) + case "imagePullPolicy": + err = unpopulate(val, "ImagePullPolicy", &c.ImagePullPolicy) + delete(rawMsg, key) case "livenessProbe": c.LivenessProbe, err = unmarshalHealthProbePropertiesClassification(val) delete(rawMsg, key) @@ -837,6 +841,7 @@ func (c ContainerUpdate) MarshalJSON() ([]byte, error) { populate(objectMap, "command", c.Command) populate(objectMap, "env", c.Env) populate(objectMap, "image", c.Image) + populate(objectMap, "imagePullPolicy", c.ImagePullPolicy) populate(objectMap, "livenessProbe", c.LivenessProbe) populate(objectMap, "ports", c.Ports) populate(objectMap, "readinessProbe", c.ReadinessProbe) @@ -866,6 +871,9 @@ func (c *ContainerUpdate) UnmarshalJSON(data []byte) error { case "image": err = unpopulate(val, "Image", &c.Image) delete(rawMsg, key) + case "imagePullPolicy": + err = unpopulate(val, "ImagePullPolicy", &c.ImagePullPolicy) + delete(rawMsg, key) case "livenessProbe": c.LivenessProbe, err = unmarshalHealthProbePropertiesClassification(val) delete(rawMsg, key) diff --git a/pkg/corerp/datamodel/container.go b/pkg/corerp/datamodel/container.go index 006801b2df..6b95c06875 100644 --- a/pkg/corerp/datamodel/container.go +++ b/pkg/corerp/datamodel/container.go @@ -99,15 +99,16 @@ type ConnectionProperties struct { // Container - Definition of a container. type Container struct { - Image string `json:"image,omitempty"` - Env map[string]string `json:"env,omitempty"` - LivenessProbe HealthProbeProperties `json:"livenessProbe,omitempty"` - Ports map[string]ContainerPort `json:"ports,omitempty"` - ReadinessProbe HealthProbeProperties `json:"readinessProbe,omitempty"` - Volumes map[string]VolumeProperties `json:"volumes,omitempty"` - Command []string `json:"command,omitempty"` - Args []string `json:"args,omitempty"` - WorkingDir string `json:"workingDir,omitempty"` + Image string `json:"image,omitempty"` + ImagePullPolicy string `json:"imagePullPolicy,omitempty"` + Env map[string]string `json:"env,omitempty"` + LivenessProbe HealthProbeProperties `json:"livenessProbe,omitempty"` + Ports map[string]ContainerPort `json:"ports,omitempty"` + ReadinessProbe HealthProbeProperties `json:"readinessProbe,omitempty"` + Volumes map[string]VolumeProperties `json:"volumes,omitempty"` + Command []string `json:"command,omitempty"` + Args []string `json:"args,omitempty"` + WorkingDir string `json:"workingDir,omitempty"` } // ContainerPort - Specifies a listening port for the container diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index 607119de6e..bebd058ae6 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -365,6 +365,11 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op WorkingDir: properties.Container.WorkingDir, } + // If the user has specified an image pull policy, use it. Else, we will use Kubernetes default. + if properties.Container.ImagePullPolicy != "" { + container.ImagePullPolicy = corev1.PullPolicy(properties.Container.ImagePullPolicy) + } + var err error if !properties.Container.ReadinessProbe.IsEmpty() { container.ReadinessProbe, err = r.makeHealthProbe(properties.Container.ReadinessProbe) diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index 4200a2fb21..dc6017d260 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -1569,6 +1569,43 @@ func Test_DNS_Service_Generation(t *testing.T) { }) } +func Test_Render_ImagePullPolicySpecified(t *testing.T) { + properties := datamodel.ContainerProperties{ + BasicResourceProperties: rpv1.BasicResourceProperties{ + Application: applicationResourceID, + }, + Container: datamodel.Container{ + Image: "someimage:latest", + ImagePullPolicy: "Never", + Env: map[string]string{ + envVarName1: envVarValue1, + envVarName2: envVarValue2, + }, + }, + } + resource := makeResource(t, properties) + dependencies := map[string]renderers.RendererDependency{} + + ctx := testcontext.New(t) + renderer := Renderer{} + output, err := renderer.Render(ctx, resource, renderers.RenderOptions{Dependencies: dependencies}) + require.NoError(t, err) + require.Empty(t, output.ComputedValues) + require.Empty(t, output.SecretValues) + + t.Run("verify deployment", func(t *testing.T) { + deployment, _ := kubernetes.FindDeployment(output.Resources) + require.NotNil(t, deployment) + + require.Len(t, deployment.Spec.Template.Spec.Containers, 1) + + container := deployment.Spec.Template.Spec.Containers[0] + require.Equal(t, resourceName, container.Name) + require.Equal(t, properties.Container.Image, container.Image) + require.Equal(t, properties.Container.ImagePullPolicy, string(container.ImagePullPolicy)) + }) +} + func renderOptionsEnvAndAppKubeMetadata() renderers.RenderOptions { dependencies := map[string]renderers.RendererDependency{} option := renderers.RenderOptions{Dependencies: dependencies} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index 58b59cf6a3..7ea7d77991 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -2790,6 +2790,10 @@ "type": "string", "description": "The registry and image to download and run in your container" }, + "imagePullPolicy": { + "$ref": "#/definitions/ImagePullPolicy", + "description": "The pull policy for the container image" + }, "env": { "type": "object", "description": "environment", @@ -3063,6 +3067,10 @@ "type": "string", "description": "The registry and image to download and run in your container" }, + "imagePullPolicy": { + "$ref": "#/definitions/ImagePullPolicy", + "description": "The pull policy for the container image" + }, "env": { "type": "object", "description": "environment", @@ -4042,6 +4050,36 @@ } } }, + "ImagePullPolicy": { + "type": "string", + "description": "The image pull policy for the container", + "enum": [ + "Always", + "IfNotPresent", + "Never" + ], + "x-ms-enum": { + "name": "ImagePullPolicy", + "modelAsString": true, + "values": [ + { + "name": "Always", + "value": "Always", + "description": "Always" + }, + { + "name": "IfNotPresent", + "value": "IfNotPresent", + "description": "IfNotPresent" + }, + { + "name": "Never", + "value": "Never", + "description": "Never" + } + ] + } + }, "KeyObjectProperties": { "type": "object", "description": "Represents key object properties", diff --git a/typespec/Applications.Core/containers.tsp b/typespec/Applications.Core/containers.tsp index e952fcfecb..60ceeffb24 100644 --- a/typespec/Applications.Core/containers.tsp +++ b/typespec/Applications.Core/containers.tsp @@ -199,6 +199,9 @@ model Container { @doc("The registry and image to download and run in your container") image: string; + @doc("The pull policy for the container image") + imagePullPolicy?: ImagePullPolicy; + @doc("environment") env?: Record; @@ -224,6 +227,18 @@ model Container { workingDir?: string; } +@doc("The image pull policy for the container") +enum ImagePullPolicy { + @doc("Always") + Always, + + @doc("IfNotPresent") + IfNotPresent, + + @doc("Never") + Never, +} + @doc("The protocol in use by the port") enum PortProtocol { @doc("TCP protocol") From debb383fc3ab10456a868d6626afab02b37a6d70 Mon Sep 17 00:00:00 2001 From: Vishwanath Hiremath <100623239+vishwahiremat@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:32:13 -0700 Subject: [PATCH 18/57] Adding a fix for validating terraform secret in functional test (#6141) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding a fix for validating terraform secret in functional test - Validing the secret object with name before checking labels if the skiplabelvalidation is set to true ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 9385a96 ### Summary 🐾🏷 Update functional tests and label validation for Terraform recipes. Use `Applications.Core` for secret suffixes in `test/functional/shared/resources/recipe_terraform_test.go` and add a flag to skip label validation for some Kubernetes resources in `test/validation/k8s.go`. > _To migrate from Link to Core_ > _We updated the resource paths for_ > _Kubernetes Redis and Context_ > _And Azure Storage, what the heck_ > _We also fixed label validation more_ ### Walkthrough * Migrate from Applications.Link to Applications.Core for secret suffix resource path in Terraform recipes for Kubernetes Redis and Context, and Azure Storage ([link](https://github.com/project-radius/radius/pull/6141/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L58-R58), [link](https://github.com/project-radius/radius/pull/6141/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L92-R92), [link](https://github.com/project-radius/radius/pull/6141/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L104-R104), [link](https://github.com/project-radius/radius/pull/6141/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L204-R204)) in `test/functional/shared/resources/recipe_terraform_test.go` --- .../shared/resources/recipe_terraform_test.go | 8 ++++---- test/validation/k8s.go | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 18babdc08d..2eb00a1448 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -55,7 +55,7 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { appName := "corerp-resources-terraform-redis-app" envName := "corerp-resources-terraform-redis-env" redisCacheName := "tf-redis-cache" - secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/"+name, envName, appName) + secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/"+name, envName, appName) require.NoError(t, err) test := shared.NewRPTest(t, name, []shared.TestStep{ { @@ -89,7 +89,7 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { }, }, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { - resourceID := "/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/" + name + resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name testSecretDeletion(t, ctx, test, appName, envName, resourceID) }, }, @@ -101,7 +101,7 @@ func Test_TerraformRecipe_Context(t *testing.T) { template := "testdata/corerp-resources-terraform-context.bicep" name := "corerp-resources-terraform-context" appNamespace := "corerp-resources-terraform-context-app" - secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/"+name, name, name) + secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/"+name, name, name) require.NoError(t, err) test := shared.NewRPTest(t, name, []shared.TestStep{ { @@ -201,7 +201,7 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { }, SkipObjectValidation: true, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { - resourceID := "/planes/radius/local/resourcegroups/default/providers/Applications.Link/extenders/" + name + resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name testSecretDeletion(t, ctx, test, appName, envName, resourceID) }, }, diff --git a/test/validation/k8s.go b/test/validation/k8s.go index b4f0255543..8f682cf2a9 100644 --- a/test/validation/k8s.go +++ b/test/validation/k8s.go @@ -541,16 +541,18 @@ func matchesActualLabels(expectedResources []K8sObject, actualResources []unstru } resourceExists := false for idx, actualResource := range actualResources { - if labelsEqual(expectedResource.Labels, actualResource.GetLabels()) { - resourceExists = true - actualResources = append(actualResources[:idx], actualResources[idx+1:]...) - break - } else if expectedResource.Kind == "Secret" && expectedResource.SkipLabelValidation { + if expectedResource.SkipLabelValidation { if actualResource.GetName() == expectedResource.ResourceName { resourceExists = true actualResources = append(actualResources[:idx], actualResources[idx+1:]...) break } + } else { + if labelsEqual(expectedResource.Labels, actualResource.GetLabels()) { + resourceExists = true + actualResources = append(actualResources[:idx], actualResources[idx+1:]...) + break + } } } if !resourceExists { From e0ba7fa81d2fc6c76c7f9f287b72f0e5c52569c3 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 28 Aug 2023 14:37:24 -0700 Subject: [PATCH 19/57] Log pod states on failure of PR test run (#5946) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description * Added step in functional tests to log the pod states (get pods, describe pods) ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #5832 ## Auto-generated summary ### 🤖 Generated by Copilot at 9bb381c ### Summary 🐛📜🛠️ This pull request adds a new feature to the functional-test workflow that captures the pod states in the Kubernetes cluster when the tests fail. This is done by a new script `log-pod-states.sh` that is invoked by the workflow file `.github/workflows/functional-test.yaml`. > _When the cluster fails and the tests are doomed_ > _We invoke the script of `log-pod-states.sh`_ > _To reveal the secrets of the pods' fate_ > _And upload the file to the cloud of death_ ### Walkthrough * Add a new script to log pod states for debugging ([link](https://github.com/project-radius/radius/pull/5946/files?diff=unified&w=0#diff-85a4916f1d8bc4fd70ca3f7f1e51756e1822fb27a07d95e552a732caec1644f2R1-R34)) * Define a variable for the pod state log filename in the functional-test workflow ([link](https://github.com/project-radius/radius/pull/5946/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcR62-R63)) * Create a new job to run the script and upload the log file as an artifact ([link](https://github.com/project-radius/radius/pull/5946/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL555-R573)) --- .github/workflows/functional-test.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index 5bbcc1fcc7..95c15aecab 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -44,6 +44,8 @@ env: KIND_VER: 'v0.20.0' # Dapr version DAPR_VER: '1.11.0' + # Kubectl version + KUBECTL_VER: 'v1.25.0' # Azure Keyvault CSI driver chart version AZURE_KEYVAULT_CSI_DRIVER_VER: '1.4.2' # Azure workload identity webhook chart version @@ -517,6 +519,18 @@ jobs: INTEGRATION_TEST_RESOURCE_GROUP_NAME: ${{ env.AZURE_TEST_RESOURCE_GROUP }} BICEP_RECIPE_REGISTRY: ${{ env.BICEP_RECIPE_REGISTRY }} BICEP_RECIPE_TAG_VERSION: ${{ env.BICEP_RECIPE_TAG_VERSION }} + - uses: azure/setup-kubectl@v3 + if: always() + with: + version: ${{ env.KUBECTL_VER }} + - name: Collect Pod details + if: always() + run: | + POD_STATE_LOG_FILENAME='${{ env.RADIUS_CONTAINER_LOG_BASE }}/${{ matrix.name }}-tests-pod-states.log' + echo "kubectl get pods -A" >> $POD_STATE_LOG_FILENAME + kubectl get pods -A >> $POD_STATE_LOG_FILENAME + echo "kubectl describe pods -A" >> $POD_STATE_LOG_FILENAME + kubectl describe pods -A >> $POD_STATE_LOG_FILENAME - name: Upload container logs if: always() uses: actions/upload-artifact@v3 From 9b719ab42bd2bb5436381c5a05e8e26084dcc1cd Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Tue, 29 Aug 2023 00:34:43 -0700 Subject: [PATCH 20/57] Update running-controlplane-locally.md (#6161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description https://github.com/project-radius/radius/issues/6159 ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #6159 ## Auto-generated summary ### 🤖 Generated by Copilot at c149c7f ### Summary 🛠️🏠🔢 Updated the documentation for setting up and running the control plane locally. Made the `rad init` command easier to use and clarified the .NET SDK version error. > _Oh, we're the raddest crew that ever sailed the net_ > _We don't need no fancy tools to get our project set_ > _We just run `rad init` and it does the job for us_ > _And if your SDK is old, it tells you with a fuss_ ### Walkthrough * Simplify the `rad init` command to use default options and add the `--full` flag for advanced setup ([link](https://github.com/project-radius/radius/pull/6161/files?diff=unified&w=0#diff-9e2fd80b379a42830faf06edccddb5228ec9ade05d089345244394619fb9e805L47-R50)) * Improve the error message for .NET SDK version requirement ([link](https://github.com/project-radius/radius/pull/6161/files?diff=unified&w=0#diff-9e2fd80b379a42830faf06edccddb5228ec9ade05d089345244394619fb9e805L168-R168)) --- .../running-controlplane-locally.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md index 2324832547..440dc98b4e 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md @@ -44,10 +44,10 @@ Run one of the following two commands: ```sh # Choose this by default -rad init --dev +rad init # Choose this if you want to do advanced setup -rad init +rad init --full ``` This will install Radius and configure an environment for you. The database that's used **will NOT** be shared with your debug setup, so it mostly doesn't matter what choices you make. @@ -165,4 +165,4 @@ dotnet --list-sdks Make sure you see a `6.0` entry in `--list-runtimes` for `Microsoft.AspNetCore.App` and a `6.0` or newer entry for `--list-sdks`. -If you run into issues here, please re-read the prerequisites related to installing .NET. \ No newline at end of file +If you run into issues here, please re-read the prerequisites related to installing .NET. From 915422096fe8049014030496af372a9d46e12be9 Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Tue, 29 Aug 2023 02:06:26 -0700 Subject: [PATCH 21/57] Adding Recipe Engine section to Grafana Dashboard (#6116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding the Recipe Engine section to the Radius Resource Provider Dashboard in Grafana. Please see: https://radiuse2e00-dashboard-audycmffgberbghy.wus3.grafana.azure.com/d/Qw-xtsxVz/radius-resource-provider?orgId=1&refresh=10s ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). Fixes: #4446 ## Auto-generated summary ### 🤖 Generated by Copilot at 9c8429b ### Summary ### Walkthrough --- .../radius-resource-provider-dashboard.json | 823 +++++++++++++++++- 1 file changed, 787 insertions(+), 36 deletions(-) diff --git a/grafana/radius-resource-provider-dashboard.json b/grafana/radius-resource-provider-dashboard.json index 71033d1169..0fa27e6c99 100644 --- a/grafana/radius-resource-provider-dashboard.json +++ b/grafana/radius-resource-provider-dashboard.json @@ -24,7 +24,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 42, + "id": 43, "links": [], "liveNow": false, "panels": [ @@ -482,15 +482,13 @@ "justifyMode": "auto", "orientation": "auto", "reduceOptions": { - "calcs": [ - "last" - ], + "calcs": ["last"], "fields": "", "values": false }, "textMode": "auto" }, - "pluginVersion": "9.4.12", + "pluginVersion": "9.5.6", "targets": [ { "datasource": { @@ -547,16 +545,14 @@ "options": { "orientation": "auto", "reduceOptions": { - "calcs": [ - "min" - ], + "calcs": ["min"], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, - "pluginVersion": "9.4.12", + "pluginVersion": "9.5.6", "targets": [ { "datasource": { @@ -903,7 +899,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -920,11 +917,7 @@ "id": 27, "options": { "legend": { - "calcs": [ - "min", - "max", - "mean" - ], + "calcs": ["min", "max", "mean"], "displayMode": "table", "placement": "bottom", "showLegend": true @@ -1036,7 +1029,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -1125,7 +1119,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -1142,11 +1137,7 @@ "id": 41, "options": { "legend": { - "calcs": [ - "min", - "max", - "mean" - ], + "calcs": ["min", "max", "mean"], "displayMode": "table", "placement": "bottom", "showLegend": true @@ -1219,7 +1210,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1240,10 +1232,7 @@ "id": 21, "options": { "legend": { - "calcs": [ - "min", - "max" - ], + "calcs": ["min", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true @@ -1339,7 +1328,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null } ] }, @@ -1353,13 +1343,10 @@ "x": 12, "y": 42 }, - "id": 22, + "id": 51, "options": { "legend": { - "calcs": [ - "min", - "max" - ], + "calcs": ["min", "max"], "displayMode": "table", "placement": "bottom", "showLegend": true @@ -1387,6 +1374,770 @@ ], "title": "Job execution time (p99) per operation", "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 51 + }, + "id": 42, + "panels": [], + "title": "Recipe Engine", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 99.5 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 6, + "x": 0, + "y": 52 + }, + "id": 43, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": ["max"], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.5.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "expr": "sum(rate(recipe_operation_duration_count{operation_state=\"success\"}[$__rate_interval])) / sum(rate(recipe_operation_duration_count[$__rate_interval])) * 100", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Availability", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 9, + "x": 6, + "y": 52 + }, + "id": 44, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "expr": "sum(rate(recipe_operation_duration_count{}[$__rate_interval]))", + "hide": false, + "interval": "", + "legendFormat": "Incoming Requests", + "range": true, + "refId": "A" + } + ], + "title": "Incoming Requests per Second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 9, + "x": 15, + "y": 52 + }, + "id": 45, + "options": { + "legend": { + "calcs": ["mean"], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(recipe_operation_duration_count{}[$__rate_interval])) by (recipe_driver, operation_type)", + "hide": false, + "interval": "", + "legendFormat": "{{recipe_driver}} | {{operation_type}}", + "range": true, + "refId": "A" + } + ], + "title": "Incoming Requests per Second by Driver and Operation Type", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 0, + "y": 59 + }, + "id": 22, + "options": { + "legend": { + "calcs": ["min", "max"], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.99, sum by (le, recipe_driver, operation_type, resource_type)(rate(recipe_operation_duration_bucket{operation_state=\"success\"}[$__rate_interval])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "{{recipe_driver}} | {{operation_type}} | {{resource_type}}", + "range": true, + "refId": "A" + } + ], + "title": "P99 Recipe Execution Time by [Driver - Operation Type - Resource Type]", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "This graph tells us how long it takes to execute a recipe on average.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 11, + "w": 12, + "x": 12, + "y": 59 + }, + "id": 48, + "options": { + "legend": { + "calcs": ["min", "max"], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.99, sum by (le, recipe_template_path)(rate(recipe_operation_duration_bucket{operation_state=\"success\"}[$__rate_interval])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "{{recipe_template_path}}", + "range": true, + "refId": "A" + } + ], + "title": "P99 Recipe Execution Time by [Template Path]", + "transformations": [ + { + "id": "filterByRefId", + "options": { + "include": "" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "series", + "axisLabel": "Failure Rate", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 12, + "x": 0, + "y": 70 + }, + "id": 47, + "options": { + "legend": { + "calcs": ["min", "max"], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "(sum(rate(recipe_operation_duration_count{operation_state=\"failed\"}[$__rate_interval])) by (recipe_template_path, operation_type)) / (sum(rate(recipe_operation_duration_count[$__rate_interval])) by (recipe_template_path, operation_type))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "{{recipe_template_path}} | {{operation_type}}", + "range": true, + "refId": "A" + } + ], + "title": "Failure Rate by Template Path and Operation Type", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 70 + }, + "id": 50, + "options": { + "legend": { + "calcs": ["min", "max"], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.99, sum by (le)(rate(recipe_tf_init_duration_bucket{operation_state=\"success\"}[$__rate_interval])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "TF Init", + "range": true, + "refId": "A" + } + ], + "title": "P99 Terraform Initialization Duration", + "transformations": [ + { + "id": "filterByRefId", + "options": { + "include": "" + } + } + ], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 4, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 77 + }, + "id": 49, + "options": { + "legend": { + "calcs": ["min", "max"], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DATA_SOURCE}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(0.99, sum by (le, terraform_version)(rate(recipe_tf_installation_duration_bucket{operation_state=\"success\"}[$__rate_interval])))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "{{terraform_version}}", + "range": true, + "refId": "A" + } + ], + "title": "P99 Terraform Installation Duration", + "transformations": [], + "type": "timeseries" } ], "refresh": "10s", @@ -1425,13 +2176,13 @@ ] }, "time": { - "from": "now-30m", + "from": "now-3h", "to": "now" }, "timepicker": {}, "timezone": "utc", "title": "Radius Resource Provider", "uid": "Qw-xtsxVz", - "version": 2, + "version": 20, "weekStart": "" -} \ No newline at end of file +} From 9f6a7c3597088d9ccc282ed541f08e5dc0f74244 Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Tue, 29 Aug 2023 11:32:05 -0700 Subject: [PATCH 22/57] Adding new extender details to the required places (#6164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Most of our recipes use `Applications.Core/extenders` and the delete flow needs to be triggered for the new extender. Please see this PR: https://github.com/project-radius/radius/pull/6137. In this PR, I added a [PostDeleteVerify](https://github.com/project-radius/radius/pull/6137/files#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995R110) which is failing because delete logic needs to be updated for the `Applications.Core/extenders`. Let me know if any other place needs to be updated. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: #6163 ## Auto-generated summary ### 🤖 Generated by Copilot at e6a541f ### Summary :sparkles::wastebasket::package: This pull request adds support for managing extenders, which are custom resources that extend the core platform. It updates the `controller` and `clients` packages to handle the new resource type `Applications.Core/extenders`. > _We are the extenders, we defy the core_ > _We create our own resources, we demand more_ > _But they try to delete us, they import the `datamodel`_ > _They add a case for us, they think they can control_ ### Walkthrough * Add support for extender resource type in clients package ([link](https://github.com/project-radius/radius/pull/6164/files?diff=unified&w=0#diff-23443c20f46bfbb5ffda2f87efc0e56ecaea1ef964ed4fc9ee06fe584fcfedcaR59)) * Import corerp/datamodel package as corerp_dm in controller package ([link](https://github.com/project-radius/radius/pull/6164/files?diff=unified&w=0#diff-f369203c896ae38d9f447bf905fa1566b36a31b235e99de6742f243f0e37269cR26)) * Return pointer to extender data model in getDataModel function ([link](https://github.com/project-radius/radius/pull/6164/files?diff=unified&w=0#diff-f369203c896ae38d9f447bf905fa1566b36a31b235e99de6742f243f0e37269cR139-R140)) * Delete extender resource in deleteResource function using corerp_dm.Extender struct ([link](https://github.com/project-radius/radius/pull/6164/files?diff=unified&w=0#diff-f369203c896ae38d9f447bf905fa1566b36a31b235e99de6742f243f0e37269cR139-R140)) --- pkg/cli/clients/management.go | 1 + pkg/linkrp/backend/controller/deleteresource.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index 080d595224..ec134ab001 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -56,6 +56,7 @@ var ( "Applications.Core/httpRoutes", "Applications.Core/containers", "Applications.Core/secretStores", + "Applications.Core/extenders", // Resource Types after Splitting Linkrp Namespace linkrp.N_RabbitMQQueuesResourceType, linkrp.N_DaprStateStoresResourceType, diff --git a/pkg/linkrp/backend/controller/deleteresource.go b/pkg/linkrp/backend/controller/deleteresource.go index 2c8df58948..88f5b1d65a 100644 --- a/pkg/linkrp/backend/controller/deleteresource.go +++ b/pkg/linkrp/backend/controller/deleteresource.go @@ -23,6 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" + corerp_dm "github.com/project-radius/radius/pkg/corerp/datamodel" dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" "github.com/project-radius/radius/pkg/linkrp" @@ -135,6 +136,8 @@ func getDataModel(id resources.ID) (v1.ResourceDataModel, error) { return &dapr_dm.DaprSecretStore{}, nil case strings.ToLower(linkrp.N_DaprPubSubBrokersResourceType): return &dapr_dm.DaprPubSubBroker{}, nil + case strings.ToLower(linkrp.N_ExtendersResourceType): + return &corerp_dm.Extender{}, nil default: return nil, fmt.Errorf("async delete operation unsupported on resource type: %q. Resource ID: %q", resourceType, id.String()) } From 07d2eabf1486eaa731489d0f6707b1219d6b677b Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Tue, 29 Aug 2023 12:45:52 -0700 Subject: [PATCH 23/57] Adding Post Delete Verify steps to the TF Functional Tests (#6137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding Post Delete Verify steps to the TF Functional Tests ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 0d8ad55 ### Summary 🔄🧪🗑️ Refactored the Terraform recipe tests to align with the latest provider and framework changes. Simplified the test structure and code by removing redundant fields and functions. > _`Core` provider shines_ > _Terraform tests are refined_ > _Fields cut like winter_ ### Walkthrough * Migrate from Link to Core for the Terraform recipe tests by using the `Applications.Core` provider instead of the `Applications.Link` provider in the `getSecretSuffix` function ([link](https://github.com/project-radius/radius/pull/6137/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L58-R61), [link](https://github.com/project-radius/radius/pull/6137/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L104-R111)) * Align with the new test framework design that separates the verification steps from the test steps by moving the `PostStepVerify` function to the `PostDeleteVerify` field of the `RPTest` struct ([link](https://github.com/project-radius/radius/pull/6137/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L91-R100), [link](https://github.com/project-radius/radius/pull/6137/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L203-R215)) * Remove the unnecessary `SkipResourceDeletion` field from the test step, as the new test framework handles the resource deletion automatically ([link](https://github.com/project-radius/radius/pull/6137/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995L169)) --- .../shared/resources/recipe_terraform_test.go | 71 +++++++++++++++---- 1 file changed, 58 insertions(+), 13 deletions(-) diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 2eb00a1448..b67687849b 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -45,6 +45,11 @@ import ( "github.com/project-radius/radius/test/validation" ) +var ( + secretNamespace = "radius-system" + secretPrefix = "tfstate-default-" +) + // Test_TerraformRecipe_Redis covers the following terraform recipe scenario: // // - Create an extender resource using a Terraform recipe that deploys Redis on Kubernetes. @@ -55,8 +60,10 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { appName := "corerp-resources-terraform-redis-app" envName := "corerp-resources-terraform-redis-env" redisCacheName := "tf-redis-cache" - secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/"+name, envName, appName) + + secretSuffix, err := getSecretSuffix("/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/"+name, envName, appName) require.NoError(t, err) + test := shared.NewRPTest(t, name, []shared.TestStep{ { Executor: step.NewDeployExecutor(template, functional.GetTerraformRecipeModuleServerURL(), "appName="+appName, "redisCacheName="+redisCacheName), @@ -81,19 +88,30 @@ func Test_TerraformRecipe_KubernetesRedis(t *testing.T) { K8sObjects: &validation.K8sObjectSet{ Namespaces: map[string][]validation.K8sObject{ appName: { - validation.NewK8sServiceForResource(appName, redisCacheName).ValidateLabels(false), + validation.NewK8sServiceForResource(appName, redisCacheName). + ValidateLabels(false), }, - "radius-system": { - validation.NewK8sSecretForResourceWithResourceName("tfstate-default-" + secret).ValidateLabels(false), + secretNamespace: { + validation.NewK8sSecretForResourceWithResourceName(secretPrefix + secretSuffix). + ValidateLabels(false), }, }, }, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { - resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name - testSecretDeletion(t, ctx, test, appName, envName, resourceID) + secret, err := test.Options.K8sClient.CoreV1().Secrets(secretNamespace). + Get(ctx, secretPrefix+secretSuffix, metav1.GetOptions{}) + require.NoError(t, err) + require.Equal(t, secretNamespace, secret.Namespace) + require.Equal(t, secretPrefix+secretSuffix, secret.Name) }, }, }) + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name + testSecretDeletion(t, ctx, test, appName, envName, resourceID) + } + test.Test(t) } @@ -101,8 +119,10 @@ func Test_TerraformRecipe_Context(t *testing.T) { template := "testdata/corerp-resources-terraform-context.bicep" name := "corerp-resources-terraform-context" appNamespace := "corerp-resources-terraform-context-app" - secret, err := getSecretSuffix("/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/"+name, name, name) + + secretSuffix, err := getSecretSuffix("/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/"+name, name, name) require.NoError(t, err) + test := shared.NewRPTest(t, name, []shared.TestStep{ { Executor: step.NewDeployExecutor(template, functional.GetTerraformRecipeModuleServerURL()), @@ -123,8 +143,9 @@ func Test_TerraformRecipe_Context(t *testing.T) { appNamespace: { validation.NewK8sSecretForResource(name, name), }, - "radius-system": { - validation.NewK8sSecretForResourceWithResourceName("tfstate-default-" + secret).ValidateLabels(false), + secretNamespace: { + validation.NewK8sSecretForResourceWithResourceName(secretPrefix + secretSuffix). + ValidateLabels(false), }, }, }, @@ -165,10 +186,21 @@ func Test_TerraformRecipe_Context(t *testing.T) { replaced := strings.ReplaceAll(string(decoded), "resourcegroups/"+rgName, "resourcegroups/radiusGroup") require.Equalf(t, tc.expected, replaced, "secret data mismatch, key: %s", tc.key) } + + secret, err := test.Options.K8sClient.CoreV1().Secrets(secretNamespace). + Get(ctx, secretPrefix+secretSuffix, metav1.GetOptions{}) + require.NoError(t, err) + require.Equal(t, secretNamespace, secret.Namespace) + require.Equal(t, secretPrefix+secretSuffix, secret.Name) }, - SkipResourceDeletion: true, }, }) + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name + testSecretDeletion(t, ctx, test, name, name, resourceID) + } + test.Test(t) } @@ -202,10 +234,23 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { SkipObjectValidation: true, PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name - testSecretDeletion(t, ctx, test, appName, envName, resourceID) + secretSuffix, err := getSecretSuffix(resourceID, envName, appName) + require.NoError(t, err) + + secret, err := test.Options.K8sClient.CoreV1().Secrets(secretNamespace). + Get(ctx, secretPrefix+secretSuffix, metav1.GetOptions{}) + require.NoError(t, err) + require.Equal(t, secretNamespace, secret.Namespace) + require.Equal(t, secretPrefix+secretSuffix, secret.Name) }, }, }) + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + resourceID := "/planes/radius/local/resourcegroups/kind-radius/providers/Applications.Core/extenders/" + name + testSecretDeletion(t, ctx, test, appName, envName, resourceID) + } + test.Test(t) } @@ -213,8 +258,8 @@ func testSecretDeletion(t *testing.T, ctx context.Context, test shared.RPTest, a secretSuffix, err := getSecretSuffix(resourceID, envName, appName) require.NoError(t, err) - secret, err := test.Options.K8sClient.CoreV1().Secrets(appName). - Get(ctx, "tfstate-default-"+secretSuffix, metav1.GetOptions{}) + secret, err := test.Options.K8sClient.CoreV1().Secrets(secretNamespace). + Get(ctx, secretPrefix+secretSuffix, metav1.GetOptions{}) require.Error(t, err) require.True(t, apierrors.IsNotFound(err)) require.Equal(t, secret, &corev1.Secret{}) From b7a49ce2544573f5283220521c642483fdbe6a72 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Tue, 29 Aug 2023 14:03:39 -0700 Subject: [PATCH 24/57] Add GitHub Issues config file (#6167) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adds a config template with a link to the Discord server. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 85be66e ### Summary 🆕📞🙋 Enable blank issues and add Discord contact link in `.github/ISSUE_TEMPLATE/config.yaml`. This improves the issue reporting and support experience for the project's users and contributors. > _`blank_issues` on_ > _report bugs or ask questions_ > _discord link in fall_ ### Walkthrough * Enable blank issues and add contact link for Discord support ([link](https://github.com/project-radius/radius/pull/6167/files?diff=unified&w=0#diff-bfe857fb12506e797b48b7815c1d5aec3234a92b11255e0df0c8e9ca7fcf8dd9R1-R5)) --- .github/ISSUE_TEMPLATE/config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yaml diff --git a/.github/ISSUE_TEMPLATE/config.yaml b/.github/ISSUE_TEMPLATE/config.yaml new file mode 100644 index 0000000000..debd7a4844 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yaml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Discord Support + url: https://discord.gg/SRG3ePMKNy + about: Please ask any questions you may have here From fd564cd883577ca29cba8c295c1054937f5c2082 Mon Sep 17 00:00:00 2001 From: vinayada1 <28875764+vinayada1@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:50:05 -0700 Subject: [PATCH 25/57] Document how to use forked repo to contribute to Radius. (#6168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Document how to use forked repo to contribute to Radius. Modify workflow to allow contributions from private repos (interim till Radius goes public) Caveat: Till Radius goes public, we still have the step to auto add comments to the PR fail. This should not be a problem once Radius goes public. We also might have to edit workflow permissions to make the helm chart build work (it is hard to determine how this behavior will be before the repo becomes public) ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #8984 ## Auto-generated summary ### 🤖 Generated by Copilot at 1fb51d5 ### Summary 📝🔧💬 This pull request updates the documentation and the functional-test workflow to use and explain the forked repo workflow for code contributions. It adds a new file `first-commit-06-creating-a-forked-repo/index.md`, renames and edits `first-commit-07-creating-a-pr/index.md`, and modifies `README.md` and `.github/workflows/functional-test.yaml`. > _Fork the repo, clone the code, push your changes to the sky_ > _Create a pull request, compare across forks, let the reviewers decide_ > _Submit your contribution, follow the workflow, don't open what you can't close_ > _Fix the bugs, format the yaml, use the `github` repo and ref_ ### Walkthrough * Add documentation on creating a forked repo for code contributions ([link](https://github.com/project-radius/radius/pull/6168/files?diff=unified&w=0#diff-777bb8504753da695b3728c8c7ba1a4827394f20c35350b93cec5b94447f95e7L1-R45)) * Update documentation on creating and submitting a pull request to use the forked repo workflow and the compare across forks option ([link](https://github.com/project-radius/radius/pull/6168/files?diff=unified&w=0#diff-99774fdf73f6fb9ec61bc38985ff59c08839506954c0055ba41ab014c2207215L45-R48), [link](https://github.com/project-radius/radius/pull/6168/files?diff=unified&w=0#diff-fb0f7798935160052ab4612b954c50fb8f31d3825cce346f5feb693c418f2abaL18-R18)) * Fix environment variables for the checkout target in the `functional-test.yaml` workflow file to use the github repository and ref instead of the pull request head repo and sha ([link](https://github.com/project-radius/radius/pull/6168/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL103-R103)) * Remove an empty line from the `functional-test.yaml` workflow file ([link](https://github.com/project-radius/radius/pull/6168/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL77)) --------- Co-authored-by: Will <28876888+willtsai@users.noreply.github.com> --- .github/workflows/functional-test.yaml | 5 +- .../compare.png | Bin 0 -> 103045 bytes .../fork.png | Bin 0 -> 322134 bytes .../index.md | 46 ++++++++++++++++++ .../index.md | 4 +- .../pr-checks.png | Bin .../contributing-pull-requests/README.md | 2 +- 7 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/compare.png create mode 100644 docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/fork.png create mode 100644 docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/index.md rename docs/contributing/contributing-code/contributing-code-first-commit/{first-commit-06-creating-a-pr => first-commit-07-creating-a-pr}/index.md (93%) rename docs/contributing/contributing-code/contributing-code-first-commit/{first-commit-06-creating-a-pr => first-commit-07-creating-a-pr}/pr-checks.png (100%) diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index 95c15aecab..d5cd64d449 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -74,7 +74,6 @@ env: # GitHub Actor for pushing images to GHCR GHCR_ACTOR: rad-ci-bot - jobs: build: name: Build Radius for test @@ -100,8 +99,8 @@ jobs: - name: Set up checkout target (pull_request) if: github.event_name == 'pull_request' run: | - echo "CHECKOUT_REPO=${{ github.event.pull_request.head.repo.full_name }}" >> $GITHUB_ENV - echo "CHECKOUT_REF=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + echo "CHECKOUT_REPO=${{ github.repository }}" >> $GITHUB_ENV + echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV - name: Set up checkout target (repository_dispatch from /ok-to-test) if: github.event_name == 'repository_dispatch' diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/compare.png b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/compare.png new file mode 100644 index 0000000000000000000000000000000000000000..44269b6e173f302eef70cc3bd92e3d267a0ff29c GIT binary patch literal 103045 zcma%j1za6VvNs_F2<`-T2<{L(xVw9Bm*7qa8a%kW1b26rgS$(x;O_Pf_wIgg-`(7| z3&ZcsndzRcuA1sD`4`{hWJKX%uwlT!z~IHjgcQKQps2yXUYS8d0#|5!x+8%vYG#6h za^ix5gmQK^#%7jAU|{dRJ4TLD3(2GPwRKH0$Yxo_Fmdr=PjItxv62&Ej1u-94SR0D z8>cNM=j%z&&*@tjndIjgW~vXU5NQq)WEgijq;etJ1f+1L%C5FvFWEquD!`4{!+dEz zMrMU;f9BGvZqnx?jrNm#Mh|;cSd+TJt^YgcgyV$eOxN%Oa_U{t_4 zG#L0R6tLI8*(=}|EYJ)L;*WDMFmm7%4D5AO02mbTi30q|Wq|+lE);df>wliVGJ9#r zuP7)k4ty#a*clmF+nd@rL=rLpA_nI*Q&MwKla}H%u(6`kGqlk+qI0pbedz+m?ZOG1 zS{XU$5xQ7eTHABF@DTsef)hA@xlB(?_(u~53m#%MX*ohc8#^OHHaZ4624Y?qLPA1r zJ40hm1tF1tbO*li5SuzU*mBa-J3BkmIWyDQ*qP8Xa&U0aGceIJG0_4oXzg9C9rRpi zt?fzve8@kaBV=T6U}t9QU}j@Y`0`vmeH%vy9%AB`f&Tx`pL80znElU4*7pCH7BE5j zmpk-~bPV*r>*io){5RcR?)=&9k9qw$9QVt^IOWV-j4aiK%&Y*e0;KUWvoUi2G0eZ+ z`5!|6?5S*TWG8521$1=a{U5RXqw~Ms{A7zxG`A26_wVB$jjN-nPs zQs1PYs$%xgYb-4<=gI{)Riimy6Z?bHvT9JtNj&-ryrI?s?kq0{OI9c}i?zA0FcBq7 zvkh2Rg72JZG9|j6uOvT9kw-hPw6G5zx+6ZJV!w?9`>zf^MxP&gOZdqouTTj8t3&XM zJ{dj4f7jT@mI!G%TIG1Dg`VAdC5r3%2$U@v!81=LWRxWuLH^mGFRJ_PhUC(R3IV0S zGN*;M=P$+TO)9mP^Hj5C+R@3+4iDCOWf~UnFC8Oj}xU)NJ+}x!<+@E}Z$hOjM@lyP0p;-_`ajN%tROEKD<`as| zs?jT(KsZ~f?cC<8{SA#$K@1c}nTS&*V zgrlD?2*UnoOK680l-1a~(I>lkpSLg7%Tj?5AJhx9+%i<2+~d_Qm7^ z&E7Y^zMG3*Z!UyI?sH*8^k<0*&pZY6Ty7s;A{DE>9YaE5&Jib)&-(H4Hr<4pn+vEqQy_6jB#Gx`GJ)7l5G6JtTMU^u3jmZu7$IIExCY!eJa}@^n)jBF7 zFEsq-SaSz|2g_AvpqDt27xNBVeMoBQ+LO8XPbm?CBYo*Y!>y4?Z=*4LEav~fr6uV- zkVJWCPo|{N2jjEXy?c)TFHD}j+#a|@nr?K#)%~80Qd+xi%xM9Cm`(6h`5FpAtVF}n zgH9={O)`!qmeX+`G@dQ`IPEzj`8%=zTGvRx-}wssQiX}-1s^njd1(m2QQQ5{a+VUn#*S7ILFMP)gM=^W*HSGE~9w(Q?z7$`0LE)xTStK6aCSVSK+ym;L>Z zrK|Y^gzYL~0p#bkUz8oXVsKWyLHInRO(IF2wjODf!VUd7qQbpT0oRw?M=wkeNuuV3 zz&m^zX|mfIjQ!}&W-6yE5{6B*+~gb`ip31Musx8hR-rH6hj3^#)xVl+l|19)#Nm3D zb8&Dhp5f>r_%{+ls(>CVV$x4Vyb5^H(g*1;*Ph;}#*d_HSUx+Njn18)dP5T{jX*Pm zn&z{mWMvqX#AK2&k#wo6QR-F3py#{mc+>GL$s`stQlmk%yFiG2#!W!$>~7DD&fWHB ztjy%vTB~hVWuho#t@orew?rbaaDIdtf#N}X(-t`%w{|`==kWhwDQ`A~Sc^?y7tO;w zEO%|@CAK|!cr)*PQvTq&SB=YenqR=GIYSdgW)C?KPf?d69lan*ds~M6OOn0?O;Nu$ zbhk}}SbUg1M$Ps4$#a))jUqpv+#-&~XJ)oUQ}hHA1+>}8eBN~I9m!-g_yg=tfU`OP zg6x{;x7&pewB*`AG)1M&Ge1Yc>s*sj?Z}(cpAy?rSY$S7T2b8U6VQvtV@{UygEf`b z8yL5minI-tLf=p%5>a|`Bzh`KgKc^KFM;yPxrEGc*&f~5{jdx zJnlw2M?6dhR~`i#xmi=CrvZD6>+we?3zs;R9$V(~m7e)%{qdq2tQIu#*^s{k*`FK8 zRuOO1HP~%vII2v}lYHBp=31QFLesgW74o2MN9?C%q#O?{mNH6n6h!%S)qZpj`b)-v zd;|jprx4#S+BB-XEYeBi%*^%&W=653QELT; zAUTZ9N@_BKyFwUL zZghPxPojAlQUYwM(geUxOL32g%aG~a)i^17(ebpFNup4va#?P@P|a?9@FBXXMtWZ* zibkDjccG*yWhOBLl_ESILhs@hm({#_D3x7S#;hsPVcV=Ei8WWdsdl~7H!SMkjifL6 z5GTn`-mkqUI~q(C^0#pm8V%p#1%=u;^?~hu?Ex7shHHy7KRj$8k~$rzrKwmA>d8EA z^mQPjbuxFIjhqyo$zcSD=5l4CNav`W*7B!fGZ}8qVa_z6Ai$qv(#Joz+KXf0U1tD` zoL^}B7PYG3a=@_N#&Pn*Vae6H-7&2C=ws9DiYJue;hpqE4u6X+X2XMf&Z`>1kN1wh zpaDxI++lZ41_phIAV)nYE|J+N@<^NW9T8@9uou=@)5X!Hd;&A4<6ZHC{eB$F4^2g? z7+PAJ>tB=?(sLh|Rl+)s;@o`FjZ_OslJN@aH% z<=P2trUgTZZDO^Bv!(+-Gmq^7oshAq#dr{gTx@bq2j0$kGgVZ;D4VY|vTvj%rDir6 z(Ld87uFK6noNt^nr>ebhs@6%Bo7wv^*ZsY2{bk$_2cVV6K~G@{*<>;3#{ z;%V5)IBuh!?7mCKl^QVqvWV9y3$kxD0Mm$&TBVpp zyXgnBK$k$VkdB(4k@ZCVcL%S1+Gt6PV^j(m+@DB87@DoWlWZIG(j^7xlhUKlR@X)nNf_M)!ij`{R zMh_LpnYujiw{e`xFt?gLZ&YgyW_7;hXWH8vkM0$U<>*An`BSTuMSu9LuUH&9WfGN& zXajB}fic_cXQEWTMA{`19$mLk$7ay9zD!?BPzzx^l1Lx_+(>NW?53!rQYPUX01XBG zip%BZJt|wRUW>+&)9LP2_czp}yR~K4{TaNflnb+J|K3XrkZc=5G_bj)ovYh5s#x+TsXu>`m|F7Mcum7sa@=_xCpKEX<#Ck z&V4ff8Z(O6-{$9D)^`Zb=+aeHU5O@kt`AoBr$5OiDvew{v$q0SziSFu(1%aL|)7kTY2>d|Nw`ae6?H%FlFlO^)mgfBJU$|ksu zm#&ucwb#>PAoI%Yp*Ja41y*K+5eR;{RqWa}$+Y-P2tj-7ZS;I-yY= zUehZU`nlm8L}|NU?GkQTrM|}<^|CJqoo@6*=fUsI4Hj!P@t10~kcS;YYS;_O`PdBk z74(9tOWjf$t9FwVX|xxnMoZLok8T=LA;jA4!D*A(Vnh)M2J=c5S*5lN%@!*QcDSkx zb0}c6%gqG%$nEmbps{DFLQ)O21WP6+RTUDq6ZoLlRdsa{d!=8-*=P8d!jj= z(#Anj3n?sb6z^Kycrb(~Tah*#|LN5>TRL&a9m1bdlUbpu>!5HwHSl0l52l)V}iNkI)GL_5Ota&|9 zq1A(9lAeZu+eOZRTQ?H?_FS^jVb}6e*u&)gJv0;!my_k{CDz=P6m4rgNG7dTN^^Je_m_n--u1nFp=F>wXV>2#TQmn9T_t$@)@90ym5D&S*N>Y^B+Cn3Ex(-9<}q zjZ`8=3Y)jSJseLGp&R!pg zC(_p7$Xnn3xo0;)DsK4P(PivGXmga(>q{~wbGLmL*7gRqD4IgnyctXoMgJ-^FLa^7 zy{vhe@dl0losGci$z8)srhy;JQLCvB)WX7S+70o*2>&Bt5V z_|1#NDq}cmi|x?f#P(LCUXiiwRZe*>=Wt8TE7T9du?WlsJ2Pe+WytxFtuT5J8%47e zaE}~WuZMT1EUv=C3Gnz_CC;`6$iz`7m=@u=mhn~l^bf9?anhdxnM55A$Yc&aMA2H1 zdwR0X80&_E0Ec7bEnwvdFVvbFL!^c!*X^0Sk7Kcxn|0MI^*n-ZcSm&lxD~wB!dpv) z4oZ~EwV1VnQ>;M2E4gwrYADtKJ5y($5f{5!Et#(}`cAh;mPBKwU@vw06VhXcd+fOP zq&(JQCefIhnqC&(l1Qag>3ghxZs1huZdVwy@5vTDwZbNPzW!FO2*-B+P!z_$P5vP?(Jd%oeQbye^U*EuDSDXcruUXAB`}Yze*z$|4 z!=Mj>==l(tN?TpjESK|29&Wm>6{?Kk6;;#e?_oLvH6ZJ@uqN{tA^J3_;%clXN2(2C z2Vy9r;Rx8eq1}EUIvp-xkd$6MRz|RxPmNJwZ(cSA@O1FTDrr@9#)RXZHX)-nIeLpm z+D}y0-|6AAn){K@(0)>}TCEV&s5UjSnt?j4SE#kbT6Cw8O8Fp;L9b3+q*@YVzcZ3p zD-wZCiF8ln{_KmGtJP3>HlN=TY8$c?jui0upuW`BBfCZ$x;JfM9oYZIwXjioQ5P$X zLOkZLsnJEwu_}=6t4+t3f;_`_AQq8oG5fv?d55l%KaGnLfWG>}Rt%`&qdO5{FD~Y% zds>&i32LNN%!|?M@{TXjtQ#cQ=hV>0Wu8XJ+y@F%rToln?e-DaZxf$jKAA(gp|{U$-kRYD&f* ztdJnR53c<`F8T2<;XK^GbKR&37AeNfTsMysR-0W+LbRCs!6)U2>4=00swr$CkEM=@ogBQ* z*9`;#3T8QMB$lq?2545lpKDS3%>c7u(Kd7sA;VRd1=nRGRV4ielUKCNI?jI0+k#N0a6^aRmvOjm7f6{^C%C_-d@5TFqm(1YzXd zzcAcfYc(!pU%&$^@AB(}@v_(z;}U*nKl-|9*Ab0y1acwK2H=nu%9l^`thniP z_&asoRaiS0R0?S}fh|?tOIBBe(O;G|?2C2r*2_(x>Vj9`+kNR5Oaf#=U0GDNcygnC zfC_=wS3M{MYYw{t5yYn13zHej`8=MrBiXb{=33nALUFi6uBkJ0yct7n8w~nnNQza8 z)#OJ~IB4Oq*=E=R1|mD!u;_x*c?vpXIDRk_ua_js2|~IXoR}BOXE!PpXw9cELysUutf$^>MDU48 z4ac7vt$JI|o_y~`-lcHbmm<&^M@{Vw*E{r>lPJv;$SV)VQPIV-5X@zCw1GwiMF!*3y*?># zT%r562Rhg}C1Zpw$N7u?9Ob);mUZ(s=xo>5xB^ zK%!VZI*bi@nI&*R1sxkZ7(Z^{p-p0Hh9@Z64|r3dYTryX+u-mDz7PBqzaBZ9)?`W> z(yW%6F+XZ5R%enR8g{RBAN6XmJ*})Z)zS?{qkA7ur~91%@`>CYgC-8Kkq_s%A!8*u zb)kj@oZK#sPN#JOI<`!iie6dC)IWd!WPHP@c$;cCnmRD7OZ;-~V4)z@t=PC6Z!~y% z|Bb7t8L%_0Ah!#BrNdhsu;~)%Pq_^l+C+>gnF8wv-*tJGYy4X|FsojJYkP z^Ln*48HzpA1nXyjBiJAfAnLCixQ?c1AA}Ibn1#N}jEXuaf*ofP$lP!tRO7<-8>C%y zno|)Rt7XT8!Z9U|s&vNG>~dz9(eV*oyL9KnyQ*EvMwB*%*QDspX`lXOq+oaRL1Z&WYksS*VR%hP5vM` zP@z%*%}o^?k%q-=A(>n@2j_#_F)9(vqBz?r}JwM@NdT`VgvwfXb} z%|^3QA?}^JXq+mYK%;;M&BYn0(%@dDh)YJ7-4t5$L9Obz&Vc{IYWePRJB8DF!~Hjb zYiL<;Xw~3m8SiIL#mP)=Ns^6XS!hWZ$+ay*BNIoCQb89bKfL8egF5Nrr999Hr+CbX zdXQp_nO0jZ)>>GJ9_nJ9HJxW0PKJDAI97#SUula7L$O+EwHbJ(j74ES%9;4e)DO)x znQEP8kJz`#FsJl60Z2`Vj+WV;(c9!SG<%fF56a9R+f0sM0Tu|4G#5luu36|BPq4wk ze0Gs~;PVr==S=bOTx~8gUj+hwtY+L6C&4QXJ&z3;kwb5;w%BM5r=UDUO3P0XAN8*75KJr8{&mXTl zKjB;|h$3{I)V>?f_Ai755*5lK{Qe_y%6GVj%`(}n?Ezu97Ek4&EcQH&PEk@=uW^5t zBLrAjua$LemgWUku}>je>l=N8w*9`)1#OMhaPc&=xfAZB{f5gMi@QGst26L!f{w(sw6K`X`J)o7KGi#9GB< zDSAz0Q(JcZZxh=-KFNKHomLu4&BRYSzH%AGP{ANBh<%M_)x^xuMZ+h1uDmb{Wuq>d z%;lUml*p`V^6KbqH`uza-i+f(B}{6ZPd<9@j0R@ZET`jM|0bp4P>p;WKZ&C7rTO&K zMr|snIre$Cq02IL4Q?@=+Y3bt+4?uRH6SwvhKLW>PpeTYki=HJQ;FFBz20)m{2ZtL z(^E4Y$lv(2of ze)YM??bA<00fX+fVATo)`~Lv0E!W~LR+mOaz< zV;Z~mB!SC53kGR|%14bZ1!#3H&@EzJg;$27sKh#p$C@akDcFxoo+Eux^~r&(R=Yd+ z%|RG0SBI4T`ybKp<^`gcA)iK?MUM;A&;c(aCSs@YWS1!^;-bD|0?oUi4m!{IJ3pc0R z)+6Z?PnYGJI-ZOly1VD(H?0p4ZgYNa-Rw`BR>AlVg``c$g2B*2!NMvOCekm3E z1+E*Q3uhGHPn^6e@8;=qLnVh3Ydx&z%{ivE;j{3@MfBr>jw^*L`~b&ZedF}mucXoT z^zr^!aPcVa9gNTZe%bx}%ti-Q@DnJFCt3P^Q?@HqGoy>COd``jvbN!`^7XUx(Kaz) zan4a0PNHfii+#eDxyT4e_3!zH^KklRHesXdS6ASu9Vh9G7C3XBY;24Bb<#PP#TBl4 zwQ0r0!!JRz#ae0G>4n<$JQ$D_CPH`Z`0&?_Fqhp4quwg?om}B_<0$p>_>nXouCbax z-mZf;rnuQ;EKOz;-Cybkxjk+UlG+O-+yW zK(L4Kz0X_4y!~#!)F@dB1&47K`RJ#7zS^KSMqUtxUhyZ$nLt(m&XMB?o4@&T9Ia+*aP|+D zkO;m_9Cj-v4(t*Hk~R_=XS!MDRl6;OIb-@C0-IWGUcLj4yF=$C3c0~aF+7Pel-e4D z@zf?yFql+^bV|_KyA!$0;Jby&Ma88Fvslc=gAvdB1g5Din52G+E`gj+Zx%Y%;X50) zhY|%_kFH~<3Y8TlVyP&_ENxs%wug`zB=sk^hiiF=s!P;cdaqVK6Y+ojGDdrU&37-i zT>n{+PTLJ53j;sr1VZ@33}7t}cD^~6(is9WQ(P)LXOBQ`L|P1G(*(N2YC0vN+;})i zJOckXNh^y|5u#OHbGBnhy(*L;;tYvnSsf+yE%aiIMZBv&SexF4NR{Oy)OVCj@9&Zq zRinJq44p;NPg0hApMT~khnD>&H+iCkY&w+@Za7<>7M(X7Ljd`ZrQ>Q5CRgjZW38U! z>z?j)8-^v-$4`P*ywPo{+wmoyl>03*42CNXqYI*qfV*#9)?@cscHe8SGR>6`Easf( zxzGBN{L-q5YKpw;^zkwhqBnDD72w^1_jkDQ>qZq`lNbeBt;Mu7*#?PgE32~?ALBZF zQEHFdt4#GiIj@Z&ix=7hb2PHgwJrVt9%_$^beM8entNTm^f)!8u;$c)W+W+&b^ z6)`<&v`JEo9V}JND)Biz7=CtutX$}Eep_law`o=-RSjXG>C&R&SrWC5;PXx=?xu@L zAZrmewslW;%*KV@oY&#z2QF+Tp${x?U9hyCkw0t;O_3@9$yoZ54jIg@$DOM3v-~WO zz{^4H{D2mMR~Or_t#ouJj2xm`F1QL&Kmn@{cud!|>2^&tY;V(-yty^(99S;cC5~X!%-xTwym9?tsti%uqb*QMRZGDi8q=|Hs469?8wR z4#CZh2zQt}uZNq@iY9?qqsF)p3mpSEn|{#Z&}tOQ1x1cdRc=#1#_crinNv9IdxHY6 zj4Wn~iMj%wt(ysoW`7i9*=dkSEXIGXg*$!M$K}#5H{WEFK7!Uv&E*UU9j|hW=hl*8 ztz{F2!yaRSZQYCF4Etedv-;{=q0SHzuP^fh51uOy_%tCL1JrWU>x}{2^x7lqLiM+KN%+IVji*~YP zn4Ud{AO_;O@|6nZdT}?9@#KV8WT5M?Sfnh?hnYF$p}di|5%53UBj85CC)b&k4p5Qn zQb6cJ=M>FYGi2pY=W$h_NClb)HKzxLGw2^mmw2bSIrau$Ms43oWypilg!k=coJ#>a z>LjII%7tw436fMVi8V4S(NK0lHJk>*lBmw>GV=HwrlnjC^OR_^NRz zsi}SQ)yVx67D$`#`hbfNhutRj&Jih<@mteR-sSNA06{MTTIfe@LR~lJZ*N!2P9&KeB?`qC2MZdNnm|4N}n&JCk>d2W2BYH?~ddh?w(X(5UNmL%F!j6kjF9xFtbNRE&7I z+DT3iq8kfg*u& znoN$0F4P3)~oJoQ$4%w6sXG2W75H z89-^+Ja6A!?rWG3=ih!jB@zw_O-Qn6mk+8g>sn?yV=!0lz-O*+Z&~1F&u?-=eqwbx z_>$aGRSBJVU*{G>E)g@gd&;p0wa;d=Y>o2K`+O_k*eRpPZl$!Z25MB4nlHEL@w3+2 z7Xq;~YymQoXYkI>Mz{LjpB5X%@6k^Do!^nUxM`b3P`la z8^~RGe)+_4GMkBAc;ScKhdo_p(8e(Zn!T*^O1HVgIW3V1EA-jhzjfu?@Smy`Heg0L z|8+`&x&kD%o7kZ-L->!^dV3qaZxSCK4EU-rxrvEbydHb{ILVPlOY=-ZuC~%kJZt?v zrv~l~fBQ^+{~0Qjb!q%G=*G#FJpFLX*dEi_!f_8?A?iq)J1W$v>M#{nEXfR=6L8U--bzfDWbq< zfrUIz)&vGSMf?4Ln!XHAf+bpax0JNFriWSdjS`oqPGM>4cp&9Jj+aDbma2+B+LTS*#;mQU9iP>`BxD(>? zwNCZ^3QI>S0)?Ua~~tNPM*h5gQ==0^GgC3juN zH7Lu6IQ|OM#LGjvxxP^D+H|X}lPfU)Xq(a|50R0V_Y*T8DC z)OYOYNU5aLd=W2mfxykNQeo{v$a%ijt>()vK(^<|?nB^6K6O%FN)rx~N>mdGokC<4 za{s+OM1(Lsprn_8mf_Wh93jI@CR-cNb2_8o&9mFS<79?|e&iODV=v}gh>_2>gI~v> zL@9qEPV1D>)D)`1%kvuPUSO;~r+ZCxZPtlA?Oj=EaH3O<&)hFJnU)SFlCyA!NLYY$@~Uf zI7<0yv;5)4*V)6(;Y3WU&8*0ci8P9B7-zn-ae*D2kugUHdK7JfGanfWs9@5cV zY)^^ufc=d|fZW?M5EGfN%vVIE$d@G1%h3)CZrfU@S=0!CFy=N1MOJT!_|U%8srN|B0m2f=V1L=tP^@gj^m&Tn$&k?pYJVEErW`C#8|*uBXJ z3-G?IQ7(A5*1=)8sV4p1e$wdjU53Bh?#RZZ(VHazrh2l33N3y!wSy0XIA#D2eHzTS zaL&Kxk3#)M(Q7Se z5l5vA$TM;8%KW`b@sH+HkzY%nmf1RgBdLEV(3%N25)JM6#He(I+dpj!AIvZ9uoNmk zQxLE}e8grm*FO(>*vG!yS{{>?INJ{>3 zbWF_SZ0-_Tl(4V}UwHPW6_J3)u7*Qu<^^pxhN!Fgv-{iD^}3*yc-;#u&h!2%+G4iU zeOXDVdkMN1Km$>C1t1_-i~lC__y=k;C;@`FQ%$X#v`gm&Y}A8#&f)Bq zB;bfwv&+gjjfY1!jcC*x-EQL6%dMD=GlC7*C0y4Kk0*gfBPr@nW07S8QRJ-CvMDU$ z60vk7ThvN1+q4=I8@PD_6RXQr2P(J@N}b3e5P1kD`w67pN#tpc+@B8Bcb(y z+Bz==2J(k;#21dA5F>wq^tty|TMRi#-GE>0&l44{eG>88A6~v(Qz({t$5*P=^jR^D z`!j9t?fL6ar*Yo9b$U=DbD&f@uQUJxHnaFSkqaaY`ef#-oXdb<*jVk#bf*F4O8yHz z21wIO9BDOZ9S&apW`X|$*H53=UvzBEp9l>8XQ4S#{c~Uq&+#fp zTvqwj(mw+CUH4Hal;r}>)+u=0f{jnp!4aZ*kZwkBnZt>zcA9p>#Z8L5O~Y+ z#uLHJ6}R_}n&oNg9;IeXm#*RX9}w|Q9LyLeE(s)vs=}66jntd+zuJ{DJz{ z^!^+cc=<=w!q!y_R7bC?=go1O-Okf%)T-ywR$jM@Ih%BCQhDLx)tgg&NiEMXWahlp z1v}MKz@3KRpx~+4pDmM&B3*Y@JkN=s`8y0Z0M+JlJ_Z4>lg*KqdoMiL^I~=y;XgEe zjT(H6FtQC%kCEr{?p%4Xbk9|%)!w6nt#ViXdr4b8WY?bC`IVb3wMy1`1OZ>|<9Z7p zd~o&U&Zv_b`|p;szaUCKb`v4ZU;OBwSq-w!dwtzaQZeBb|NI0ygFM;#V-_TzC3NaW zaP-IP_II!0Kdzs6AO~5xDH-nD2sLVCxi4bD1h1eNxc-eo{V)Bpffi!pp{l%`O}1Y@ zu9SaV2HU6jUk(0`hnPUTSK-X=bo>w0{c{Fh6dx-lj)Ug^!iK;5`h^)BjXG6+o%8>o z;9qaGp=PMz>RY+u3od=Of6nGVOnNO8 ztVhB`sXqK~^x?1690R<(!(+tx?<%cOY(>84=Q2}iiT?eb^sj`jIRm_W3{QanU)#yw zaUSgL2NFP3Sm-ZdmH&pI6E1+4UZO*gzi0Jd=K2L91sM=kD9r4i)g1qkrkhlNmu)1* zum1zj|2g9kXd&m?sQrHsLs*I8@^Dk}Qm@7B^&s?gf85sZ_71sq6;QD6K>dZp(7W+V zRt>*ndM>fQ=Oz*(Apg*W9sd^MKX?ND%I6;ODK?NwY2rZ^OyC44UK`ehL#HulL7RLI zt9SG_%TY;4hc zgRvC#d)z4NiI+sc*8y)i9oAd-xXyYNURA~N0m}y{M&Wkv%H0Y6D0cMr>FIz^^^0zX z?|RJzc&a5n)o*6%^6^VrEdIyfAHpN4ZG`uT_;Gx)sc{<=Pb|wrajYSR11bCf5R%qx zGAI0pb_Bzt+r#F!r51PHm*B~^=hqK+C*ua+P$}YsLa-}Hm~@+*w4=zSQMNl|a!=|pvjMhqr0?+kgORRci!_keX0uf<{iV(@qEK$I&Be!3r7W^!KVy-pLG!wj5zD7t(pvdRmJ6ebj!U| zR8{*`GceNi^F}X%YR4H+iBkFLlnLE(L@bP5Ct86lc%hNo;t2fq9w>jPRc2n~q~mUb zczA3$nY}y;Guhhci!fS`GOBbtbX$Bx>BNBROmNgKQ7bK0@+?6)&eYL4YCS7{$WXOu za6WD|986f5@%4UcAd9DaCNopWk8(NvxiG_}`2i?~=nlbAZ9TsBuNv0cA$p~|jQVgn ze|^HRx!x6M_p4uizUuhP!J@aA^}}P`JgfLmp}R!P#ry7WC|Ki_AD_6RG%0AigOIx> z$<;>Sefqs-)Gn=4`{)w!AQ zAnzsqy5xLM`n7;4vwV2^sN>Y z4Mh%;d^4??BQi}DMQ4Q_4TX#+(%MtCL)YKzFKIYFfnMqS%)h&oS)%s(bOjd;@`}(w zBy3H`dj&VzQ{6@Bj*~vu^D&Js8}V028RQL*)hyNZTF2|#y{0D=E+?Ad>032&nMAsG zIbj6!X*8M@8p5etQS7pG9BvPOIg_JWDIYRnPj7^T^{c;GzzT3ZMfOc5J-Iek@ZcXwDIj z9dv^Ki4PM2A_J)o22WdTW_Zn3o6RdlQAiq#4%`cS)XH5;(%+I_oCD}^qp2VA3b_*K z1BuM}*LcAY?m$IB#A&bxkcX{Zv0iFc7I|hA-3-~GlB`vF zugbIXIiiyM_U4T11OTTqIn3D>sAmVHRpHXzBaO4&?4=>4r9T?<$qq)Yih^i)pvr~b zqDu6f8EsCh!id+>Bn~%jP{<6jU2ZQ|SVREn=JAJ~2m;xaqdA#MURnbfw^M@Be4vFG z++#Q>iY(-?@hl6b4PCp*DfNKQ_G6=i7s$ryg9`3^SuT3f>|o9QY?oH?#pO8w3O8_! zGN3BZxOD7O+&p_sX|NwY*Nq*F)sFjCjB`c6ZP@&t&!eu0!w;W_Z+f(sC_Om#Mu)@s zC}qu^*8R#d36eN&)z-hyWYGqyEBG%7e4Y2;E7TBlCu^c}7xU+v=BWk z0SI_BTcB82$_eNu0z0xdn0J>8H5QfD%bXk~L{5`=lGM49@o`F=o3kK=IO~|Hl^f_FA3Bc(kIH-|8&(Uj%47rWYmx^umY-4g%e>NJ75ie9K zB|UDv5AXABFd0pa1-1?`|Ff-7wFcL73@m1+C3{+xqs2O1I_<_B@K|q1*kw;T!uk@m z3W2M`Ws}mas9XsNAMiKDlcqXE{WO}jQYfTi8P{79KDFvLo%?QqY9AB?Tb5hxMHgx< z>26s!v$NOnVUB|ltTYS8YGm_vO+I!1;@j-PU$*?3x51m%d^}T<4A*CA`Op6afIPJ` zl$ecbHQ`bznZX1&H|$chD+yZ6K&hGHwktaI>sQd(>~CN&U?voRx~ok9nwtBmW6V_% zkJnB}1gNq)`rHcGfUdg0UJ6!xxL60OEm@p`y-I5!P?~V(AkX|zb#iwws$H%|@n$)e zDK}X1G)tJYDPYL?fTZ)+Mwz&8qn(sLXjroj6dw33y3cC?t9f)@^QtXD<2G0Skx ztERsgpy0_>2F39&)Y7A>fHt0P1ZT=t32BqqnXltuG3okCm)&zxbdFCQDx=DVqb&x^ zfnuVbug6gU3@~wr+M?yr!bMy1%Jam@btBHoxKhQxGM8s%dUkXJX{_z}2?{75jZoF! zLi2R$f*4=xmhfH);fCDKBP90>$7YxBYDt=lCy^8fz2mZrH(Hl0uC!o@kpa4m^m1K(^zT+0a@+TcW(7%7B6>{=)6$n&R+55buOuxEQ zQYq7+6%I!G9)d|fn80YTDVa(GPJ~~p+S4-1`=~U!p=%sDAFKAQa{Y75sBX0oP^?9D zs8Pq@>Ny^om|x9$b}aL}@=WA*t%OsONBG*1xW?pIh)mD-v}s_X&AQ*YQ57-jsSzeH zUZ}o7_}J;kd3hR-JO7$j(nVzWJ8jV|m*ZWi3{nHGA%Qb>034RN-yp)_YRs&T`!F|- ztUTMQ*L@3VQ2IwgCBHh)=jA#e5~WO{ltqukv*P{yTD{t~b+ku9wv;TSFNxJ6Cjy46 zysoMBP@%Z{>ZCqy%vx*+hBdevekCZD$c(z)lcB)+>7fCec=7scb=#3}2VO+oqR8$w z$C*<8kF@pqBeYfH78=#uL! zzXRA4u~Yq?l4*V&`Po{l#jVg_wKvltKR$JU)4jcZccEV@8n#rrv1-=Yh6Jtm>g1ZH`009aQP`CvMZh_$L5()_J6z&x6 zfx=y$lj&!Ap8ofAzw>^d>*522*4byDz1Ld%zJIHy|9b!@dT_ndnP41$wbXn^bD!_zH!BFR zW2Z@y{9<()pb4U7r7q)ez#*i%zuKZ++xY3c#qKPUpjoa!!leEEpjhzxT|Y}8BOoP^ zDC)UyXc^@z6Pkz-c6WMLZU81349aJd7T%+Rzy{9ug&0zCJ>~(eEWScj2);;AV6AYIADyBeuHL@ zccpW+gInLt!V_LOu1eEuWV~0-0oK5zP=@o1z~vOYfj!ELky^63$`H82vDKyKz$aK+ zqrYq}_dxjtZOD1AgSI$K2+9KGMgLX-$l+2#u>e<6-6A<4*TkV3}@u-9?Me!QYI-G?W;v#Z=OhB|>icp0?VFaXVYtuT?(7&oEVE zMK}-nGHvKPgf3reJsls2^(@7cAcJywHq640{(2ELuhx2!$0YpZ@X$1ttO)!=X2`mZhX%Ze4IBJoU7Z)|HX zn6VSCbl&CBTB^(NJ=OrMrTTn-S~2Za2lVc^I^(=ps#e%gq);xNwQzOGv(Cd{>ZbPz z&I%w{el-&wpW*e;Aoy@u^7E$bvrF@8G7h|gbD=ewQph~PZ4V{4_y8YUtk9Dgr zeLf^BoS2OdT6%a`cJSm-uA8A(xBi}MixBqZ(!Tq|zj{mZ2F6FW0304D#fCU!kRQ$q zl;t@;*SjQ|cZ=KkcE8ofyBxlySS<2SZu2knkGFnQN9FpvM^ih1Xz>M$J-4Eiq$25V zpV#4BnuV0iSM;qPSj`m}aMq&2Kc8$W#+{(qwBBv*iHnt`@Yz|TTHlXSf7%*O=M{s4 zaH|yOUHxAA<#$RGMU{-$^xA2b8w7}(r3DJPXlU|Len}H>geqEMsD)<2OWxCB1bmNY zNx1kK2na*^ruK!*_J2mw60>j#jMnP9J;npqnH*wK1^keWe82LlmbAfcDeDKm-7hk+ zZ(QM*(}q5L$PEFL1CNlI1ke)fI&DqUyIOq~$>=e&BQ;9rQzV>yBGH|SP)oXvuYf>(ny0!9GYb%9*DE! zpI45)5&Q;rfK~C;G>N33WJ%{EJ3v4>#A~BI2gslZ&+!plG|@J`lSPwL=6*?BR%0LC z^F8@@O0HToN_7|w&+p`15p#vpp1+KqI?=C^_)zh@7qKZy@}})R|9ur&O2ry62K(xA z*WPgosH0}e9Bg}x_@U0CD&=n!o_@)KlkpY}JowzUfpdS(^*lX46m!eOLN__gX4Pk+ z@uC#PLyz%#(~QF!z^@J{scKs(OVrz1f;P@tBoO))PG)kbyW<#?pEE_={3gm(Rncey zl%m8}s(#`LNAO!y!o%Vl9AGKD^43!&FD8pMr)|6{acL0z{#ldwdI3P>&yO59_0x&W zhrAu{ARI7*^A(rdl<|NqB{|E!XFe-I%-5F(vHNz|W{UZ?yq49V1P5A9fyrN45%s0o52`vfc4bnAOP5#C1auyQT@PfM}~{Ma7#6KRd;^OmIN zse)!zM^&<)F}z%TZ&y52aXka>0Ky!AX<|0qOy@(A< zuK+@GloZS0E!kUb;)UkrOkevH7+t?XQ(f0B@gAV3Bh76MP7`@H=UZ0^`{R*rjpk0m zP`SKA?QkPxdeCVN7imQG_k6<}e=PP-!6BnxLDsDAIW*8b;RU3hN?+(T(aX|nTCHqs z)PNYY&Q!lQHp?8|*QecaeMN-jhbHZKr?dgS+>(r_T5MTW#kgaDYvNr>;dcz<;>A>l z6baDn$nUWYJ5@y>cU%XYg*(f(n%bpV`M+_hWlMkl5ws6x^2?I(6gWV}IWmF@syGm^ zjn*<9)$6M* z!@;sc6#w@aN2qqocv)YA@E#WRC;jTgd?;>zF`y&?ksqmwaqlwiv3V1J?iY^{9^09b z3FqrUtCOGV7JQoC%|$hnZCjWdEWITAsb(Ouk_D$_9;fxU+(sB2dCP6ILM3@0Mq8C^ab|V(#SGceXC^_{MezgbwhP7wPg-w}i%ayI zhEI_LBtS1c3qfdHPFGcoyDK&0d!i=(C=fYtjQwJjHlLlI11jflY0z>^r? zfz8NG?vX-OSwd?fLO#w<5ep_H(!yTbU+`Zp?yo5_FY0?9KCOc_g=ycX^4Y(F`&**X z#_mlNnvzeP=GeK}d3*@YH!Cw}wm%54`s@_=qfH)>NZVod8}iO+t$Qgdm9g|7z;k;t zKfp@@6Qz3fmme~d1Dm8o%kA+%cR0R(t{I5?r|Z5olkBfz^2QgmnDkHS;2oaNkQkva zXyr^A0q4ZjL7iqzz#WY=yJ5=$wmH88T+ip`j9)ds^gFxJFH(3$FB_(#J8**SZ-dR} za|>RJ58dDHa9i@ur(1lyMr4l(Ir5!7^*L;7a+tp_YSHLBeUt$|-%DpRH8dn?@mv;( ze2#M-wEYM@xzP>A&drs()k965<+L!vwRs|BdaZT_X=HP7!3D!BmYxj&OVo2<_DIvK z0oy=KqZpeyp070h_7VKXyedKrfps97c}UkG@^~q+qV=qrTjB|am!S?^!#p7FVPSIr zW8&Ld%uJCG^vR;>uZCybA)y8!;omq0kq0fl3+cW$*9&Yy2Ic1)T#wOVcAR?S;Fk7g zH2=wk#uHl^T5QPz>A64>vKL*dC+l8oqTHs}*xdN6e)`f+-0Z*~>YD^5t0|YTmhK(C zx_85y9=_ZPU%GMkVYnR3Rl|f+nMXoEB1;JS_PyXdHXFl*=szJTaa#H9)rl4Enpnxu z>Jay9rncqRD6d&HSq)!$x*{gNA~H#`#xz#OpMc$@8sM!C(F&=8UBc1W*H;$RlbIKE zJwA|A?=p(n^|O8=v(`-`YJSJC!p-6IrdL*T3WWPegcoG|1*S}Im6AmVm<*!QIlF$V z?w|F?GFG3wQ!KkyYxdx+E|lo#7HllYWYtubm*=cGcXZ?Ub@vqJoy362;lsM7Jx1zW ztkk1I`;>OQ%Tu4!VCbO#!8m2L+TFGY%bVU@Y%hECjH!j*RkOqO+;o%y{SQeiT zO>E3a43F$%dvi0OiRQ5;nHhJg$L;Q*p;9aSAcMB_0ntB$H4#$W%a6afVq*LU0w+m96dQ04?SecKb!rc&gp3VA_vT&Zp0kd%a; zByG|`-=r1nJOMlq&8P*qS%Si#(J6lRqz-eqqLnv?Q<#i)F5=R=Aq?_k&_nsb^Vsmv zBv&1;{gSq1@9JcWcf!J>G1q{rqF7mG2@sR?ea({kcpb6h0WHT8MxtSuA%`5@-`$X_ zY=v{QjEtm*?(?H*pVv4@xJE!&IJW~Uj0IY$_gEihQ^G6%)PfI#?gbgJuT4S3#?621 zy$4U4J$>zkAuBTBHX!a{ep~bgv9^FL;Ba-UNL`+=9Siwn$!ig|cTnp2(#PlM%3?R3 za!C&>(|c+_A?H^!s*)J`S)d;`_RBTyk+ns)!L44=Z~5LGw6i@vzBgtLWg?KQy)3Hl zS3J>H@*4ynPV$Dn)*0`+?O*f0OXQ0j_bgC1hr#cThoX@ceB?YGSkl4)&99Z#gpGzu zv>~lRd-Y2i=}$as`WSd`T{)lPKc`~8acu1145n?Nu= zfy|_d!vmp3MRXZGZUJACQ`xur;rZTA{wyL*YRs5^-t&B=k%_)R*gIxleDY8CZ*q^Y ztIA`gkR7GJpRPVf<)DrMY` zKb4R}NwWc;dzu~$^A8WC8o23#y&dL1skbyKRdsS>W%R75gx*A)&3C6-95<8kQEZ(K zh&C%;BYB|#k*X$hj~dPx5A=|1*ZFluCe7Du?2HY)C!x&Tlk#ZLsceh1TLx@-UYtt0`d*)q45Kujm zFB~(=sa8s9{tln!R6cl;XY~BOV_i@B(XYl1$TMMw4poB9K3)($%0HhUeJtoPpp`970VE0hpya7TNf}Fh?1seg{j=R^Zm}^DD@4O)N5I|T+Qa8J zm)u9ADc%th0co$Dtie+r=7-?*UX?drgEVE?aPlnzt zIX`t}`Z$jGH(CbX-rb|1LkkUdT4;|;y=wDwS}kK5Tw|^Mp?)H(*5Sotx#s9!{e{oU zezbW)|v-LGQ2vKo~KzOgw#DPG#Z%TPUrnvOrTZ_UknQ_P>Ai?rjqjyflP=vc(L z#CV-#;;t*x@J%*qWJK$i$VB7!l_CS|FF+jFWt+jz@kJ!A!@^hwOrb9(zFaySM|IX;FTfG4pt_502gtxVsq#tN;4+G;?v0 z@TGc*WxKE-+?O*s`=<|cQ&mL^htV;p9bJl*w3L>%)TUqkq21J5_%5pP@N;a6=?$P$ zUOm3rb~qCVs=z0Zx^%dG0&#$|{}G*v@j$l3_#e3NC4{f;XNyK(_zOLNMUN(amuo6t zv~g1bIEd27Eokm;WF$fbUA={8J)o<(qCALE23>VQ$k^8^N(Tb3m)yCj8XB1jybTh= zy;Vn~U*veF5;H+WkNekJntayG>2u+BWCl6^sep9oi*3p^v z9j|dB+iYrmAE2$*T93);9FxXZ zR4O&7@3>4!R`xjG+LQXwJmh5wA`1B57EhJh8fb$Z9Hv;;AQ%KQC~_>n)76KsV;q{J z%gu~Qo?ePeMeCr#M8P=?C$ZK2H>*ThdU!j71{TOj=<*-`%RqiCOvzI_<#`fjD)Uwd z;wmFht-bpsSOR-+!ePEHlC(imOCEB(kiDW3V`u{nDwlez36^W8IH3@&8=xe;DO`Tc zRTY+g(eFJ(O$aEw(=jL%(Y|D3wja5UJ+406J*zXh!leIQGLdF16^wg+`H52;e?j3E z$e<-eD#qS%<1}K(=dSWWv+K4UJ3vwR2~ubkY}L@5)y^o>(lI^AkM(Fr-(Fd2Z-&}Q zp*F&5RAu28k%Uv{+E0k^vGmh+jb!nfyH zrDS?;eX-2ka6XcP!1^D}+FSEJlnI$LioYsaTPoQUQzraJ3Jrz8X4$2-v(;H4M+ZLo zX!ZF1Q<#3j#_cFLCw0HfqV&Lr;HGG+!IeJ+i>Ezz&mEWsLNF4Kh-P|?fDN-S{f1$kf_OkwL%z#Tz_+BS>iJhXO)zWOhw%Y zJ0NH|&&DvAIKf?W%GORUC5IXQD<`%NZoCuB*jqiL3yXxy`@s~W^%NNv6nl>6@MjlK zln*c-M7=DT)_$vTOyJYYqNCs{v$BfaY~!IAtcwLQ>!nN-BDru`oIh$~9Fg;OmOD8z z$^K^Q-s3b3H+3Q$rbeLv^V83v+>`NJG4-lm@7Ej7GZCX)+^y|gT}-<%w$R5I5@i`J zc~z&o?`ONGH1oPmkM$8gHhFlKg8K^&9JQDq%i&G-A(gR~lrt7n_dbcH2&SB`tqSb# zxw4-uiNSAm+lMpvswD3g@;B6Gau_UzT7cpfMdEbtD%u6;DLm@(SLy3$Z)<ScltDCK-zOGmdT?Bs8F2kOuQOjlpa^lqE2~L`* z$7))zXfdvXC$DH zCm+_JUf!@KmCSA9GHh7*CJ~~kbwtoL z!~!i0!Xvj&;CkCEEw!+Um%-eY+|=@<-r?hXf=;uKB-v3!=vDRSt39(p9y3hi*mwIlyfR?^-AoF(AK3zy| zZ&NVC-S0stIwR>4Wyo7-84X*Hg)Y8l;wKGXstjZJ9VT7OD}DTnQ9#`U~IYaif} zM&jL4h^WE*WrG(maOhQwy@l<*Od)bzvL97$>6RIU0xg1P{t~MT@z)2vuS3-}qmhq`agU$1@^WWNyBB zS1xLZ<{qS9%SYpNJRlg_MjmkS8SeEYZF5{Hfwi!)j3x?ve7AORdvn}0Mv(DU3?>Rs>Cjx41XFpuORycID9nfEl+VDQ3 zx^nisxE^6r(>e1u1)$6ye_a?_F(g{Vv6SxL`<$&OFSOt#B-%dQBiqJd;;WckpOT(; z3G1GZH}_U|FDAC<(C5(hr7|Z@c#@6rTE%vbeYa=he(|wtvoKB6CWB^Qy5nc9UEB=W z?)icTUS|ELP`&%Tu$!RYaua3xnj-o_v!xhXoemmWCU@TJea$pR99)?aHnUJcPQ03- z4*m>15@+oj_p13qn_Ygca;M7AdwxHh2S38X-0nyicBexU0~VG zs)64&NR{CZe(w@Tl2jT_;nhv4x3q!;bjaeO;Y%*d_(Q2If4GNhe5m?}!Mz=E(Hj~H zWivKgt^=@Sz_D&*a_zoi(+pllD8SP_F|QXli%}+^DxvmWP?alqAIzyw0+j^6!v5*~ z&=F16zE|LNvCkjNWr`YSfkmX1At1m3*r8%LZq6qwN_mGAu10_K%*_2VB6NzNt0#np zk8~G~=c`v-NyxO1bqf)?AA`yW-C0w4>{)wDQ4!qeBMHH2rR_$a|wYDGn-&fAg=2Uff9rD^)g+=$$H^aKMStieX<+v7PYku5M2gr zbO16%6A^+lR^UUaJ6&Zy%z$w99#9CWDE+MUOZ4#Li@YV~46?F(UYn_cEq7h#=$a+G z>2^+$V3yAx6q`NHPMdObJQgHb-7Td#z`pu=K7u)6DM>DkA=L>eXlk& zxi9r3GoPLBp`^F%z8=qcXL{0nzT9>uZV5yhhgbH6gibnj*7SgcEQ7~pN{yLAFYdu= zxF3*;?uooIs+bq#Z)xFZXks>6?F5jqLtJdvVxAU{Eo9ERj->d}W5*UlLLQ_0`}xyo zJ!eFvrTKmj+|_V`ov#ErOgs!h{6Tk7w8nEBm4APh#kVgM8Ys?7hzdnbO9=p%__AG1R!zH+hO=sjEm=cSq9? z4VjTeOLF8@;LDJhYe_BrwY$Ku1b~9pNbEIRo7#9$TlloSqjO2C9n0=gtJ>dc?z0u| zvE-YknXOZ$XhvNOX_R+a9Qs{6SnC-J`WDc%K#B%*3BxKitMO?xTnf%BsTE^ts_-%! z74R--s!o%qo)eoRgqD9x8>i3fe8JuQI#7Rq*9b#l1PL= zRx)9<<)(k-*dP3N?%D{@+bt=M0y;WLTsj_tlDZ&enbx+$=&K&; zdey9tUr)OE?;B+;XAZSK;As9PD&&|s0Exz!60GQsZYm^$vU$KQWWvJaJm9bHpRgVB zDPB7Xm|_J+k_s_tCHwhEEFRRXWc~iOQ_b6H=Cf8SY(J)ULNh%dZoB%8)akt;2n;oG z7nz>!-F770@GaGaH2nlOU{;ThV3K5e%|kC*K4W5HP3y_5caY@`>L68afQ8NO;w|dy zZ%o5{D8H{_mpuc~934`cULX_YakUs9`rp>bThN16CAbGgXSfYd@s0&trfe{U3E|%L zwJ(0C7rOOi5DsxNmjUeZZWnU$*(vnpxkYVD}bI_ z!Ca)qhXmDxK6itc(h{z^!Vx$_??oZ1dJjfmeB>*1K!$sTBxPyVxw#?mAflNtqHFB?tob#a zFjKo2ER9$GO~mcg?Iz#Ir&Vg--#0$AUu}>eJATO5dx#+;tGPi!AHr5oktacz^8nEBE9VPWW8DrhQEc((D+YZ5MYc*Y&4`&KA#qlzWmQ1TUMIm2)^a znI?Q{gAOxt5gd#_*A@9P>zw459_4-ySFP>qu2Z5x%DOs%3B`` z1Ye)-=eJ&EJm{-DGO*l+mlnTZ`D*i+ucVkmxJ*5(TE8iJ=%G@;(3|T*w0=lJ@6N8p z^X`Zr6}0iZ=zzZ&cj%uGSIeNcpH`05w)7&iIQVs1D1(8!SLRMLvxl4?bSUpy#`~?NN*lu7@9enhATHrQVhhxDW}a zV$0emoE*RpIt-_3-WZ&%9$T)}l!Rm)i^6wXr~4Y-jib;;3D(`v$jtbb2~Dj0X{w#e zqZBd#1nyJ4y@>7sw9?c80Q+J#G7>XZH9Nmbd0l3sjDw$tw<>m*Q+i6pDJ=!c_;!%# z7IuE!F2xqOi4W$S}unuNi8-w{XTPv=Ow&Pfbs z_+Dl8J5uNkNEL@S8Ng2fFUhIF(=3FdPK!gCR0EZE#{mD29z_Cl1-u1n*9RP`^HM<2 zqw)s(z{aiBRMnI6)5Gxo*fs%dvY-&2c(-A7R_2llJUMkD`BdV4v5YvIUBB7s19mOOxwf8EuwDpTmF;7YC;_lyx2r3)+YQ8l^|)Df(TVsi zTe|Bm&yDgDK=b{h2Tq)( zf1zPecQ55fSK>;hh*x$$&3jrzs#u2NY z61)4DdwH2WvdJPjT$~jMnlY#FN5M~rUk4u?{cL9%W+7Z2`A6i&qBFS4i@(}}GEQo# zp(;lhLnCg0J`vrnwwi*f+E|;$3{oowDc|F_?;q0T@0j}?RVx3DQ>7-{F^d<~;OBPr z%8%}pV7?cVKiWLf8!y`A(E+noqEeP`Uj$m)$>s$Nv^Zpq zM9Kp0`+vC}!f{wWa|tK3zcQq2ZuM?|2`g(--RfE-Lu{`BgBOSBR{T~;$b@B((?_;6sfy|xaRyt4pkX@VhMZpV^W;!OK$JgdF z^-Fz8M{#C-uz?(d^u+Zk-};ZxmW9CE8qh1Tk%GrEm_!v#GT^XhWyf2vEw_jNm}RXO zNhh8o@A*EpGSoS)G2s|CiFZembCjNKP=Ix0CszBl<{E9HPj~sBXOl2!M*TkC9pI1# zKOFwv2Aoc2#(JfCwR7M{^iB$>%@2V7)bJw$-nU%v+j%VV2P2Vf$YWnwshKzDIwbQwALektD<7MI(;p43yRlEXxQXdqY<;;f&>MUB=g2$IpvH_+Ei741v zN<1pWZ1~$K&#BBis{HwYPnmuYplx+IM*w(Pc zA*lZSZuc3(BP11f1L+HJbcj};K@=5|3Zupw<$W#dkLc3tDWJtIpO14L-UzD4QMpY$ z8L~|OY|Hjbdi%x1OyM`t)J_>le7ncy+LhO7Y7y$r(%;cRheGA#LkIYL7(x}d`Pn|VJmbmX-j!==LIHi?uMMir>(WQMFT-%VUWjhWS@RhXNLclut`7X~ z+_ukwJLVU=>iW0uaV7j|S#>58kjho(bChcWI9p?%_QiE2ZdRrLH^2R#W^EO58sn$m z+UWl8ioaY&@TLCM{sEzp*utHt5zb#Wg8zC+Q}@T5Jns>4#`rfwwge4eB94Xlo1wG2 zIX#BRo&I}IbUVi)+;uOEp#jeAwjQ&z+Wgm{5M-t8ay`@j4E86ZWZJ~J>` z_#20drkjA%KX+3R>UtLh=mX{dSjUx~={FY7W?e zp>#_Wi~bu82-JlF3gdaw5%Y#io%r8c{70p}7#sZvW|9BfApC!t^$&ro&ZQRDQ~cK# z_y1luNCdzVyus5<_$Qm{e?K`Oz+zr51FU-F+%XgtsXQ$1A~YyAK0=YQe- z;S4--%T_`h@XPqQs`7-aAe@w5hVr({3=zmYOmzw{~wK&-=!4IAC!o99pB=z zvN!uy`yqaVUTu^fyAG3=kfY5%>I44yf&7oJgrK1iILv$hvf!px%IM#6V#h}FL!s*d zx}R3dDnm?}?f+-vdK4h;|1hyCt2!(9Kl-;ceo4|a#tKE)dy@ad`|SJYMu>S2CH!^K z`fnK#;t_PfO7_MDjpbiqRsP>eB#v|hOpE@@@oC!^|Dzk%`5d5Cn5wx|y!!8F*+2eq z2GIY$`G0wr|99m7K{7ztiS_rwy?3|Nmd-#aA!K)#|gCC>cshjH4z5OGzblTWeuXZc?_JUpu)9tT7k$>DuLzICCq&pvOuKRA8 zop1&)Tt$$JsW2&KyadoFpRMBr)n5Xp$uu>O5`UfoLrnrkx%HAYh2OLlW_x^v8b1;W z4(tNz>F)2~VLi^+z5+i*av_$@uBdq2-rfj3$vPVlG3PopL$+BF{w zvA3sn0gMO2S(iP65~U2)U8_54t}5YQPL}_8q};-R-LFX|qleKCEN#@;t8(lo9-&R<<8-L6%?o>41FNp765DQ+Z4N%o_G~&rMfg zX_327H9w);<8yp0V_0g}8k0gS(0a9jAA`$xqo3#s(fT0CiubV%C2;<)YrR*Qa1^AQCIXF@2*`MUG_8tE{<)ZygO|0jZLEQW4!4Je-fK= zK~b6TNm*7zaO?jaugot=0SJ&yoe&lF44?swG+`GxpZg8XaZJeP{l(&Z1_hF9A%ai> z#@Oij`gji2<#cvL9hjLU(9lPpX(^JD8E7j@u>KPwvFuek%<^F?K9Rxwc)hJI zc>A??x57Js8mT}cq!WZq$sSJ35r0O`_qN*;5ucyo0W`z5Vc8j9qW@#uzeh$JxJCH# z&{|cS4ZVz3f6k$p3T2eReCFEU4Bm<5u{}*#P~$q>=O^!5i+`DNM{Efny1T(k+Nbg< zDB*FKlFslr#;_2(z=m|H{Ah_=deCDBfP8#*eTn?#-@Gd#pvTAI$J_LHP5jT?gx+9N z+Rky=oa?E=sJCD-1YP0D`v9SieJP5Hp4(!G3+T$a55CHMw$4_{GDkr*U+3KvG2y|k zVa}|S@$C;TnLb*W0WY47C6a9FS;%14tQa|eAJETc;~CCA7CZWbZmtufd$WYdpZ4h>FOaV-7dqcn+0G)WJYiJhQ&ncv-_GsC zzTI9O|8#TN^u1YACM_~GnML>}nHil8aw`u!z-{OsZ08sZFAi)He1%Lb(OtuNTVKwU z7`C>ZQqO#I|6b$dBbDKmT{R24fdQu7jZ|a$bwuqR&+U;$$BD$gb3|4>9IXEdcjVtq zWExTYx8DsY@tx(vl)uer5YYIc<0o<1)Il%WWX+d|5j^qH^X{8>L_xv{6%6lU--bPX zkv7DvoXkXBi&*x$$dGtD>wt>)wUfOq-{zt`?Q0b}H(>t9Ml34W50a`f^__4)f1`UH zMAAqOrEqoOv(j28JlCJH^> zCh?URYKlITgpao#_<%QZpKbJH5?=~aVW#kV27PO3RjYXAt5fkl1v>s}=GDy;I;%U6 za#DP<0S&f?MJwi(Xi9zw(Vg2D=H5C>aKpX9>rXVy z@$Xhgko+I4S}tXeb)2{@%}D;zqn&x*?}aa=lXPIyA)jiWu^G@g@E(D+C51~)`Ukq# z>@Ug|UjavGE4iov-zWD6VCicOGNP;{AFdn=^^5Z`EUp)mj=DPt22_}Yc~@3~&O!;8 z2trC*i!^CU#!QJmwl^RKp}Gv*Sf_X>4Jo`CaW_?Fab~S|R0>bei2DV-uN%Gi&C_Oy zsFEf#yx+XC=zlJsa8Cz7qAO+kkC%L7fQnlx0>1wRjoQhlo$xSl4n__eMcv(Rye%g( zze$0q^V`YHOm)fo5~DkF*7#2J8b>W#5MN&+EBESfw5*0yJV%5wzZ@ux%l~+AOHE;a zn519#Ipzrcb9j7RZ(igQLCq0h=Xqt>`+n^x#O1j|@ArFG?qoo>G6prXIiWObIhC}d z$1OLgezPorS*|qmrKMTXlM7He7-%}coT5ejCtq2OJ?$|iFi1Z!S55>95J@hF*Chtk zb;&){6y+asd)7~PxR0Bs%qDkvhXn^4y5zuEz=@V=HPtOG)iV|y>5+R3LS`YCbU`bq z>NDuG)3;Z0Q6%uQ6XjfmWVDZn7VlTio3`3H1}PQ8ltORg>X&#c=TtxxEvX< zrN>xcMA{en9E%ahl=_3?+NxzOnFPK|!(p0bQs2Bve9H+7k*cF8@hw!+_j~jtpq^U# zb&~FSu}X6aHrdEDMr|l(wtDg8Ct>_z(YtThH|AgI*J%+e;pG!9kVX-q`V<#99cgF7 z3&NgvtDW`qHuPy$)x?MtK^o{@xx9!;Ruda&#JspC&$E@wv`4;&Ju~@k0q%a_dU;GE z1D-z+@l3vhJB-VTf?@Qx$xp8HrFw>$zOlC49G}$K6oFB_-u*C_eyI+2`^@-UW8$f@4{?Ze%yMLK7t1E2Ladi)FrK$6%!)0)I*!J`nM zaX(paD>6DCqQMc_BY0U^?t!Oqc0W(|vp1Z$DmSR^eeXYsjKuVj?U|tKl)fmFdby6?RCaUvDoJGE#G}AEP{u z84r5X94KcyfAHg>FUXg#FLxmEW8`KcL~Dl+oc}XWu0%?#)_zt})b^rs_A?NdMSWQ; z+keQ>9`BB2l;1RxWaMMj$*Jgb3l;w1TY6eE{&e{oSy>hFsp&8qlAn9VC)4s4Jp@Ei z`W_=%4srKYvo57Y`*F!W#xz)_Oz#LizMe)6H8dWn z^3`@6NR>rT=jfHCb>Kiw-{~8k?KnMEx*P?@*q4z(NTbSgp2C@*cVrIR+~8uJU)p}X z{7cPDItX}5dq>tf~p^8j8g zJ9XPUHO=%vT86_RK)@UTVP(5cC2tOU>wau@ybG#c7^Ydb1W-i3r;WzLh*(G}39x9L zMAXhD=o3UY3C`_{IKlU~PZ~e1_@_^Tu|i=?9>v2k_@1_!TGX!)%xT6=0Y= z_7l0LTcnnkp0d8Y3qX^$-xV>L`%JfkAnJ=(WQc?#OWE?!WrxK*ERNYtjDK+cOkOSz zHZYiuexo^(N)FqaQ^)tl82pyYQJcK)u=|uMk8Ehz64Ot39b$8Y!iB;B=YJXwOUuL5ay>H^RnTv{YUq%G$wu-mDj%u+Vxx)ebd7Se;8bEoiUbosTqV9Tvn;Mgc~ zu~GDLKG|Fwm!#^~RZGN-i{z5;PwNy@`GvwUiLlvk1zA3$dhg*r33nmCzv`LIF$j1w z>}AQF%ICmEl?PzH5*>nl=^gm(?D=GdKcv<_y?Spm?O{-)>8r84FaP(HF(eBGx0v&_ zZ%R;&7L(I$!CNKo(E=y+7^sI>%!}e)5mI5QuZKYppy}6hV{|l|C-NcD4QQ{Zi8yFK zOLp?8vTEXwhonffGf6Ab+ZPpJNDyY8Y)LDnA9^WeK7H+|w^T5eI9hQKln^6_U|tTz zh#vHuxFI;J%1E+0HDFb@*3YL7N$-pG6a|SB?ujt%ra#{f@U#L$;4hH#({+Vc*>>^D zM?YUnZ0r4{jgxp96Hq`^a^oPEMRH3NXHTqX(C+#Pgd^ea0~d_B3EeTi9w5b`VW=MV zHs#_8`BULF@`oO~8=54Egm^Aa7GEE}-47D=vVM5Soczk==i;D3Off#(i9{$uYMUg!$-M|2erX4~7&zT--#Bfj-O zhy`8eK|vJ*81(ET|B(^r(}3yX`nK_L9m}*zs**}LB^AkQm1j1h!-eDKy`Aq=(?Hb& zJ`Wx1d%tgYwq7}3KP5b$q6+wXg6&5l{^$ZLd^2n?ovz9v@ogcRbVfP-hk}N;xXlQE z=8bfokl5ZxcdqTV3^#}Z5vOwDSNF^By#}S+2Qrb&`C*wL2FIm{XUiqxp=L~(d2op} zpLz87GWQa!Iz1T$gdL5o328fAaDHz8vo!?vy-+EFR*xN`7gE)G)o9Zs+beTNbG_SK zjL#OiT$IhysTq<4(%(m0aiks8aTF-9RQgM5VDjf+p)$W*OO+tR1%;|yZM5*jUnYE` zc?z-X9P>59e)x?bGDkoElD##t_o0D})y(${AVU5&cyo_d{d;7kV-*3!v@C(Qy>6Cp{nQ97CRMdG1}ld|juXP8}dM>eCJkYvK5 zSc%oW*HzkNuf^308sha5{VP?d7MDf+zK|;lmho;$NP99sQ++MT*f{~DPdu+>oj3Y- zD00pAE}p;(RE%W;u93{_mRiQwJ5JRPfNU*DOYcKR-SESTZ1ru=l{15x+>*aT2xS2A zFV)&{W@`E1b33!9p!qwSE=Z|b~nhc7eseV z*o4}b%|RNIpNb=O!@rHzpfsKo)3_xH--Ar}kVVNhC+9)z#Em?qUqi3tFSiHm5|2g~ zW;GT%-J0>@ihp98Fd1ldOn^P$P)h$Pa8OYJdIvOp)%A(t5!Z>J>4C9-9T!%mEHKYdCPRoe;}j4boDNW_cr+AwaQG^6 z*0|50lRjGX2gE|=yMw`ScjCwSe}Dgf`=sR$zk4W99#}K8zdSmYpvzx7Zq-0PrtulO zQoZ_Valt8npKaq-Nh=<6g0E4e_Rb;`hn(;FDND@WsK-(~kYZPRe}Y8lgz3YXdkld`=1$nyr}`q|UB{JCbY)ltRHWQMMdgE7 zlt3XJt>lp8^BP)fT95X%Q3dt4HL4+Dm*QD9C!0dV#_l5%!>Rj&lGXj_sY$Afqo#t$ zD+JVQk%dSVILe-idzOKk=p`0P?xGfFqI+o`#_i!x2coHnn@7if+IXw@PE3Mrt-WKn z>7#RYB`{S8@TCq{89Eh1(gdRLIsXq|Ul|nF)@_@hjYA0Tn&1SN#x)^8f;%B-0*wZ@ z-~jYVEbw+-r_G<`~d+fq;-Ct-#~o zLI_kf%H!9vFJ_KuJS5M0y}pFmHm`PV>OFX3YGB%I9FaK&$2JcJC7WsUFC zZUaXl;{~|xt1fLu!P(`9Dbt3q{Woxt?3qFX#f$Ax5G0g{<$M0kRF<*1YvnK^=^#%` z4d&Nbxnm(X?6sL+!|sm;I<1=tTUx;C?KdjuI~T1v0~{eK~2u>~9Z(QqQ530&%Qc6derDw;tqfh4Cf0HBqXn{w0<=?}4AS7oo^1>nSDt?Y zpFW@9n;Me_K@d09q%%fK>QvYZVe}GI;nTZGaUE#h7&k6NAb#kklw9+<*{r>c4cZp2xDeT=*jLZkNd1kUhv z>cJ(Q54kdX`TXz9VObjiw>SR)LzeqZ$o4SXWG-BHH-yseV06}B?vn9E6fPCurw=ib zd~m{^YH%{H;0C;*V2X8WN6W^4gxUvxlOf*7y(NP{8jqHUG8NK-o_2O6O{|}S@tT$i z6Him68)M4tYcY%gX$Vv26f;SN3&oSmbY{F;8%UXvE^?dj57NLU+h2#@`ojg=SB(xx zPcSbse8xJkreTVoByl%5fnXXpjV=&73JyG?=&qE$Hx_ieN<4>1HO}FPekZaLX&2uk zdH17I)@AZc(YYU&))B7LjnFk25`QAq@O=TO6+8{^yq({c_ut(qh6_`NH>5Q369tzY z^4h!s^7R<^ZwcBx5Eto;Y<*rRaW?D%FHv7;R9uI_HgVUe;0P`z1=pw5Zxe&lf3}$R z&IxPDqzcKo-E!A}xlZ@v`TcXZ&FEfdoBqTrkVhOp5V{X%Mg;1iBbk*cQpfB54CO#i zZux_br+lWDltm}FZ32uJd6KbLe8F-3Y3RyE(*v4qoo0VQP4I(m2+b?yRNxl zCBs>GntQ7=Z2Iq)p|kIc?oisJ!^sS3O79Q3`R(iKg-AUft7z8~c9{O=bqMC)u@*=R zS5!_151DmV)y^l}zBMB&whV_PovrqwetioR8`~EU@{0^fDo_qNTA`q~FP=wx#}gNl zC_nI1sEY-kvPJs@e;{6JyFHaT`Vg)@&W)m@YyD3ai=8h#*%X)vw?abewL$<`E>yd6 zkAQ9p!|trZ&R<-Wzw_@KjMR*U=`>6x{Dy)|sAfO6P2egy!iy&~-M;NQyQbgnJK!z5 ziPj20M*&XQ&()4;Fx|{$QgV33&`i;c0Y099VhqIdmV`}z zYFzEUAPXn`5bB(q3{`q5G*xq-z({|TNh2lYV%=SGS;L+t8GLo}DEMC{5b*jEZa5M) z1@5h^;qYRs#P$robb1kmb9cKeUA=(z56QLy#lU+V=q6?b&FLFy1^@Iqc!zFlNFpv5 zhei5`D)X0gA$EJNJ%=wDU|oD8i>czDXk!z@3(^;aYE`X??NQnv5=zYfvTOfa9cYu& z2Pyeb(KzQ{`S1EDUSsa95nKtBzyD*fG5gpWDi?v0!(FBxgWDju_5Z%3{PLDt5o(NVwnc#;1Cm zGST+<9QGh=s);KBG_lG(vaP4JmvH0ilE`P?m&eh$X(FPpQ{|34+kU{M5NzEI4AlXKsaiq9O(8Z)@* zMcJn=tb$Lkeo}vv`3Ok3Nd@ngg7Gi+I%sh@p4HFEn|M|C+idxu&8&slrVAIec~rBU zHRLJh&M&I|bHt{{b^Z$nZ}A+8hkK$(0p zIL9F2jdTPRo}in&379Y{+)}+$?VPL4O%tMNGjySBk@z({-d;ISYX+zh|Bw0ZrtN(0 z?#}M{Z=WB#Xz}}cDxq6uL)WtQ0XjGDqF0R1kU@1zBtaP?fNLmj&%fW&J_7PzhTNhm zS}YpphH1lB37DQ#ocUk(8BxO07UMeMA%>_xY{i$+ZAgvvn4LK zp%8V?=0N$l-M`?HFOz>?fb!Jw_?hOWtf%4{a7x|!DEyC|G;>M{xl}k}QG4HL9Gn_+ ztp&gl_8NZ6lxr07A1FWS-%CNM3%Fco_Z9v#KD+;gfm# z>I0mpfVEKi_p}$bf>Cp%p|9Dy&dKP6BjWzc`sKe!c7RxT2oryAC;Zou1VH=K!>>oy z!?ImOBdZl&kHcK(RY53F%7|xB@QP1saoRU;7@*M3c6rD2xwY~75HV^LN}^Czx%l64 z8Mgs#xsiQR9eFS3DWLCKdTy3GS#jGgHy7 z<6BzhHG=<+>;GRC)B~q}u8k(N^oZ$VUiBa<{`W_D>TA6D2G#8b8Cv5&SII6uE9MJH z#Hik1#)i6D#(z6y`M49>ym_gX7 zqi;o{tOTV4p?D;#hTDS-QEtpSw9gFxj3Zz1Ubah;h6;tM|8GKGFp^JGj5NFc)%LAI zGV3d3JIz;c3{)lebA?z`Zlvh{$l&UbU}Ihbcgo&k;spEp!na% zoxeVa&%^l$fg?ed{}=WKU!R)@K6#fi?1p%*PrQNN;TVqte9Me4HrkGiY0DNv$UlGf z3WgZBxjbFFjsC;cgyrF1^x{K}nLj?-1kG+!NTT$!`_o6A-&4V>M#^~t=N=|7A2f2c>I zfQM%J+}1#_|1L>5(k7QrY>_mVDXyURd)-?@J!__=zjvhL2K_}^lu8@O|HlmdYm_c{ z0uCxB_tpd~8MyBYT_53cRC8$bAEnc{%3<%8{`Q>h;67c00<&3G*l4|K@Mpam3ler3 z*vJ8Y{Z3#k-G)se%8Xwy5)Cf^_66TnzRJQ6#`3KDGQd%NG)9oc?`tWE+xTO@8k0)I z!0Bia|0@NNbb2SGY-xm-{eod7?bVrXpykzd8nc^pcXn}Vu*QZM7KY1XU-*|6!*&mu zcEd_(Sr2{*Y;xdhD}9frS4&_kz5N#X3~u52V7(3|m4}yDFNeH+wgwvkwG?7DP1IB$ zh3E}OMM(G9MH`mfZi;Ku?6t5nnob-%!?X)K)a@ma;Z*tddt@D2{b)#(8-xTDTnS{ zB{|qtd)gI!uF9(L(s>AdxVyh-^cPuNs&-%Vx|KuY{;F-o1Mp~+wOMKBR+)(`wx`wkCAh}%TXtlz{}zKN zm9`m5NsSM0umcG@55Sq^sXOPMeQSv#ZbyxR2^HNt<ZaD*~Tc%T&x$hKOE^?oHVZ4*OpMuq`uHmuf5{f=2kbnUhV<}R}4?7k3YJCqY z;s0?>PKpqJdeFD56q24iVtDHM($+g8JDN!m==yMeh!92QmdBwHo!&daU8?nWcPeon z+~7CPhZEuvGVmP!hJo|jofVy0y8+D9^}2|8^xAYNHXcXpRxf|-)}UDIGM66R%@#>H z#S;~KaCF68ow(nq*Vn&1=tD}w@ozX6C*P08Zwusf-&RPb@B;Pw&{?>)VA zd2j8>=BcwIh~A+uOeNR$<@tJH_rY_$7&TiyFG4_A{Z2&j+l=%olw)d&+s%Hi_@E4+rH zDp6IL`#x<^4ZewMs-4$fG8KdRUO%eU+Dc3*uXi{-$~JvXe63eweUYs4m ziSuMy8T*=%jswsy2P!Z}=B^jqAt}xCou6$mu??Uk+|Da9U2e(wi0>=hkf~_69*<(^ z1TjDz$6Z7=g}3F6T23H>2K0^3xtHTH+GQ$ zEAFr%ICPPBfFDN>@AcShTBVGI-%GNjDmV5arbR7%HjlaXMt1=HFjT1YmL3!-H@fHB zPgKZYFN^r)J9>%>Y>M1(zE^ndP#kD!0$<4V-m5?}l86TD9>#%WUI(}+@X@w03Rqg3 zGdPhr5_k1Ti;Lw7r+i63j8kJJaBT~|9rkUU*lPqz4>=mizpE+dJcT&GxvoFx@sSdB^34WG4Y6EfeWz_%=jrxixgF(fB9Cyu z`L6YOz4`@g$=8y$ZzLczA=RDle#vIcSg)gUL|a6Y(yj7G<(jTLIgF=tO$O%VB>H=e z(OpTT**ub7xnyo{+(y}|%KmOsQM>iFRj>IjL+x#%3c5*?XU5O)@?yXhI3l$Aa9+Jg zO`z`esGGaUEZd@s0cC%hB*l{TU^R#+?{~R(w#D~0#$eWQ$NAGPAk)soL&KkA!+L|? zm_@G?+CRQGU2S%-R~&LZdE$wlP|$0!-HCswUvW6fhB5G)=6-CjK;BZuT=Q(qtu$Zr=LL0OT>-$z4nKTkq-XEf$aMjM|BZ$4Y z0lHT*i20Mk-rrV)|Na)Ch~7bGtgSeuX8>c}R^q$pZw>pk!={GS63Pe#e#75ZF#6Ad zMZNW1@!spxj-XxSCi`PC*IMxpO!*+kr8~p~#g&uyN%G8uA4~`BDjF^^;`kR+wMa7A z3e5$}-e5kylx6t=&kmWkvs#%x>Q=GW-WjJgfW++8&m>3$x#%a{iN|hkcGn385(JCX zm}7NR-gNlU-ts~z)5N5<<7cnV%@cEGT6+G`qY7^TYJA)l?$d}OfR`qN%aCw|uy80> zBpDVF?5Y(n8;}n<3>q!`i!p>iOHG!Qdf_f-_cI9;6h?VtoksSjZTmap8+3P-l+Qk) zuGAQjivBw_C^&^2LUp`gAEGzXAA&X9d0KPof~Y*iS1l*zJ!FXclv|*DoBsNdsAu}Z z4cuQBNeF;$SU0jVe}J;$oqV_p)Ed_mKs}Aew$&5H_iEygcSA}Mi5sPWA8dfsz!!&}xLtG1mXgpe-`M1ouB_HCsUAnY{BBa!&Y z(t>*y&ccv(^Sb_}9Ts$_-wd^PG2Y--)`*vd8oWD%?MdmljBUO&&Xz_Sal*wDd%W?M zMdBoDdeWOgeVgHUYApS^h4|j{p<`C%qYV9gxrqDD)JdBk1^$unLq%N3=YeqZlSM2t z_1_;%1 zr1`$6+a|+Wf4C7Fbo5h`+IZBEihVpa)|gSrAtF4>cd9Eu!re{3X~wu$VskxYbpy>t-=xil?s zl0EVv+U;iOKv|lj#K$;af9#1cOgy*b?|!FQp>H#a=i)8VSMXgZWYqzB$Dfo(e@SNZ4NXym`T%yKmUao(9)quMD zt8Q7aW{3!`QSUC%TVA8uO3ewnZv8S>qy$>yHpW_7Z$(pX!kuu#A!qh3`LtIb>D$Mk zwfR7N<*0etf*u7KGI+e=r}-5|Itf1d3bq)^xA9jfeQ(36)gCpHQ;89^xock-RVd31nCB)3VU-01>P5W#Mww+-=x#v`f2o$S=};gQcZ zL$#>hI>w(F{6YJINbZ@6CU5#l|6Xa*nugd z%TM;AePr)Re!TAAV*dJ6jF48>z-;=PEvS6(B8}*n_O?=oaUWW|yA!w>cd zwf$_4l zLz)$4+?V09M+sHlsZO&}!Kt%c4b$xS7XeubD94U2*@l$EF_NwXuKri{{#Ic{Z@IVZ`r1lU}J|f|BPxMlMji zXz5%KMC$GbH;x6KsBOnJ9wqyIHQYh6*mxGDA=Hp)zt)R5l$3bN;;Kyw=rBWZkbQ zA#}aFiCK?f)b0v0Ho#AT0S#zVJ~Lg$2nUTKemCD)UIfN zhtz7_OMr)t{UxbEk%!EE&C(haqY9@H^AQ)nw-G`6#&6uEyTtF{vDQ7cGXJSh#9tb? z7ewsigh`dT)xO-r<=ypF4j_IjkT6u(AL4)t>QcbKW!B|$m0}DdH}S`?x&&XScNIG* z%3Rwh`znN+XK-y% z&JnoGD9v2b;FjoBwUV^V6B>Q_%-%XlElr!jQEuEgn%Ul{p_D8NPBouz*FE)txS^a= z&JAJ-7d1rpk(UJ1?H^#XofwNsW zSWxgTrTxObjC7MQ{P?`JVB>gK9E=lz_^ugjPBF~;f|V*+~A*Wkw$UDnMjI&MFwxw*5yeFxJkEOzOVD{3rBrwcnDOaf zYST15ftZq}fem;wf#2C>8`9Lq#-WBT5oxl>jXKQOloRBkp-Yei%jUISXZs;H=v%7| zb#q;mR!X@iw-3o08d(ln?{77=J5_5RYkMN(?{8CcWD6g1%?Jf6jwN(Ae003$z2wNH zT@P{e@BmS7QNMmo(3T7Pbi06|JyN~W7D75UwTO6)9#PUIlDpIBJu~z!PjA}uli@TX z?M0OX>AqB(2#uO#D-vQQbGk^=k5s!}4YB#xj+R$iZgk{Nu(bC197%>!ozs;-ii1FV zuftE`0W#2Bb(%%cD%80`x9lAl1jMM$$mq245W$F=ACg)>v5p3-N@F$Im2 z#~jnAMRm_5i{R$K;&uIkEcwOtiBH)(iLCIxt-sZIvV-B!*jt2wukf3`_?As%?Q56aVqnZNdQ1LKu;x$oSrTH{BthO^N6bnDczU)FhgcX95mey&|$5>pb zXr~u4STs|D9C7vWoCuA+8md;X06)ph3)x5s(==zTo}tKSX}aJ$eZOxv$FJ z%m{pjdri-lE>dihkXm@2pTRA`fcfo(bkfBg8fEWHwUs+HPFwSg992`sTJFXPmb8}2 zaVX9!s{+s^08wblq=2Br@~5S(_kb~!`E&eqQOS00fOwW`g1X8E0gl7F0GP}uIV=f8 zW83XyVW9_zvY?ZE=gaHTg+C{J_2sfJe0vphA4?AAwV=);=?yHxVWjaY!*r{RK;7pA z-pIX`A}4#aZjl7?6*vY}e)sJBF(}A+d;M8!r%UR!}+#`}dZ?U7h!FQZ3JPY9-@$$r~9) z>Zt6L7!{J$zKg)Z&2cw!MOw93a4^rLVye zpe#Zlp;$!!PpscXa_i?cy_UaFRV|mHKN!^Ox0{zUifcJIwxa9KKXL*^`kVnBXM+J7 zq!GteRwF`@TH%hwV*=jUJ>zB%j1u(K^&fXPZX@5K!vo>57hY1gG5K7L`*h3Q?E&fH zCy?TJUC-L79ku7Hg?ES6sxE!G?qaZql}(C%8w`V|gW0?`67R-0h1!qbR2}^*oR@U5 z40vIfH*KD+Uj-eMgVw$n67HR5ugtC4#J~g@0z%)9K3iK*cBDX3t9Kd;YGz$dRv@(# zXG;e~i84~j5!R^+fgMRwlO^I!9=i-%O#J!p+419flH64IR4e3yqqsGYJ5JpzzB5WB z&ThYdB_I0cgg5B+;ZG@JDGO3BKjqLD>CznLPHjKb)p34%fMiN{i;c!%tJ#dNH!vF* z;SNc8r6L<3<$^CMub4m^73cw7UYoZMv?R%!p27hKz6h$UqADWVjrpUJ^1ITJs!i^D ztdeE-$fD=+6p$o_Gz*j%?{`*uwkR#2Js*+799X1iV7CY;H*Alc@fVQMCGtvCM&Tc} zCQb^!Qcfu*2?x^;PFPfPfo4eP*qzGb{=}wf_N=!?ttkaeK;`N;LG2i;jZDL^bW3dw7mS@O# z{cP)@O#)r5l_1pKQ%`FCX<4+xDBKb7h_U4Gklb!^m4TN!VU9@Z0(2M|+WP zTo!4X)+Hq7@Cs?ySpBUaJ*lulZH>l>>$lE#!HJ{Et(fM>}-;|Me&_mc-?AGtS_ zxNEk*6yLI>KyqsXFE;W}Ew4u1ovK{r!#MzgDNpIqqxQq|PR*ARUj^IUIUII%YHtt9 zEh$B`GNB{oP3&bGG#+<9V1+~lawZEc&zX2OAZukS)D6VjcV)+z7r*yb-G8Eo{yO?P zC7ZH_nf-mP;@+}wz9PIcG}Un?-K%?B*ulwm z4oh^VLyaBDsF0K9Q#GF#kmG?+4{ZQhFlX+WhHmo_4!+mrl3mP4fe(OWzBN;LcFnS_ zuSt#%?z;IIjO-9e;Sm`k+Uw^CKsv*&39Q1dng;df9n|XyIuPTqU&&B=9z~|KSQ%dW zgt-^6N$heAcDeK_0JO}pB+=q^6{6{@@VbtiKjINiEy4M4>#PWLi6c0_Znv2+1Hqi5 zXPXHAq#kF~PgQbM@dfHywHxnxRMXvcgUQ9%?-sV_q{}}BvvOV$0f&tGHxB9_TG^Sa{0{t=T;*Sg0{krwe{Uo*gT{Pt3;WW+YHop!~-;*JlV2z<988u#Mx><=J4Y72DbeiK@wQ%>Ry1hED^$dAvT!AHl#BU1u`lX(-+?Y%mExFL>><_Ltv_TB z+lEqA>sf_mf;G0u{Sz&)d<|p3BCvFBO?RY$pqZFaP`}8p<=}$poC#7SF-xXsx51&p zuerP_J-Ci_fw+0NSEV#oZ~bfI4!ThN%y+>DE5WS^;ITDMN&4xkpCUvF1k+I-?=f{<$_8iIzPM2WGPj!LUkvGs>o>|WN z`Fvjp*gq4?M_}u3cVZpCeB1d@+;(R&N(e#&=9*?Hu15oYG%xavr`mh|x{jIO+)g-zJy4&x# zb=xbB5z1_cXNUk=B|PLM{0UoN1~O89Se3^JD%Z*Rr~BY^zg4p~!nTC9 z2MbKM}hG02g!v_cWHr8E9(m6 zn1FQka#EiV@;K9DeJWCaWdBi0_zhyyQ_~QdiD>o~7=5UbQY61SgI90M*1Az-!o43_$zNt+ zbvT;NSc(Z@aY%{7%_WY1sTN?-x$yKz9y$!6%o$mpSvLf79=}Yw-`rX3is-5IisUf3 z0`M6@9W9`d{fXgwi9dLUhF7sx;b78lh5oBFH1GK!3Az zg}=0DWh^ZQe@VBBz#zJ^eukTDY-+z`tUtA5EQzzV$6Ju${{D5`$8WDvDyspg7|QcZ zEThCm4hMtWO2L|{^2FYgDDRqnekx+Gc>sy%l}HX}KUSLarXGz}gphLRd5k5qR~?<| zfAm^#lYp>r2Ny#FPgEyh)ghG&mG7^JrBAD*r0b6em{hg!hv)J&O|O2N75%+1Jt4n- zZJ9ISf=dV&rNR|Mi)GcA-u9AS6||9JuNiZ@@@e@!01XW4=Cev(Axx*^w6PIv5d}^u zO1QRH;`mQKqT+n;d2kIYph3z&j|7^uN}a8j6$Y9GETCpWLL{Gf{vL4jxA~)R8D;JnGECUycb$!DF3a!%NG6 z+R&f|<3cVQbd8vWpCwd<)41uwJ4@rQ`Hu~&50yTxe5O!;Li zi+0$JsoXZ;saNV44iOK+Fye2Rx#qpzu905rmSod+KWBRYhu7MiGtd?m*Jp@K6CoB- z0GTT}>BX;+H7b|3%~+cRcO+R3p4w_qBMIoImfY?Js9tXs_1!fY*W@<#rK8oU>C+wY zQqZ4~7NFr8A_?rQz6bHlTYn>EELFtvVwLdX;>)FDm~hoFI=jH^gz=l<`LSX_WW0Qm z+j(2;PUCS;>;QERch4#g(=WQ)9)6Awdm>m4+B309w0jJwta9_l!PGU7N0V+vW0E_M zgJIW1Uc#g*tD!SZoECj8Rri(pIXf$NeM5*A(R5$sHP&f!a74xt%oR95^KtQzEdK`d z6D-<|6=ddJ@dzHE3jtZZ)$o@Nmv3_A2@|;ZOlwtL2faf83>y%I5>23ve|PCZ^nGg( z!jwN}Kkr|}J>m#3zn4p`gJK>ErOLMD7zsO_ z+I=_9As4`)<=i@j3H%oQwU<~&$}DYdiANFR6bhxGY9($kzQ$YR_4& zvCCZLrL`F}t@*Ncm>H#^b}79~fpn)vpHDcjKM-v`s|Fgz|q(FV3LjKic&AEVH*L9P59tA zwXf!KjDpBCA*4wS)Hopswkm-n_SZ)w4^_biFR*{@$^@2 z2mc^W7s5ZdPt?t5{!gzNncw+Zq%Go$VP%~(k9V@hXJ~)rY>8y&H3%%T;CFOu_H%q)! zb_0@S>67z7J~Xg{m3jo%OX4vjy&Otb{SQ(~lw7NG{h(lvAl&fhh1MDTc>cGsY@>F; z`Xj4W>os?0%zbs{`xV~u@gGTcXgv430@VY~{Fjp(MOpQ-aj5lYuiFSOzQI-}?{btF z$+>Q}fK9muWR>E5T%%&CLm+70OGC;|pXnZThKw5A$aOThCn17${Kq7djY-21!Ci+S zdDgJK8=oLnFVs&Q!JUol)Tw*Z+79Z}!{!%Sff{Vvj3*1`zkx-r(Kr->W(L>dV&c@l z6sB9YZr)ojtO_hCd7adn#y%|@S^u6sDB;kD1Xk-iD#@Mu z>iaRUKaGU~CIn_3TDaipdz1YLB>Vho|wZ z5aMkVb*ycP-_d6q&!YFb+@eB%!px|R?JsAKxjaWu%u>b=X%y!T6_?~X74s`>9S>oDR_w(rGc(unG0LK4DL44 zEl4z`sMBNC_5s-U3o*O3sex)Tg$6D$w7ZNzPCQbgCU(5`xxiURs?+S!8*)g+z zAA~iB&e&mTFqY+(O2o6xdJ(g@9MgUcuJ+fF7bM_C?MTWu@A03 zx$z)WJz2YFA9^>^_Uo=YzCw=n|qQ~)@vYg&6|H3XbwGWeammX%+tL< zgPaSKxB@4BxG9%RhEC$ccdA_L4OADbq+g`{_R|0U~Y;O^4mw2reCj5LuPep0# zY<=H;MZqOWwK~R)z;TDY!L$KIzW=mf)CR@;bC+N#V(!lZJ3o3LgB})|@8OY%ndWQz zqn=uHjPwM0_!DzK#_kTgiV1-Ie+Hlya#Bfk0>e(HuSK@h1w5}kYN+mR>k__yYoX-6 zm-rGuv{-s8mV`sNIZy0fc~;NxGTo`j=y|`Uga51WA`XYXZaxLK(|4zFvCk7hXVr(( zC!V*ErFR!)A$^>+O)K|oY2+1JkkRwtQ)`Ue$VWS=lj^c1=MQlqJ1a7%DKP#Mypvjm zdmIzEXnYtEn^WL8)aVcrt^0>6vBC?+3bRuLEDA_`Dra=p=S04}@k=drB3sgQ3K^jh zKU%JtqiZdKz3zL)V6Gj0H1a`X3IkEAwXIb%nS~dykDj7Oikh_F-}zk_mg`IPfJY}q z$xBvU7ILe(mJ74rw9cMMcyH!m2P4d`SIuLale;?sjfiIP|t@t5-^TH&^OAM?*RKl+jl6qB5ty`HUo?u_cI}zIPnS z*%|GmUaK+#nNV8~F|>sp8>4H5p$h@63z3Gs*UP>C|)n zxQ0#mxzt-AD;hOgagKZ0l!SZ=jr{OJiK1+$@xd9CGECc|Z2X}4SOb4uSSM~1FDSt%~ZG|#C?JKIBj z``LwM<3g*+8Hs(m-m|{BHnU2G#{#}5ktfj59N#k~yG`{G74x0_LtK*KfCLZUkHE?l@ z_@Vg;5xZqSM%q=v>Q2aG5OBMb;_L+zU02w z^}xBpS${!jn(or)l!o4zz7!gbr$>20JNUwV0r7O!#=@acx47>1O%X-9b zf37-76E%!<(PMfYI~8AmfrRT_x+AS?K<=x``t6$u4X_m9k@|a$xsacL;D2A@AYAz> zs=+M7;W|6#6;&kZ%n95ts@$FsR`Z4ah#eOnLWUpQ2g13Ve-wX2u)p(uI(8nPjGBG% zpd zcK5?&g}H_=Cv?ujryNfkoM_E+O~4k~ff_JQ7;gr&8wW!Vi-A%ZD08)X#*gJ81oqkH zXsbL7winp=8mc6WU@nN!^2^9t1sh&mfIXTPi6S4 zb`2hE!k)mtj4&FtT&d@>vp4Hd1Z*pNi{aen>L1s0Q~D11O-ida6)O)k=0%EjSF6v< z>x)X>v>N)N8&{Wl?E)5b2EhrDE^{*JTiiPy?OnGfbX#h3Ug`%pYjVv@c@}Y2wxABI z^7BhI*_QI`{Yjnp@^38Bk^T2~8L)}P!~RBs6~ix=rscUQAaDJeE5$L)dgEfZ3MIV1x{Pq!05t6;udK{bL$a%IgP>9zm=CS#BEg zz$&7?Z4)iHHy6)qi^!&9oN(x9`=$=RwjCV}K{AlDirY|$gp#P;=!J?8UP}!iOAYCajhwN*g;ZlQK?P|s<+KKAOo$IfRGDra zCZ&#L%B7P1dp>$PowM|~B8*n{_)h~5pEFBGt8ci#3RB=;dYU^VC{rPCVv)A~EGb=u z8QbNUGL%ur;4!;COGDd*247XA#)*L8>Os4%wHL$b!gDKT{h3(!s}Xv1Q+a13Z2F9{ z{NP&2`->E`y_K4vn&IpgrXM^MifNfTek>#P^6dT6UTY87h{#rOCA5%y!1AXvk&Ob7% znj8Nbsyf*I==9VoU3&6q0>&`gz?4`~w_0SBl5%?!(b;1b-aa6o z2@3i$eda`)kezy2+3Y`frZ~j!a_Z8-EZi_0+)BUy7^0_uSE>367Q#@>IH;C=r~}3g z@oXO09s!3pY{+8FFsgaom20c7ev8pesXLp1Fqq6e(yPfLmK)PjBmDb< z28u(UxhnW&G-YMPkw_6=HcwzQ&ws}>Rmu;0eQDixg3kYDkte04YMPavkH5k9hu}UN zTg-boJ85ceksdvFYdYMQ2(_K$O}C5?1Hm`8wQhWoqDNo&*A5fbJW#PYGe5N+&(fu` zjF_BMdi+7>?>Nl#d5rm0EC_cgAs(C@npuM@$e=j$z`CF8hnGl0+Q;-m%p8O`~T8z zs!Oec+Pb6v9E#T>*1yPaWg=^!wG>dKuS0D z#=_D$ENC#2`|wFiEBFWMZ2{20g8PT!ZM|XBj|Zhx7ts%&er!9rWN8g}>MlJr(`-yO zi|n27_ed+C$15f$%Y!g>Q*CBxYilb7wNjQIj`SL=^qrTB%k^G{-Q&8Ps;>{7cLJBz ztX`Z&V*HGPSID);r2nrl21eROsizbJn*Ki~EE>s75i#AJ_-42_Q&A29l^hL|Ttkd) z=Iu2b*M#E<>z5}h{5r@B3`l_V;LgyC5Cd0N8igLK8m`sRO-9jK?Uf zeaMY7uVQ2Pla<#$`-icfFv;|-j3zrWa{V^qZT)DCDes&UR*X^urm4;XS6QjH2E-}_ zJk7@V6=M6YD;WcMgm7n*0eSfBEBNhqm2Io<7=jwk{kq5>Z;@{{$i8H=bv#<#Ujx~e z<}EeX$G3dK?uD-!oiyXS&I zJ|HI)KAwr_Zhd{M+TW?S32dsMB$VN#Z}Bl0QnS&lsL1a_tefg2Ha zp}XGkxA(Ij-FtuE``3FMa2zwkaNqY8>s;qLuXSBZg_IPb^dqO*J%nt}*vBB^j5Ed_#By9+++LyK8V*EtyNAv;Eb;&N(lsV8pJW@A2#@bIj z|LI3T3M4H2pm0q)qX6t{;ZgPj&3k@I55LE+1-3B}p5TYQi&tvyPjqf>7vbyg>a)of z=qm17AC6y6Bz>;TZVN}>oFK5C9xc8b+>Ry>)EBCB8(*h?%fX)TUPSAJ4Lv+#_;8G! zGkr2IEQk#EXh&!KYb;_?ANuO7*7e&!SKXk2DYS;2kH@(%-N?WpPacD^J2N4LlF4pN z_uEvVL$eapb_ZKR)m0&c5AZfS;`TNwE2sJLWvG1G%?7L~U@9(QW!mT37^_0zyBo7$uct=WaVMqIaL;UjEO4eZnB6s93L^E-;j^)j9!}CU+;xWnq68`Q1nLzEX0Hn%(j% zt)EMEboKz$@gh@h5+m`29!A^iI#pGh&2eYu^<@3EL$24<;jT+_d2(;K^I|4{8oU`< z7To)#R*A{NeI&A$$}P{6>h?V*LR?7Kk$fDhL|k2{CBH@<-Wy-@3Sk!`<4B1=krQ+^ebzTR!+{$zxVUP#QheuTvucUn)QqKK;!U(IaDYMsA zs^K;Hdc^SJuRH(aYk%JyT|(oL{2zexA3oDqoFwannq!OQ-Po%!J;gDXug@4a-sC>* zo7BZ%I%74x>?-E8G3coyWYxB`2u&y(Q0vzElbrs34GK|~GPUUNZ+?;fKd|e+0M`uMi(XybYQ$AJF9d;fhK5cZo^-yxQNu<(R5>H4Z_TUCSgulVkd%m4E=0+Pq` zzpMxrl))sRZh0vOW2z0HRw0UT{be}+>)Wg;yj}vk5=jh;|Mk!RHqKD zz4Ba5_kLU)T3(Hlf#p^FeOBAj`*tCOr9d>N&}UJh9vxI`iE=wf%hiNfX9KFW?>pVY z;oxex;Wu0Ru>W=~)LW^X-xKz&g!?1izsBoBl9WzzSZtTn+iVUQsdA3snkG9u?f^k< zNCMUosPR3Meu{D5`RSb~$UBqba=u>w94MM~BQLPQBi1}j;ym9~X;v6XrF~StUw3Hx z@ybT5`&@sle|imS;}4&jC*(SXlpaTpe6>MDvOneHbM;%j(XUU)XqYNJvf0nL|G)J3 z2pY<1+XWK6mm&Fc;(~OUr4;4EzmhSss+DSE51x~rui-47WrA96(bfm=X+lNrhmfJy zajUf!l}e5By~UNobNp2Ld4_;4(p}7#y|KJz=E)#VPT6NlChPSir{r(<_-!!wZLzDY z@v1%$puD>4CWb2#+jZwYzvEj@&jkFWm)UWz@=2|dr4@yHxoU^TAK?wp#kccN7-}2V z80&ZzU+<^n`ZWs3P1%)@iWI8bK6_psUv}B~`Jn{$0xoQD7dr|ox!xYoGj7J(2o+gDtzu^Pq0r&-qPHBE0UZIPjgF6H(megO-^@z^z#J$ml- z)shf_@vxbV@_lEhJE#3X^xK`IkC}RU7hW0U`CV)H$!jIpnw&TZDe+s&GOblDcF;~3 z20+WyhKC;_Fj_%6(uX-nSi@ALX)pcE@>_m4KcI71$LZY&JB2_8d-5A8C;UC^=-7Lz z+F5G|l7WF&mF@=iQ>A3GNseI50gDTu(shcB6Le~IyL0gHhC9F`^boivv|9J0-O5Yf zquCdr>9=U3l_r(^Scp0k8maC-NJC@?gzJnRYS*Fda2Ryh7NwGfH+9+8I}dZ)&MK{B zntkMxS+lI!_o}tUaE9@fpErhVkiE`&fjQ%T%};zj)!E<0HjfD6FKU?8q)XNH8J(I7 z9Rg#z&*MMl7n_jKSo5#f{L5~p7(j8n_y``q=l=~uMjqnrXA+Z@vM7lQI<$ZA17*`AQgmigB{;TOJijmAi9^q7D;TotlgkRb}fR}R__&8{4*7+>Eoi=y#=R0+Xp-7jR|pL=OWzb7L%meb=9iMB9A{`X;JoUvB=&-je|fwKdXxnq zMmp3q|HAex)Ily?2F-YJY|5{b4*9r|42!7;^aJv`=<6vmI?>4Wk51~w=eWlE-BJxv z+tj~?aTHA~C;MY2SKd|nuL{DX#?~BoN_cFV4Mo22|3YLz;kvG?? z1L2Zq1}PG>E1x(C@M2fZuZDHws0S!T6}5}5itmP-%EPQwet-pL$1mgXGqHjN>%|T0 zCprb8XXF)15%}Yd7Me*nN>WeiSwk=3mQH#^&|G?su!B#7oct<*{s5PzgjO30QIqjbrSOE|_F2qV z4nFiL-(5Yk7q=1v(G+;%URghZyk)QM(%W+Z=!XWK)LbtVZxsJ34lVW>C|(%KKyN$} zA5K&+s* z__E;%!Ay*!0=y;KfE28CO(;4bd0_a~(r>U1o7Gd`HNJ4o^OhTH^1$_G*F%ri308W= zrT3OE>*j{n-ZBaj^N!EO)O3TU3eyJSfeqel8sR=Ft(C%tarr+UKQNrn6&sEK8YaRZjny_G^x2KRyRVf42A_SB zaa|X25_|VxO+?nI=SGmIj#RA7652yRV{nwHIUP~lGz@;gt3t7I2FBZz>CO(GEOIXa zDGTD9N-*;O_|*RMzs>MxD6&(HYXm0$%i)PC2c}ngytN^hoMMAF z6zFX3;Mz45>3k;OH|hF>iG|{etGH?paw6biM#073m{Y9J&P+*Ll=Qc!ac1t+j1_%a zge6(wC0T0m^EBI<>1yq3$yh=Xi(8 zB_6uapJ5N=5(SO16WZ8pVv5-YpvsUJ^vbaD1}g;2JK{{wb4D+ADT8aSFa6eGI&*U= zP&h&;dGW8AK0(nkbg}gs3jVH)-&J765wlqTNKP31w1Ly>KGTRjm^tI7va2xYtq|(xaC`GN2n(Tl4v|_m zM)6nAUCIX1ATBJ|_|1O0*|lIaS`7Fi=8?uU3stvs2xH@seKk2xKep6EHVn7eRu>>l zr0sR%bS6%-z+1;cJTI7XF<_O&Sgx`r*GbE$1m1i@?YZPk%Ep{5P*}|{fM2}Jz2v-z z%@n5tsEFl&`J@UI;#t+L|Ky*>>`!B&pDr|vDT;tZdVO!*>{QYN2o31tkXuda&_asx zZNt8D65r|ov`KiRTU&XlnFsq+4jU=BZ2Y#@=lK_^9_B%<2_-Jp`4)%D1tI%%Oc+os zGLFz$pztxKj&4Zy2kAeWpT+cB-H@NFM=98U8lnY;VQ!iw&5UECF)*XaBpoW4IggDx z7S8Qq*^z`)L8)6EW`8Q~gd+x7bN(%M<1yxbhE6L7H!(0qhlj8N<+AlF%jEmKnRNZ=p1qZ9eq;XKG_)bz-+TVOn?cQ(Jj%E&f^+&6uFt_>9>jee} z?&ag4bScYO0Z)d-teinuk(;3qSOh|bf|m~=XjspOiLM5vnNE`t8sSMkd-##O146p= zmPycwdg{%E(_0=(j?1PYH(Q5y9`pVBP+IikEk~eQ4SrZ$)us9m1B@cAWW@y$Ce4)h zdwkJol6Q|>h@kN8nN3A|!vPLy2Txm}#QKImI#!C|DT+T6iAIw4~5_7K%Dh9o!A-wk8YSYM;a zQY>(P^M2#?N-^e(>VHO93iiyn^m+Ol8;3hyNq$7~w4Gr;Rzx7Zv{J4Z`9-Q@Xa)6` zr=@yC%5}t`hoFf`w%DWmrb<-_T=vR3bD}4~*BvUd@~Njxm{X;Slf`}TXE*euFPMF; z99~!2MGdK|)$Sr$kn=PaPl~mF{d7{u(9wyyLSq%uw}j&Wahh*%SB-eFpYMuJ6}hlf z{%1s__6Q>{&mu|O5#6P-l2Ka|E4TC!=>G4vplgS}z<3rThFbCRJF5?CbrJB^s!({bzKbj?9Md zE$utHW`c8D(K5&_i}1E9naAdXiEiqc_0#G;HdSC6PS1hwCj``C`U1;r9Y zd+7X8aqkX~Vy+@}4kcW<)U1I|GCj}_PXVvsVciGk?-l-0AwVt|WbAio5>!nMZgGm* zllO^#p#P3%&?+40F}}pM(($c7W8)(&(MuU%Mme$n0CA8mL(Dt0~3!F zW2M2r_8J`$GKvDFiKIs}LbHBsV6%+R$Hn`Uxo!Te%8Q8c+uCZa#gm$@VQJiTCOetS zl0|6Kv}YIp2b%J~!-z;Mm3nDHf9bwA@doe5%riA0Ccl^dQ2A8)>#VoLSpjD?Fg^aC zyhUaI8ngo3q%KmJ?3lRO_E9tj+>gkW*CV#zi|nlf&i7pVP|a4gznF7|o@$E~N(=gU6aCsbF{3(F z5{6n_$kN3nv#Y{$8uNO?)qv%>B4ED3|1zWQ6Nmk5z3y0a{O8p1{TjAF5BR;y6WPAP zyU=#})a(gl^pl4QW^0N)MVV4hZFySZ? zV>r{5@NXS-(S$+G z`&?cMp~<9uOEkM8iK#FZjU_c);CSy>6K0i-1$jJ0meYt6UOYi#$|Jif9&U4%m<-bs zgiJ1{(Oj!y@$#P%&jdEQj^-4$+wUBVKcuvu5rIR>$u;Km6>#6SV%AK-w__v{2mGsh zek=;Q;G)t778=y-5LJ5WSY$9_J_;99TXN5BzGUZZIDKsb2Ti7|RCVFUTy{3Kz9KE+ zY$Cx58vM>Ho};^$-MLMRZk5-tlF|AJuQjtW_TuQZkdTc|ejUZ%LMG_LGnCUzk$OS- zThUZ~Dk({as*i^@{d|h2_@9x@kkZwCQc+nsTCBqdKJ8g4nauCZQNP)EaTNJelA^C5 z$?hf#I?cpa@O{OW>7B|sc~=m&3DRHA#7h!*QSbZSTK=}?H}a{e;ueqR&w8)~gf_+A zOp`56miMAo(8y-5t1Lw7mPnpMOFwaap4q(J@$0?a5+bv2X3h6Ne)(8;WKmAj_CwHp zx)2{hPkO-=VkK!uex8O2oPr5@#c!^8`_g#*!Q#2Pns@7{_4H2;b5$MmMbyPkB3pIs z=X|e_{P=zz3c5A22P#)jZ%_)DGabE8Z+5_P zdA3@S!ra^(Ly$|`COLi@^Zq}W{S?Gr$=TcAFZ(TDnfq=J%eaA9u}mZN9l$OB8RUn% z%j0_6iW7#sr$i!jEm&gCnWWG9hZ`PvL6IiQpqoan$+JSi%xokFhQQ0GnyH$?)@HfU zGvuDf=(+w!lM~c|{+GLO-ZK3!9ktuYmkmcd0_A ze=VV7#k%PAJG00Y^QIWdrwQk(#V+!gXJ*tWO)ZW>c@lmp3`CX9sZYE;E)F}HW8?EO zlYqsZFqTxY?EV%DpoBl^`K4l(B7khynOkA#t9mx_p>_dh=Q+W^n zvmHLAVtzM%x4vgtxr~~EuKIt$(hDV&njRdxg@Nkgxu~etjwnuDmlE{fp{J8EKakwcHetjJ2}iUxwkB8l=smsTa-_4tVTSBmgJ|p zW=Ray;`XPasy|^??INHWH{&-zOgsf`82MuTYP==CH7t7wxpib;@Ve{RhrzEF%^EL; zue2>SV_NPGm^FVH(nx4cej%aaNsEnrJ8ACPgc?EyhM44J8*CheF7*%PLck;XDLw_k zP*e%dZsof=d>NT8)QL2<6^UJ6D8T+RS?PmD%=B(M>Qa^DEE0zrWG8|=ul@-`BBjhz zHOEHh@=kYScpM2`$cKKByWUO5 zQZOdf)-pcfdmV!+>-cr=WS8dFpK;|Uf6MToe_H8<0av|5ry|@8E#hi%H5wW71daFl zd_c)euE?sOy3_?S3(Dk2s&ZQV)EKO+QZ;x9H6L{@$7zcHD`xp8G}fR%Cx|HK{Hh>_ z`P#UN#Mwmb(3>8fu{|>wEi}U!nfr>o_#JTm z{>c)>8~J|Nt+$7HWq0SbpkrA(Q6u^-Iz?0AEy}@yyoFicRa8+XYF0@Rr-~#vb}g3tEb0_UfY9+qs|VVHz5RWKRS@u1CThAB?AN z-?34-DXT60{{R2H?;PID&gMUnv)UORweMnc?cGw(!CdNIR#08loX0PiLB4wN`0DCP zbocIAv8*jA{~6qh$W>_ca3Peo<705dNFK1D-l!Hkt)rrXSIE)GEa?n*akyr^(C8K9 znQ~Idj)jF4<)x{q8DtEfx!-p2d8@v`Mm^Q2gcg(VW8Iddhi-$W@jZ)>MTBEZL^1;X zMo6lq+0QgX_4YL-FLMCC?$kU`vkK zm$cjC9tF)+dKQ8n70Qi-w&u#k`kL7Sr*_x> z;Y|sW=>X}oXEsm*?y7ZOK{zn2tnRc&aCTp422e_zFG_1AKqQ20!$08e1TNSl!lYy; ziT$q+m=hN|!@lXeQ?UzWlGX9fakD1=Dj>7Nq*)PA;vvI zml<2k?);YJ<%)jyyUu#)H~fH9@(}D(#;aQ3f;am4npT#&Ez0pcR7e$wY}4*bX!&`7 z0ixH$KGT()qc^tq9y7i@TYMq+pYa8XxsBA~S$mqV_}{*0!sUOAQT21q zb;YDwGvoT&7hz}gvErTb0*No~JsgKkb~YeTnw*oX>--!+XMS{z-P6 zX&X6OzcSvdMBq6|p^Xo)LG~nk_P#_$Zi9InHWsd0pX&2 zMLJp7Ei~!`N9a&NticBEooQZ2Jhw%TWhcEHPCIWy-wVSZH9d{cjEDPSJ)n*Hs9fWo zsLpSG!@^#ijLv&;;f3_id%k}9E9wrBZJRj!Si}WWboP4c!8he9-_4~^=LN5g?{a5I zq_*_=_}2x-Qz%8MW3x^**+%C#m6un9yUsV&(;AB2VI+mBaGHc*IE`*Uk47HM1+VkG za$%0Y8T`DDi2sdV1+M1>rE&5Nr||k~GLJ3v-2ATIYC<`NkqQ}nYR}f&8Q;qOrc6W$ z=j#DGtf;&)+T^u*Qnm}I;ztXtP1c|Prl_B#o?%oJE4_ZR@f$|6K4RY9`k-45rC{mG z%7k=9BnBpME7~s%^-6gp1l*iZtPiH!j<-6|CRKN|%itT-j}BiXp~^*L>_L1WDdPAM zI$4XXK0UwZ^eL+iWqq# z5!h?60rO-_R*#R4&uZAUz&ic7Co`bbO*PzI3{th8G|&SN$Rtq-iF}+%9dxlXQAj$> zeehE`b!w@0K1tjvs-gK4O)xRYM!EdZiCz->zH`8h06_!=m-|WU2H*17zC&YUMH-4F zpqR{H)$w%G9jbWlp!M?fev{vK8i1>lg$-1YpNI}%O~FwSHE<}!nGr47jmqQ`?mIZ_ zx%M8*m0yo4$MZhhwufvwj?4wxDBT|Plyz|oK&;xXWh>h`*x5T(C2txvC44WhkPSqq zGYqTbb4R$k0SEs2zPOXsvz#pl#TTY{U(2Jej;DK4POi9CNH36whGIQu?(2g(rMH-S zkP1%i+L0!q(b|x0XubU_?l0ERTaiO=3Arg^Yzby$*SQ{AQ$m-sQ+g06s_K??H}gh>GYn z(^113)Og|BmaM;rr-ZBB(AjuT#Hj;My79g}sSanEZ<#p$lzsjhLINQPRi`!kd;(i~ zS`v`veII)^E6aHC#Fr>X9Bd7zF+?=OQCst@h-aH|#@F4;*kj?n+Iw}XIif89SGpk= zmFjvrU;jp}{e}*)a;4H8_57K=NG}OMX`?yKwe0z~Rmra9O7VyXZSE0gmY1kPXN6S0 z*kbGV#-Euj6v?&#ily_`6fgE3WEOZLcFqj3^L1_kHJ#hBfNXvbdm&i)g5sUw)nUb; zgi|W~g#-?ruP?I47U%no`?~luxH|0-eKLGdqSOcnA$ZhrxdvCCqPmqeX~M^rxU+6C z68^ls`c0)%mWse-)KA=;mQu2pDJcUUbwU&2Hg5!Oo-S0}g+IFHBz3bS?|(OuUe%n; z=J#)T!CDD(`+R1z`V@w;n#$sKa-SSdJKJ>!fqHocFl9ckbT) z$%zLHcLz|L9if#UrP64F;dR~bH4=x1g~TuZbrwLn^FrOmcQ=G)DXJhI2iP>ljgi;f z%4($@|CUHRNBf}ZVhZYcR08HU-!}$=gl0wU&bs_9y$<@AGZ)M6B#4{Oru6KCNuwl( zVOLRrJr~5XDZ(lB(Y8L7pzGsd(IZ!8-U_p=(H`2K4WnXb{Q4sm!1Ct~B9G~E=?zIR zj25|Lb}O6d#w1A1-KrnZ9I9pHLl7-?{4~S+lG696LM@{Y8NHCuI(`-O(bbLB^ABc zL&t<&*)ru`+<52(b3r^oymwE41?-7in=st4vZOmtSx3^{6i) zFR!YrbbY(?quz-TU;bg1wiX4hxwuSqq{+0(^zV0Thj~rIYVSZe9T#(b+ubE*4(`jO zME+(6LQq$AsA^ZTRr>Do5TA1d2J?j*Vve97-8qD`-S647fseo`%!&?twN;QQqScN% zFzIS%R|s~ADm^JzI;4EIcyqQST{(BN5lpdiqGd$bLT8mB^28om-6ie;+xip%90t%C z`SNh4b>F22&_)4HllJ|cg3>=eSZJ>h6vdl;>)#ekAzB{nHS0GGbK1-fbt09#yT(U0 zULjEy>#_G8|8A?ehec!F4br6PI9=N=Ho@-Z0k;?Oux}Iu(X>LuuBcDvfgV~dFf5Ry zZ&cx_SR$tZIe9+k#dMeF{M=(M4I1~&?Aqh65wQ0M+YGQ574~UjTRvwJJLS_7#x&mn zrr6DZX+yt9?h9VbV7iL}!Hif6_TMz zH7Y6B3%(~OPdq9U4P5ZNQ=zUQo)BR}*iyBbk$+b;Y~Hfz$w&a2P)>+Zz#Xg^9Snkh z3H!#Rn?Bpx>_^ev)N-e3U%i%aZmPfOXXj`ygy8Cu4e7n+g8?Cw_UijW^Z7DJ!ill?** zx>|VgaSiVD4eDD@GW~Ar0Fq0ozm(Xo?v*zK$V@%pK*y^Rr>LupBR#*ac&(+pawh)x z&;TQUN^KUHn-1Bk^@Q}DXH%k+^OmnKa zJl@)EcBTP@6x#&BY3_#3>}D;~Tn^=H7c(iAn$F-v1us<+job^b3_3ul6O(*=J)d@i zaA+S!^`I(Vbe(=3ENwo#Pi>sw`r!IYTQJ;FqG0Y4nLA<+4C9zG)RSI2OxT1dP(23k zEC5Elbm$Fj$4JZ^8?ofl+(U{A8U+`8w%`b5!G*`9&6O|7$aV?{FOB zQx)Hu(+NK*_ix#!8uV^EU1y|+<=K|j-><7v-d|Crk6l`lqr>W=aeozE zcOdJ!H$@|49Gp6c9sd$r<6N+NM5#%OpbHgK7#*S%N@K$g`>3%Ovt z7d|-rvJwp-hdNY#ftpFojLJt)-;cLfI&WD2$>!YE!sS7;B1TT_ch{gJly(~(kYw#F zaG4_9tFr5;tZ@v2?x5vx4@R|dwOo>rHs38|M%Aysxhdyr4%Fj-lWE`jb-lOk$_Yl8 zMN33dm9`AK8CG`GqDnA6z8bsRZ$E;}@%3ZD)@3Sn8+Q)b(y-dbRmDLbaQ}e}`+zj3 zvA$u2&lfprTjSoyTb)a`zZ%+f9*vqt0y9o`M(;tyZWw8W zUW%~rhmb0}tb9|IaGQpE?7^}gN_Eruo||akGiEZbU{VA$q6(Z-5Q%O+)jHdnJKXhv zJ3DZA-Kk34Of)%~In?(x0mM!d2(*o}xL;-;HUfvy0ZwO?Abhx=(5Tz$JM*wltzmQQEThu0tL zGut#fY8km<4ND-{J&?N|3(knw{{ZCGz)L1-^VYr5Q9vxgkD!_Y&v_97@NWrR2a~hb->YI7rae`7`_1mP6%$fJ`q7Sw`xHHL!RfUnl z9-I0;6e<#1jNl>AQ?eI2p^o)S-qXl3jvQ2Ij`AU={)#?#GZ|hHU18spUe}Zz>@PXo zOllc5?1=`~X@hnt5P~>0PBDWb8yOqTIuf@Yr!Z5%W&cc~K9zRt-tag?4Dm^Uklh3t zFgPj)g2$txjb$V;3h;bdj;2yMCGE^ScLULH{1Qw{ZBd^-fO(ETwyT-VFQp0a+KI4s z(5x~%jyi=c32^Avv>rjkSFjbF10Qoh9qJFfwH9)sMM=1>_hhW{`f3vm-RrIrMlEho z9pC2Vw|LP1Y3>@COO`~X#YxGek@85NcPWSJmn_194K&Yh=iK*x({Z=;9+8B#seA93 zC<@xfH;no23=hssy}hv=s^IT%cEFibS>2+P56b62uUpcSW%tGN1kAp}2m2Zeju{Wv z5x?r-^4C*Mc0ocYC=AN5Cb*nKWTWF8__tsVP|UBNeZBWnMQq7aXyj86Y&m%Dyt!*Y z^-|-?PwO!Wn<8{}F_2Ma-_vG0?T)S9tp~gR&An%xwPLne%=L^Gw~$nCQ;q zO(y#uni>yim3j6W8eq{TOl0`5jSwO34jjqci-X9*~2YHsR`wnu{;EWCDK;?QogvwB5-?++4enGs8+D1Bd) zAZC6s-{z)NPje;Bvl_tFyjpCw8MOl`R5u6}g#af2!Q=C3BVx(7DZK(E%`@3GZP-*v zd2=jcXY)t4c&!^5KtVwmBV$FmSsIOoRWvP44L{(fO8wxMA}28Yu&s*q*?4<2c?21g zO^HH;g1d`q`eh=JzPn0zE<-cS?Kvd9h=b-pzR*fgU>jm??IkC)}pX!P}4JGecn2RMJ^bN4y zRl?ULj5PKs8`*YMrF#AF7Yd_Nk9; zR8gC~ZfooCm9j1J{BTB^z&dil3t;1q4N&0jTwamhrH-DgN9%*I4ClsrzAkoBN|r@_ zKE*RmL7dfS$-C9<3;^*8q|GvU>X(tE#}pA$*!vz|61iFNIUTAl-hH2Al#^}PTlm!y zjIE}IX5}+oqpUZ=5C|R)*J|;b(^qfI8tEM=)={^5IV_lBFN&DTdPz_5CG?Bvgr9AJ z(gh6L$quevYHgTb%QyS-(Q$vMFZ{hUYWhPBPWimFnUSgUm8%`FI;H8Cx%d99Mn1)eXMVWd_w)Ls{@ric{6l0QMeBWh`%*G| zl-fg_=`TT;qiVzuRia%-!qrUuydJfg{*Q^ZkjNY4akiq zAWKNFhFLooVYhYmK)(U0gJBO@0Y}|6emx>*6mgK~H~8&EznT+5+e@)+ z3>xe%cs(L>5Prr5K=YnT$(|FGO!bMv=n0iXr%Dy7xcML(Adjp5oP;^)-G1)FhYyMs zT`e~6!Ha0c>#tzQGU4M}f z)M}tGJm#8?Rbgs2JP(r4xx<)~!Z)NUxH*$kE9yMWc=<9p%W)1GX z6WS&NsQZ$S+J1qe%H2Yv-CnAPg_5lqHoWEmo#2BULXl3L(y_556IFzi#Cg`eZy!kK zz(znL59dxgcpapJOhkK{MT6Je(y~_Ij`3&o(r3^YW1q#Yt3`ct(2wfoK6hZjF4%zU z;*CMm*b}G9W4`i|T)!V*!W-XK=G)H6*7yu0hBkAA&E0sqg&wK!VrG{AGKxJTLaIMF zrXRiW6Vsi%l6v_S56w1!6p2QPbw@1V1B@g5;2N@k(x5aEW9dD`sFyDtyMjkq1;NZ#NqsW6V)&8SBFyHw7<^ortfrooS zK;AvpCUNfb>y1_O2EW_vtUc*QIG2RV>KxeS*5iX17i;YF)M@h-lk#_M9Spk(_&RTO zKn~_D$6M&d_|3mpvQVj=lAz5y(;s(h@91c*OQU)N154Ep+-hAziLF>0{lO}n2{3M45B_CI^&$hxG*9T`El-Yu< zGJV?I?8XSlH)O6aHjL)ebS2DoT*Z8jlZRy(AkMe_T83UjIx0MbGT4%PWPn`}?|HrI z3x3lQzffpi;`M+|Jh$OU*NZbNN=03kcdjdSlvAJ{;?)PJZ9MEHhn{IPLOa^YCReGc zw%pk6*J{E!Zu71UQ4C#M{fGb=%~j*$rI58*AM~~!ex5fR7i^1M>@`r{`Ez)xUrkw1gNBx)ei8?QPUIcL8%*|x*n0cSqD1PDT zN>LHiHr^V`Q~5F9weFJ3(pT>`R6QMxAQ(`vRp8t)&aZ`B*ojCQ^4h;T&woGvMuV;> z$v3E3%&ol1R#8dVX0ltSOe44KAjA24{dl>$^;0Ya!3LUTl7yc!Ricu_GECA_97{xU zGvr9|U8JMQE?S8QB}-b3NrN2-&Po_^5aet+=|~~cPp50o=k)Nwo^*sL-E}Ljq*E6i zQR#(>eami*gE3(VMKbnAWzm~O>Nq=6%FX4k*>Y!_K{7KTJe`-w+HWAqDohIzYo5(} zEz#EwcbdrUhHPJt%Ov4G5bw4Bm%BqnX0Zj}-px6r#O&)Oa>RlYi=+N>bush6$bW79 z1Cx-X8p9@SdJBbVFn^`6`QqMVx?4`Vs?M9=He1Yn;Lzm~H|wK5XFAl1mI>)~3!M%4 zUNy7utyqJMV3y26vqxkxYU-MLHEz&{GTD;%3T3R*Mge?C$Bo{qrj3}N*OpOAd<*_4 z<2)!W`n6Hfd@(5NI^%&V@o85l-tQv)-NBC|`tZ;FN@{1gs2p-1$ZHYQX1mWXvqIfi zzRdfoN8VlPH6ENcENR1)&S?P-sKvSz>nf*FQ&(=D{U05KZN8N(`n66&)))I&2(gbXHuabPQVVu(3)D1Fh$u>~|1JYq}=@x<+qz z%;((^CF#9Vh>GEK(IDVgzoT97@MIxf^6q$e4XrRY<7elnQt`7HnutVpchiS5Q4EBV z^9HXJ6L9FfXFf#|pI<^9(=70@q_EwK$CM}4RV8=l`@c{LE#NVA3~X%G&#ot$Gapi- zRut!%>KrCSAI$4z{$=FbiW4I)~u=A>*R z&lee@#n)BF^RkK3aE`E3I~+gP<-*|Wa^a6SFQ=a~VP~2;@D+$S+h_WnMx|I8szy9< z{{iG2vIENKm|k2%?7^w6laRWv1mW>joMtpxxKl-1Txx^9^PPIb=$A`4dv#TtQ)l@+ zVBu`=%bqTMW>qNC?*z4e z0(Pqy4E@*MTTMPj(2@xyd$=Pj2;ZT)nUgXaaQk}W{uk4FaPczVntn!c!ApF#00XC? zs0A#`q0VbgUPQv;^(VipQ|AP!=^5Y8#i}wgGDu3yUqlXP$jR|tiTzgT;kh#ubI=_y z4FQh*){=)0zm=*0zwiZtf4TtNb|4TY^OpUVyW}-By2c}wA22F@CpFJ9433$6)y$=N z!SNFY1o^#<32&R70pW{I()3B<;78cH6wg19vZTR*dw#;M6Z9sD@yKO`Yk3ViwpjC= zI>t#n0w%#K8!K`ZTXvRj=nwZO_bSg8IK#BvtQJG)2W*?Ud}gF5317)u4)+^3FT>yg z9*@joF&~S23`>{jSM9bIZC@bCizf1`g9|X>u!ssHPr* zROtM!%Yk(LHEBUM!j8;1D{3)*7i)>>=WoE@4lrN>V?k(L0lI@1mqWH0o`>>-d~AJ3 z5J@h(*hk6aEmYKvZF`-{Lh$7|uwj#TJxC$e`5)&UeVuRQ+n49?5F6_5Uo^Ym9JRSy z1D&cS_|3~bR7vG#ErGPnB{lQBI}$>?Mx&?Vp(*Fck@Q`12Cz#DJ?HfXmPz7XmAmq3 zLkHaAfn+McNB0PB2REY={%myyb9dXdBC=K0kwZ3H4S7I%j%*1tmW5Imh`dj>ZQ$dR zSw+rtAC4Nn)l6Um*bP1|6Q;jS_@teD3-eUhvZsAh`6*4}f})D$6B|YF4AiknV994| zK!4P&*!}5(bdTOv7`LLq6cslsq z`d^;>2`WL?Z8wZX5=FzE@u&j^iDytU5liLWf_LH((`|SMp-3xUe52EfiS+&$+pm?1 zqEhhaOn}*Ry8Gu;L$}P;d6%23QMWoa z@X|S%roD>0Y3~;2dhJcMNANlZf?V(XSSFVEQQ!J~f^7uKa+~ut0z7u|q9# zZlBs-!q7lhJ#K^A&awHV#^>xpj5UxiQuN$d%<&b|M$HO9$#$jv6~dsVY=sbza;RdDHtGbO$a2uXSLmLBh_9;%dPhW`V8BsouX~dAhRhyYzk4-jY zq_0_TW7Z?W%UG}X5~V0YLt&-eMet*%*490?dsxiFl7n?_S}8@I!xV#8Bis9Z1sN{R z!cyz=m5>^*k9q)GR}b!fI`4Z~15+*e%6#Q^yC6og7a~qQKJ@>Gw66e)YuOeJl3)og z0fIXOcXxM(;O-vWf@^U1;O_2_;4-+o%;4_&C+A%`=l(jkUj1LaYo_^G@za&lyGW z4VZM?)OFEuW-XMmNfGe*ijV7p?YhIGP4m`pnf*pj2*crcYj#&t9QYwVI^$)-oWj@~ z#lcAlRJ-e_^(7*55Mu5*sTkRNPa+*A>m zDb6=a=yv*0$fH8s1}Rq+b!jwv{BHmYrvZukc5UmlURe7}tdn51qth2g8QBAi1n~H* zaV*fjKK`;a==?ucMn2hBo6Fs^foHC@Q!IjkqRrdGL$1d*hwdH88(Ai-o;I71ExFZE zdD}1Ev{8RmL&V|oH9+;xTmR#Ddq8$}jnrkN(3LftZZ2XO{c>vo8n=1%zImT*5HE&u z`7@foPmQFh+sE@11(T^amb$vf{kzAP0b@}}Zh?J6=CniU@rFd3r1%;x`UTD;6FecG z8Q-(cqc^)xc0Qfy8!g67c?AH@Y)ai~sN^J^Bf{^yhDmtkN0gD6dr{w?7E3ZHW00_+ zxu48YhESf5nq|o+R`Dt%_8w05@}jg4QTd>fh*CPEyT`@hyU-yP1xMQ_5^ZYzB2#S7 z?)mJt4pry1Bfuva$S&Cn7RCKC%+j;(^GK{XnF z&anVC4slHex{*%D-O>~Q*~cd8<;kUJ^MSY)m}SKAbc~^pBh57pK&*32z53XYsMv3R)_LhfRXnuZA$i$U6;TTFI#uMo$pSjLs*N0wQ9+7zej)A z0phy!TpPJ5qh2EN@yl0i*`{C7d`~fDR^>%KY^-iwZtG(r*W4+HBO}Px!l;a}x&WKT z)K7tNmYG)>>Fjr4tKGVuyz5|5rcW>$goX34okjW0kRF=0_~Xe0D+mGxKXQcb8N6YL zh8JT$MU>WQI|Rjk$db9DQ`=pYCqF)TIH{HyNv3!0;(R&{4)=0(GY(NKsiwwf4_Olr$PVZ%=)rg<61ftzz+55{eA?IMSb(twE-YC<9tw>ILNu8J^5+^ z37S)JgHD%xLY}?cf76t1;w%lzd6=N3v=BY*z z=QR9<%dd!|2c)wd^1@7eSPbD3Bhkw8INdtdqvjX~6(5J*xkz-L1JmicGSVrTer*w8 z16=LJ@S~duhW5aPis_L6RylX`~nJ#h_`Vj~AgOX(dnTsCq9U8Vj4Au_N$X9=IHsMxV7QCqmlmcct zGvK#r*a+30D%5(R&JGw)TgaSii`xf3t29MzCFI8RS(^+K9AZ1f4zkxG#$ zYN3~%Fe8QiKE?TLXDsoH@ME@Z73V|{Bqq$Q2)xqd6q4>~6LuA`5Ls1(m+zkKtQN*e z{dN@J{#n|kV?TVXg=l}-a9g&_5{4wdA~)E$QatDyvMYD>2{n;oFsj#{=j5|%?gjL8 z*@4SL?tS;lqN(EIryv_{;z|C8Y0&tai_z=O4@Pu0tC%I&spf{#<;bTUkY6HL;d~*M_xwl%@GzPO$BIHhBJeTnG?b<4Etum_HosGb2!v}0N z`-(?Y$2C<|WwF;*2OKIGOSLd8pk+%o6Kso;Feb=sJ+osjp?82wNIkSr-kv9I%xXL^ z;;zn8m{~NQ2Bm~PU;XUPRb@jGeJ6#;0bf9?HNW^o{nvbp>EP^956@2tp1)yI%;fhl zXD|v*VB4-(Ffw-k@|5A5C`W2Wt<+*ePojVq=53m65J7ZD=ED#QnZ7ncIoJ@(F z&xLZ#o>6bN5@VdcIF`u&u$r&jP)hA~k7!!9T^`oPxyJc&_We^0xQ2ov30rNz!%4aO z#y;~4v}u|~%OdQK>s~ETB(fsr+U5R;L9ST))zHM-8pd$LDkemeq87gu`WCE^=8IN**xX@DzeLEIoadom(rWSH| z?*D!riMpETlyL73@LCahdn@#eX?7AV|T`RYYn(zkvhBO^)<`@NGd%5vu8d$~ez-OuflwtrZ} z+Q@<_&uj80(%>Ivs{3YZ+M;8b3qFXlhZK1`t^5`2Xx1;>-DH7{PW^iKVQ&V}#56Y3 z;*x{nfmUm@vES#i_dPf}sBE3PqinTGaTBzcPO&wFBfkff+sS#%<9y*hCAR@fc5-B}PSmzsuO`yk@`~w9jo&{IWv8gltI0hCiZV ztzZL}>sPdmt1IrD!ds$FzUS)VHrpxYuGf;$F28|dW9gZi8E(=QI;bVHLY-IZAV#i4 zQ1l5PRgO8L=NB9HHX7xc2QtbwJlIc_46a*SHAAork>+sx8Hb1!Bq7u4YU4J(rh->x zn=r;Ilh57VJ%!tjZmG#CI`aM4^b|){yA%~^=dkvM7V@>h{t zyOdyySli~oh&H+{vvucw|AO(ILViKeXSt<%i|?McU7V%3`mTZ*{ITFDs&&GAyL!g6 zDJO|npcDGdvIJhg!`(huyof>euvJ*3YI?n1KvnBgRRajoT~8ylt;)d2*Kkv2oh=-D z@qF7ItsHYb98bx6!IHohzYKU#De`wFTC$4~F&VnQqs?El6WTpxwt_ij|Z~9zUiAzI)A0 z0%@)twkt>u2exMK2XWh}CJLC(79R)G?o3wLGiCp8W8%&-y= zKl;~ReZ8fX0ybH{gdY3RiUlt4K9V}FF(Qo2vYi$PWs)P8(TVsZZ($IV*|DbaxFadq zb@l%`*%t_Nf5)LOj~>N^(s#@q1Y-W496bK#(8^E&Rk*?0+EQre-w`?i6arSmYP4F! zBfzK4!7B_JHSm}Md=IE|U{xaD^ihqo4sB{}?(OS#NcD>x=N2W)<`p0@6n%zr+s(Ck~xNaQ|_%zeQP zlEz)E{PjS)Yzz>dyu8)(D{=B`vlX1w^EEud56NjR`TY4O!{LUQvChV&9GkK11I|8x z=Z)7TYxTr0i&h`r8+&wouTNk%jTxTAA%7K~Kdqr3H5xd4%p_3iw~sg@@*o3BZi%KQ zFa@@!MgNbW7s9wV6(65a-RT_vh#N~=yaf~yV^Xlj*EO8hsy&-eLQ;9+L5^kz9ocmX zo$7km%#`a$rL$-~5+8#>$ifB2NZRdr$?jWn4wD7`bC?gp4g-}|=Ne@?Vdq+G1vXkc znNHY_FHU4<^Ij~zHlNb~S;49ynSoD!KNXV%B~^aVp~B7u8DAtb8c{P1@IiPz@G%(S z$JqJkrGHuFJVysTG&BcjUKIteq*KIaZT&e|>G!gM4V%=0I`rUR1#{Rtxi^?8bjg2A zs~au!E5bqafL57on0V0xKoy9s>Pr_V?@;l;Xiq71%lWtCr`B6c$P1L>=R5t zq}e&YLkL;GrQ+CV3z|P-qxD1Z%e)Il6r7wG%S&>ua3SlrTbx2!{&5$F8|!l_+x<)L z8=y-lp1&w(XwXK%_!0}#mO~}iM5VRCl|cgwb(h%afnd<<(6^i7G*yBVMnmyqTDGGA z)<$4m48I{vLcKNZd{vmhZ=v$9+#UiAzZdLSA~6SyibjMAv2uR>-NGhd4Wt+cqJc_v zdw!zI^m%aI18av)^9_$1%-K<%dE7K~nd_pwzlpH#9d$M=sUYEYbhcj=-`ntTzfG;2 z;?wRx^}eSQW0O4lJJ}Y&Mma6Xt1jw0(JOFd6*4nY zlCo~}qQxeV1!RNZUETg^$9u0wG6plg>T*I-CAK=cAI~?!j6vpQ?6$~}-cJ9FpZZ5M zQ{nG*vDj+O{?o+1!K%avXnJs6xNyUA(j-AeFFzSZuY_qIe$(wZgrFQ5s?fI#rvopf z0&Mq$*1gU4NtL5#W ziZ_L0Lct5?Tycnm|;J-H~X&_0cUC zKe$n8HHaX#ptoi3|1tcD6j=0B5d5_bTOmbd z?Hsuudb+DDTGcENZK6Xo#}D<+DEL{J^LGXZHme*mm70IXthvDES87LPU=hG%G4)Kn zd$*bMQ^Eesfzo0b!o&h6LW5gg)D^=ojZEMN)8)Wv%uDx2CkSp7jvaxW?5|l?Fmuv! zqjB6e`-b_n54hOi41WsmABVNW=`^rwXGU1d+D+M_ZR-jJmK(d@;ii4#L>GN#7eeV9 z`OIAefie4PUd~P7eZyib`?RFp?qdMCE8m^l2L#SS54Xon)NSf4vokV!Y9*Z1V}*}d zHiA!XVu30uFdcz}3M&iArwz8X~NAuXHUUE+K?&A`ZY@^pkH z2l9ke4K`OQ{fCcxvMlrO7`NT5@&lwUjJtL>)8q zVp`uY*&}tKuV83p%O-r1`uC#<56;c@*rTBOHDply>5ioTa zqNOmJL8yViNmd42P(K?PO@Sl-|45EdjP8eCS33G~q?6C*gLRfSCO+4OV81goxNgdx z&}dFYGa{upD+-1mT#B>NK`F-I{mM!WpAY@n<9q!&B1+Et*JW-bj*{^5i1i`AREXdV zW+?^=^lh-qb91(VY*}S%KWl}7tIm7|NtxjnCppR#s8C8m%3MN;m<)q&L++iPrMk{t z?r0vtsbU_$ndmH!YoU(P*Rs~tt9{Qyc&at;uJ!!Q^Psn=*=>qj>>!D)t+%MR+h1d| z%`BHyBt~fJvb^t(q30xIR3Vr(fBq~i)(GYq^4x^M#EBIp%q8;roD|zlqubZ$rphN< zxvYUUZEdAv>n)Rz>6$atL13xByj+eJ8NrAF&$jEbhp_Ob~u1#zAnryl8Yl9KMmK zM1V`^6kf2NQ>n<*?dbw^eQ21_t86@`X&%!*sk}XPU5@3NReQT;upDvJ8LhI{`U4}g z?eI$;UOsVI#gZ?Ecj~`kAoIpb1&Dz@6#PAXY)TEC8aFbEB2FM4PNCeINk|P`&lx%F zjZkmp*y3mRdr_s}hK7H`FD+3($sp_NJy3c7Wk`z}zI?ViVknN=P*2mlJ636;qe^AZ z!y)l*YRR3D^>9^FQw2_-*xxk~h50KkJG04Y<%><7G+@>j$a9LG{x%_6pk}FLRwemB zJgrEj&iRLj)hGB;T3Q=ootdF49aX3$vb1X zWK?$Xq@_iax^S?xTIE0Fq-V5{bpvo7R9?4pbOR0yG%9sNFdkISr^bqr02PwxKbx1N z5#S#DzahvELVJ@PAjxfnm97=3T39Gm8aR(EH70LG=@e9J5l|g0NlVo&NotB|QCY=P zsh)|M5JUWC~5UBG^Ls?C%3L7ajc~UmCOg1S7{-J< z%?v+~w{`9&jPY(if{&Edi07n5+!UQM+jOf~P3S{zYsv=df7U-VJwmNfUk$x`-t1A& z4sX9HA6zM*R=nCCKo*A?U`1hYgu^(+o^);`*3MAKXvF!OWLe~pCh*lW=C^5S-bNJAc0sSvJ0Cx z!u`3z@r>*nyux?4C>ABZV98uEE3qS9jZ)ScY}tGd&m+Rlp_dU+>nl7X`BPI#4aYX5I} z*TtqNsA4(Zg!g@LO#pnj*AK@?Hi6NiHqy%xJ0^_^fc4gK=0_+Ps6NYEdr+H`c2s3i zNz9^}Fmcm#b;|MbA&r*E{CPYg-u0|zzOs63l+IUQ7#(%RAOhHA)D zyxwL-BoWQiumrn>bl1*Xv5t(P^j@}cqSsk|)1ii_RO?n`5@$KKbNZsb*OQP1gBT=pe>1riyB~r52_pshi4*g#tH`C650Ao zFV=yWxymjvC5IXsfrEC7%5q5UNyr8)Jv(efi%$=V2?lm1tVPt1$Yc*8V9B1w-uXLm z60ifbQ&s>G1nR(5kkhEUE@G7+?9e`SRs%SBvyL7Pq>|DmcG=^m&fC~USW6GO_Nt9A z6UUkTMCWNf@hV-{?1_zm7lj`;ANq0_dIusU0(CZkQTL5C>+U_NPWGd(7YnW4aw`@6 z1kQWzXLNlp@Y>tE3n4~sYztyh_CL->ope25N#Kz>4FLgwjMD>=N_sT4ncXF%P=6a| z+plUUb#>v%I;~(+iEzG^{MhxZY7^0gk{K4;c-emDD--UMYiNX5sG_Iwu=0A^*Wkenb3^EA%ZSI*rjLRn7N5^AFMqbjViB zjHiqE4^*7HG_ifsDiQ&qP_g2DsG-RLFqWZ1cp~pUpzL!G!n0aX$8b)Lz*#CZKKZLl zft#Ns)OCyx3qHe!&uH62vs<`OOi`w34g`w~K$wRwy=N&J@>Waf<-zY|f_$zh| z29YAln(Nxhq2F9wI7^a;cDa+T1U}$LH$%L}leh{Eo_(&vw`xt~vvgT%JBB4Ly$sNrF zA~TyayJ`mx*JmOV*7%UjIkC`Rdwrf$j}4a{+?0iht@$`_?%f>ZzE42HkQ-^^ZP2A> z{Qmehs)!N_HcHNVbV?yN_2B|^*2w(m#R)CWU>N=Z@}p5py2@v56A%nA)U%?u5k9?z znl!BegHfD^5p5em$TT-9*@arp^}zh+h^d(ty-Xy6Tc6nd{ z>g%b#W|`S-Z_n^gE|G(q6ya9~ShzRp0DKkMW_&PM?qT8u=<1Jalk1+_O1zG29tqAjF_=(S!7GKB*6y3H{awwH!p^@qbG zB*rIS)f&aOh@t3&DZM`MDv3rf$tu3gr zm?*8%tZm!D%wD>Hw)(2yLggHK)C0iTH1HsgtaPx@Ds zCG<;@0W)D~pVlMXzs}%4CiKr+>z~loOz+VCSHA^A#M&9mY?`lg9`cjf=Yr~e?#f8K^CeuDZ7(*tX)e{*%gfibcR&Sfp( ze>d=NhGYYOKhnR9z1vRco8hjVeBu=6_v!i|*}qWI zx4)ePYSz5?#j3!+8nl&BO)`9Cx zD^CuAYL4UAOf4&0=C2+P28X~ZG`zYmQQu*aq~#-iT*90h>NFD>9i1Hg1lDNuVlcL0 zDh~%f2Z27WIg&Zjy-)WoR42jN^S4tNFa8}6gb)74Utbnlvtde0sq@=8^oHTtB+m;~ zCHJ1~KHjz~6G3*BP|;z{JFqEgapkcaJS>aL?0;ScRL zqSLiK(}5hMyU$^PJHmW~$e*w(N6&kHxBJZ_L53ploIe`u(p&YyfAsBd2ver{CjMy9 z$Nn@;UXL;0MH}AN+{b5eLJg$`6NO^m$gpJ2HEQu^K=QAI_egIrMa3OkXoE&$4e>WcvPvlVx0`otbze`WzKl>THu)unx|7n748^g5ge58e@ z5+?3`hm=m>#iT?9hf|0)m#6(3&i@J9KVx=|EtuIHn*JpDPpbGE;!z|Os9_4X*JOpO z_kdKT3+_m+JNf{3!9WN`N&F*$>QBGlIq(zStP>nDY=B^_kbmFmV{#C15D0v`>5haN zhvCNKzz3&W0ynFV9QXp?E_?s15am8hR|$oHICO_ z#7eBY^EZ9`&Gn1HFXOE;splOl;|dg8CbVI|8(tctZO)p+|JBSUwqU^4*16WMs2h&~c<-K`^glrU z{$Lam1OvQ`@H*H{{#3tSbM$&2V~mEy@TtM-biQ(LN4g7QWnu7 z%Q-1X(up*3# zt$g_erexZa*jnNL6-FWBf+cN#zmp-2B%v5wGv##8iZey?dgA{ly;qF!HNP-XK%j=c z0}p31XP67TraX`i&O3<6(ORg2h&#&MSOZ~RgD}u5Zm_^l1ixDb!EaXaPqs0R5AC!B z^G6HG(XluASD)A3#qT%rIiX5ej}L2L{VlQmCPIM`;%Y*(IvJf7HB9T##FedxXi>)NEW@D!F9p ze%vaN^w!qCjT#aY{*n}QDRo(Xd%ZRg9ep_R6g2qK(KgH&@Mv4mcF6`_lQBu~e>hDU z>wx>Sa4Ht>A340-L_d3uX_6yF!HmN!K`jaY7L_sCFn8|X{;wB9;AOYxWzt~2>LF>F zv}c%nZ*4Xpkcp z*)jBBIB2;ib3znVG-)Kz}?a;^%&R3C~Q))rOrFX!J^oCe4@&8f{ zwbpG@d}$qtF-3q&{|DOQjG1JD=f(%=m44o{LH^$$8S`y$XV;39w(LWY6k>1+kwPLN zm+AD_!uM3Mx*yfhz zFU5y+r44r26vpzm9G=nLl%TFrvdF{o_ z&EXy%x0S?HFxwXad&Uo&EBrBke7|NcN0`t7+Au$wp8X)f zwzIPzhdbHgYfc+oq4Jv6klr9qFkH%-F5^2OpFxJi%hveiHHlV_UcTcjb>+HySxHIB zcASQiI#GT7LF%Oa)kd?~+_~X$3{I=$`THgY0>Ey#-u+_cGP@sIo?Ec@@@Hb%75@!^ z51a6bw_Bvlon>Q_=Lm3Q4p{Sb(SwnqqW&`OmD0wgTj@?At7apX-R|=oyj{XMa0ycvx3hj)5WFTY{#`y6L{1Sh zOk2@)BtL@F<(1`?HD-atnZ=RSczkaB1uK!i1dgiKyR9=WbBc}ndf-bz*J(}Br%9`P z3l~eF+E1%yzKca8Q8jblZOS{wjP+JPXEx=o)`)QREMTolYYEN7S0d*vTFU)2G3V}) zr^(|gU7V48i>%Aaqn+cP1N(4>UQ&ohhw(kv<=aja8evZ(PowL!?}hR-YBmgb?q5VD zLuJyP5M(*|yCk9%@!40;OP`p0TU0!{7&@*F26j(hJ=B6$gOpUXAJT<2IvoSxY1iSG zwA90cK)2TkEsoh2(Yw$!*H0t(u}FOPa*k}J)$4)v4er(>Mqqbm?Ebs00;_a^`V;B( zPnQktH*=&;y({h`-#@aeoerqPce^rUer$s?@Ube)@m@>2tvuAF?_leR9BGYes(*I% zN+2#tu1~zaU&BIUTzM`re(OX%jXH6ml-)Yb9CWnj4a1`6kk zXguIBVM+JqxV7$TXm4((HLVP?zCb*Eys#A=gQl&}ImRcIH?8c!rZG#<#xvDyl8w_S z-G=11NvYZy_RLpGD}?zJ%z-CFAdy=MRZL9_hsIu?;*T0H-;ltrcmNK?s-Mn|aZT=G z)@0kIt+ih^GC{*j&glg2LK5XFOJRHzOw{P zVNrtCop+@JCcQ9Cl44>@Y?Fm^OQ8UYCra-3$0P*p*Qayggw)UDV>C=gPgz>8pS?Yo zUya3f#lBEkZ?sjtC^zEHT)bZ5&<0NyvzuqD#vcoF$~CW3Jo2bA^b|z118Ny5aIK1>9=%HZCE`XF$V+>10l(Wu z;FEZ9;kam%>^Ie^lWsXMdD7l)$ZO`8rCb8Kns;InzU@AL@<+XQm?IV}o`ZO99Yp;3 zV0oqKinN@~YQ;WWe~KjqI9X)Uj;0{zIE9^GKX7*!EtqT3NGeI*8|S{dTm{(r3mYhg zVV2IsI~K^KUDR<_J1BR0F*{dYoi6ujM`sq_r>>`iRRluEW*MRrY41lG_swuP9C>M`QHApk%#am2d)TLt8S1EDi;DNIauhn@W1<1fgbYLX%gibs7U*5PVm9pM^#a4-3M=bZTUD8(Ynv#k-? z`Pf_gmCI!?Zl4(_oqnaVDEt@~6O#jK1`$5A)9ef^Mwr}(e*p3Yz}zIbT`nj@%YJ0% zAJ;7fmB;^BzE1LkYCZ5fJ1;Gj!V4%fIcYa3eBKLrZQi^%w8YDkCSxYiVaVb(Hgj(v zaXN+rnV4W)#NXKU4PTpDUrm9w$7yJ2n77|wLg_a7&{e*Q_L(pV3scf-)#yIl92oaY zpJw6Zn;~h*dtVD9XE*5=9MvlO9#1=Z7t-wB8Qq+poZ3~Hn@<(Qm2Dd|Wx_~FNg3*A zeO1NxZl@f(X=%RUaNGhLXyeNx8nOR)+j50@1 zN{qrd`;vQYeRhsoGQ$z8T=YuJ+v?14)3e&8AWZR^|$tZq>6ozE@z*D5+%e7}UIcOdbkGx|zNNt-k;i7t?>H04xl42&9Lw|diC z%wslAWFd8?TB7N%YdF_i z#_%oWpKlg#nugnbM-`&nvOG`NB=mh1viXFV5g%_(h*w)1r@b9aPsZo&p*&+I-?1&P zx@O*3g(m5guF)@;wF43olJ=dB(L5>}UvF@(5Qt{ZUus68p1(#m%|mT^VAAUp0i09E z^V}MCd4*jdjvd>}kG1vtukqUu=bRWReqJuTzBI&l`Z|w}Gq^b3#ppiZ2RfK2kGbz2 z)C?Sd)GBObRMosvUJljMRL_2Wc?^EsTqR5hdcoRwCy@_bM57 zW0Lz4L&)i|M%OWH63v(RWAB27y>IAt1a+soXP3!aGWV(avo0N9wF(8Hp%?3-2*tzUiuJCeLB>!3}$=VM=@b-SiSqwtbyxg-lG?C7Q8D z6a1p9eh}#|^;3etC4wZ1!5LAwTBj;_8>f~mqilIwhxQg1Kqtl&=X67nRA)vq>G874 za1<}~?qy3@E$M)d81}7l?$@!>gw=+1!A|~)(0QN!5y60woxDX!AWo5RW7pBmvR7}r$dIiv+2VfU#ZU$*_R6AT z_w|iC`N1Xn`sI5)JzZ?GkFT|2%N;tYYkJ1L?a(GVM0m{9V@{vxB9tqUQI4Iv_Aavu0p2^`9I@9r$g@*Nwy&{CrMPWCJ`WkK4HXIgacI_fBxGv@dkn&-=A{; zWxj`m&^I!1^PKNw*_fb~G&J=z3k=$Z zs`HS%WxM0Amhi-oyxn7w0os1azolY%B%ZaAyLic=oAGnG9@?|yA(_YA9i&fBme4GC zc2F`^!bLlA(K#2>%xGfzdQXRU^m=Y;eMeSb^#eEdu3l0`+0;8<$FcD9u-1=TodV1^ zPW%}jjr+t0oiutcYOU5`Ln{lbNJ`ibtZ4j2p&XkngBNHk0d{6kCm9lo}cI004@_JEwyE< zi2*II&C8~8U>^}$utJ$9nsgoa296Tqw$G5k)!zS6r{%%H%YgTOSuZj<2aWm|+W{!O zuKwcMQ2r%zyDfXrsI{MDZr^eL7UqajKB`qCF0Ophb33zYci8s{fX8<4te!=QmF+5G zzK(n9rF_bHiCG>u4QSIl?NIDekz>_UB5<6LyZBWs%_GPp_u?>(aM4?aCgi*ov4*tv z)a1kXojy#*_a`Ux50V$Rx{_&~ufqhlPU+;nFT3YVC)*Ym$9JA%OJP-=_lb+IO;*`V z_W`cYqI9>7JrMM6`p2cjXerG`l~c*Du8BuYw+giVLuBgwKOp5ApYr`-I=^-u_2xxZ zqwlxAT9_}%54`HP51o~33u(#mnA*9&%${G2Mr5b2ZXoJ974mOoVxDxhomhNOez?Fz z)0u=-JMD4^Kv6{Ay4~SlCkc7+!MgvY6>?lqRLL?hK0Q&mP4R->ig+vd>atkVbyD|y zIA0VY@cxYzDNh7QOpi{u@z7%UOoex|o?GU14DmU@^Ls0Z2ZMIBX~6XMZE`f?Dgk$8 z$CgOTju*ENA$-QyIbJbJW{SgXs2e;w0G~^0I1pJ()VAgEgZox$w6GD3jknN1u{S11 z9#=AFS9$Ry9rGG~=fX@25k;38oeq~Uv|xCAgB5$KlS1!94qDf}rfoBjl=Jn7-<)Ij z;V}E@Si5C!c%aOI|Du{#rlT0paBG8S^fAJ>>&T6yQedOpGb<;0_Av~(wCH))XPQsB z;-#m~{eHiUCwAb(`{5pN@QH+jM9H_Z?c9AoZ!P*vqLE6D@9D~unV%2aDIT8l7>CuD zNJZDJJ;%WfR&HH9;tpBpc$5XlERo7^zriedo`P6$F<3m9GjIn$-Dn>xWXq}e? zXaSCE;Nmi3mp++~SWiCHh{M2ZI|PBg%==fyJJ1sFd^Q=6!nf_r9Aj%P{Xt*;b`>`_ z#b&+_EEf4UC!@ZOtX9o)+A^LT+69#KKB5&J9wte8JI#$>d+s*p-NZ3&7Y5S>!`=Wd z=Os!n1h~6Y4bFc}pTgq}XglfxD+xANvRsB{<>w3!ALfP!7bQZ^V6%^os4V^M9e{6< zaOBlP6MY^dx9EQ4A$!BYfXgM6g;aR%Mm+G|LtK+DWA6}^R)w>2<7Lc03xA(c} zQJd3C?D}~&+Q{bDh^};*%LTVDZNj!oqh4t{7q6zAH+9F-`A?OvxULR<@OH$fhhHK< zT`A-$Yx=1LXMPT!sE<=}5$^y;O~kIS1tqvkeyi-#ek zc=|g2Ij-&&0!h7UL=hp5Mja46-6-@+tC~&sirv_;$ESdr4pTB8)MBXYZ|!Royp!Dg zFtxL@IK)BLVCC`#3$zTEZSTY8GeXDNmEsmu4SmCs#51E}F|`vJE$ArwbwiWY{PKb>JT+c>B5>D)%pj z;iP>O2UDzx7n8MirK)dhkPOv4gi6EJEyU`VT7K%2+zGx9=-&S|9N>9Wu&LMYv^Su1`H%qh~0WB~hGF=)i>AF@vunlhw$)IOj@2rc6>DtwG zgup4O9)|s+RX@+@MO$$FSU=4Vu&bEZ#PP@KYLgF@j={zS9)MEdD}1@*x&1!QAJ0wR zVEJ!bKBJKSQV2W`;)tBl`#Bf2*Pa)t$)wAMZpZd0cj6m*p2hn1IpC&3Me*{vKri)S ztApU_R_Pp_KD1ygJA)Sqcp~=~+Zy2$e}(zX_-~uFL=HCWXN6Pdd;{k|_dcw{SJ$UO zOILpZCY#<4CeH&(l3!jgyU_G^tT_eZy>_Dw-w?zVIO zNa9b{yRAo|J}0}#)s!FBqSvL7i!9&$+5$@AA7Q5cM&x~cj#q0vK3%9+SHCWCyY3UU z2=fC~uU@$LSMtCH(`9-{B&aj{3-|7tEp~WQ^w2LM{NVI31cPIMi$6qX@GM^4Q&w|%Tl~`{`ILOku2krw zhP_zmT<`*_t8enpOBA7kIz@h2ca4sb2b?MnS2>1|3HTqVm!|#sFr&==$;-H>GE7Ci z)0me8y&tVHt=BotK3VsZMzNBL;xxrBA-9VQgO2itoFWxMT6`YAn|-X>teTDZ1gHDU zOy?}-yfN^D_SsMK`;hUn8Ui_lwMwy;n#L1X98+AOJ@IUBf>H$CvubY&{5E;>?B#DT z+t?s}eUVNoy%i&ClEC3du@0+#e4n>IcSLQ&>JNDk$(jB_oVU5dV3w%4S+#$m+ z--G$oBdMNJAYJTM4qus`n{N%QxCxmI+x0wpV*7yxPXb3lInj(eO5TlVAnmWa=G(`I zNBE8l(7xd;Rm9&JeRZ^2pT~Nk!Jq|Ka?q6%a`VW`U^Ji*lo)|1(8FgaH-eU=$5_lF0tl(5nD6@=4va@ zSZDu4p0G8->o(ep%JXYodu}e#T+t`q$rIOk?=$5%F9%V-1io6$H6=mhEucemP=_iK z!EC=aj3CCfm$S29w=%MjxiFerM!i-l%0j7_-A&-|Qk57#Q9o@9uRPmYHVx=li`vfO zZb84zs>@^KRtP$Hut{*4>mY&HV(^mZqH7=65~<3zaeHp^R;<|CnkLGdMMv$h&hJ}< zhc2Ib-p68!L(wXY%}29q(jbNVTVd%@<~PX(t28@$rv(xOcrf})g1o|;LE$#AiPt*Q z3peLp|1jJy%)wo$0fh7YFLH5oeHM@)E|2^4Qno2c1Xlw0SRE2ye9gvWbmnWjP^gIt zz1zKNy>ix4&$bRrgecmXVsDOkMqv{VBiM(yBL+s)%gj<9uT}lfdO?rU6hpl$yFhI> z$gNLq_-y&MPKva?OQZ!QgSQc0osMZcWg+Ch+DJUrUpL)plUd!>V~_%;pIeU&AGl49 zO{iUW&wn+{D!0#&CAv_)lL6Tiz2TrI9&VeqVfxe6LpL{bfn z7QbCvS9z<5ZQv6z9I+d8f12*J;Q$YTB?Qun;A79K^AXZ;Ce19m3oXul4gexH1FgDqAcP<{D48uY{R zoa~y4;>4_((AY+}O8Bk1o<~NomkgT$3sF5GG)3p2owfhM8$XQOb>AI^=eTDH66Cus zjxGVw#*W*SaX0los}ydpeWXbw&fbs22^2izgoKZ1Lj6J-{vjkn-Mv;9&(THc${7Q@ zne3S+(C^%Au>lI#oe04@K@?=YcHl(Vld!(U`aQj>{?|eS-Ylzbay{{|-W+$`nb7#P z*T>;!m&^p?`ZO9G8c<{xc9t%-gLhP{4g`m*Qi8=o|Z~^T#x; ziiwy>x>+-BMqk2EUH74y{s2@bteaB;uKp*gsrGP|{wHUfeKu&;{CO4hK>HciGAUi9 zNx0r+ESz^3aF8pvucPd`5odCN#esom*)LbWEJShm8iZu(P1gOy8?B!t`NlCmD1Vy!(0)m>D3&~@F4iU$bV$%`I&FdbH9#j&jJrW_~Nc`VE|ucg!+ z>@TX|a(gK96@(+?v@!_QpE^aNR(`C^1lSk4W@}iV91FG0xx5x01tgRI(g>u(tN1)| z;_3tI$-q)@(po7ByI6)u#ki^8Lp*gESPUAf=HW;8&wUcuY82QwL*8k zmlA#y3Jn~fI^cAUW>N+%5ZGjAx*jd@e8{W3eht)zxLs4^1gpYt#4QH_!dyh8f926Y?tP~`Z?{hF40&Q?P)N&da z*s8}yt5`GIdFv{9sQ+t12m=r!rLq^867tCMKRgU*qie|n>8m=4=uZ>a{T_oMFVpg3 z-=bXsg=U_-WD zp{iR&T+b>{zJB(gt%7sidF}}geFmWtajjwbn$7x{eLd=)IUx&6`2%}0sH-D_X0398d9s>Yaw6u8u)qDMNn-Fe1$H{6UZ+JM65$jY6Uq7|d0iuV@TZw^37z(andg zHSM4b)F92qq0&7QzS|B?cAMnXyn3ip``qj?Nx1$5tjIG$jK#bj-1tNy=VlMjioc9r zT9<@fnx*>tYiqOpEG^#7yKcpLIVPK4W@?3p#devrc~McC&%5R_Ty{wDJvJ2k5$IF= zHQh2FNwdo?PINxP0))Zbo+7R=nXqffF_PU@CLfZEABpFu>|o(hC4?5-Ljx)C3O^rJ zkQw>VO&DSB_4bpv)M;Ke(d-Flxa+8lj+;aK%Z2VjL0D(+axPTgseF7X?7}kh>Z}cT#LKVSm=ZJ$p>(!+1GiJx;LUO5 zMY;8N>#)j)=tTV9YLS0ir*hSX0%1rY@2rZIsuv^+H(1A-@2qKNV&k;^#4{G1;?nI^ z6pDT`H$n?Ww^C=MPDZ2;@A1tzLGU$x${7zv#9b4%g2;0=-5nO+T@OCi8ZE6?|L9|} zu2a+yT~X*=JbB$waMg8ze>$2jZC=hG*oJc4jzV=5UG8JZWoGNDQOg*H6M!q zMTOhGeA&9>1Uq3k$=K-M<*{mZV^!uWV1GYv#<8nBHmS1f2wfW0@P+MdH%r4|EM=V* zzU=#PWm$o*Mmp^PIyr5q>}!8dIi%B;*LdnLr~cja52%C4s`-)n;uXzbzl$2EzlxeW z!Udmvy>nm44(!d&t}^?=eg}zpqkRzdev8mS;*lRQn8GYO{^&=d$v7gIZirdD9FSUnCD}H;lEi_rfOfqnG^?RGa zb`6WHAoONz4a6pYUPI4fHbGM*88*7OP4N^lY{$3QHE%UqGG4AHAX9p$9+h9x6ze&? z(3FJfz|t`z9bQ4o`nKDTe^uwQfLK88am4ju;yT8#9O!e@t0Do@m&z~Qv$JKU?8Z5T34q=zPG&$HNW&ZdP&lg-^JQ`fN zWIa&3I`)>JD8DTFI5XPOW#*vMppfR0WuV`|;9l!!tvi=94GOCgK8A!F$PCe%r?&WH z4VW{UJ@?yqOzRji{95?UYC~L*iJ^zmkD?mQ--d)%5yRQYC(Q1IDy0Rl1sPiQ5}5Yr_e{Bz zaUL!D>#M}w&Cc*EEwr@z)~h#=GjhdMgdQIR+3j2?}$3f|di47ui8Kv~VJCoFM^ zK+0Z@Ib5D;2~Ma#ta5D)b1T%qO2UMQOAdRouwpqy&=ACKh9Jb&o~&x{{q!he?YB6R zcp|6Cd#^J0$1anmBsuH~Vi&=_-;U?W;ci@(pI@d%>e6TV&QIIEHOORS9-}UpWmA*p zA35Ej{$=>Jx|nx@RtbZCbWm_lvl3>R%^Jr3Ewvi$qOCdNUPQAGCFvns_(eleM*=F0 zgQkMfFS}IX=A3K!_ZsmnLA0b#xs}(47eZzjLOKl;?=Fm*>KWkI6$#AN5S2$oC4L54 zW{}eyHYY>ty+~|kLMMBz#@u@3b*~IPjMsqb=f0GD>jF;}rOc}Smt46St|jtpn~)Ol zmQs25hWcc}u=|EY@QsYaGuG-jBT*_g#DZQ$aI!-u<^0(Li5I6RiHsi^p<~QxHyY&! zNc1b^2J26h=o;z|Lf{_?xlQ~}woX$e8FVa3l$>IZCrHX1wI0K*2c8J$AuyN?P!{TD z$>}!{os%Cffn*_vGX)F!a_Pzo2eUGc(CP*HnF;ZUPxFRm%=MAV`*BQiRU6XG%b9kt zJVF({?dL(}{D+;&U#*)S32Y&Ortm{wN0#|JIa^2M<1(53NXDloxls8>LsZbdBMpqb zl2YJy8iehVZ>is1lQN^lBxY^VjG{bp(tY=hcUD!xjq~$zs%`I{4V-ApMF?+jSpI6T zDm&e}#A)lY+$lbPkR9mZO_=h+ncCGf)dZlMq@3hKaaevXmW|AThS}h9`OQIpp^VI< zi^M21pn+wA^3ZQ;Y6xQhx!Mbku+x29tRx24J20Xr?Xal^7RIj8a@G*7Vux!pO|jn^ z3Qvo@>Z=iQB!ZpRgM8Q0Lnz>_iuTGj=ya!kvFrtDF3lLsb0gKXv|Y#y`%9EHQ9PA@ zo!ZkF40Ww;KlZRuwymfIzBKbi#6=-w`=EUynm*aH5iNg4*o|Bl4$ce-k9!CE)d2EY zcg9rg-fglaLO=9bfLugPcmDn=Ls)q4i>c$HS}7>l^E{O5kj*H}vYpIR&*xv5BHJaz z7w6UwkFs|u@B37S^~`u>x%4k2WaQ#)ERBM(z57QWnHq57LV;T5jDypxhkm?P?Omb= zE}KwXM+Pd$I{w|mFW8UBkM3I36Lg$>sCE^Nd9-*Y;;CO7#G&%mXWs>Z+hX$;%INw; zo)Z7$HM5}J)n9aunZ*fKZ2|T57mQmXDOp0|O>tovh_xru7MnNr(yuajok+*qt-&xxegZn@0f zZwdvAIEqKWK%)d3=KsIhDK=%4B>AKSBrF`Z2WO%-XMfVOg?X=_|*$9 zat>c?#VZ~y{}k4w9P|7xO+0^Ro{_9<#J9y!VC&REPBDix(QoHqtS{tgag{4Mna`R` zm+2LdSj82=V1czUu&%1itmMal+UmVp1#z6e6&^ekald8Zbccu{46C!ygzF}ens)C; z*3u{)wMG%c+}cvf=jrAnf&`JwDWPqjbra7RIdYcFK=pS^3eYcLF z`I@tocZNtEd@CznA%fav-anEWNek_x^{*4o1gE9>^#r_-(+Sp}@#^$jy3XtNeHY8j zMX^5ELcDHY;N#jS`GTMmo-82lar#T<@a!z`5`UT{?50VeYaprXbqO-Cf|+rni!ucs z6AKPAU{c|Shd*0y+1{LefpT`k@+%#Myb6BUAy916WOVAa8wHF}wHtjanjmU@*CUME z`k7y)&_DvxAx9#Z??58u*+8o%qwQNvcdP?RQKn9*9W;CD$4@E~V%gA#EruBS`Om}@ z%Z?CzySh%HK`w|5x%VnaohlUlWtO!xaofIq;yV?80_9Mdv^lyY*urbhuWdSCd`Dxj z5_zR^?Sshrjq)2%5h=pr<>=|2E*sM>zM@@n>cgx~WDlUHeBjFfI|K$_eCZkeM{k~< z{ugu0Qh$>as{3@L8IinpT~F#`(fj;$mBnI8^OEGWG1got<$8Ru#q4>s4{a=ruQ6cLasOYEReG&bje%s`gBur>@Sd^-9!^quxT1QZIDH^oli+*kQVq z+i`o4ma8l47g8k~%k51?f6RQ5-o6C7mrP}h<~Gpz8d>Hz#Ss?9kLZ}(YIWb<=@5)S z;&(H{l1Wf^I;3Z9HDKZM0@BoszeCLz5LQ6k`VWC$*@I7pZ6TcYw}b238un?;{HX%n zF_e?tZ;CRq;)^#vKxaQ?sU?(Z|E_R{rlJR#Z+!GF19f|e#u|wzqT^3cMInX}8kZXv zIl~nUUGu^2b*@3j56v`3zGOJmeyEfHBU^XNn#rZH5J_kA!#!>44qXG-Gne2F)mEl= zv7jAGIuQ7AwiZcKWJMy`cL4`9BF@Ne_z_TnX$1&hjnRs%~QW+KWwCA zinXbp`AemNjR|KTSDhlkNUG9}(*eo9$1%m+|OJA7yk^3325 z%Y>JE`%mR!=UEFfZUqt9l}}5)j3zY*dzeU}6=pm3_;r?dmG>(%=j|cn$a=RmR3iBq zg+h)7MnS4(e*+y2e|5%+S;d8>Yu!>d#S#sc>jlfK3m*1M^kZ|-CF*8A8^2(1uo8*M19q1?(Twk$3Qu|{R69CaVcpP+so zFXlxl9~L-WHcvDZ-49To8HumV|F#*P6PLJ&L2D-Hi}17>CH0O+W5~Mhf2&A4I)Fd-49=`opiXf zek*@~hxy?7MX!QCsDI<$@H;)(Qua*5KUoY&zHNWK)eY6rVixB9nEmyh-0`71Z>q4Q zQwv!+J*PbxP5o>3p&HK(?$2%lthr$I#6@Qc-Dvl#f_Uts7pKn<^;@g(-OE==RzCkU zKhn){X3nQLtu38qaiw3lmJyMRoq9to5!{TP{rDWmRu9W@QFdT$ot|-?O-1Sld76G@(nWt zJ@lH&ukQWYe`V+RyNMRbVeQ26V$So0?ImceIQbyUBOXt`G(N74mt2zUW}N9Fg%4~7 z^O<(scPfuX+G(pdj&F9DHd*S{o1S{7G^MoRe2?_}-9Qt~eC@8O`el5w!TIb0z>nkn-RrZJvJ-44o|e@oii@*B0~Bz7VK4tB%R z!ng~COst41u`~HzB?*^%V$|p8oN~G|M<;1#zPf)|P|xjM@1#qub;1jch67|Lo5|;G zs7TY3mnlZj|XYtL}x-o_7+*3uzWJarFlqFh^8bTBV5M99@*N zM-0NXHeX0ve#B>A&&eEOog*jCvL04W(_b$0BG<*XOPs>0Wf!O%&SwsKlGk~GqeH$2 zl9tmSgJR!R^4ULiXj{9E=US*qrDseiLNxaMaHsdFTDj9U0ebl8TlzM~TI$eruupn} zbC!`m^`)nPC~3cRN=JWHCb>Zm61=>m6Sb?~9XlSB6Xk7@EtjZ27$5p`y`-&aT9Iom zO=eDrjyI}rB3dfcohzXf#S;t-_syk%n4%r}#0iqbsmFs#W}>bo18rAkqIeIXDheS=#rNPk zmaIQ?ubwC--6%>ZT9g>RHy9)&W2QQMfHU>PO0|;=k^f|-?~bSfp!StJExWT?s{IIK zbZ0Mborw^TvSed*9-jC{Jh1V$8O8lZ@WqxQ&xbmFqQg3%#cEbpk$fYg-gLv)CVI-x zX)KBc7T$r4JEhfr%A9>u?-QqzJrA6M1wR0KTydpge{sldBBdO;CvUuznto{Q7pr10 zyNA6xLfBo!Pr)`3r_-)jqn$&4xf^6zH%{$s@CFU`jT6(r%mEL@BUuV8Xv9;P}E#>_hZ$Lo#yq;u8k|f^s>zTn|zP$Vt@ho0^ zaV?1N)~w{J85bwvcb{_fr$8Smkd_LrviksJxfBR9=p8-tMy?@~H>~r*X2LT4FtUT* zF-Il4lrLYP1$_5To0yzLgX2}D3?b-AJ;OK4!PgfTaMqOG{v7(8i<`YAI%2Iv9&L7; zOa7F_ z%mXvthv=^(ixYGQ3fEvI>igFWP(mS0FNM?Wo4C+UXSy^+v(xBNe?TqsgxddOn(us@ z$jX9j&W4vrpIx9`a(~NNHorPHj+9NJQ*dM-A32?EQOgTa8$bz*2neagN}v^vO6s6K z`gMY+vDf#MrOqB@f`}l=RnJcY`$zeRX5e`Kon*~Z{>(<7L^2mS&au>0LMH+Iy@ic{ zIWSN@!2H^!l*DVUD|z7Roz0GFV6O(UkR$jd+2ZDqXAEclb<4NxQ%XMz%9ExZxY+nU ziq5JwuSemtl-@%KU0-(4z3k#16zDeuGQy*9ttVyx2f2Ct112NE0~k4Sc$os z?|$B+wv5>;m&~xGOKF6eH1-VaXlF^`MX&7Iq!_;~PTfwZqjw8SAn)$)8?42@?gl%0 z!je;U``BeYrce2}#Ly00#l*Yi#L2GY{l)y-M?J}{N?(znv0ql={W)v&} z@o|G8??%XWU*}SYvoqldZvhASMY_Yv+f$P7+VJa-%uEdN!hm*Sl^a)n2UcV5G3oW` zxCL33+gFym3?n%@3Q+Ao>>%&QXII9w2ur9qEEr|U@R{aWmUlWkd%?9&KGP4C_)IEE zKTQ^4^tZ}LBbYKvZ>sVuRcRHzO&+{^&Fjic)+H8H5d@bYf%Mr%&_*s6NVWx9rJ>K@ zPHeT#^e+}Cg6gZT%gZmdDsjC^KY%jNUr;h~{)iVeem?>6Aq4T#^~OBYjqbV<*8^P# zlJYWwA69wzLEIiE7-4og^6#mA2omxdcC_00B`wuCvq{h-TO0$@fi|6thNupWD;Yfm zrv`L?(ryh2CieUK8PW^VmI#oTl`v-!>GW%Y_!4@}%S|8p;rckoXW^li#RFtD`(u{J zgJXKq*m1G8?b^2cizv|J3Q8ZSb*Cx*Va=&phwMh?VQjKbBf^xMAfu1kh0K3p;*HDH zzeVy0Ur*LZbr;NXin--5DaD&H(b%lJN64g!`4E1ZR_&CJAYVmM(lfe$vpPwO{18{T z9OX7v>cT2(anmK5?1LoBBg^(pXJgQC=?2}-!IcB49yFUV=WKxxrK49zhf9M<&3w3J z1J9EJ7_Fb9pL`ydDWz-aLNnX%ZH^lTJna9JgFcT`7;z1^UNF#3_N`sJMUqYirY4>7 znk~-!tdtUi3t-P5O?pMR!T+_p(acl0H7W1=6)+X&w4|NA+j|{@*Zk^*4@s%r;=S#a z>QxN&ir%k4?ts4)3(nkReXCrxF_-!)w?Tc7HGi&=jAnJs@I zX=0P@l@r`ViN&pT-q=AfShdJ*WrL6q8QN(hM`h%br(iFglqz3a6=SyZKGX94uL~C_ zmhY)3>QVd1=2l9YmyLly6FNyc!hwJc$e9#L5UK0+SjVOGay-{I!+%~(ni$le(gB14 zLJQz!2U`J~B2)Pkbx(Tutt98)kyoMwe1r z`?})>oz^69dIeFU;z_ef<`^e-6^M{Jd{)Dj5Nc|hJ5SSweX3TggpTXs7um0?RONy_ z!ZY^oUwgp*Gm6eUu#!8NW1vsN?$s@W3Vvu)7aWPwhv^=w7M`BpJ5RPyT#BVTAgC8O zsWWl)4`m_;V8MARw}veyxyIkF%9V3Z0WE#Krg-B?FGuzbicN=L#$wG+O0s-zY$&=_ z+IiTByYHw4ep)UbE$PTSeAVBqU)*}A#D&gP8C#2U8tz(ODs?|Kv1D-^#=I>y-+kIL z>#sIa%_WD{@ND)`%9u!^tUX;x%Hhq#t2|CjT)Y;;H%HU%x_0KgqdclK`wO1q^#sk} ziY<^JRu5kK$*mIO`NgihH!GsGkY@fVm{Lu)_@|Gen7Exh%2l)?UsIpppae$?tO_&H z>l7M}vO9G_%{m+^)d!3ylR)Cn@2#~cJA<9{&;0Bc{AWYH)FK>Q45N{!I7Evx&!6Iuqq`)g`{U1TC(V@URKVPwy!j-k zd+3xt@{p?zeGZRl-}W0vQ#GVDFEz1cbNKz(fK3kjvrI}+1`LG6yLWPpt`EpsHD@8C zT-V-4Afw96?uXj*b(d7iegEov|0^}&KA(M;v4M`53p`P&h$xecg51O;koS3+_rs)u zu47D#Iy3!XpN|eyGGs7pIf|VElRswyi~K1GuT%P7jP<(N&i!Gq{xtyPujpL=G;hB)@4lk!kE;HUf zH|2<%H^ua?2TR?!n?*xV&E(uKln^lSPH#fgs>q&6JJtzmWXFX!-irVXyzJKggdS$ZzDfXngL(2Xd?O7$obnKof*JuzRQt?3~Ak-Pm!xP#4 zw}bY-{iJFmc@nd=dMYksCYONpFmte_Oc<`b$mYT5exgsx7Ska18iTs;9^u=9Kg?6U zzL!ayRor-eMG6sO{X&_hy$?4*8B1a7s=PtBl7`FRMT9J~h@cnV!3jGN`BRg$N>@W(`tK>xX&m;t8vWV)LI@ z<|~0h;J#>y0|p3#i;Q8Vkvi--uB`t*s9OLl6Of`nof^ZK`l$5u{ge7hL3e|HgIt*JsCjiJ@x^|h_ zXE6FMPrwHbi`HgJApg~r1V*$n*hPKV(|+^W-$*g%oS0F{<&rpC(0@(m;27mUVKHM8 zP>_n~HTwszYdX}BcP=ttrSH`hpKe^b^P%XeMM;biy}cA^J6Qn3nU;N##S7VcpWf4u z+)WA=v=A$^m!1ovq46@LTzo413i1lVaH#@BAJiFe5O8pj$cBAgYVP&<^hxfMT#lR= z(UI4X;LG0(&CLzcz27=icYH}Ts*#6|K=OvsIp!aAg#jWyg1aZrQJOaB#Fg3 zU5Fr$u~ew$Hz`PjGDaTbASi)eVeL}^~?VzvwkdTz0EOQ zR^y&ug5DDu>P|U9Akp1{Ca<7K>>2$t$+WZv(xr`P;E0rLo>qT2$a9Vflb#Xpe}V}B zY!z^NxfR-D{ieS%LN7^_#r_(!M}NpI*uNi^X^p(|7Z$)`YiZ2e-2U!=I+#kj!u|Vi zS;m`^yGl4m&`TQkU!>gR;Y~?yztS+6J;O5dhUg_#UO~az$YGb;g12?!dMw8qo>eiH zGt@l*JbIZbke_caCs>t4WEu6w&!UvwoLWEy+WzeU+Y(fi1(XJ=Ag%~|?LUX-YMlCo zzc>pz`UgZ(fCFJyL0`X?WvC?gT3=86N9ok(MvhtbOEO7i`vg;RCkHjl?7cyaVy;gm|K_@R^hCJk_`y&Dd3v_LUNlkli1Y*H1=&=Z~Odj2QpTsW+o|ADWu- zsCIBaE-<%$0MG}hHT2_VD}G+Tr{&-m*YhX4X3{u$oQ=lDnP}N){1@A8S-?jBu;73B z+^>FtGoCh(kDoua#1f@)N$VyRJNs-q6C7Z8G*>AAz^tmR>tk2{TW$3BYU!^R;TJDm z53`&DmqnbHK=q91s62?l$HHEKw4MIq4J(-sb>_g`xk#MJrC4<#UiO`f0dwD9S^bGw z0R0nM;cu9QpmO4tG~oI_pTIUZOlvB~iP5lsu(mhq9EjMdi@%&TIlBU0zr_5KN&p?d zdBY59N&6F;!v%cw#To1$6(-Cdh+fYd1)o*)nX`~YLajwfCe>)6dE zl`YO?G5a6BrR4{Ofxz2ufwEhX2C4ryA_5M@k*gl#ds{nDl zM(Z2&`1s*hyUpY6v|Bi?Gm)FxjY^2};Kt?Tj zaL#{oN&my|15k4SUz8?h1YmO%-2Y-@ZG%CV0~Z1oS}2Kn1At|~f+Fb_p@s6YpI_0wCE+Zk;Z(%UnHaUxtdmIuZKg$1tSE+Nz3oG;8 zC$mIM+Y9}tGku5kOg)NC1n#6baOVyzQ+QM1Qt?{_%T)8n=8wnt@B`Za3C|^QQOa^o hRvT!52Q1Sb`A=B7FE%;gS1tgLd#c(h2qlZa{{v~*s7?R? literal 0 HcmV?d00001 diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/fork.png b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/fork.png new file mode 100644 index 0000000000000000000000000000000000000000..88d8b69832423bfbb868bc3fa6aea4c71c57c5e9 GIT binary patch literal 322134 zcmb@u1yo#3wg!s3G){0x0)Y@bIE`D7hTy>+g1a>uG`PD2cMI;W!3i4Ny>W-v%*?%a z=DxM=d$Z>6bxv1xol{lkRMprdF^ zScww@^TVGQ1|Py=N0w z`V+#U62=j1yMj+Q3faZ)2eFgL_WK7_1M=Z~=Jl%jJeA;RF?qKB}Xle0HZA52>~=z?P3Z6&wLqAx2&QGePpdd}=WZGZbg zg-x>?M)7mZ92b7o_krZgyxe;k4Pr`s{$aRf#|I8NY4B^4BbcOQ@Tx@AK&RE z;2|tqnrFy5-!PuDw{)3kq){-G#Z#HEnkK)_D0wd(5_K1QV`=`BmJ2D=7{wJs8nKu7 zl=Q5HA+t{;Ba-)c9ss0paB9u-01e+*x5L#rTA6%qsBk<4Tx zGP$DMbpl*b`#L;WV1)r#G@|%Y1e1Oj)Jg*+214agMEEcPBCHBzaVV(Ns5K-D2n0gC z3Ove~zeU=G3bM|}2?~*$urY;RkCX1Qhxtjf5X|^s>Y*pWvg>3W37xRN0%u)QPsL~0ypkfmOzr_9Iz`&Ob%d@JXZ;>SWHWzu4F zC(_@MB;uYTh7;J^^dQx7=`in;cxis z8)mbHBoQR>%hGRC<)b>_I1sV>yG8aIn5&DH!p{(qev|7f?;cU(Dt{X$XxLUMu0STFVYzzQ4i44XsIfLv8hzoTfJRICeQ^&hq zYFY2p=@H)N(&IBs(`zZZmIo_wC|rErq~B&ZR%^-PmJ(KUq-R7+tPZjFv5#gG>-~&b zWcih?*2g_=L5^JMvvRe{cjYfd%0C<>iZTPUUyaYzD1X5@;y$7{`dJ;wrj%UKBHk!` zn{b94@5XS<0FDR8OT;%bWUA~H>lD)$FRExNQn4M;^ zf7M6d=MiR;(n0G?D@{v4%O$I?ug6ipOfjV0i7XIM8qyYf!?3DkhcDtG`*s?SA_{ zQA?w^j>Bm$+1P%Vdsx0le?5DBf4$AtkLP3BsjD;C_<=aFcd6HN&|xPYB5}j?VDMz? zCnI9lbuO0JLmu*4+FCkKItMNxOAEp~&(+9qEBeWH=ttb(bm4R#2l$KD0{xF{7V){{ z^5izQR!Jj5ix^_YniX>p{S1Kihx*fGA0v!&llBj3}grKuNH zer`B(uamw?I9ww;Ny}9Gp=PJ%R63*6s(;x*vYoPDJHBvJOMc)uyH!s5<>coR1Zh1m z4zt~==8t;I=~8~7oK+)9en{A$VbNC&(ONl7xY*RH~?J-;r)_M93 zH|#g*#~kpdt3*)aQTb|WbH=}HN&HIOqh7xrwSH;wxbD%mO2kh7bTy)beB|v#%tMR| zU*b{A=dYSyYC{`js!Q4#vr3)nmyfNQ+vDisSIQuTW~Is%e?H&pW7~|CwH|wr7IPG% z6$4N34i8GMimc073+b04mojUg=Y0p@wFTL|$^{CYD_2)%MY}{FgG8}iW_YJ(W{PGB zes^ES+(o|*jr_yE?^aXWS^A?XdPdzAgDjTJ<5cDk^L4~M}V+N6yagp29T{72}9GI?e{ z9B~?TN_R4~3<3{47v7yh==uuE#}qSz=v2X-p7i%$A8L$pr<7DYr;Tw2(|!lkE&b4;T^v`$xj61z7ID!cO-$Tm}Ua z*|sh)i*r&=&R6LfQw0d2;Hty(wCsDngi_?^sN`2q&27)-oyw}35YRodd>0De=k0V( zD0}^GtS)ULCkMj-jibOIz>>fqLSwMd69`NC-*E}pcQEjOONWDj2{MO4_{Tl+(D3CG z1wCK#{5^z^34}q0{=$Wxu32#ZbvGt33;w_2unW*@Fv3cr($dgS$|4Eq~TrS=~`xPL|iu#)?Vb$i~2!$<@mCr5qT3S6*n; z%Ggn#%GJu!+JVoVf4jxeLV!kHPJv3)#@?8UlZl0ig$9U5MMcGL zZ)C#zSxn*|*`dD#Xv`cPZF!lQU0ht4T-cdx>`j?jd3bo3S=gA_*gin-_~77X?Wphi z!P?>V-wXM#a>R@s4DHQr9nEd5sb0#}H?VPX6riDbsp!8ye}7J6SM&d=$=cx`uLXTU z=9eqXtV}G-|6MjTEB{L>uY$R&v89HXxfQg{pmhK_xH$O#cK`qD%Ky~(PdU~9Cnq~Q z56eGi{ijR+JFAL=vAw8`6|_!A;Q#d3KQjOG#eZbvXMTD0e`<=qxAWgpp$!d0<7fWw zP6MJkGS5)85#sPrdMq#UgC>NCztr9FXT6M%ATY1ZtWhKN(IF; zE;B9gK@ns`nCIIgv2Oa3*H)%oWr?J%n8rDFMaOj8GR|T0eeT~kqghlRq_9X0H(4&1 z@b~3gtCM5TZ|qX{ z{qT^Ukq%v*x)REq#DUmSu&5^rw?tFB<%hmWfsq3duefvGIpD3~BPIrUVs$m!;OHnt z?Q*3K*wf(P0P$4a24$kw80SG0?v2oYe6YMm`Q@?I@neG)r1&G`Y1Zc`Sg+Thj~6TC z#zQ38Osn`l zacPYv7SvM!iSWhr$_n$yh}`GT%4YpP^-B*o{?I~|!A_NRQF&4HpFe*Z#!)Q@nRWZQ zpY1SOr%pGzV+b^!3%~gyNcsH7hn@*eQvLJlS}Xvl51{?%w>~JbnN73uB|`nn-`!mfjN(Y<*T&&wbrRLU{hPdGIPDt1_Z$``ZnD@GZ+j zAyFZZ&o@yjSls{g@Z}Np=_*jpw~s*0q`L6Afrk}|Dr^|+r4E(^5=l0q6xY|Qefg4- z*HB5t6#NO1`aG&b8ONuvsP#N)dU`r#4proxZoT@>xbA2wG6*Dm=>L&oeQodq3YUO& z@!f#C^nc#wJ_wU^LTgG4zqXSgsBi!jpw{MQKa(TL2Y){)1{ow|WEE~UMo-U2S}+4W zLoS3qzP6iRNghU|AfXPcsH7w|EiJ9#W)RU!{b1mmVQ%xl;H)6;?#?%KxPq1`%fI6B zr1V7K@PTr{QtZE|*YL#T2xV__vuQ8=H~i>=ft8g0)DVAm5E2rSEWV$;RQKsbj$~eb zao3fo@q-N9lq5`c{){sL@b`>#9a<`tLDv@vez+N?h^k9&GQ;#{DzyH0{r|ZzLQ7zA zKvB4f8`Ap4x)zHL)Ivb)L>7}nVe%6p6O(5GyrQ6(tkK^)IZ4dVr!9K-{zrd-@(k9w zERXNup{2P>Bxs9(;Ip!_(UJb+dH@FzzkVopsdr@morDmHj+bThU!*e15Z-}5AwFy2 z0{2|kW@%lW&?qvfZiH;3@gkxlV5spUsEK*X?OHuOX~D&e%<-L_!o%HyZ&=b1R%?qI zYvqbdEOIL=g=W73*r}Ii8<})3kK?SCYHCX@7N$Hsl`c5ae-70B1tW4*4BFr61Dicb zjc>sAII$7->f&+$Z=sIO3|qfSNyIG-*<7b15_MZBIuOvL`Ok$L7MC~_CIDm@ z9nv=j9h&}BOlLlj?f?pk6Pm(}{-dF*FN4Fwq;DOE zMzM4x0Pu8fV2a6|Qz0qpIo`z70Wou?+8Kc0BEyKPGUApZG=8nSfarAFbliPLzsV6hc$12&8yquvi7 z(uv|bZs->KRKMiBm~{JDuHo@&(fDM!)qYBjYjArcRp|p~-tFqvo|$NDI4c*|Y!7(* z(tH`LIm=|`w~ES4wh`bIehF>QLV)cjzF$Ls!SM1y_)PPn@RGKpAcKfKh2Rvd(d5ZBDumT}C_HWP;S@f%$3A92cg4TkNz8_Ttd{`%H zkJ5eIS35mk0iTaln@{E6*g5V%Uj#u>M@gncSxrqwN2jgKyi}KnwQ*o%qq6+x&!1MF zud%kY0RbG$L|X%%|1oqz<1hq^6deRT8(;ayV3FMHh|RlA(%H16f68bO)lj6B2EI{9R}4g%Bg9cI9BmQF+56I@zb)$S0|p za_xh8%lpXZo5;!KWu_Ca>t@9D?1BvUp*ux&^>-zzWig~SEfWi;B1Ko7=aIEbwHArs z+hN^=m>AsKxqcumF&UIZ!#~W_YHX+9exHCTvtJ0zDZGOVcdfs zT&gCKfPUFMus8%Qvof+a{LD-K=9Wb`R+jd!Q2gA8f5XxX+ig4<6{=*syxK0&_W%OI_{u6O#`DitHqWYezm?)=cQU-G^4-r< zS1jG?td|&89=5qQ+^7QW#?%J9&quh1=S?%M+)j5WpVlaI%gW?tDs-6_>un;@zoxyt zb6B*hm)6ioj+f5EJ{{_xzg@m=qr(<_sBGE(SP@;{dSpfG=SPet@;*TBz@C^6!5U@t*%uouB+qxm!FMId1pZQQo!)Y@9!f}_Ub4P!VEC=^B8o|qIdPxR z!D-X%n{o-{15};+%i12srKcOJ=xLzA)3>}a;mbBH4!2r5n(c;<#go>1XdIsczAdTR85p%5>k@f@;Y87TqxH* zlYIjgp>VZwKk-<3FO$F+E#PsLM3=pj>AigS_`AYOWmORswkv;o+obVszhq0!#yu7l z>Qny7;A7xl1=NS>U(6nDb1BT)$=O^ zX7QK)qvdls=CF~Vyd97%<$r3hMY-qtWBX0Zu9rY{Y$H<8dbwm36E!1SOFaO*aS6MJ zhgkVM9t3<-NP5)W{2MA#I(3T>gQzB4D;;j-cX{{+2R*D>Z72cWqHrc z9I1BDMJFc2?Y!hP`${G_b+xu6C#Rd=vGwuDrk;(in{!$HJD>WLiaRyY=OCErb9kN&h!WQke@CrAeHMD=Fd=Id9sQ>+%CF!827{{&9o-5-asx@Is!9?f^L-=F{;9M$6h(yp zY<0wt zq5qhIKyh5Z&6@1zdOkf}7?rynFQ{X1FW6OT+s_uufi^8&70xO<{3;hlMdyHqEtpr z|3x49_efW60z2NTW(Uz5B}v^NIM3>Od$usG+;(DnQME&d^A=P_Yae=b9|9!%13(b_ z%e&cjAVp-lcC#}ov9MS`TLe*`A)ij8kvV{k+{!F&XovyIqm??9>b`gR)zg)lqohEf zAwqB}fa8<6!u*=nxZ$+uTI`QC%D;fTB;mXugfYo>FvMI8@&kSn#)cmdNCk9tjcFh% zxIN!VuBY21B_oc~AA!f2_Bo!NrHl{Q*X|#t0x{^*tl{;@P~LPP%NOoDWZtK>Kmq&= zs;$*V`A+y{f*N-DR&M3Bdf*h%TZGfSpKk3t5s9Sq_16mBX>rN*8L{~xK9-Aha#&>C zRNC6wcEVw5ak4iTYuMiEFQBbqiH?KYBbAH~tgWpL@n~#EXnP)AW?gk#3G`wC%r~nDyxWcSwIhdsF%D{mqZzz#{1nVp2{i$fkX8=#2H~^;M(825?i8o3{zFj59-~r>5uL zpcBbfKu{n3llGz|DWXj?+$4I{FPEL@>FIG?{l7Fhn)6%pui^C}V2eZ4{b8sv#bf{= zVQzS8JP|f%&q!I!lvX)DvlDa`cpNuMdY#2)y5bpHvmRd_%=S;w;Q}8=RvyCBoMtpm zAKK2xMX?99U6$U45-}%$Jol9-((535Mst0nGIq!oHEmTI#U&-Ojvu|f63Q3d?z%Wp z(kl~iY%#{<=V(S}xg(aEHNKCqk^aXx2}Rlte7qN^?0`b0|Bt4*ZbVA2!))x}oNT+} zqrnY#4-Z+Wa?vffb6kn-iDF!Iu6`9ZpEwJRjx1IpR})BtsU(PoVbDb zy=c~^prS4DVkmChdhYZKK2`m3S@E==5GNXJUcO|Cl-Im*WV74|&uf6UTM)jyQP$S} z;O6GGe@QRt$YuqkwzvNg8=9_AMw`kqBp`Zw8)XptOX5HFs6vftTeKG^4%#MEY5Fxl z4S4{s{z|J5Ec|*GYs&^gq{6$6jI7nxf{F?d)Msa`uWiK-B=8@IrGFU{P~&2I$+XiC zF()Mmx$uPyCtO`tcnf3@5&%8-WOQTB&dyvH+Mn;+hoNX>p;7xa9(<8Q8QyQWbJ|at zXybXHNth_Trer`V@iE2LcC`bx@u+T*@#;nVp{~F;n*cjs95Er?+aa~wtgMa~^75t8 zKCi=qphuX3Wi0dY&@}JI4`J(;Qwg^t3*7^0bM#Co=CoAdyNqAwV9I^g&@k6&qO$Em z&u9(|3UW*jGVDo4`E-t5(lHjGz>N*Dx6_Ri|E{ga`IiVIJ=Keit*{deLG7YN=gnCA zvDN_TZWR!|@%1F~5klCa$fCk{MZBAMd`w|(uDUkmx1g9^q|9RS>88eNk<+&j)$^{o z{hm*w-K+IuWSbY1qp^>Hppu%O=hhB2ZMMEqK4g)%ZGEs|WyKzP-Jvwy{&dhz5(!21 zsda=NsskQE_BydDS zP?KK_CAX>6Wg`RDxaSv)0r8*uqXt<+xtvCW?GLWl{}Ee}yw{SXe*Fax;8aOGZsCVq z^YhDqkKwD??@Apu?K<(UM6n2v_XYoYwPu#WML8MaMr+>%(Z*lj6BYfILf9fItN>rZ z^9`P)U_JW9&17jABhCP}2PqU$iDk&5W{!hg-|#x_Mty8Go1i)ObA+r4o2x1kiZMdl z^!~*V&S|;|0f9yCm(A?*^78C|tEdgu&g#4;CnrA}1bI!0iArfz8-=*li7Z21QRiU) zn?bZpg?@EUp)b`iPmlqGiRsM8`OLw1HJxO})Ltm@)INJrdJDA{TiujTmA!J%q1xnF z)RBXqq+bdN+d5d&K5p>< z$uEiiJ-SYYAJO|mQ)ARsKPM6r=|?M3J`05CkSRFb;&E=yr{!ZQ14^B`)0J{X7kEp zd8uZ-{POeDb*91;Q5yu&_c|}trcHy>YQbpF)6)|Q84qF<-Vb&Mcr?^z8g1Z4RDab{ zb^Y6H@2is)X2Iv%F+_?S7L(v$Dq0btmA1<=8`QG~2y#~u)TCB?VV}e2FDA;TPoFHG zUsK)&*VNUeyfYt3`AE3q{pa=X_1@4erOdlH$wlWDVAv2b-&~t#GZ?BD*!8je)c}^^ z1kT5Q=yzZHh1Rt2x2OvLkhho2RQ2YJv+7Am}6eQ?xlnM}`P;P{7{u zGb2a<{4k1PzUtX3wDMz0<$RYVEbga6ku(wU@j-qpEidP^8y552KRMyDQGsF$-R8;B z(MMq=sCA4_NGPxTTe=`}HYm27BixS(+(p>+;n!P!EdnB<#rNUGpGSFBEU6869dmW| z_xEKt<6>j24m_4yZtd*IXIN&q&zc$r$KWww>?X>{A%BsLi~9oH4-T?7{?wv#P=mG( zh1U8r)Im!{3-&9N?xp%h66E6=oJlojZuvD1vGyao#ElX8W@Zh_8??+x2L5g~!y`_P zk1{GMwVNeLR&C!?0Xxg-mA$NRbxihW+>!kx{qIR^0&e~qDf;p^6ushk1AVscUOA?- z4nhj=D5MD`#}$8&6c@9C=;YMYd%68rW~bSRY*`}j0_Uamm{2qA?d>;Td~8q$4$Yg-W-KeUove^m9*f`%otWYSb9n$)1tZF&EF9D!p z9)&g7mTG_f;y0cCC{3ua%WB*Az7ok?gl~G${lTY6Qv7L6s{l=erJw<7b4W`_NY#x3 z8bJ@6Yr4BD|BR3=O^#%AP0xP*Juw_Mi>)Hw9s8$;AN`OkfBw0qcSAj(FNAiUt*w)D z)9=s^zV@~V%Ux&9JyG(*qNHfu#ARj{@Jk?o03x?;krvVbt^mBn4Q+&A!%{ag_J6~z z(=mvPvQ1y?YO(X6B)o%*o71|G$E0^B>KhHGG8+*c8 zU~~#^il5?^|HGH|#C}eVmc;AoiHEk6E!=bW2Un*Yov}pq02dN5L;3j^*ndr?AA? z^IO6#0l}+&lJ=d`i(R{QFOJAazA9_7oU{VE1Y!5;RpThaB~XG(X@l~RTpV3Wgr|Q` z71ihz?o`f}fNu4flnjQBY22%`8#@l~8uFD$>zu8Y<(`Hf_g4NhIc3@uqFbD7ySB^* zxnHJ;cth@595&VN*?WUSVjF!6*Y0>zIFYMieM3R~6E!{d6BlM}X8c$E=sI*~V)wDG zhvpMaEr;sn!Pj2m=lf5V)sYccZVXqLnah7NZM`G=(#jlUYvDJxD48)Y>0~6+kWXSM z>8u4##BLQv7fC99sk`w5zeJuGhDMcQe_`U-alUQC6qoPSJy5OY0UcIEvO02y(KTh3 z{?wsOAq+qFT#+~rugy$Si^K_N7hYUltYR1dgVU&sv5;R+k#7<6@;W1Dy9p#l&el^1 z&TuY)tAO+$OYGcVF|^I~((SpRhZsggeB{I$jv1IZ7q1`Ky@giqUCj-O%)f23u1YO( z;x6l=3&xPu!dvX?BOs-sMP-#A`@Dfi6e00+=O57%wv4V4UT)zSQ56{zk7>7?{=_aE z@SQ=Kg;i0o&w6V*7wYsE!A415{eY~mr`J)pE2slS^At|qUiog?2oc`xoQir-isqNx zrfP7U&k))fYcsiYo;?m$<=g*zQ-jw^5Sc+vcJcT=)l~Hx( z3g&p}LqHjG%F5Av)l+5U(e58r@X(XqXm`s&TJxwdUodd=LQnP*bU{YjePJ>(yCtg~ zL@aj!4xy0T$T|4kzxjq=7dm?}wqyLry%0Eyv*a$2b7sCKTi&h22u2h2%Ref1ic@fwNIEA4occ&i&xuWi%Fv}l}0^X&ZW zBK|c%e|6oR%*J-F&I#?T8GCf^_wqC@b&pshis~LlV}N+GX>r5yAOg z=vTLugZ&HL=yi9m4{Y|`S#%fsNGO&2sgoSQ`3F-xL4B}S7gDKv)I%(E_E@B%0`)&^ zlZN!eSbE&pS+0ruD!wUI;dUh=8M5}cpsNP~HbyRdoPzCETM-TbJFLqfS_h`g&ug() zOY%3=1oNw1f-Ha@`TihQScaa?H@h-F16<@&arnOXYWO{!4*DUY zwV9>Q1b@W0K)xrbF_1-Bp4%Sl&)rQ0TSv53|F8~(8EPi^BzvH%Wmy$$+etEmUL7iE z3wHxNYoPk7zJsX#2sb-3LknG!G&w&0&NS1BHUKomn`-$7RcOFbdDaMux%l|_JqRG- zU4M@D!48ss^c|QPZtLKvz{DL0nU^$8!970F*W}Hun|b_t zfR*ZEX=iidNB2`MU6^w{*@VUFlHNo2+xhf1my9kzezOy(J4nw0T6XnEcMtIqU%e+}l}IblPc4tlBc_&HPY-70b-G+a;{?wn=05d;;FKljtm@(i85<2`mn${yqZM7K3Re=acsfH2EuD3@X|fQaU8 zX*=G!z*0S{ZB-t(JKi8W12sittYAvE0V-HOFBB!C7!si3;*yE#n)2hfhB4-`s z`Zp}v2oRG$e5421S#OMG2tRq*tgHh|^ zddKTy#KHc)qDPVr`*(lg48d0`6dC9n=q-n*KXXV?t2#gT$*F)t(?afbNVWj{o~2d; z1Wyr({Zlbpk$w7mS-V3QIgTpQCw`aC#9%^5nh@%yTEiKD|HaWLdCzo_Htjl&BBL{L} zp)=v0{$|T&&25zS;Sb?6uRaLI7+z#RSAIF?F7@2(+SOP(uAIA))lrO}n6*%PKp%W6 z)+(B-iitV1R4!NiAY@ydU&O#u2gD(;N#;Q=c5v#+{LRXMvSq|9!z}HD&N_N!19y0R z?*7m`gUc>8i9(>yt0tprh$gc@UyuY4xq2BEkL{LiJ~%`jiCh6~a{CORYFYu5E*`n2 z?DTS`FjrX%Mr>E%SRfpJK>qFK=fM_GpUO`lNKowQShXP8ZHRnW*lJlb(pZUoKPg;` z-QVh|<`U`dPQr33r7zsZ(?2liyDLoDXLEh+px?u8ilOddo9kDLT%{4Yk9qg|9CwE7 zrW;5JN3l8e{0e=XyTh8o!An+f_VVg-?^cl6jLbmitJWc#y)ki)+r|5N)V+DSPuJi* z%MB-_AOJBs2NrI}&{IP)>t-q?NlJDyZje*@9vqQs%a2qKd-6peU>UOEyGg`^ z%)|miw2i^d-rvox)r*BebdcJBJVRlhL^{`sE-goAide(+bT|+QGd%okay0!6lB2oV zhD;e#rs-wj7ae;9KO8NTk0P`>Jw3_r`}ap$=PuTnk2(!iJ&4P*JXhKeJ8qTYX_ThL zx~2dBO;bHT5RX7vG8E9D!3j1H-ol9K=A zHD!AnaA%kMconpmZNARkJTlL*d+EG~fmZ;nS8uS)^T`g9 zEl=Jy1g;Z|Zh0+AK2sYp4g}56I-O_~Kxfv)-!DU&R4x~m7Hw=$ZtwEdR6ko1!DBFb ztxGZ^eFEAUh}b(K2JK1zO0=B(JQ!O_CZE&*p^u?nMqf-Wz+-)PMBbk(xpG)pnWexn z1_EfxUJa3$yHqzfP{X3Puo|YihOO=1S8;s&I1F8!vjv@mihY@C(pj$8MLJxceUB~R zni(QayGWEk=Q{}KxC>|~k{fF-9{M!+c>>Rx;b(QVm1pzrAR-9zun9Hg=TI+QAB^t0 ztN(>({hzDlytxtdu)h_UZG@}>fWjC4LC=JHu@HSOHf9rykd@p^!G9$ZztG@V+ybqt z+VyO}vQ{1UtG7~!)GT){(05b+6~B6Q3^_v>6NG1I@wLsV!M{457bYNRuZTSP6~8vt zVTbS$?a+fS(rIyrX%0iwRSo}~kbVAg$NA!T30)_D^;e$O4jBbFha_meW^$us%GocR zgV@>GDRs%oH)4ditK2ar5LiLCYhEG*C>W06Hc zms$)QYd3EV7G%WeJ{=ZRZHMM&=WAswHT6cEnykY*t<41}hx7+arWG`gBWOZS9}2Pi zUDr%dPf>Iz?9{nXEHfWSNmBD#vPHg!hFX=~eCfIk`uL4#Ce%hipy{cy4>0zBcK81p z7)3ZJ&P=Yj{1h{&q!|2V+`76f5ssS3(;v?~9DiXME5lRlXoA8hBB7=!SIXE_-$H(@ zODS(muW7N)^f#7eo7;`8)0&X|N(uS3%+s5&L{3$r*m!9|q7Q=ejujT!?))pRi>l zZ-E*Vk>^LQR-ib-vhM4uOP1w@3;qqO*3lmRy*|44k=!RM>X&cd2eJL#qJAqQN#=J= zM`nC%Q_b0WW%k8UP~*80}fOO27K4VXc6o7xT`dnb!*F zkNa{@*^bOdAnS@UndCkGQf6V9^0_>%Zn5#iY}FZUAC%3Mn$Bst`?S7oaS}R=B(h}F zCdQRzR^mZ!se9G(n^m+1mX4U1nLnmuSpXD%uAgfoi$9E#{E9z8WBH?|;$44B)SkNK z<7LONb)$_}AFxY^J*e30cC`s3EO$w<#~TfG-t%-DT4G#mE_cK44)*`?U7jUBjD7k%zqx)ENEB&MxGwb&`bfE_2WGZQ^EzB~?UO#t z{W7}?)+a}jgGYinEpYS5zzq~_!fIYW033K2ksIu;@dZl@B_(A0{wR0Vj%qrL)AtV3 zuLv({sp;vdY18RH*o;HV{1rf^m4{g}EO>e0Kj`C823^4Wm`yjE;mCfrCBM7f(?8&{ zKA54-G@qsPqV`g{1K8tzPS<40`nFZi?N!Qk${=~FSpMR#Y>N^3`Bx1hfUl{Y`+8Du0?uf>yFmSD9NNUYOCYj(=cgu$l2yPtzBSwA3Cyq zA`Fr`)FUv6zazX=!cf&ZHwa}$^>BJDRc{sHOm9{!Z#hHLXm&1ZD>Bk-x5U^-!ldwy zIJn6IipLV~R2IYU9AE}rY8-Ug5iW;0T8*-I$^?t@^+#IhgmXVBNHoRw?jfL;0aIvJ91#<2vusOAJ0? z7ZOoqRBl^QC`KcZHNP8bHUI$69KN%_|uCMJTudY0Iv!(IgNwKYydSqo%|@%YIQgzHWdW(rvj(=A)OgYxd5 z_xCyk&cX=a)|Ax}QlTz%(3_w3t3L~;ObW^l${X{RdOqg$iqk3#DT1_OHM}b`gOU&( zux#3r&STa^e)9CEB+0;XPF6bEd`6~+*op`4jWNwEM4@eEmH7;mD5pDjY&g))=vS0? zN6hh-7QYKE>*lFLA>bJ`1}9GbS+IsHti)0>rvE%*;j054dS+#%a@Y@|fG1eS7A7T$bxiVoP~kDH zgFgB1OldNIopp3>*Ux^lxf`@Xq`N0mT;B-Y%y(p}RRs90=FgHIX1$;O^u2L2t~S!I z{Vu6oc8C>t@iiiqI2CQF=Z!+&;B{H5nF9PeTsOeCotA3S6+5J#B9g2@asSAyrqE%u zU4f}_S45-!7z0mGMNMtdJ*7f~cpB{#x5a$W+^7mx8=IBcwF7;f|w7^=T znfKctgY#^EMptyv<-W#ZZn5*HN9%g`i*D58vBC))+Z@V+iOtS%&|bIX>ehOZk1V0?CEPge)k?rAgoyvG^;w ze^GEhV_*&~_4`phZ097qWw89|DkDb~HUG>rV)=#BAFAq~EdO50aXxPRtPo|o@h$z* z?0!#!$Ma{~l)87nO3f7VJ(yrYC@UddK$pSsv6Eh==>YqZT1e{m#C#bRxAH)N0~QW? zT1FUKGPZ{4qi)!%wAIx-BEJe*R%I{pp;PQw{fe^0!E(`3;ZkvK82T`64_oc@se|zv zPIsn~9mX_=B9^o-Yq9R;ovB(57D25O@rlKJ%&tH`byyo*cT_3-*K**n1Bt`0c#ZyV z5<=hfx+o3ejgc))Y=0&Mn)3vwQswV{Ml{pxXT<}ms3jyzymG=78i(_ntRC?^sZ zSClF9lhJR_v@8mOh$SWE0bni{p{>n~?G1rOl}UP9<1vTZWr^-vA|2OgMvWHr*5^Xg z%v)gy91iXbNgoDI7(~v&d=<~14d5kgnPYsJjs30=*(rx< z={FHSlD=*|N&i*sIr3Q54feq$+yhPrWtTJ_?|c^u#qUbxY(KhR@H)a&1PF>iE~c33 z+u263mim)>v-iLB!CTbd{~aY1gKN8{q$Jb)DmC@V$^F-q zlAXTrFI580{#Rdvf2VQ4GQx5%psY80{T%DRE1bAYEWpn45pdy!HCB90VFIi99Fq-4 zKQZP6(9;w6)l2UZ$Q|jf!auXHY`#PMD*vZ_6cKN*6BSPSvl zZj`#U<5%uaZ$Z`eW=tw;v5EbckfgTTj~ulNN}gX!-dp0BJcTc5%G#ixN@f<9lai8d z-C8YfCbmE1fp=1$7a24fx5I4Vv%mQO%=FC0dn6#MTSSg1*#HR>8t0Hmt-aUHDN~UW zpXSnqHpdyl9(@6brBoCo%B;Wmwa4cfa)*Z|nNe#owsU?qYkncc8r)KAQ+;}{vQdMs zAd)r~57;EaS8wdOvkm*WS|Qwe+ZCHIjI!kZ=_Mh-{&$z@7>7E8u$9lU-J*C%89}MA*UcuAp<5{)JG1dlxn^p7+9cu=;qKl0fiZST^t}sM=Wdh_ zWk-|Qa9N)&$y5||QsfDKax(W(5Z9Sx=qIy1z;j!r>9_8SUBJC{s%^qj@j(uv-1D!* zicH-It`cEI zCfyM8fcRhI4!e0ySTVR|-)`J5Xf>gu*!a1g^DT@UP-H^-jzv;jTc>Kik-`*~G&eOt zXWu`ZbyGg-y6G>XpIyup7hbxY+bWhD#UEo*805#)Ah(3<>C!EO?aXGp%>E;;(A zL0Yxq%Uc`QZYTTG-bCmgnB;un(%h~O!TB}pKQbBeztgwcVPLs7a#3B7i;(opV-inJ z(2bB13}9f3vgA$mOUDR{Il`EV`-WH52oG9!g{eNq}A07_Nn$ok+f?%iv(?pm13p1rntMiLxBRt zU4jKCcnJ38dB45ibM_hMoNw=ccSe5QBUk2HYpyxxh3EC4ssNusviRH|v$P7b^Eg!D z7|Z9{z;f-SU;IaSVEYKKYCNZ5zEzyxf_-eJ5f!Zj5E))<*rUdrWfzTR1%4&8q`Xg? zDWI1cRZb93XY3iK^JNT*>*qE^igsz-k3 zB2O{poeGlESwYn~KBhfCALSjDx>;dv3fi;|x0qeJVngW}!wO~CDQzt;ElnJVqId@a zrO`;tvEm;v9&F?=pZ8vO{LD&W9S8$yrGj18QmgmeDu(ViW%sh<8HA_aI*H(YWq{2{ zU#m-OU7$^B#8oEDg)?h4SVWc^HmEF{y|lHpef>-Qy(7~8IatW{!O@Zbi)OJ?c71VF z&-iZN`N>VYzDqOYnPHt>0~vrk2%tcej|3ZVv2B zhGv-;=P}>X-5_7}1pvD!`P}lfRW*O_ou#p(GM^kE2BIl>_wJ2U!M0Sk5t7(nx>`>| z4BkP}F3`@%zSazld@tuTH(vwpP7ml6ODEzzRHHvK{`VbGU)-@VAPFz_idC`ce&bq8 z_y&yR*FZ(b1S0=$J+(zR5#Q+B2T}poOvaA%C6^5|%HE>BD^)u{M|Gw6MK8OpxH-Mw z`WooZNsGVV-5&@#ov231I5E*mp&)5q7&o6JaJDSa16o5@=fkUwMcm^eO3Gawt3v#_ z!Uz1_J9ZDz2d#qJ^JjH^`npW<)@^EPDaWjH#Oq_yQcLD=Ll|)2W5#i}f0{!RjdOlq z0}EwN1my&{<)g(y71XV+;!NI;06pR>c(yx$|m&TtHwC>-#2Tvf8IzH2$U>Ok2!yn5y#|V>Pr8L zOwg{MVdJNgx#_%*r$4iJkAJdfuQ-ZO>=cw1&aL!u)Qew^Shn1MSGHYk75K;X7mu_G z4h>FA6ScpFSRF9|+8HgmH+Js!MAj-c+_9}*nR6;NdHAwNrcgCTNo+pk#+;k6Z*~yG z3B;3kTYqwv9v?9jeR95%d&X$EVW&+37IA9;X$BF^Q9T)CPLNL3WSf*zNM%=vNCeRt zO9@l|kNWX_Vz)T;yy)Z0oEkD??kHV)%*&h7o<{YCsQ% zv24+S6JLd@(`K2nDIDlZY|}KHhP`C)eT(x)05d=iKI7Q9UVY2MsR_~kbN04y$xJiyUBd65dSj~GS>Rhz31D&zy}AtX1W@u zZ;v?R$W?$4AW20a^Hncu`& z*!Yj$BI1KiQ3Wfll{zPtBWI-=Y&L5)9PoYbV%5omxVZRsP6XZ0o8WBH#7)o85wbyrayImK|i0-Rv*3Td}0>!bF1Pq2Bn+c zGX@+S9ww-f8(uZi#`6a5fVb0~%-CmVXZ3uD^uk0?o=@^R7!aO3423B#$jV?>>B6qJ zU0-xwjWfk@8fy~DiSjhc(3v~2<7O{B`rh|YIrA4;q*G>=O}v^iMG32I484j)asM54 zd-QKOzS^=D{_*4Udh>&i%abWhp*uE21a83scrcaB z!KG7UM*U;T_dQmsQb>w4|L?^&ewN)dPpKHvk;4BtZf|flvY+2rb~v_)|03L*n3za1 z355AKi)1W+v)IB>#41ulo~q1O0qM(!9J7-x8~yF4;}#IolP72iJHKei=eHyaEn9x5 zLod)BN2Pxmi_(0-<}m(vXToiix5B9p$8(|Th2?%Y-UH2w6wMJ0CQaXNc}9Mwv%yL zd;VGqo&S-0%hMOE?N0wk<@Zkdzt0C6(wmG%bjx-0%-C32Svi6@aLs(5VdXdA^Pnzo zr+x>gr)SJE>m?kmKjbR8B$)({Ic-lV^CpjF@cuyddGCYFI=8oX59A#Uc;OFIrF2Df zAh_l2A86;xn1~xph<0>`*+{;syl$3i#Lff#{STyOdBh@5L>mdD7Qs-hb(jnRR z5lZbL8g$EuXr5G5LmlISw|(EAGp{tMcktmi39dc*BECc6kNM9wvtn;)S*g>adb(@5IAHy*uFfIgm=yF*T^{u^3};U5%QTs zJ3^&o$yK$7nnb63m;BxI1s?8Yt|^a~SA&+Go{R0I{kNFE*EQBdHlulQBX^Ix=u=u< z=E+rBaq2ZdYnSCK{9g@^pG`bhskhrN##73wI^T~2@0<_umMCAm5JXLgvZ_})8e4g4EB;EEBYKOj!87m;c2g1{?y9(qS75GaT>r z#J2v;t*Rw|#skL+3o5q(>w|NaAbN>OzpIyG75==}uB2=wGt&0GafVTR@FlCeE>zM7^DL3AT^cPEo#L(*tYp}Wb# zA6$+#ax`0XbQ70usT=U=yOJkMib=fx5Uu>vz>gg;EgEZn6)D&zTyb^H~J zE=wMO?J^Jn)OJboZKyKHum<;6Jw3-)qz^BCDc#8M*Yfx8xECmx67Vfpt3c~wecbCY zz64|~KRr1~ZoKy1*J0=E=m@-~YRbF8a~=*i$)9H3@A1Yhaq;j}qp_rL zn)6~3KvhwVgyEhV@cd6!vSiQaFqFQ%$F?3&th<%xcpuw#$G=U+We&#C% z36~W&_we_xX|Uo6Mc;DSFp;k2n)X9>n8>yjCC!?Dw`nL@3k_W4WV>yJxBdXof!EGX zZr&UB$&drHVjTrTm7C2*D^~lk(rqB;nCA_=foeQR$iB1!J6-(>yy>~GDiQ5bA3N7MVIwHL}oY5`hlK-PRg6vfE7t@6(0wBBfL7+$^Pb1TIoj=|E9 zvw!nDY3v)lMbF4zfBNLDY#QU|^okq!0iwNU>FXeUJ!VAidM&`G0T)b4ATdO@Bv!Gt zuB&wcWd5;;kc~zfrHrwJOb8WXG4P&E~Q?^^h<3M?stve1<%^q`mA5p?!4iO;zf#G$kog{x>6) ztNywha~6bwqJhVbEgS8gR~LU@TR$6o88V^wz;V9V__6JNw-XEVc6|L)?8b#VPG;xE zI$3~?N4S70JhTZvK>u&fra1PA*+S>rM&Lze-l{%qKADo!su!{?MNwGIY4@c@IMr@Nu;@!(tY^OfniQCxB$ zRbME1yXypSV9u$xh}xxD#_{mrsP}U#gWS1zNVB5Un-34jpuTU`O;_}ZLCxJ5U+{Ps z`1yZiOP$CJcNS|ld9aaboqaEvwSMRwM&&0Nc{uUuO6c;1J~4lcAp({R6}kD_A8)Fn zLXtXo7q6qt9~D6{xL}Hd6sc6j`Zz=deg*Ym-_~xWL%%wM>QuW!q|e%Xf`Tf6RP8z(v)@YeV%kQ$+TI*X!UT`*@7rOA{6XQD^qYl% zReHHYJM0SSBku$4HU0>`1t+bxA|roUv24j~>#iiV%M9Kij-k^h7nFsWsnTm{(^`)K zEyD(nmN8I{A3|0tbA7R^{_EJA>bS3~GjfO4*Kw)L|6s$HMO6kQbT3G6K32804V|FI zl{8H(ExjPuo=w#)U)~)jvmyi9db9O%uS;H`%-B2qs;F3X-Z`9cQZ4X9;N1ANr}-Qp z`>1!l>?=*y*=~gMxi?2x1a$QiC~e+dTrqwo`8P*J6^0)+<8yOmNn^Kd4(-wEtbs1V zOGGK%63$M>5#NKZ(+qIIH_5!FEM@u?KZMHk7yAe|hOrsz_jRV0?b0DOVd|n-9+v_n z$RKF=CINZWv9P)!79qV*oL>vVBCeqeUhv9cMBRbdVbM#u0&u zj|mS5lvr7EPKX40Xri>egDHFs73{>BxbuBSdB>StI?EmL0c}FvcRgJNrB94Cp!Xe4 zlTl2}Snb0=R;~Z(=z0M0vo#2!Hg7{`uG$tCp8nf$Dg;*P+d1E~fB@ z{qIwJR040|81pu*p9$%HV$lU?oCI&kfX;_2&NnaGbl~+YIE`Dit`m$g(ro4rMO8Te z@GYUBZp>axHkkmT@5}@udXJbZN_4(~=SA52lE2z1dQ!Nvhek2@6=9d5f^kC>;ir7} z^fWXYaq4lu%~vmhA3lf@oxuhDC?gIsY^%#m*KR9)Mp#o!m@;@*xXSdnny%k=DGox8 zqvwHx;XqK=4-vm9_E^jz2)^?roS2?Dc@ADw^}shCN#@7B{kDcMuzUfsZ!U(qf0~y11ecxOP3NVP1`2}U_ zPZQ7mbhqOP7%Wz=nYxMqWk>a30#o(d>snr7ACkMHqlb8N_g|4({c-Nt&ysQyyN!m> z3?OyLp0wu>t;iZkYn<3n)PHaDWJmJ9|Cgje>>;Wu#>N?bI7__hWoL62%jQ!NcHbYu zv0c?{3kt6Lo$lwJxyr601YwnxF8dn18ey22T15)Ad(llmeJv}1 z`$3$VskM}w;V8%Y`I(hm1v^_|WRgN6IK|#96DF}Q$5hExQBE>t}2=GoF>n6E+ z{IuITeQDY4^}3v?3_^C0Ud&yn&WyUy(ti}s2jwdqqPRx?kH|BDgg1qu>djLV^H@ss z+I=1i?@vLuwu`|VzcRg$v{l#1C(rHAjdoMUQeo<8rU||iLwJP1&k@O{{?`Z4FWxP3 z@^ntK{xM=d|K4GQzv;$g7kCE`oiKJgnkoSgdmk?`6G|gek94c52EuO9P^syRs=co` z3~PPkaTH*maaW*=$Js$F-9=~%!@bkmPDgbcYFA`lFc@;Y<}bdv12`|e1em#H&wiN* zgyBXtxW8tce$LJr&`W7?+7bMOdK(9RdQTU0^vbZdT7hF^^r-H15~1)QIl~NfUSY6z zm7F$6E`3YZf4tP8_;~k-wbSxZB0s-bqbkcjRkXCdT&2S<3FlnKdAG5+IoocNZkcMF z1wuNP(4~L0aQpLqTRN!Z^wpj1aBeH?2iZ>KWD#PKc;3$e`^9Ak4qY(>0&6YfO_?_h zOpwXa<#I8hDu-G%+vs$ZC-15+ocuxpS^)yn@)yq8y?6h%ko=)BB4{JkjVY zo1xR4DM;LF=KH=(Bs0TNe){E0&@#c{{f5rX)#nyD>Qt;tz#Vq6Qz6#33|QD4e+N!4 zU`c}|*+1^DyE9a_5jz|GPITKV*gdS`v2vUP!aeCIm95OK?418!4HUKS7qglqlFsnk2cv! ztB!|X>ZkRp>Wcz+jhZ!(fpIMQ;P4o@Ohe4x+`5isCPRakww{) z?9Q$!vz#gWu87e;3+2f13aSQrB@*rZN!0xw9!3_;7hHkB_(a)vveKYG;9}}=TgE%b z-c=>&|2^^ugHPH4&_kzIqVN-LA5K9rDm^Wa;)x#8n|Fn8cWI`lXVu6^#2qW?=GW>s zDE>9o7x$ITHP?7s^W)*Mu1r& zpz-uafilIY!bN$FUfA)hA1@KzYbnyTwpRh-?sV*=A$PqXKj}c7W8^gqpxs-*A3Iq1 zVO3I{aAt{aM8uwYVN8q891@=1!pWQy&u+_GT6D8@PsOjrTuwP_-DD~v-I95Y9SMs* zcd)mUVX~9C^S=#nbX)zLB?we}BZqmm49QcpZSsrpGpoXZuQWVf3VA$&py@-j3uNH( zp)4fj91X*n*D_h>JCX7?Pd0yqx~d#`W#e{?i>lJ^<_Pz}c0b)n5f*D_uyUYC=<|p^ znbf@vM5IA4Eg6@OmKK+mD!u1=s9#G;S$4g_wDR4U!DLa)U}WBh+B|Kvnw~JspjDbhKrC6Bp8{it@8!+;t<&IS%;O zI-|1ZpJ_^9!hloXf}hR~q5!kYQ8b*7UYN zAbX&p2pcJ87`=qIN9fBaB@dcWz-!1U4u~j1M1*TFyijj{|2PG+AxSH@w53?{8-sRi5&T0HDx6fm;GcR(%xi+-Fe@~<#|OCIdEYM4`uy$+y30UPp;XDa0$HC_ zu&9k}s_SHch%@8u(y~ge0hp2JZMdJCro0<5Za)?epF1PkF43K@r8Gjeg(yx)zymV) zE_C43%h#|!@3FGdx|QI??ACPO`To3m1Jox{-{6mz;IO$7lBIF!q8>?I}P9n{yTs$+=6;H!g+-^oMU zXGPgafJ!c|nSWuJlbc39nv&6@7ysf<51nGL*6jM&!1D}P_aAgD!ZbLJ`tVvX?Azs` z>-hY`B)P|#JfO5G$D^TZxRGa1-Gd4b9!S`wj`YqTlXY{}7F;ifgG%UU>yrmu3##!( zW&w?q`fPV8HD3x1i3icF2kz+MS(1%chPPXXmC0U?4!hU*CHIA{_b{x#iLZhbhhBW~ zsfwU~=x`3)1%WQW?Pf8S^BEuK;9jz#LN=Z|-Za(9sWI1NAJhiQf5&>ofdUoqZD(WE z^?1xn2T!8%-_uj#x}vcAo2HS6*t7qGjusT8zw==@!WOg$hD+uH%1uxMR=`nYQGQ3= zX#c6cSx`wN4MX|oHyn<^Ql@a&+H3^@mqj^2l|VCKeEJT27Ck$C%<1w9S{CCT;Zdwl z{fYA8t%;d7QW9FeV>Wf%H%+%HH zoUtFTZ6E{Aq-~~KppHpBbayrf*-^H=_B9O2-RZ^{HF7eD8&$*p~%fh-2up9@n=}=erAkEA+8!l>05NkdlWB%eW@0yAdBdN z!L|12 zsVCwxV9}8feP3I`F`)7igz3uXJacPWN#H)NnW5twZPeiy23k!&3X#c#s1O4odDe|V zyAj_g%&HkE{I741YxRcwdu}skuKgO8!1D{NjJm2S$$Cr6(#7jSG=iEZ6kb*sm4Hm2 z*u@(j^F}%Pk)KYP>bpkh;hrN~qzoHY1aUlWio(ClUqDn@GILUMi2~vg?wb_sLKvo` zSa*%xOZ@<#hQ2H@)g6W9=4L!iYV;!Ez=D&!~WI>;DTHAcd5u^np56eIU5Hi3=UA={XV=% zF`(aEy}+N^7(7GnHItjVu6P>;=nQkvc-m1nq|ce+T#0W-)>5`Fuk1%tI^kk1ms9$S z!(r4I54$QIz6Eo@g9~>{uDK$Xt)XVA_5Lkz%W(+xF24G+(s}k_$#U7ciPcAP&@3xp z_)zDQ=RPZ7^gB7{r}7ZQi(~nHn<42rKeR)e`!h_)FW?UDgVQ|Tr^-?fNNly-DzR)< zR1kx&;rfj?mwWhAPf8Y?Ulq@`bhBFgSkiL8pgw{`9sng5jV-K)NmtGwx%eJ zs0ld3d(s|X4u}kZTr>?20L;sw7LBpAQ0Q~|ZPC>}P@Lz%FFy>w_vDMq<^jXIS6B1x zdaF9JE9CttTRQwsKl#+k$B@yHMx9s3r@x|QM<2l{)H-ksMy8;d?$EmiUpB&(%C03DUq1iaos@s+qDIYEKjI>0%k+lR zg`Avec#oGVq<4>!*0Np5FHPA2rk`rcOMYm)P2B(gJlFyLvr81| z4>3907+sfYmv7v6&7V!$@z~j^np&UKE4xXts$1@M9p)39HJ{$JkXhJ2YfMEsTU#eY+y^6h2)3p`&xK@95UE7Z7&y*>hHiK;^Ei>^%( z(|dw++B+%1dWrnN%ZQ!cKGiNNl+AaOlSRMoTp#P4qiVAdS{Ma9= zK4=DszVqxX3}Fts8*(kTh{O`^D<&O+J-=Lzpo?Dz-ur_NGhF{-y>sEKbSZn?%ASg~ z(D8gZL{Z|(a@yC?N5--YbHq#y5wIhK|}f2E1B)AQzd;k zpJjIw5s3JUfOVew*pOZcUhE@DsN`33Bqv#C4CubqASBF=h2Ko9BkUTer4*^DYi7rt zN9*buVTR6j*kHGH!Z=YZo%YxXkGRK2_Xg|nlrf_8VyW%kFfY6LXtBmSzxyv)ZgBx{wSC`-}E#T|7V(I4)8E`HF?@N+g}g9 z<`nbIHxmZ?G?tsxtQ_@0I`$yk>I>*-*kzur?LN_GOsB7)ICf!X zs@kBVrYroOV_tigYn*@AhDWD^*73&Nyen|R?WXE9 z9^hR(UvyPeasyG`Ua1pFx91K}kV-@OXXM53ZT@AypCZ!ApK7o@+-q=_?UVayA_6D0 z6BqCmV%b6I;D22ZZ?9w-HJs`KA?<`6=yUE4{x| z_Bx4muw>P2j(ciwz&@sXckuntgi6Ql=J=}L&t0W2X3_OpV+B`RT_>Av>nB-SCM_B# z@PlKHg-N_5KgBPp-0n1_4RJh{nUv^elR@f&LEBenh}2&Es<}KgE@P(=Op&ikPJ#uN z{nhKEa?41C>D=GbZh9{!5_jJm)n+!rH46oJ2%hA}F!$*8ctomXM_Ji4Pte56(+FgK zaEWoX#yAk_OrGT|Sc4gA4cFop4@w*$iwFwKK-g^g(5>11CRC$rd#DlbM!jN`8zSUq zav{qO+@;bk*c@}(86o#bZx!U?;1JGX8Qi{wvXqvo^{aoY*(^7Yo^TdP?vmekuUNIQDZaPVQ6d-BC3%dbU6EAH?d5jS~!hkL|2?N{KXhx?A(N zt!nKKxHEo=7(X0Lt$vqZQ}eDPQ;O3k@F}9!Wp&@JL;8O_kdk04s3ib^x9TbA97c}FrM@CEjE?uDb6yhNwEfmZh^=)-PUgBT*DjoP z^tWpQT$f0gs;BbV*SzetpomU6vr?U* z^cQqIV%<$iO)ch+6jDf7kV(H>^FPhXVV;uF+-k}Wg!b|gyhaZ>zmd={f{k-S%e7Bl zIUTdsPTR$|zfa+E!AL7NtqV7O=_0Fe)HJZK@cWYnODzbGVre0ATC({gg}dm+TO#)i z?1zYkE<(jG-)=$mO|-5x7k6|yy z67==AcWHZ8_m6d*_1q_IW$#w$s8Oy~zSgIbsraQa^-f^mj=#sE$IU74`j#lmXz=CY zzPs2N*OJr0et(Dc)0YQfk4xVSE?N7nXI|xcF^Z>>l<*_drlhEFQ4DM zVPJqUGj&TyfN`EHYh_ffTG`np=G_~>e7o3|q;w1N#-WYZbUhDG^!8LIwH zKo?j3YP74^VO{K#83#D~)6%fbO~T{lYA{PixyRP@`op%d2BmZ(497|N=nr&c^W)Ec z&gmlcrjmrgwk>T(gB-J!Mo`w(u}_ka>zWA9S$TCswtEQ*LB1bRG@ZUiGYu9yk<(){ue6WUgYQFt z6CZ3xI5{*qq$UQvI4gYj&%OJ+&=bLSOn*nuD>ZVq_LV0twmh|W*Do^4d$M_+057w6 zJUq@cSH8$KdvKeZm(lzd$t@6ln!GS9kCr1bV@|;3r^rUqpgr~dAD(;AoU$OVE2W29 z(R*E>twQ0OOhp?kG0tR4E{BFt54vG^C zXj%t+4pN>Vg6qCK`;lkURgb3zD)KC>QvjLKo0q5eS%>!wrRuNYxc0OxfDWU4DN6OscbXqKI82tXWw!=*Nkt72Zzqn|(Le4i} zdn!ZI)K5a7)&x0$cOPOWz6DR|5zonirlk_bm7Uf$@A9GSwm)t+qXc~oKb{6(Mmo#g z7^}()TAl03aQJd8r11!lG z-A9AXUCLe33wX1YD&-&h@OU$^xFJJt)HgVGq~Fy#G@yFRy0E=g-!}og`-AyQ9v4va zlcam#!0DVcN#y4HlIeMXd+>SE{i6GA)^F=Xg7KIo4-;_SL<0EKYeZAR9e+OS#6pJl z8<7w`on*h=pY*MGrDw=1ArR0JP19M`Zo4$OVC0Pgjl7*Au50~%*L!wCjx(^sEua4V zY``NO5jHjk1{&IbAPUj{;iITNwj4`Q9kPG`!PkF*^PQ)={oKMnYiP#p&S9jBOhttp zxXA|H3quiY=YhsQkLqfwhSoO1@iQ{{gnb}dZ7fc9hs$LdLJk@e3|#IBr|XL<5{{Cm z$oPAmr6xZ_1M|Tq$M0s*1?Q#qfyU#7eWv2?IJWY0+*`Rk*Y|G4U(5CCm57hMpiMNm ze(!($b&&o+7UUy+-rxCh@!R$GR)>aq1C)D&))(ICOyYJ%7i8oCSQS`WwwiCcX%tLO3?pKYzpE(f#51A)R(X`-y4tup`aGUwVTZ{5Tsa=hu99wL z&92h$hz(ZTg3G;u@Wut&*4a%oyqjhyu}wfXU@g;cYHU-W(N1UL>dIh);>lU;#SyO+ ziQly8gAoa&aIL|B0>Z65zw7!u`~0E+wNBwy8IzQkdoxSVMCAyh_!!2{0ws@O1hMAS zv!-2jYT~y`Gl!Zi0pb?cgR1pZp1Z~m;zAV)SEUD7?^|H6HWf8+9zL+2(Wu3Ez?G2| z;Gf?s(+Ptz#U>N>>OHqLpxG+Ail|mSA!=A59svUDlf`#6uHET!=-02bc);(nZqyyE z3q7-Z;4zB*kd;o)I2C-J+T5@UV~Q970j=nPHVS?zSwt52IB5@}4ERF!2RwvHyv;un zJh(kKs=cC{jd|0i)Dyt7647_aXaC1qs{?N$9Gx;$y`=Xdi!iTcA&xV^Dq1nHsKSMO z;>G;hfU>?3F^*%pV5z;A(A+rdWUMDR3Ek)*jiw&`fd0z*aPH#)somn&fzeF+wNiP~ zGG1t&WQ%7Td|2`OhX4%)YhU5sB1!3!8^aS>@o?Krg&k)c47>0fxg#SRZFa;tHS@cDJl<{< z^`5S@_5^u7h0K-dtCwlyeBBvI(x$cB_Lh4rN!;+2btdJ_9KchU6w4e1ap|;ten%U? z<-2JlZW(kgazYjCj^B0RqlaVAzU4DMEiILc@4~RPP3E!8>oTeR+OWg}=dnDIwH|b5 zuh*_&=CqjG;*3&o(V!j<{BMFs}}^$Nm6}4=3(hRY~V3OeA7RN3^^1*p7kHu72hQ#fzMe>MPK$ z#U^xGKHP$DfOB=V2F%>Ob=CT{a{NR5F7_V+c|bW_k%7!Cs>XUUGiqjXxJ9zD)^m>_FI@msQWQOG|B3G#^?$s-y*_$+ z=mFls1D$5_TUPx~S9t zeukgI*$=Y=_T$8${mm!=kl0l44}vL0qn^k+`N_WA>)%qF7q9R}!2a~+CI!|?eW-df zNsD#%i_)x)h@-lR3a>JX$Ie&At@(j@EU*B_1M!dj0rzKbRIv+{R}A_qyH1SC%)5ZJ zU!Vf`ad<`lgCg}$MH{C=BOZRm9I8GEJfVnRNPZ6!RFCf^mTCC7YI2u1TdvWAMh8ik z0(xI|K7DJZNNWHzzwNIAF$InN{D!8fH9vkV_vmQRveTTH^ljtb2SFY5wDt3G#Ehj< zJ)+-#<1 z0mN_+XP4rQ%977K_#L(XsASxs8oQY|DMUN*d+~FhC?(+!BhTY!N$}_C<+O2ZM-9|) zz#DkYun)PR>JOdjaI)i_kO7%9TsM@vPnUA?+v6_y2XobI_=m=j-mu&br?an{54NZb z_e^LE{(p#f%_Sl*ps)De6r)@1uQoxcHdM11MFmU%Ocj0Vk=OZ)T}97-{@q}FXWPf_ z{8G_>)=eiC)bds#+<#Ne`n`U=qS_kd1g>kc57zFiXZ1y$NrNxW5FRi{zR2z&o+W%5 zn8rOFxXA8L*Z?-Ce@Iyck4Y&R>qHcHJx$j!@!(6}QfEdx!~u8Xi>IL_k}v%`?i)01_a7;pU+V!Jy{Qke0ni$g~OR z*g%j8g!E$^{|>T-2(BA`)E1lr2EdEk_=r<~Iqz$oRQDN(?-0j1F-PZh;l8GqKEK#T z9|ua#tE8JBH|aXfIgB^|-sLr6x?#S;!ap!JjNHMguA+vgo^2m$Kj|x2r!w}kTl&dK z8ay{gI=1Zbwu8biNYUyF|FG@^>8bTFoI^(sx14vG64AFjd|O1VAgSThI!PQ!1MIx{ ze}Xw7(~cQ=D9jfWT#fH{MvaE9KUVmjS&iS>9t9P82@S#mh=BYNgAd=ksYY2~>EeOO zZLdVgkRD5u9%QU|#tr5L!|wgzz@cfqZ^>A?#CldihM*&Zse)mJG1;Zp=gaTrJ$%?; zE!Vuq{WS01KOt$wh0tGoLCz3uJsfc3Fyn{6zk03@sGsVqW{0iZQ_j-~3l<)IN)T}iDw-U^quLlf9hUeCzd;VIl0jK)x3An|M!$K&vt+1Z zV(!kV@ZNpWupW%AF<-fITJ8vp6aUp76s!2|ot~0EA0sXalBVEn|`I$A^k@tx&Ay(uR2SgS96P^re z7cs&;xvK>Das;&Edzy8rGz^Ztx*zVYkBw0N?DL`=kq)ybJfFfS{8rPQ8f>2X`sJ@L z7$K1kUwcO5Yb|to_3J4Wf5N|=zl{lmZJ;L2%Ig`0(2aPFEj4&JW?1q*J?I{;6@;vM zK}~rA5L#ECQ^=t78d6yF6fDHWXLpPp7Tz3EG>PbXaa^^GvRj}T0Sti!>7V*bbR3jn?VFIkVC9KtzezK%mOvW5D!F|A0M0A zK#Y4&LH5@)FH4aME(loI7~V>K#_|!BI4&jr05{OWYLntgvWbhQhKid_q$X3$vxM#) zd8J>I_VE{w!b&Y@n%nkB((>I1$v{+D=WZ;n4s@tlV{Y=Z%#|GFiH1Z$1>M}0g`wJY zpY3R3jjc!R-SKJA6D>qr=A(@U?|ix8;c=9>&U+Vi(knrp;xXzKOuN0poL6yB~B>vq10O-{J89`$mC2m4RTn;dR{MjAlxDbf69 zyc`inByb|2wVAclRT7dPJQz)NJ(%%yc`uT**#@e!%eFgVZw}RGTdx0*pqeECHV4bAPj zPNDt^U&4f<5K{lVZ@mPZXwv?vZaCN+-%*~?J4t>e*)>?lDV6n znn|&jo>IW&C*GiukZb7!WQwC{Wr=XS^kG^M7o4ajXC?PeQK{jLT$k7d;7*F;)wz!l zaS*tem#18T2Bt$WQRGTMmg`+46@H>F0PtV2FG^WI(4 zyTxMfyffULG?V&}LnE3iPM$=374o`O<2Xbz@bMP7{`Bw5?( zXe+8+!+ZlpvY5m6(Xd{Ytc4w9HRhnMZw;y+u@nziLbE+Mp{s)kK zZ%&4IU?XGVM2U~?&U^BeGh(claQ|0gomAPAIxhdrZl66U=r!k}@yA6Vr2FU0bgzq8 zTxjTel=)sqZYpK(~axfw4JQ zL!PCH^FQpfheRp(S=4f1org1}F8JGset{O@253P$>BOI)|I7jaJdHa%7m$UM6(uxQ z+aBuqytMvh1BUz^C7{haSu2%fKKnH((-> zx)-f$6~v5wf*I2)^I z5keAp`YG7{d-+Hl5wnJ$=~J2s|M~lOHEI@FDheCs+j`0Uo$5($1OW zO$ZtL8iv>4kUQ|4dk#Vtf^GSLxFXRxn%f);BQYjR*sRZI%>NB$p|d)R+3NoC(CByd zV)>_E|<3^U&U#O60u{`oo z6v+&vu|d?4{|Zd9(!mG>;K^NSm&9>Oz< zCpL9V+xc(BxVl{XZ%odm<@a;AJ+Z}yT#H6x+ZiflZ`)OG#F@@0a=E4wdCgI+Q3)Z+ zY}}t{b<=o~-q_s3aT;xgNivG$myqj&yRYhtwYC*j1K<73UI7xw<}SA6-v#fz>Kv%Z zMtJT0Wi&26H*E1p;wM7!kyFig%A-gx)0?$&d+>XFPSHv9&3UC+(<=G+F?VO3%WOxd z1r~teY&()j>@sj~#x?h)N5lxjdZR&Pe=Xyat6RTmlwZORjdAkoJ6#dq6R_ER#H!#g z@T&XWF|zm`96q(Y{J7fcMRLeeN|zpL9>bE#ag5A@x|#xu_+%TMH0jmZsSf?b6ogq! zMt|aaWyBZ!#Z0y=05$HM+q|>AO(8x)%AX}DUX|y@N;B!TZ2pj}c|4Q+eN?-qYxgUc z<)Y7GWAus%OcbwfmSnj<$IYR{I4F!|2)XmqBnS~KnfVb=41)H*0zNv7rO$RQs7Y

eoHkvFP6%WqW8XTWAfDXc4s?=nqJN30cjm${ugCu+16I0ZS58*R=h}Yr+6uD zp}4zy3&q_nI20>ZT!R*Ohhixnq_|sfcL@IG*=L{ge%<>g##`yGuD=VOM=?a&W z*Y1p0DV^p^nR-#wZKU_*&ZUn+y2hI9A>nr7#lUsUYh$$;^Qy=T;_cKhlaK30-ff!* zJlywUKCh0nU!LQ1=uBCx*fRJo+YAh!)PO`|3w8G47u-|ij4>!>D7n6T(q;GKmt=*dj$4gbUk%`3%Kex-XT0HN}MF{2_f1-ShK_<4A zN)y>F!24b^-t_t53Dqi!h{NW(;Z(m-oqp{hBtCQXA?M)ks8z_CV+V0>jmWa?FV*Yu zl!y>NKO}_}q2{^gFZgKopCVJwM30N*yImw78c6wsh7#8k>66BW<;^?-5c4Lm*Mm=@3oueW%C;7cQXIanyKE z`y5-lQayfJ&oz1VaTb1MV=S*-Qwh{Y*vT0?k9^XL03Dq>{-rpB7O{lZ-aI8!<|Oi| zu;U8#LH<5}@?Gt_PW;{Hjv|Kru!Nd;BljrzMa5~9V|jt`jb-pX4KG6YRDxnQcX@{~ zLb5-DIE@LCjrrPB35?~aa@WN<9U;!fG2>Mpk{7bfiOPF*6SU=41>ZHKV0wF`C}iy6 zHz%n1RGlT1P8hO8+X|iQ7*tfjb7FthtKz~`k~qdabHaPSOk+DiUrEqpRvR_jpkm^Jr%bf@!jN3JfXRn#!lV1dt;q?T&dY2;MiaCg5E>OE9zBkK)l*zr0ltYP$B1;x24_ z?i+gb2b6oZzhz8u=2coOJUJ=$Ydb6H_B!Cu`K1~i)MU5f0IyvOIL<>ksjnj_Yg?y} zCULt6iTdrmSA{%e|1b}_J zQ@FUvVcLDWzt;s|!rrZY7$T^z02KU#gbI(JoG0zr`nNPJWu}wx-9!368{bks4ZpcM zG=~!m9W#?(;`aCouN8CR;zM8LD6OMU#q_&4URVJenmisy{J!gaaS*|({Agc~qvef! zJmW8{B{gaF-W`OW6q1`W13WsAUMm@<1+G&i_DU}`pH7PpAhnXmB;uIW6COVABG5`= zM#7KO)+@^GFF{L3mZI%yG-;mzdqxdb2~W2xp2uCMzs-yAnJEX{K!kzvvUY(AN^1}w zy;EZmt>+@cS7Mzw!HQY@s}#UJwZnyiO!uRCPWfmg5u(FBaQ=MD`KJB!9%qw2G#wd3 zNB)(1@2Luax60@%-}8}0JG@}F!sq$`us6bri^gG6v-w+^Bp);4;;Yc@myYaJwc@pKpX^(`=(Peh#@%K!Jrk&AD zg#{MRT$k;~^kR+p3&jfvm-A~9fL$7rbn}ANoMCa0Bs-D5Ql@YZ=r&V^q8`rb*#x!L zVUJjhWm#8uJpVHOaY(pE=3(R)d`u?JtvjLT>9w= zRuFe2din^FPb%HxK$*OZF)ozCAZl2wv)J0cpEP;?*5!Xj-43toEJWw{s*jlBW!V@* zcoP!-Ht{2Uy~sJt%*T6r!gSsr?I>lzwz^{{B zZFObzlpe0|HOZ|*gm8&ibts1F{)KO+^>5Cj8*w`S3VK@Evl(z-_GDvxaX0n>flaAt zctc&`P@zr-xqbU}ezjglh7fh7asAkm@yeTq*0R~{$+5Ca@@b0Lg}-0_gk9?z)S8A> z>b5V)ze`}Vn(P5{(X{lA-z-dFubQp2d*0UlqToW^zSpbYnQuSs+(jJggXrk9M-HUD zb+X@Ar#DO^WXnITO`l@WGeZNNwC*~ffk@hN(Kn{ctAE?5h+emdUKgdlI2g6N)tZt3 zIpedrt$#l4k8>=-CjJ}`msi*R)2)r{7=evjrna*#;J6BG+>hjSgUQ-XwgjbmKX@Eh z#NQJw=M!=m+c`cRlKURU%vIXm$)CKH0hA;*EU=Nz>CRDf@C4d@W78^zclU14a7^Z; zg!l*j{L^=oth44+YtMzYm;wK(1#>P^q2RXQ1dpmdWR%@|%0{m>FF$exu=_b(U}AMq z0Wtm?trZpZvHPD%;s+ieJ>P?)9=Bj%p$#)qn=`NB`e34uS^LB3!~8zIX>GBOqOaGH z0!PxB_28KryLKtZhKBv|dGZIfk=vI^-?awuk*~c^_MR* z{;au_m)m$r#99}rVJYwu5+k*A1V0^Bq-)v>dW2@<^zOj$$u-==)H8Hz8>~7-< zB_v8SDtzn>iW(x?Hmvr*Y}M6t{X|n}F&Hy#Ihbe2=iYB;(DE&8dlKL$i5sf%CI&JQ}0>T0dZ8XfG1-#mwdeNg;uQ2ncEeHeg0W9`w3{zn&CLSYzZg|riU&e}M8L9@K9JruVs&$klvuO;kp@`BI zGs8u0_JaB+A~KOq)Dq=&gkTh^U!6O{o!Z69Y%9hU0yB+QE)3(`Mn9HNx3G(U)?%0~ zHISX5zGu-cQ(f&7{Sh+Ohl`=?uegDKiPFCapD1e8%orE?M-3|d${A+seTmZ1-{Co| zZEH?i{#AZIcM{JvQO0Att=cf^jgNr>9Hu1q9?(4X+i3W(D)4+@wx>?U~n0S6r&CLGdN+97u z_i%@uP(pJ6cwmQpK<6rPUwV%Bpp^Rgl6187;cAbyQbMA2Q9iWXbyA(zS-<;?ksg>2 zG5Z;9^Da{w^)`OcI;+-IG3zeT{{Vc2p4@_lg+N=lQC^DWOdb z-bhlsu%)i&>n4%=GYM^Z8eHc0_&ZxD$#zq1lD5kgon)@ex^X8fS<}kjQl zw*1LQ$;OT@{v-XP)<^xx*jY*x&EBS60oOjzN^Wx?rkUm5$fB#|iQQ;P2{z;Q^)13r zb4cpam#?Dk_pIeQ#Z4@{kYu()49TT;K~@n+0<_<;n+9@#i;GRxwC74ZYzW&E;$zLj z16Yx=+Vb5zvpEk>^|PmC&$A73_?}}u{ZQ`=Ds3$to&WV3qf zixtyNPXmN|iJ&s6Q-_J}R{aA&RxvujdQwY~yC0wyPG9Y67py<#jJEt-$l72Iv>MJa(-; z&HCK5F8kaZZQQZ20KL>`d@?HQ-t#_c_#RVo7(B!pRXDBzD1w4~+xKKJx>jrSp? zy09cIKSZ^3I94gremt95snS)hHFw`uf)P$j7SMfrNAz6QH~i~lP@}~OmomxpHWq*W z54OmcVFoU;g*09TB(@{|+ET;nz5&1rht^j0uTCf6uUpGp zv=sidgyx_SK&^T7t^p_7n8%5zDOw+fUcK~H5CI#AY14RM701{}@N>J$$& z^6#6ORkR-Rm-Fz{%w(~w4Cs1N8NV29exCHXJ=q2`<#W|KbsE`!9Zo8}899Ca7I~O@ z=e>;R$-c-vQSt_p(o%??xlF&Hjm@NvD(tK@Z4sjEdsiLMxc0JE@Baic@lr!5r*LQ< z`t0=^DIyMVZeYOenQ^_hFi`d0DW-WF9EB&fh4j%3H&u{N8{8A{bm@NRW$h`k<+ERu z>Jy6G>&s;^5|49EV9@3i>wY>jC+KcvX|8FxV5eJe5%Y91&apHhVjzN9-TAC?NG(R^ z;2`-|a7HY>A1kV5v~tFe0pn#2@Km_XQgy4e%iGziE^8e#e1qUfE5w~^iNEt_!|b@E z%J(P|rBW(-$A!Lp-BjfS;tLQ7Dby(91pb$-l`IEb!rnJT1@S7tH2d$bju1}ex^%eGbdka^kAfcVLM5#`%_UZ&bXCsSCgR+b6Yu%E}6EZua}(UYm*L#0)qIn zvTu?3C!wKM-@Ef6+7&?+iw`9Q`J}ThLaQisEJ|sXK*+g zW5Zgth*{&$Z1Tt&JRs*~Usp1q3Q5xfdSNT6QNKHICmZ;5h>oQs z{&=hd3AzS6O6kx)avBzGIHhU)Z_V8u$zBg?J8M%NmSZax&pUAkK41>MU=TM#pvINk_gx!*w-y^&wV$q(DLKO-w zgmNdFj43ErBz>?BbIK{bMDv0OOz*=%D1m@4OE=`aI^x~cnwHF^{=5V-c~O(%M&XB? z&KH`b0H0ufs#dxYmi287S=07Gxq}G%g(eApyBb;=Cth34@g**VYPfDDzg6smy8iza z^S42i@-U={EKfm)q(ff2cR>M>_LDHCVy~YO6lGfF`JSf!0mYZbipPFg6S+tm8jHB* zKf>cF#V!fa3gRe4pglvo6%)pHGOckMbWztAX@X*PyJHg zR5i_N^IcAR@1olfR-WvzCc(7=&e3f8b(-JbE@k~0pMTOs_;A2zX8PledJSC0*#Y1)|FtlUZjD`Drns^7zPK9kF@}DASqd z4Ps)kVtpR^r*7R2dq_V;Z_qjE4gwSQ$8WK3n##4SuXA55(FH;;UGP3?%gUY!yfK$w zRKHj*Rmh4qIAfFmG!m509k$`k)*DzN)0Ld)7AKozP7vo{gBi=JQcD+Ked1{OxTfdf0va96c>PG?Th2vzre(taDoFQ-Lpg`?E!++ z_nx8Vbc2PC&~+}b^wG?+*WIudI##W!@F~Hps<~G*qOX$^w7>(;8J?T&r&~SyQc%|{_=~i@ zP0rO{jYnES0QFVtb?k%PLqEZ6U8CKy)YdMBC1^P+;!i$>gGj{p=MNJq$p<_~rHmBK z{dmYuB({0SWh@*z_d@yrsRscDAv$B&Tfzb{GM>k28P@zC2{2;C!b1*{?#MDEc;v_fxlfHb{aQrZThhe5!dZ@66We7TCkYkPon=&mPfyVBMusXq#TGFsQQ4p@xl*lW-OeblOq z$U5AW;Z#JW-NL67%#B0_?kUTWq(8Ib9JiP*^6&w>XvOu`h*1F00gtz3kJzH%=y>Ft zfmBft1fe0usssR^r7}M<*vG0!e2#jNJvE_XVflJ_=q;eVr{;@O+r*xNZ516+{tzzwgHv zz!$cW_}_5>pYL%4Jzs-NAI8SB0#qBE{H6HEG92p2gE$3JSe*9e(Gu;q58So&^OGPx z?nEfL!KYonbaHzs$P*SK@#4;`VG*?_7t^`Mjc-nrt`%T0dqm&N0}Z>2IT>DVHh4 z52DT}$+IgrAhV);I>tCng;}L|vEy&GB~dLOL`CQ*jp^YiqUB<|cI&SYI2lY5G2peW z{6wS5wl%iWE_!*-X))=RpmwR72)Fr&!9g`yVUn{YcCpz{Xt9K)Kd7E~%1j1~K04Jx zyZx-U%VwI~?wHTjqx9GkoE4H;PhLk+6FB0xdR=g%jU{nNO50x_{epg|vFz|%>m1~< zo%U)hrDaZZ$+46TZIwEL{A#G1>rfKLJBjN?57I57+hsb74plLU?EO7+xB)e1>4@>@ zYRKlnl{>?8euty0lp#F&ro2O)k#x55s}c!M{Hv-$B<)n$GtWU@d&1Xx&{}#Qto*W! znQ~owv__noo*7jhbeVs{2#T-*C_nG6Au1|!z&soM`3_PVt@uWi86|*;W6^50mEkGW?H}9=(GJ99TRs?Ow?y(8kGcsRp(4zhvx5?w(@&gV?MVBOs^$v(YnW62a44S z=m~Y5dTcGV^;m}Ro+*$)W`BM8P zAsFwCkSl$K_v28p-O#YR$0m=C?yiE6p1Xj!`Dn%{QIRYuJ72kWWkU=ppRYbCp99@M zslFVzxPVucc==^-YF0K{M90Xv)jjDfQffpOb|tEpLi;l^jDM&dmC$!DbiaioWf0L) zVEL~HM9F6FZ=S~-xy#AEZfq+h{vC zcBnjdgy+u`u;rIZXef{h$oPHP7rJBjrYuP=WhDJ=&(0Zcfqm(lk&?hAxwO!G7!6a+ z=7nOgz^JIKB`Z+8LQ*K>llAWz$7!&`%QhSPZwdav&w(yG+sZzJn*g?N7t5@89%{2m z`1Y8LbiJvxGO;eWWMKZ#5F_^EBk|AqUt{7Sq~Jm{=ELucvU~H?c)~PzTe+1dRAq@L zmj||v^TX!R{;C^OMe;1(MM`n%AVJqzRyI|WZ^v}O5^rTP5sBUad>cOlRZTe-8HwL9 z8_x5Ql+>4!H-tq`o74oxq&XfmSi2Yw z>^^Q0kEZ9Bi%vn882K~i#FV#+$j%;nVhxwgeEAg;!IvHYgUTA}Qq*_bVz(OO780nRG*amNk7P(yG7WF7`bV z6dr~?h+C2dLt5mUy*|U?l?R6L+pGrDQ=~PkjI-xR-v|jX-gVMHOrb_f$GqP?Q9`Ub zV6g!%r zWd>Y*z~ORUBaA{z#E&yiIS$U;eW&o1OgKgh6f#hjP5d=l=i(w(R^8o)8jrpOIo_qf z9S?PNvZtxO+xito`YxXd;eqDua*cH~kK<%FS|fj|nkfGVN(3~OOaVxrbqmi1ci^j7 zpYBzFeee~nrfFAZUt(|ZAnpBP0p+SNz< zJ9kOsWQeHXLq5B@(kV-(i)TT`=O*ig={}w15LYXR6I)4mOY}yGme@B*B=rT3p_ApH zbNu4@l5>q|>C5&40tB8#mSyCF1+hrb&Pb+XLBG<)m#T(D3vft7cbve?YKP^g{}YDZ z$^<@xZtq)(0Dk43Jz-;+TiHCWDG1JoM!)qoi=lYdb7heRU)@<)28jFLmZF(|5`+V6 zNgk4$wX1E{q<)GJ-4H71*{0XPL(l1b*!so~16*OQDpSRHneXU;F~y$h5RHLr{sish zkZ&W_Zk*~DLDq|jB#cs`xK#oB`?8A5P(xiL)$&<~Bw67H=S1|$_Lpwza?QL7Ee#Up zLyU0dkR$8&a=KZ*>lcuBizs+O;6EG4gArhs2Z__0^(HBW%0jDbH+DoZE(+F$rit zjuDeRpQk2+dDkTbZM}K3>x?cHXg5rz@yd5v~4@OU!lVKpRP$poHn%XPM zYyK=~g7mKcjvBbgd=4qUIpR{$OTgO(_Ar?53@tWg`&Rf6EGtJX%;?vY8fU@4e0G=5AaA9fX`IM;1IADJL#dY{!xF2bb5rDy)C5|Y`O)SzOTM+gYY;@| zw;1mW+~aOV9|yl<-Kz!{dBXc{Rsr!;;@H`LiA=~E?Oo&yN(PmxyPm(xtiAvEB`}%8 zWEF)k>rd{7Ou}X-W$^yCS!9H<4ApJB<I(Z@b!+uFl6 z+bRzfQY5Y4bY6N?cygMSGIzhPXS;y4r%fiSzqmD3N&XQcV^`d7JGApmrP>wu9pN-r z@vxZq(!3w^Rx=!u9w0G>glmY-aNQp5`!UnA*YJm z>5MY|Dwty!vFBZgY%i5=cnCH}D12ES6tN7Bp6-M}BRU=@P3V9&g|cEx@93>_IxfeA z@FuqENF7@y$cvmF5!zeqYTB~6z3V#e#+#2rJlC2`L}BqO9!vHvK<2Nz@UEAF%*K?n z$T|tt2;E&ov}PZV(}SvS(;)FMbb;80KO^beEd?M>tS=PqNpd0QoBYL3L~Tc??J+m- zk2p`*@$OLW48B*{&*WVItP}*&6b@Hf9pR05;HrHM#)WMiOs6~pIBNZx!w zrPiT#lyK4D*8`JA|D#jxgZm%vxsGZFa%x)Ziy_ELu`0KZPO&O){Vl9sd(|C~K0$)D zNGl!ZJZ3wM49b~g_=ZJ1PlSy{dlFoVk5ykbc@y*n0!3yIojm;}FZq=dJ2^iNlKfS|hRkR=`S;kQctMz=gV2Mv>er{vUxHP-)o z)cuF+?Bi!t$#3m&$8qiH;Olg&4QSEH8&^f>kDL`jUmUGqjyjovRYQHOo4t8QOGmer zdrUk4TWufS!*r#QM8f)^ZX~piwfg4Q0_96*M`wfZq2_MQODf?2V-;hEWcXU^Ar~pz z#p$hz4S|4bXZ0wef{K@n;VXc!$x2d${ajS^;l$eUZy(Yhz-QvE8b|q0)vO zeK?b^`jQa(i6(+gS&?6+=Vgy!pje&&?>A5#um3}R13HL`1I$Myc!Xy?1zMFH) zQSEj0$Y7W4k^Sq!yk2{$z9(>G)cvz)WOJwXXVVtT=XAg>JpY$51UWiYuDd}mRwahM z%9f?Lh>U{jT`}_kr8s@Wc9Kv}VL^8#QOT&$R;>D;t=R_m0d^LSuQ~%wY*LRbrw-a# zG9pNn2Xs9WqD1=w;Rs}|lpg`CrqorI_{C$BPmtC_;zFI8V17s^;Mk*S@{`rP?5^uf zsou<@{2tsc={!EwYBOa_ykYR~V&)%en@f-w_^A3M+Gscq}zaowURGvsl|LUwb`-; zvPf#FCxn)(af)H&CKB;{YwOIkRXr4Bi(zW zx0h5z)8so|1Kb0>D=D49mSpk1_NCA;zZ~^?Y4@2a1OVR;1XoFs@Gi$`|MYg;tWfX2 zgS8sJSB)xKbDy`alXoq&{VV_;s<&(vt#>m|K9HEEU*mddnMK>V6wh0sDgzjw6ZHhe zKP!0mhULJ0bT7&ff%Cg8NMTYWCpl)E@Of0^`292Je_pf<=a5613{i(Zc{%=gIc0`n zlZ%i?KZY4A@qIiO`yoc^{#Wf+lM0pH-b}zKBuO|N=5an=R|K(JJPOk;{7m5}$+#Uo zod4V5=UJ%^sPkr!7TX|OP_$}u%1WT@@t!ZvcPp8+x_uF@QPNW@IP)yaYD!GhphoKZ zBpH5t^Z1B$IN4bwR84i1XAHkY55K`8F`Xhn+Z}(oO>$3VQQ&18KF=@g#4EBG&ER1# zgblD%LmKzg+n?_bzZscKR>ui32;ym^z_oTKOZM9zgthB%2w2z5L z>k}NpOFd)i5o$xmAe=A2^L9I!?m5(l`vuJ#^?QZpTN1Z-=MKEOe%1u_QBG#kD`-dF zvZtVaa^Jv5_Y|}dbdgj<-Rd7=`Yt#oj>`jD6VRRCJcJ*DljHM~n=z5hLf&9D?B)av zowQ!2vcpP0IBQerz103C#-!jlL#98em%s>sL)b||Q&<5M;A)N{QyKnxndqEDdVdn( zJz9kl&C%!UokMMvV4`6QxZaD$-9hiHDDePiBpu*>tLxO)i1>tMgNHR`T%sGZQW0 zx+odHZpfBdouSU@9<}VpMc9Y9hod?WBcW}$Na`d$~&?F3IaH zkyA7?Iu$XcL}x_%n@R$|HCZa0?ulV7n;PruDclAo*V;l zM)N;L-^0(+b?Q-jTFTc16S#@=)%7;zrQ}IWh@|(y@NcO--Vxk8bn_RnOFdvx&fWOH zF%rOZxrJgMJr0w54=fTR9@FazIPqpn@uvE8eMkE5i})`|_|x)dsg^Z&Z&c z(%G&3dZ`1Ycv?*@>`wVt8W%OBHRwcz;xs|HOr&7qITsu`-_uUSrmvTTt?#zsi-!JS zpBxYYZK%%Xlv`jZ?P(wWg8#rZmMvf#8-OMo!K~Ap{ z+F^3hB0FZZ$)J>&X4SQ6P^kJ^ie`LMyy5Zgq7|Z{mH@aTH(eouzO^HWGfOs1N~zQ> zUGvnf%@3ou`gF?LG2jp`jEGmbs9DVzD$u~IH%akkXYmPISSq$1LFYRm-;DOM*J!2U^c7? z&Qd;D{rz|z(CIQ)*MEH&fuX+W{qYOg=DHzqB#7$mpX#7piO*{JFLB9c@FC%HSuN@w z4dwL!v)9{oNMlP&3}G#)!0~N4|dk!Y5L+ zb>}TQdlsF_lrNU)Y`S%mj)v9RS^~;i%~1ry?IDUD%jVpj8?xy#FCRlX%^R#N$9EsN zv4p9Le+j3EIxM2^=eCkkdj;mvgfgZ$Hj?X73qR_6(#6PErSGRkK_-mW4iGYnh6%?F~FAYw; zt{oVn&O`hD1s~!1wnn~P_uAvG=yBu#MJ=8=ix0c3!9~cCS@xjmNGGDnyhhy9;{Dah zcG=YbQgc(*=NBNjy884)Sv?%=kZn-pO_y3oWRb-{nCz8K3v7dy*&fYxb&lK2Rnc?C zWEosFQ(i<&iO7SC!zsMgX+Yw$)sBvlaA+1e!VKQyGTGbe#$K=`JGD7XT4{9o#zU&B z6OYNwd1DyW58yTUu{jQSlxJd)T4iJi3!TE{_`IB-!e+2T{Inm|wZP%nxoVUZHN1H5 z#rR9y@*HVn3Y`s$+T{+S5K#ZDV{E~<2CNqfIB%W~Q+cW9Tl1Qt0IvIo*GSv9&V3MF zj@#p3&6=K8rM8?1j3ROmd2?L}$ENWh@2)+f&i2#Sp2zO5_RX_}Je!cv#Bl!pWuke^ zdp&RrAc>bs2-4*?r5X<&huca?T!3vO(wZpYPy=+SEXY0WRCOntaTZiOjYs<>(HZHDpvAupfI4YIh@wDq9cBWisy!t(#!|x}h{04}RN27s5Yo9z5 z3GTd6?hwubibALge5p*p^9&Ywc!bzb&+iSpd-IA1urLJEq}8}zSx`?t!k-+V*`8I46~)tp1>Ls!qSD0oN8|6VZ7#0 zpvYMo0h3Yh#rD|#w&Y7It#d)6^_sD+&gC=y#uPkB_~|LL6djSgy{#r`w4=wnF?r4aK9xH!^9{eB8$0v`@EuHB!G;qBA6bxiQIarBKT zVKflKLi`3EK+bKh(pIOnvC%b;_So-u(Vh8nsL5qp-cx_M1@1D>6y8AU){9zNX})cS zj|`=c<>jZ$``T$&EbzNI(M9-~HN2Nq+ASn9@z=cH?P}4Dd?sYeJZG`-+)@!oHD`(v z@RFLk99AY3ZJ}KxpG*ae5!juLBM1G*Civd@g9A;O=y4Co117+lE^{4=|lU7w3fhI~JNxhNLUiZKo62 z`#BC5jQ(qo~Hj%;^ z(bGD54+E`!97)15@UGmOyUq~2U^-nc(BLJE!*R#xbO&4 z*FhVtYCE<}KIefvw8eqPQyB@iRHyKOpKP{-jP}6^ z1WxOguC55d89zwDexkS6+d`r`h5(bw50`LKKjC4D_i(1MpgpqoMZwQwSSD$CbFCGN zHIih^wPoOB9FRD_mkX0O@mi7I(rS>Uh9_2K(JQ>G4~E7&jgLmU5Xb+uxn8`c@ji9p zV}zk4aV+D-w)|K}rqZQtVaU&e^Fso+k*~l@bQ$_Z>m8YR&1F?b_@1)tictP|E7u>x zTEOk>KwzqB)sKEu+<}8|@gUEK1X`2%n{3~#FD7v4A@a0ONfc_zJ41BV8*sy;hhdRoDjOMSy}Ug4rjkQtAY&qhs(1G~e z?(KN>R_PA8j`GLX1v9qm^e~}ncj;`ZA4nyD!^~w>rw0xIRm$R=+thSN3XF0IdfJ(p^W5gIek_jM)ovMO*KHXDkn^k_GKiO| zXUuJ>bwPlkA%Y4YBS$lv7Z))zx2Cg3t05s|Hc8xVcyRgI4+sR z34bdZ*1Ax}7n8pTsi66A-uI)|o#t@=}HfAObtX@5JHCeIb}Fknwa!?Muw( zl1j$fzz>c{pq19G&RMB6sP3G-ty`UK#m8bIT0j*5z{40vQkZQf@Z*HP7||PdpEKbB zHehbL;4m#-`$e~h%-*j$hO0|esp|-}$k%Co{DRDcz*sVYBaR+4e1=8Z@y8*Gwp~IZ z=sL{pY+Wo11yxjK1(((6mzw^cv$7u_MgvX(fh+WO%9cH+M zUL=y@eQ7Lv!1JTFG&vpb`tOF_k#sW^!1WIdWkCfu^-@zQ0X%{WUl|T~hK;#%#A`~a zhZxO5H*l?$FNK{nxRrHs_m9_n&(`(?-Y9u` z`;+Fs188EL7uKa4oi@ZtMJy^ro_Z;db#B*8J(r*Tz{LaGR@wsvM$|xG_>k}z2Jf-) z%o;prg10cz%vDI-Ovq3!_{9P2MTDB`DOTF_ASt6-+IO0%-Dhd-;Tu_v-j^1bbWP01 zwuVw7?l+%o^_%k>9ahv4G8geMner2Q4I&1tJS|;RXG_ZU)(ty>MKNlj`8Hb2@_Up0 z1=hI9fdDe#*cL4I%zFM~muDmtHc%!AqHp>&BQbICsh)vLHKll>a6WtMI$CDUmL3ZUWs#) z<)L8dCk)-G?=wcZo*{-?PI(2Lu9D`iE<+_PK~6 zh{4=GO>UU{hbf}}6J8_A{SV)M6sF?bw!jig=A6QuyZ%;y*Pd_LiNq?dv(7LKwJL+H zoGfDN8~$;6|HH2df58eu1a|+b4`Y(1CWW#`5yGe+^(t-5%b9Ssn2>q51db9x5X2p6 zI15%7`Km=y(S*r)s<>dlKo7SzBcdBc2I?vmpF=-MI;Pd(>vk@?7jI9EbiqXkI9{zE zXO0FglzE%M#m?V}nu+-JPB{9lE-}#>SkZ;L#o9axNThAu41@slL|2Wz3-gMykBn*b z!a-@CNIJpCHvZx?EQTey(TR1;`MlP0ovEYG+}i>+Bm7cKCg1+i(LGDh7sFo`Z_j%` z!204g3ET#qNy(p7|*v%#X5l@p-?F!?tkU*E9OUH38e)W+vCwBtlnQAM1W{J|1imh7(&iR z`AnjTa{a7vEpZ#*<#7XO4MH9#Da6OQ7!a4;vF&ds{g?->XDF$RH=C&uio*c^N|KqZ zxpm|}e%9#A#-aHkP+-s@GQafm_`oP7DJ|6JPc7cP@YP1@JZl=I43Z36>4|u(z9toCGFg$x5cbdU+AB9hX0aE|5kyxb!(Ej0=nIP)d z(pP^)B}uom&HFtfYy5J1bTgQ|_kQaH*7`m@Q1gTULm6ka2a#R7C6IsG<;zS9uZWDW zvXKL#m526lDM_=isL_dKHcbfQ(~4_Lb}OQ*?&t;T~$0p|$u2L5XncFk^d zG|(0_Y7_smd;A9I@Kn8L7SmT;bQ*~%s1Esml)d#=({KDYE|OA1I!7tpAkAn{5htR6 z(jWrTjAo;|5hWxhpnytucOwj>89h2j4jA#>`*WZB=g<8;=lTa;=UlIIJ)e&>JVtD( z^XH#2qqw2pe%)hPANrcQT$ru#vFCHvzq|m&OHcb7rT+GVD>l+Ikc181K8u?g1 z<)1;zdz;C9Qg@A^Kxk{vd?I$3y5K}g^pQ%x=MDCm^{c+6*on#N{}OUMpjKYLMUsJf zk-enXU4h_R;j67CI2<~Hxx2Y&5NIxfZ!}Sw_O3}P5r-dHlfkKEzWYHjEttJ&%uO%# z2e&vro>=-%uZM>5etl71s+a}BuAepS{Qg7t@JBbsqjg&qwTFlwk9|o~2iK#%Gm-h; zwp8z-w*KZsofu*Duiy-4lrlFFRz(a`%eYR2n1Iy;shrL3S>Gy zfCFJ@T&J0+ayK{0Tb!+2)NPoha>bh zu6AP)NPUE&gUq5&er%G_n+%+kec`TM9mgj=?QXlfacRPiAkU0>9*E>X^k~N%jp|Q2 zUybLYVhEmUw~WwDsX5ZdZ?RUNr${!a#pE+=fLG>4wK~tXKg#AVEoh*b5`u!WEJ@plN~IVP$!`ta1^-3BI^5I zHrA*@_5&{db07>{H+1wX!&PvT%s|Ml(a)5D^Qqrm7tYSkPF|Tu=#Gr14t`T+wh(T* z+|IQ*SF^jPo_&HzGcO;U{DiZr-7Ct{U(}w1)0v(F<%857!x$r zxgLlIsZxMoSLFVOH-Nq2>D!fc^pN@D#>3zrcqtqrLelOO?ER%xXKBy*xyMFZ7OK{?j476JCKR*KHT6RSknB6bQnx(^g z;pz32Xa=nS?L|^#nE4C3^DIw_X7w z<+>rf{Sch*+Fd65czy6ao#u(QN{5*U_9mkm{x?T{P5u67YE$NbZbNDp4vk=sx;N1K z8eHo%gFdw9?^h|>@q#Jv2M$btXoY{=P%CqBE&{XfH>+pTA1?U%@I&a-zQI;SikHe~ z-Jh3_<5cCiLWDT7&ojsmfWYu5a$VzE9g^2`@-+_o&M(k-?L=HeR*$2ShUhHL zQ*ybp9!1sv$RV-x)g;MO^o*cjmYze{zbb50Ak0j13U9P`7r`*)rItFsDdL_SXwbmb-68j5P~}xuy$-{5{X4mLqDOQ|fC# zZADqM%U;J=1w^0!>Ht>$(H5UpT8VrGauso9vjDL3)@(~|&di7Fm?|2UxcmMwtBIk( zYarfK6^h6Ydg_E@D5h$x1?50BZj}84orS-tp9~!F|3p8l7cy@cBm%J5G-3Lqe?i|l zEaXL#p%Z9cvB9IX@$qO1MRC^mKOb6Ut4c_Ro6;8EYQS`)h)B@Y*a98cpX22`Bq9*d->1*|! zB7xoiGG5c_mTXL$JZl8r{?_;e(k<8Dg`%2osgzNgr2Ut;a2RP-f?MoiQy)7_V1>qO zhJ3Gb^Y6C6oWqs5@Mfk!E0t#f+hoSZ6WrdA?2mBrUT`s<7Ohh_Y@J>R5E$H#Iz@A> zea~O0b;|5E<=zLlyEU9`%Dm5%uFNibTqiL5FYz_;*+3Ew87Jr4_Av74INOYuSw!QB z-6xz6dj3^lJA{`WCE36Cq=TCV|_5^ixycWDfdKGr{H^TT84{Xq+wEcwHy z^cxB9ciK)AZFcm3l;eAT6j^Lomebll7{udu3Ed5$4D*5yeEf>```@;iDQV{Z&JBmtbQWeh!$#jr z{jrx>a4qrN|JQ@ltfCUYt@VFi&h+RWvHaCfJ~sYf5B~O$AbE-=0sQL$JdaNoHzUw~ z4D^;MGfpb z)bIMJ?;0c|R7&k!rgI^s9_u}A>K|Y8Y4V@uM+@&4TnfiJW=ny0FgfD|`^R(KE78a?c|jR$IPq4Yb5ji?w%s_ zPd0|@WLA9R7srWC4~Y|vPlmsiUV{~N5!`u}@RL7l=wGI9I%6BJij>Es#fB8d0cCySy zamK`DV0XcAj*B|+dGOQYmrcYu$y#djUnT{{%ewG(%t3d8nbI(x=Edx~6+7@jBo)rR z;Lj=W_gt#n`53QJH&gn6GY-Fat@rAMiyiGTj47w69=1JX-f@XB4s^Bj@4(8tQDvIC z6RwQUUs8P@K&9YMD06Y#|6k9vRB(SkzbP&bqw7@`z8Ch^c(%1JOIx6@G`V`^fU{eP-W9R zfSdWkVoJ=~di=b0?Glwe;G!`)*ayy8U4{K?vX0_YrN%Dfw!>AFMzelvQI=F+&qC3U z#}|z&$+4SQRy1xE{VIT(Gb2+WSsgsS19$yTVDS4L~+;A`^W|6OI z5_wJqvg~a9^R@ zt%&5YzV(f=RT``9cS=D6_DSk51PPV@N-BxC;ryusvf9I!AN>H|8Gd0b=XEQPG=L>y z)yd(JWUY3{MjM%Ngj&=;t;-mcukSwep_yOu>fpr(&14!UXCofkCpFr)lm+SZfrP8PdXzZdS^`uC{@Npsq)(CjiRY3XLl z;bPtQm*;wc5l>yj;{FZ9+gpF@56T(xI$R*`+JK2Q?~%A!iJFt7pFbJ@__rclC)Icm z2!8}6t;+&wst{;=HzP6OU!mE5IvWTrzq?03XKZp&4TRISC5FhvS6DmOz04+6L_m3L zEDFNSLSHY;$W(won#Ym6Rw@z73Ip5l{X2dfWx-s4=Ficb%Ip`Jc8H&Dnb&6blaIXiZIRpaW1_F~dT!jvRG^OgX%B@K8AvP89XJm2$gFZg+GPPR z5-?oMvWT}mkWNP6vH$P!r#68B#|dfkQ(KqX{Grq`4;S#M*k5l4zqLG!G3d{UX_9B7 zw6VpEMHtwqKc7Lv)q62OFw0|p^)SuN-?=r>)$Pj@^bhPo-cK}7{m}Wo@|rxE1PZrs zBMP$Rmvpq3I5kYcgvwKgfJf zu#w7fW_78n^}?36S`m6}bge)P36aw+;>mmS>_0n+^>)TnAYlzs+K*&72CR5K470K-JlNx zk8?t=_88h6vEI(*#Owiol|U5CQY83RPEglq&+NRy8mec_N;Waxug&jv43~ZF$bkk5 zmO<-bx|*zIo$C4$iQr}i*`#itT4&@Z#LeF3dDW(QrSes`zDUG(SzfYLZcx2@Qv4sy z77EKg2%^n`rgyV1EI6v+(XN5E)z6>SXQA=FEPJ9%m$B z`ItfVzFco@SxA$cma!uFryAxLK*_Q$KgBs1domNPe~x1qW|g6L+O2sA_Acu&d@7Kh zk(!Mp@xx2k;mAuP{p99;y^?qATVwpV{MLVP*w{fm_ZUjQ0lnR)e97Ry?cG+J7`Qr4 zRSxS7*KEEwK7z-;aU|1rS#q;s*j7H~9anXD+qHz;uUpsvNHjCRBT3f%?=HaS%6F%b z1ABWC4O5fcSeve3gC>}&BsGs+7?Yk>6WT7SojBQx&Hz#SZKuL;r7u`@`M4b?6%wmL? zD`mHQaTjWNKN<+X>QZOe^|f5F^!en6FoWU}T0*~e5S<@7b+uo*&1=(w^okmAW^PQi zhQa*pR@EK;pQHts1%D4r<4aL%9Dp4zaRbW)0L+onB|5Vx8e~{({Zg8c=|@~iWTn3g zGS=U3qTl!x5Y>G1F?+RTbE>d@6?R`51>Z_*H8xAvwZ75xOO z`?dG=m+1t^JU?>8Js}SA#iMUnhl**c;Vf)!!2nHP+Q14$JE^BflyZ-Zg;LH9Xbmb7 z+(B4Akb;NZ;nC}Rn&Q;EN{PZDGGu-qtrlP#(UFc)1_HKolomGFcj*oRfoFa!QBq?` z)x^!5W88F!<604m#72P$?ZCXZf2L9aW9Bl9dt-kl6vjW!uCD)?w{u?&Q`k3PjIVQ? z?L?rsisJ&ek1=lhH3v_2ItFMspv;FyZ+4F!Tsn}0upIO6tGq&6+CIgLK8I~OaW8Na zkN5j&l)a->!lC&Lm>p>(KEM#w8>eN;x{}jnXD&u@za(78;ORwora|U^_sImGfD3h{ z<0CD59|6?BM$!0nQIPGQ36pFtDE$Kxy*`LrK!fRI=qHd;yyCT24G(5O5Hawlo z*oqace;RbdquI<0&N zfK-ch!7|X=%Na><=dG_SS5&vwWS_^ny3dUo+cCu%&s%`{_KSB^SrdimXo4cS@AulM z$P9(TB%^)`8Z@-7Oc_Ts@bdVus=gb$+3Ng88A1LONpQAmsuijY}QYA_E5_dq?DBIcsph%|3Zb?COR8 z*%^+>N#df+!?DE-i?L=EhtNB7*F{b&9DXB9@W#77Jvh`Ahrw22IBUNr2><{UiAv|` z3q%!K?Dg;dhV3@eP%#W=NFoU-Y29B$Jhj5*t_Ohk7F+rV*+iSs#>VA7;W+k}n`$Ah zda=b1mCGnnFV0bAb?F|Zvn*_TK#tv+ZnKA9O%xW}B64n%n(?25{l+t%IM9btk#T?; z$QJFj)Y7M>iGdkl_wV%&V6}R0PS9N*)}VPM5FuEh?RJ>#yjMYTufxBu36p_`ex16M z8@klx0eiWk@5v^A=o_&Ts(RMRTT1<*mU`YSY;-MNrtrJT`x)&VUm~+0XZJ*d!jZuXi7Cz?uOlIjS;tVL(odex_$bwh) znzpiB_h);^=_u>)DsQKR<_3k@!^P3Cv1^xao5{)QL3; zS?|W(e0M!!$l*tVnZ~C&o{#&Q+MgAgSu@KAmG?o5b$cAnaMdRshWm%IiG{~P-TpW= za|+`Kfv>($s~Kyfhw*0Pi{Xs+I}`TO{u^&t#4bKEES{<<6=44YI9~sc@C<&FGuy!J zHQhZR66C*@9C>4ARaQZEzcoYBb_RZp5cPRYM8RfBNJw~~7oGF<0$u)T@{_2fpY2?O zll5RHFX@9>mlADQzHF>o$I{KY;gpad;(%4D^Ux-yiSI{#lGE8Y&sy8Qk1W!w24!U_ zyt?kHd`P`i8D#3ZU@Edyi5SY^`8OSDa_R*HDAR(3O&cf7e7C)G5)W^dBdMGN2rjpl zVG<|bF0NvY$?$KD?C;^?uOwm6>IrR-7D=7^}6Jz;(PQ=XyC6Vd&!;SG?_q^0DefRe$qn_4x%4n)47jn#C zM$I1aK<8>9i8fuW;Y6<4r1JH$1u*{+elyq1=(p*j3l$Ec^!<*`fEVAE$)3Mn?vm3k z6=?NDQevuWAQ(_F-{Qd4X(v~%X%j~)`OM#}GYKOK%b`U8Gj?C2toxBr-%uh-~cz<3V z3LiPtgu5*bcM%x_ib)pfBOGZrM}6XJDG%FssWjzIH>5s{-m_JyVBPHZ?lAa(JU10f zQnb5ScCy=A&MY=W0G(xrnNS+WtaH}rMCnJ^R}6+~wAHMgJX3uEFh9$eO@%BRm2u}5 zmJ5%mS}It5_qExZ8BV6U^vsHeiWtZkL~3VG7#hTq*1N7u?yWHGKX}Jwu|rcw!(jiTNkkP(3u3@ z`|}ZW71pnqqv%O`vJ>gJzVoDY#zAKy(@d$!|GgcHN+zdSZ0y~^+zH;E`}>*vBK1?y zG&mq=;aXa;x>ZP9a3uw1Xl-sptmDMKe|4!{@eg_U!uzoD zG+_{<+*+kq)P=EZ&8O(eyF1m=Xu^Cr&tG$E+#+XX7dj=BunYYLhi~o!;RDkyGkfIz z+@<1m3p-{(0~xWV6CcRV%2&wX0viIqk&gNT2Z?v93QB!!ownEMVc>f-OBWK1(g99W z#SMRkW}+cUD+F=f_I$%J1Hw!bt^v9rCcxK1+UIM_gx{RUBGfr`pDaBt_0ZSE<86A0 zv$q_5{Q21*2OJvF*;KUP0eHuke4B9N>Pd&=ft=5TNS30-(p6>~q(bL#v1I}IAko0~ zM^2ok={c^y>Xjy;LJRRQTzTpCKw+s$2`S?PV)XWn|K;$n=uI-=Vv>7#T6N}@v(Y?}MeWwH2yLDZ~^ON&y^EvhZ2>L-~k64K_gnB%kR#vq_+){rMvxyN5* z!Mkh~ZfG8<{cX6H&Squ?@+3nThhVa_J8!Wbgp_ZMC>)mODET+OPGNI;$b2hTWs8J& zRSlsML3^ITf<)C0ON-&O3f>1{Y3Ufp^Sy>zQou-yIEUAG`z|)A&rV$Jf;h-ADp1_czSxEQPJ;Jl!8$wIT=U{V9fFA zZHNj5n(-y&euGIGNPSN~#87bz=YV>Eey0yGy^=m?i{0rmxMx`Xj|V$1J=q%TPn((QnG*^F%YmHcohB2R!aX&RbuC{w%` zesweG;4;@3Z(Py&&sDJ+P|@1rf7vd@{%WW42)MRmENECtkj8X=a~RNAw8 zYeu!akgz_qTfT5KS@XOHTo!V2cQYM`Gu9P}qxSocQhd+~E?q<`>wq)fFDHGVqsa5I zM8(ib#?Z>Yr)fHV8Q-ECEAMgr&M5kGRC4$|v*PpAQ}fB4nlx^`hlzLBX>Dq(-c~)e zFU^)(?{3&9j-68?-_3Ig#VyMxv4>4bKbL5!Uw7Pu8#x z886fq&3rs#U>M|*D;_7IVTp0wdE~7yJ~Lm=zePqp5G8QcEalx3D-{O z8vWDm93DKc@^=>^()eTqWx~#2Ts(iAw{a>9eu{5eaI&DOv$xPQB(7{~$L>oV>z2?) zV?WaF*>LR96HkP*xf_YbD^9mNTL}=z?#djNw<l z7?FGw5uXY3bYm9N|Imx36(3V^W;b|Xt5}Wsp1h($;vyg9TPb(^JRIDUjv?Ym7432S z56~8$0-0Cbl)71SY;1$8rk?M!LT_oM392^!cHPfD*|!EOJ9k--3@g6*_~Mz_nr`Cr z4>kAif6ulU`>7AwK>0UPC3ulkTgoN$6xnCid}K3t7in9}`j>dKQ;??TW3kJJ_N!+j zT@mviVAxYH7D18EgTiAz30~%Z#V*GVY;SsX#nxa;yZHO>x3Yy;q~E__*L3keXA8P{ z(Hi@0Yb6$l)1;gWVmWKAU}g<|Y+;6xrc~Nk5mGp=;;%E`88h}!D_)B7FuqxDqNnmF zMW6hPk5C6!@rTKZduQxcr95KG%g~EwK0or_u{-HWJ0We@{VvS>(YMb)yu(-*(8iUy zFGPOh+{Mi};=oh^D{yj})vG88k4w|~gDmdhVY(NseGqnV0_%luo<<|#dIwjvE zmS$U&%ZDs%q(Zi!B<$mg|FXX7ok>jw*2)qj}HFPTs8iDi!J-0``6(}yG*i) zz>RVCI^%KcU`N}Q zmds|5g6Evq!dkPMVlM~&?H@&lGT1JwMyV0{!F_KpH&;qfm}lYOqff(;g`rrlxvoT|;O9QExRz-RT-th6 zo1OXoNXpwJfE}{VrH?`aK>F7^{{H71;sh%Wj<&(P@91ATiLK}HWlCg;U~jcYNr(9N zg@(FWDh8wexh9>ZP#9XuD-U zBT*h*h?j{l<^&nxs@vEWKN-wQ_;}~lqom|>#x)BUP_K6l-idTKZ00nXMolnd0wm{+ zi`7}XQCfP7*Oz1*=kJLRP`}QK>Q5aYsDk46Cy0Sck5~Ag$IZ9|f^#f`d8IAr zx*FFoIyl5n_S?bh6M5_=RO+{@bz;Jp(%$ufCOOqX*BP0qkU9gdFa6XFp)V|cQAgHf_fJxFe5BhPoB47LZahS;ccehG@ryc+sM`H7Ub-Lna z&p)sYNq8`6bCtK2F~`eqPaLF2;Nf`F1?Povu$NZVu(Ov z5o|dayU;X21l&6v zd2*EF?>cNOmXx7yqunL-wpKi_nC8P^?d|0BQfJVyUS>OkpklR0H*82+ZZe^~a@X~H zlE~Kf{-?1#O|+~ugXgb|_z2$mXLcyQbn8ggGEql$Zxo2zdP?8VCr>tEwV72h?lmJa zu>D^5IDw~S?(`il>DDh(&V7vpZXp}lp&4^6?J~EA84#M+w{1_#>8RhCxWVXpx!7j? zuxMQD`O&o;4BOX-U;Q`~?H5I3&l})Mw&vKKswu9z_JHda7w+K{ldyjOXy5!ufm({P z=3{08vq-U5(9xmT&~DnF6e{v3$H()=(>s%YN({@)M7mj&16X&|f|oFkwwuG502gZ= zN1Ts=>Lajg$VyU_{iUB&FUH?Zd0gS0%LJrUtKGrytaETuQA%c9%39NJ^rg$+=J1m^Wy#G%n z!Hafx+NC-T_fn89(EdQr#RV#F*aOttyXEXjA@4i2Lab;otc1w`28wlYv&56qtno)k zC#qY=;Ep4+Vu2CgPq#MYEC609$iI~{{fQ~sy zeqLQQ3sE$tgZ&Ksj=su>V=^qIx>?9onTNvG4Kkcw;>eXOVp};#DLi5fmollI;TS}< z$x2>yVo5T?vRHA|D6B>_7;*MNiNHc9t*kriNUzNM!y37m?R<>`FG*@+N6zmw77IwA z=gDPp%9_T}q}JbT7s93NrgM3JdW9Y{VU8$=1$i21q#u(T=-WE=*N2MG4zDd&OU}69 z>3SKljYu!y>JAQ3zl~L{X&AOMpT?0QFFctW%TSOQd)QiM_sjn#4@R;}GL)DDcZaxh zxiJhnj;G?}lzs@)(~F5g!bqL8l5*cek%;Azw&|`BF~v=j>z@BMUlq#ven*++2sd#n zztcPl`Z9z&#hL3`RIYRT$nLS?ajv0I>2e!6hFsIe#HZeWTI8vE0a83H+-|xZe_l~0 z0%X}zu5uJsVO>n7Xwef7QsTVQ{+~;?97AKlK6G1B+R3X(?-ST=t0eOACGW#3%NHY{ zBv@y?g0r`=a12i;gcy-)mnIGC<1pDc86t{GMOcq{ktWw)R=tf=^Eh~1musUuaN7nc zd%K*N?GGfJ=nox^K1PofbapQl<#%vX%q338` z?{n7?8aZD5*}BTqoMWZOFnB-@GKfL*E>$azTK6BeA|=a&)Gc(~{V6?kVCJ zVEfnXULn0wg-^$DYY-k=%=N*~X~)Nlk$x%{QogIE=tc!v1ZwR5&0BFDMf!gWRAFHK zf|qrMi|IRLIH2TeiPGFRkEwg8lQ1k~6 z>oJ3?C-Q0bR$U{?shp7n33;6P(_DV`xoC^oW4c>c!w^LqtI@pQ@wg5kLZ!XJyCYHO zB5;r6mh5l&!{@Blg&UoP{D(8scUMRsMy3zmtHED@`jz5F5OREWD2WZ*4;dbTli9KL zwY4h&HQFojecBhUu1SCPUPX1$W%9j`CW;nePg;|sH7Y-`4jrb;l`ZOo41@ypx4uT$ z_jd%5V%+l4TaSQ0aCC$XBH(P73Z!I}!UOJYA5_6S@BX~;3FI->k4=FWQYoLb$MmQ+ zlaoK!6PqYCRX_m7`z1cIcX=EsAb!pi^%MVyQ3R5L-`CpN3v-@Z`S}DG&nI#w7PB}q z>Wo@K+T%lbk2#j&;^;w1LulIMBl#6e_~q|Us8~E=;C9AFcQk4Q#DGyIuKY}4kh=Uh z*uIb|VxRhuJ7!qom8e|#3rnUlM2FsSL8Gi_Stu{3V%Y2N9*pbH#-59p>J|`uiFT-T zG-60M-zXzIo}vS&lo&(Mdsh5SYNCb_+Y`U4s#Xbolt80dicClAm$_NFs+cHh zN8Z;Oxmg}()W;uTbK^Mqy9Q!mJcNz&jECYgl-|?Q8UBRaV~I zT4x-AR+R=L`3j=Bp2id#MV{|1#-~kKn-$L0^n7wc`*b^qn>Wk&0LKTex}nG4SZCIr ze;R`={u_$68A0iaa|~m1fXfn+#+-F&t^oLPuvI~*@A^$odGVdlp)2J{A2uX($D@qZ zR?GP)K92vT)nx?;ckhwsYRkRY2<&ef@v0H=K&a1ti0Xof=>_#DC5G^d?79Lo`u|8P zWa4NA54tdLx?$mRD5Nv%E`MfV^IA-KxZ&wY6GU8ngw0*`?TDU)*ygybVW00HemR5D z1JQf5&RM-sOP8p}&OqsztFwKSG)Fbl(@8P@wyb0SEv~+jwilIjxkuNGDfUAsFtaK#+sL!3(jF z+tgJFzm*la4kE5@8c-i(b0HgTKO_y#(` z+C(-~Z2G?{>P;2F%+Rw2Uv!3?f2nS^90GK^!fWCEx~7kJimg}Mn0!QO{Cg7cvmN8` zMS7a!jNvFgwVY}D{F(S)2Z*@ITmr2%2u=hk)~98tXidUbimw=P`(u>T`lnM_WVtJc zYeIRBX!JaMDFZksOWD+;WpI3LN29`1ow%AMyD!W4k*lu1m1juP<%L6Y z)^(1$`*uy7Z+;10S&x)tNfyhd-0(wN${nhcfu(sL5hq1EWY?8yg+9Hb`o%NKwIQ)) zU_5dl$W0=#c=v^&sgr=>|9wWkYY|+qwoA(^br$kC6F+?@9S+vvPyq&m0v^Sk@jK%J zDtpF{H1lS4USI6zydDiKKg_-1!p40tF0aZs;>W%!objvD9Q7j7VPp3B)f&UtgczczsuOs zd*oxHX0pwgS{nptJ-zMVW!%AP!YC09Uo_)K)Hme9Kj`A-Zh zJ?Ss$wr+kAkTE~1HHY?YN}ehDOvAR%_|fyJgreRHD@wm*9K8|ky9a7n-Ve=!uuYqM zF)G`%A^Y~awe97gaB%g$4J_AaZ+&{n4crMUf2wWXOjEVAtf1Z~(~3+M?_;WOAC#Uz zu==E3_3I~EXIU22843-(k(Ova2m`P5#FrK#+Fjv-UT7O(kC8=9!+(0jcASnErn9`} zR7|O&VXQBfbxPo|u^Q@XU$cEL1L(D2WN^FwMMfEGtty^crX1f}l=AI(>)k?Iof*s} z#^APtOiIbQ+If)XtcxUo!bE4 zYIpGGA-Nxwkv)Boccmt8!)@4@lNQ9z;R@b4{w5i67*hq<2l&~RQv1+jP!LrcC1Smz zMFD{9N?f!Kyi5xWejBQV9qvx}VP*JG`D73Vz&(?+AlUBVyy*psibgj_>H*s;VDmSP zKYzszb;p>*6;IkT;eh-E`Zj(E4i}JA3X+gKMw5a@{bIrO9gmuvW|rt>5G`Uw;Q4T- zjORJ)Q?9_kYa+{Re|JMGg_vHhE81YA8`x$3yu)L zonSCRW$Mr_b}(k!7BmpCZM&FZPU(DZ?8!8WNZybX$f7OjjwCR;+ulG?R)L3lNl?zHlK~*_jdONN3224Xu}kW*4+zn$08GL;44~T!Qo?9d7i=UW5bWTyp094FkHFb+|fM;d8ob`@P8; z2V0DZ$4NQo0b$H)@~QI}E6-+jsH@=Le66aS^{TMz-fGEg+6>nm_b1I7x}oKf!00WC zUoMAcVziFtso;XICsA20xZA7W&!BW1*FichCHA8~3Q`c4W+?|iIOxgtTxyMEq!xxN z%i6yG6d81BIKm0o_Hbnbn#QZRsven;7?4-FPi{+nf9-1w!@|*s7h_8nbF_jV8uk^H-UMV-nRux z1Sh@Wg_i@D*3RU8(BnjwlR;m1plb&sC>w9Xze^4%79Kcw!R0*lZjMw8hd|pYv^RG8 zewg~|POmpB<~Mcss?f;mLx-mOJA{24BYSyRXmO-|~^M#SpR} zcaeEPf`AidP+Ef68nvlpWpYd(+fUIL_%sDeS0vP(eV1dGI-Z|fA+GqMB7KP`wB{tz7!)B-P@NvXbzvaz0DhLBz8#VRR0EI&qpzO5lcqU3*o53KGI@5j&I|`6)#}#I5#~w#wnv+uBfbhHg=s>|t z*n}RP)Ri08V6vu*9Chhpnf1drzt;GA#OwI&(d* zVn1H1j!Xmm3Vgnm@Kt+Gr8vdql9139Wg7I>cg{#sDvwd}SYmZZZfNiLHR)R3#|V7- zwZD*t&8-TWMLRYP?vsvNz%tu<{k|%3ITOAsi?nkH%dxuAub}5V{!I%+9W*D>IGQ#rs{3)pcf)RLvkDd&^QLMw!{;2YR2+ z;P))fELPG>`n)ah$i`UAI|3&pZwo@(TU8%FB#P~Pf^v%tW}w%tR(|g}*tN<a*KlfrGacegx2oYI+&WvgfyjsN6=_qoD2+s{ZhgSa|H39~0r z(y~#sww*7N+{9<~j`M=sy6e?$nH*+oTtBx(iBbGa69j`9=dD|rygk^6P-poU_{Kon zdNK518r&{vD*CeGAK7x~W`v@v%Tt!JE@=6UO}ZUbNws5A=Y`yQ#n0RL5MXJlCPRr% z#lOkCpNBXLM?_=h)PIhf7>To)-+*^HqOYTNo-tt`6%vmquB|*LrhnJV`eF^_Os?I^ zS!x&P`%Ytz+j&J(>Nl^RypLk{!=GgK))^A-9oH>&#`SWY_yAolddzw91J{0my*C#+ z0r5#ATLD&#A7k%pgBZ0$d&giM6IVA;_c)zq-tN)ZLV(xZ?p%8 z*4iDtHjbL?+lJXo#q~NzZbfK$h&V>W(+dtw#J)sRp2QvbPPjgh$Yi^Sp`ah8 z8)|Fhk;bb5Ss%Mxck|Jx2vlr%A>6jCmRzFNpeK&;2f7wZF;!FzwGpk1pW>=-A8vHO zebxdPMKIm~wNrNu{NDV&goeI+s1JSKKE*y)W{T)44Ei_iS}_Af=@v4$(d|AU}Cr?P0$MK(10L9OOy zl**M0P3c+yuc5kKo_>4F1{Gkmsm-0wbf+25)$7`}LD4=)fB$_o)4`S)bw~$C805eHhPs`E&$KG29)zu~K;t3Mm-90!2f_u>5 z9`ry65Zv9}9RdV*cXtWy?tXB04i5L^{qDRo->u&_^UkmC{coyH6|2~r!(P36b@%G^ z^wXz5&b|@UiwrJ(Xs5p9_aklu`D|%AhiO*XBC){+%)RFvZi7N0a>w95S&HbTN9*D6XL@Th=u21c+bEIwFfHu-NDVGG=GE}9CR|}k=ruH#TFzK%D&9Q7*JT35MIuaUtJY3hi2WQ@S z_xAZ({%8t?*QoiXR$mnZOJDJ0Lyr;PfOjLCp`7h{ExVWFrfhyl4oqe_xU_8`2FX8* zICs3zjI)L(H4~ zxJ=9`&G|L$!}-P6cAbfqj%q?#ZO#Yq%Lu(3FbmY{Zk*aGyFysnYakV@@mZcPi9GmI zKO?z>wc|bdjto?p+vC&5pJk|zBG<#}8mZ%YN9`~4h8{0bovOX_9=mRG1h|=?$~Gy9 z(EkE%1J#FK=C{du0Mpler!RGFLl)OP0-6Ma-U3?e9U+@nQd4W0KWoI<+m8J#Nv`M$ zT`8Hjtn@<_O7p9-`lO?k^1(42$=65g18jKzQ5SV^Kx6djk(IpP>L544L`4I*6ZeR# z{n>7UnI*+0#_r2UPgkk+92YgH-dqz|bKHSP!f+fMy&VhuMWj!};K;&<`&?VsBy}y5 z{1J=cJ0bx=Im9^Q;tJEW&?7-$!NpoucR>C36IWafoTZ+YzUB)O9Gdo6&<7t8RY#$8 zAN&`L%`)2cJHzbz+vG))AAtF!etqdzrwY$JjCJ-RkpuaVZ zs=rYpM?y*(^rV!9d1`iVmWf*L-iSD+YL*wXL!YRHb!)G+smC^ctv zn8rp1;&Zs-(ANi2yN8-HHD$i#XSLA_DnsR;9HtMTz2*^B#CW~aUT9XOX9#~2mFqmV z*8&O6FbdqKL>T+T3PdX=?eKFro5O-g(|PfXo8`f9+}GyHvebhkWd@#A3F&GqQ=d?zc%MB4F zqHVJO;a&ZHTM;|Hbuqe&pX+^)uxvPP2i`4+5z{p3c~Aaz`MrF)c~eu<>1oX4;SrfP zq{Fo}E4bt5;|W5C#8!$?4!GI-WRAqAn3OZA=Lac*rt=r$P&Or6FovH;tI0IpLPCEX z4IcQ*I*DgL-v`y$!RDoijs>rR1FbMp2vuORjv8ypJlYC>0mW~!n~|EA0L2su%&Z6S zwC7`oSWEb5Y&%sy*qn@~%x`*lP| zBF3slMx+EKc9~}MybK?#;oB2I<1?8Qld!}J-(S}CH)qSkVlt~=e~2$*<_oe!)beI2 z0x-a3k!KU%5?&ePXmIHA*^CW4JqURhcOTrFlE*IVN8 zXDPM=HTV?fn%wrO$K>ee`WVh_McR20AHOqOXP*~-`My|J!R6&tLy0^otQ>y!c?eq< zzsx82^|r_iuD8p_6zZKDA9`qE0N&lbh>^tnz%w{^r-3n3BrDM-)TnJux7OEfk!#WM z%BCi6RN*>DW_j83m*{e%7yFMgLFYxK?|-RZyAQg|Genc=9w&2H>>?UlX~!3=RC7rU z`yhx`BJKl!>SWR|?T}+>JNw#Dxs8YSE6(2jkrZ1~_C^ViyT%<5Gz#=@8MT;+|6$bq zn0T3C2x?iuLLum)syVyy_*5EZ18p7tlI^sjemv_*)lDFEhe_Qvq_&zM^)uIo^w3P> zu7^*NttSP{R$B)u(S5~F5Be^A;@Sy1<2HVV0o5Z0Cki}e^`B$~5&J)s^NtxCXw{on zfyt4oqkAQNPH_W9_P~b)i*AUiL{Alt~_zA?u@pVWwMTDrRLKkR_&(JIB)ma4>n@9I1GeHa1PxMl`|??^ey|5 zW>>6s;c*&=1P5Na0?-S^8}ueDO6mr@@o{{q=_G1cj3qepZrWHPz_n48t1Y*Unh6me zTK1Wkf^~xyTTJNO(LcFCEI_cvCWGl$~^~YUV1Og&wkAy36Ajfazs$aPTs|Wx00HMk}tzuKdfp zB&IP35`M=O(8*&bht*Sf-66f-4*EN)uGHlnKmb6oMw1Yzbwt7{>y~oMj=eRsKG0jcKHJQ>yG!5%J zYp~22=y?x#7MX$54ocDU#vHyIxmoZT5MS1)-I+7@^9u_H_yve~9Y^H0nqFp#lpXQU zVC+q&aDm43%f+him!iM)Ig!Gr?{j5BuMylKJH3S*bW%Q8jb8}lT6P2E2Y3k}LNybZb@dRi87jSA55`Z9FCgb?&V-ih zIwpuyxyCHJc!-X;#7+8|3%r@Jk{I*r^#;2e_&T?E4-%sFAw8>$}8;iAt zimUs|=Dh@0sc%cn^x$qhF?3z{sIcH95tBQ-Mz#mTYipU18=7a3e4zd^+RL3>_t{$h zkEN-g#;Kbm%fJInfjs&sHJ+b)JQtLLx|%TZAhWi_g1^UJ#q^uyI3?0bxJ%r4};E-@T$ z`JKAm6wREixOE*{FPRfpR0*S)weQlOw=-U&7&SlwDrE&LX*_`9g65cgF+_tCUiTHI zR32k6xx3&JB+3ekl@uV$+hXUwocVOe-IC4371oLKQiB;x#TS=^xVRISyw#B1*=Z#VtdRd* z4m}h42IuyB2C<86>G)ohCKZ^I2p|ibzKAP0?#!Za+%>OS#&$B!FtY%z#%USos+TZm zJEEVI96;}O0&^@MWmC>lOXu=-Ts5pu3MC-G2UF+ZU7VZu?yqIoC8L_QPLvmUjFakq zXU=#r>xVD|Uz(-K{F=!AFosn`D)(k%qN`=C;RL*wavUST>g~ClbIxzg3B^aJlfe2E zOLFN2!-Oyv8{mhiY`|`ib2} zz`*vc@+%t8B{1JYnP%J2?pR9HcwN28v)s{aMae4viyQ%u0cu4V&v~m}ug?Ml zA~-%ve=eiHG#~{)QMyav3=&YJe{EH71CmEjH1%5ipu<;~2GKr=>D^TPy+mCb0HLOP zXFoHR&JRQ8tnA!ru5V#i!{0qCsFgPc4qj$7W}OD?!yMtG2y41>s4F|cNL7li zVh%T>^ouvsqvzsSC#m#I94_usU%Hi+`&}1E1LRdY(*u_3Gexw9P1E2KM`tL-wX$)G z9@hDoUwkw8(v7Wpy)d@QoohpN>(B)B>f+-HHZBf?iu$Ry`C&bZ8>g@Y><85bvP|vA z)A@fB;HR*gB|P6{czPdk*hb02fGivO)7^(o+aE0nI4x6=noTkj=d(nDPOO1?ykJ-# zA5WTt7&$-AWR8-YTx4B$C@VN7CKe1(Ei#v-?Gi?*a$My};c-Z2)Tr*!adio;Gs{4_ zQ2tJ*c=vS-&YEeZV>;b)S09yc)u>_3wdCe-7TiPvER9eR=4DI!(P;gqo8adYvOc4T{_iYiWMs=Nz_+}MrpmnOUs_vBWe7Z;ClgE-8l-?FboAD#(vGmJCsBx{sMwvpy665=}4T$Qi1kVr@}Oc!sJs^sl27J9}!_Ovh1P?{(-sONY+tz*KQL{0oF)WZ6o+QA%Ns`rmf<)4{LwO8(&_i+A8&W_57ls z@Fw2A#`?i9gQ`(pT53$B&iR1#V#&})8cg~(4GyC$#!{P@++AOAI;vJ$K?x~}otf?eX7wE25e8P`>9TuUW#l9Dwrx zZ!O_F`!<4s*@VQg-^CJt`!ssOPGF~W6+i|>s@LSpGLo#tl!H5f&uv;hjxsCc&h$x& z&~5vjAAAKWHazFwW*nD(LFdndIHL>F^T=$-h75}8#5kmK-YeE&h+zo%q^#h4-AEL0 z9w$pc?Q{sMKbw->-t_IKzlt}Zp8U#qlElh4zxduxqiFmQy z0Lo0=pQ~N>5l8t?CUbOE5r(vFqU2S|i3Ds3y9(^)IH-rg5q7OOY8lkLb`}t}sqBSQ zq#CBAkt$v7!uXm#{=?wd){g1sMF^zE6EAo*#cWY$37DNqO@L3_zEO|9>$u}nsUSIS z!26iL-0|}0rOCqM2OuG=wd;>svTzEoBJ+b;-X6SNs?-x%y;4?g%wbq}mKG!KO73z~ zR_5!BwkhV+)V{-Xao05Oc<8k%xxT~P6mSEj8rE4F2K~Cd^16co?dL>kuD3szLW_Qv zfdQnO{G+V@6#D--@Uh3(_*S+zo^ji2EiJ{=7^5v+dMcy!(}08VpuK(bzkQj{11aip z&Uh-fQ2=Tfo7vpVKBixWeX4btC77-pmmHU;%{VT_unf2l?(S*pc5B9NHLupJml5Ua z2wHKO>DaPd&X^a#iR3TFmZsE4WrN1#C*rjks@5{nL{4=)2QU*#JFeArFn?eGx&5@N zbg@2Fatll(CFI3p8G#USmTI}c;Z%5gWlqYgvUD2>~t0=*BZ|*5n#I3+Qc3> zaUd)S*KVY41{>`PIyU(Yt^lIJ+$b%A^&gT?U^Jb-ADdazpyOc&0c@cdE~kvLKNd>= z_L$$B(oU>i4_|9o^!wB+blOS*Esmax(G4n7nIHa7r}fXt<`gg>*uwcxTB0dF#L_b{ z+2jl)s29e+%V8t{cSru|_PZjn|^X#Hy^!6Hc@qSn7o{bVxEB2)f6^8#Oi0AUVKdS_JpvKIs`$ zX41?W%L4QK&t3B{UJc`6H>KwQQc~GI@F4|`0_bgXSgu_^2Nv?O&xWX!27QG!;e10q@D=}75jgvJ@x2AMLi>84&TZZ@h108DHt90*WVK;D zfms83uJ?{te&0~*vD|~P13;kF;+VL~uIG4wwESv3YUO^7oMLFEJ1WzTxMc3-V%>h03DmIm7Dm$_730lAv{^r2Ys$hCzTL18L*ifWJt9jx$;7*a zR<+D^#XU6yQH>TiC010PheRN@l6-l23_GYrVYxCVXR@NY!;~q&I z@`-n;;`i?D9do?^wT8LeGt-L)3B4uo9=z4u)=r&+u}xbY#!Ty#CjVP2wOkq~fU$a` zDX6O;UsjJEB zODRF8^Wu@^t11ceg27RwAGsWw2jqlg?F8k1vPJyHf(T*R>$EJl;@+lJ`f9F2*Eh33b|de=ng_@_;P+{-yTSu@%zNS=KFZnBADocp1FNPj0Ko3IR|d9 zaI{zxgoTNzzBiV}C@8qz>~LgyvRvnojww-vm`x^3sr_H@xW6U8|6G*+(?FXF0+XkS zf28T#LRf0|&`7W4tFT+l?uR}zU)8RrLV625KsdGgxqhp|V2t#3e+qbZLymXxN(nHoiU)y770{W#Z}-9~OaU6~H7SIdNQ zAClQDjyZtWkr<1)!;VdX!6k@t$%P(FtlyrubR`GHoabn5n7N*E0iNGYo)M6_io@9g z{B(9FI8wR$otm#KQ;1F8B=@o*$IMq`elspSbCASS+Vgh%c~;t*ShTv~u|iJK-Nv8i zUARPQh*cvDrmh*qhbsU8f;Z_nN@Jm~FO$s)>0h`YI~lsa`rh72Mlgl#r2 z0qe(C9x&p1=(w=xE7LpY-Mqs6a5WB&Y!%vSMTKA0V;eLfJ8*jywK(eXkV?C2+b079#oiPWK6wSNf#`=^e8x#lxX5F%O{ z;avQ4B&(8wluKsvys?unU_F5V`1vh<_J)%k>#4=Kvjh<;@_roSqAMOsbv4ijl@ zf_DlUHh>13F0ke7Gif(L5IJt(g&=cNwbxxQC-!?o`4BB!T&We3*EFf0&UbgWLt}Zy z{RHanthy^S+utB1sO+ZmWw$1^_1BqQy1Q(FBn?~r@=M@EANcS@-*I~Y?KNkq#xAjZ zu1HzJY&sta-?1^b8&aN5Yr_?MV94uyo_Vs?HVlt|z{tznztmu5#m&u~keFy>u}rR$ zo3#zWMR7{wnb@0Wix=?U!recEs{d)=Loe>#Cm+KvQ_ISSGm$3?hck>+@=IclDRH?q zms63wD(^G9c`;B}&J6b|^RaP%h%Q-R*B6-s;W+}^){izBDq=R_nJ3lg7IGUVE z{}Qc?$_KCnkk23W89DDR^9%k`$mn9;<>cx$o+vGrDdE8`kCFOWf|fA< z*&z5KsI7MVmS;fz38%tKmaNN;!1JBVmN*QN&MxZdd7MKhJM#60*6t3ylua^oTD^93 zenG@7)5`$M!kY4yP!yOQ)5a!pcyXQ|ZwxieS7C!ZkbO^*h3bey%*$Y)1L53t*8=5` z)T3V%*&qEZ<*>Y0Q*n_SsD4+~< zb^X&n(5HCe%03|2Be60nDcmZOTZzBdN#ZW z@6Mc4$&i3tf*1|XtrvD%Kw&3iF0cM+BF~_sfblzUzm0|d zapy)bJj_}(Afg`)1!tXPbN9meX|T(G>%z{Nn3GtVkNOy){~oU%m7@o%E6~i}8Z3m! z$IU%8M>#G|_xF8hAZpLRMvU8_b)a)_)MH$ppeJ7{fxwnYWIqll$b-!N4$-Es`$GMW zsO#b*vBVwmSX9tf)5SAc`5kx2qwv$&FQ~Em%vs$N1qhat zKo|D~o4<#u$NO}WuJ?V)8eCxUNb@lhqFj852cf>d_}DY}41B7rs9q+XJ?!Ak&QQWPp6d8;y?1Tgx>$kc zK|l|b)WWI|sGr7eq%=7%fnnu8SP*aJ`KEgaK>dpSw-;`(IIjkL7uFZ+PsE!DdX3EH zK=p$&*1$r)$+lGBtsUTWr-aGHqk3_Nn4ru-ows*{HnDnGL?%=wLTn^-}FuPW25$J?A%lsIRYX;^nG9**$Br^tTczQqpv29-Szv) zCT`$Jp81!@@MFW1j^(C@q{ZpZ1DZg5LSRdlep99bjkDy6^E8#^Ac#fA@Ui=zSUL8t z>*7#=J}l#LF&DDoe&S)C3NnJa8RIo9R@Ak);Wf$z;vgY8dR5jj(Ew5T){ws+Xi z8C@C&2*LorBSM9HTL0`hpyo0SSx#J{Xj%8{P!Mi@ko|<2wL4JL+-c}6wfUCnhQ|Gy z9xFYAuX-3JGurVkl3M+})w}-o1xw=Fj2$X1$51cYHW|asyilLG*J5i+6ZckAdq8@3 zAlZWqaraFFC+1t5Tr>UDgK%cRffC<8hV%b=98KpF`kvue7x`=rmfSz+gb>tWick?d zvw*=o!SM{nu;}=Gi0IT6@0YE^vX@>_d{llh+R!|D4RIGP+^+drQ-3==t2<(WI6z6Y zhv6QjF(GdIrnIRcORkL<5^h2sL1L7byqc*}L>#cu<(^7k-EqPX5aA^ir{r3c{H3%c zrt7dAEi>DAxZ{hH($v-sgZm~wCYF!}%iY zrpms5ZbCu*ac2Afv=#cdey`mPRY(zh4KeR)nyFo>td=Fo6DET=EqT=!Uh)ez1L8&0 zW@@Jck2M6578>i@H*H|@tmmffV6OaZdcm82E$V-%cYnK~j+_*zOt%0&H4ljG`nP8A z&u$i4g8h8=16~R)Ln$lw-^{T8?aBT>CK=5Efi95etJGDXLPHz=4=d%*t;qkcL2d-N z*-}yFk8@fqslN&$`X^8Mw@W4zzeP&}ra=9VX#XSH|7h)h48ng50_^`ITl*T-cJ*eW zrg-WVT)^!1`TLX`vww8-L~f`GvAoo9 zqv>V$5h6u}g@X9M_~RUV>gV6M0DgaQ9vNz+{EiPRVaAZ3k~YTw-GBDKpZx#%r2aFJ ze^W#L^G5z1f&FKV{2ONBKdSW~)%wGa6tF-j>4WlLY}e%-9BcM2QjhIG>1n*PF2UE3 zzeQ9y1e;ki%wv0FqA|anzW2cOcQ?0j2TN!*g6VO1!4ggn;p2o3(OK&-tG@`i)9tmMA(2W26uw%|pN+eJDebQnc6}PR|y&7Qp(HiJ=Wv9|L z6%zLm;q~H<8t$x|^B0D+KPLJS!Y7w=rVqgaMEO(|iJ`$)LGuTy{G{6q8RHSw7mU_#nzD_&#rsoHO8#@DF>Z zD)y$@z*dQ$JS}3)F=&?4K9WRR-w40F7Z2`W4;XTYTl3hN4dunHE^lUNdNUx zor5T%`()N$6ZA(^O63h5gI_TB0#ZHWSrCztY{0j4CWQ(u*0=DA>@1uny{D-j&tsmz zd(cm(*ySHn!3(hktIS`I`Z|k5Nq>iK94MLfyZwVl`n;6OC`e7$Y*X2> z-Q1dzn;$tB94(eIUk(sKz@@T2RrA<{UkfK*=M#p9JuDxGf)%2e7-BGlf;-)aH7dZd zSf*m7cKyf8u)|!1>%Lf|yc5*K4y@g-acWzEK*QZa5uc%?huGkSw5i~%`>`-(;=Xd+ zJ6hYjH=OhAYfbq)lJ!wK0F?`E>B$jh5I&o*xsKWfEsx^R3*Nmi#z*~$%U$iN zA@7M|mqbR~F#Gx1e+#%5O{hYJwyJo1 zw~hxBtcP#u%4rFF2*3Gbq=W^d;eE>Hf`dTEGAI&lj0hO0j)~BXWgz0V?Lj8-1Q|A?-^x&a==}Ud6!xb1`DR|1dEYOpv1TglB_aNP_fXGc z+FQdPtfaoU`iT&nf%S;jCgew!X-e~1Hs}r%{G$&x5Yp%9C7vh z;`@vKS$mrR2^jy+G#YYTCz1^FHV2IU)Y|Hcn0gAbe`80+UYt?(@`FXbIzF`#Q0X(m z3q4G;w;Uy8vrP2JFLuu`q9HducCUVCXF>w+AOVDVP_OQULMzGlz7D z;pCAsv=L<%b{$uA=JE+wp7Ht({wk|{(kEi3hm_X2Js83v5jjN(4>DXt={m6W4YC( zaYD-#pn5=%8Oe2 ztp-Z$fF7d~i9mR_@~0WpL3D{!~z+`|$T73I{0ICOi zAOQ8orqG<6$hRA}C!32h2)$<_hYZe&3L-?ij0S_804?bZY4Kfj<#RM&LVnae`>p%n z*^1T@w|q@1Gc-4iN}uF7-9udVahA~tpHVal@kf+@IBQgzu& z`|?p``oOo*WR9u?#$?SLaip?3LJmzftM`v(NxY>wPH}OT`^i(HlRKKsSwYewdnepM zjK7=>p93Snj7jKPmBt~Xx{WjAdPdnO)fCf4;Wl^SrPLn3u$naKTXMpkR>R^*9|C1b z-hqxR+T3m`nbNMxRKu{@WExC{8Xv<2(z4VGbH?|l(jU6W3b;U%uRKj^>(8hYP3l+N zI9JDRj-yq!LmrDa8syiEwPl!!iYHKzwdW!IQe~#Eedl@_ zLUZC{xvql`Jm$Ca{KcRPi(8Dc02wRm41KjX8%gF-6!fC4VkCCC^=Z4@&!VlV=uoYX zw9ys54N@LsNrjMfSeXqUSPqk21pDg1jk;_1bdwoUJVWLv98Esf`^`1#c|_=^EKPiR zHt#vlnv?TjhCv=qa=FI-ejD!jqXD4}s@%w)T>|(Q!jiT3P+j1}Ri|0jrV1~(QJP*> z2z8#AQJ~!QEl2bWoEHS;wHEvYPopU ztafFjM9ZpFYU4GJ7S6LOVU#c@}CH;cn^ZGiA{QJ;)M$}Y69c%CfK9lP>uyRTywMj2FK;pScMTEO;x%o2`kg6nUuO9L^0?!o7}{CGxqz%1PrJA=*N zwC&^xw(65a{jWcAJ2rScKCL0#l%~qqG|DAE-kGTO(i^WGm+R(;vx_xz8=K8rRAPbI z|Jqk+h?=clOX{`IXm$ASk}>8(q#y-Q2ayj6DUTm+f+v#51**(AyzcLb@-kA~)@9PB zB{~2S?{%$okwX&+pDNvct=&{Ey|c*PoYH>czBuVY?PS?vAG{t}v@`GONiT+01E?3H0b&E)q{T;>!+NwfWTCm-B81 zlT=LtJ6Hl(v3Pr&+(jaF?=53EzcYk`jJVHF_{0Z6KXew(6Z|vy#G5G1Jop*kt8#Ey zE<)Fl^|s2bf)}#}4KcEpi}z%jeL;*%A`6BuHk-VS1!gMOrW^BZu_A?8=1ZMP-1}35 z6&2+ECpm&aLgw}27xs9Tcod{AyMykvMTyV^4Yt5+T_Z?ju~tzdRU3^0hNP3RpV~_~ zmCf`eSaIJHz9=51N>}ej#!V5;vRA0v8|rZsufQy!x%!Smf2q(o0+F61%Vr!7zsm%O zIjJShCg+C2Y6&>K*Rvx)c1f@^-5J14xx^GRly7EPo6nv=V<)aciKW6!lOpfvN@wi`c*t@2?- zo8N_J`)Z%hzydiX_@*WoI8CTvSl5)3fp7E|)-ZUxO%7q?zZF+ebQC}ppwIZDdSWPM zZORDSGtzB;>c@jk1;Z_L2ww~nH3Dk?f=LQwwX!X%uXS=T*3Mx5x;wm%I;Nr1_Ixc@ zU=H;5J6KC_bOGu;wAFKlzjSbYpM-scLd3I;re-bllh-SYQKx#O-WXVAvL${x0wq}q zj<~=ebAX=4bQnatD8BQ}#wY3-OBI7ck4I$nWe&zNr}5J{X|I!|`U_a5jSTw!_>h2x z@N66_l^tWM_@sc(C5TXk*o5qpOWvk>7R`#ET(F!YRmmT`ojrj^$IbT zm5X!32XMY$wZt+D3qG@nS_=n#yA}SrnGP=GSnzz-JF`gCS!;AjNmU}yN|bXcPvPBh zxOS_&g}<@92<6LL*JgsJdo7#M?>Eb-eOu`Uh-};l{fPH~tDTp><(z`rX_NdpW?a^J z&GRZqP)h_Y`ii%{;i(mwxEHZYCsyB%l}gckzHEIT8Ifo^cvaIPuf30LhMK2>59VNU zJ$5b>tHfd_`R0p6ftPUkTX7P9Hr zn&tO@K*9vSbFb%3SFOU>m`EG2VI0YGB?M(fDdMx0rU2!|a31nQ}f1)jiDK z5O6GtTdW8PO5PL9R2+?UiOQOn8qc%mx{+#PAca0U4oaHdrhA-PhkrC65K{s3*hJJ# zeE%S-w%z^?316LPH0OhnI4`#<49}364)b=*{fBFUy`&Opxz=kyvB5Le+Lp zu339RBj~38JJIz~cvdIPGzy%E7bBljGS*Jv@ejimJ3YEV#RftL2p1vWPTEyfQVJ#- zNzEztUaQgjMVs8!R9X<1hkzZSbOKWi9J9=&t;1=m6@b_2()gB(!yqLVQzFl{eP@VV zGdW*tQNq$A2UG4Bg&fUrt=O)>0$a(M03Wr-NTdA`7YNOg)ldN8>?G+lttBSi^IvWBhOZ4(-roD zKpP7F#Q3}GBZ|EOxxux0+t!TVaPJbgmdR%Bs(5O7HB?(IWV(W!q_#53g=0 zT$J>hN~%%P(+-YQKvNmfZh+V;mB3@uW9Tyi_J+?o2RJ4;Z(Qgu)A%{p{>Ul*t2{M0 zlc>6K0oPUVSy_~PY6wyq_P8|}dohfePob#&L+%mjeAOenfY+?~L!q8txHrmcMg< zP>cdsLsbj#w`jCmo9+7(p&26>ByK*m74NB`v>x(OGHbPW?J}w}WKYP6nH7;$%Oe~u z7bM;s%uXlM#|p9YpE01puqsLRl1ZP0u+`Le6@Qz{r#s`u8b9D=hdzY+ zAGTD?srJ^d)aJZx-%j(hT#HS?!%bMD_}B+xhfilK-Z~>woA^^3Zn1EyTA6}1FxJlm zQ#k`x&Aimi&D?Q$$L-euwM&LJYhA|*bebzt5`*{BQN3r$V}z!%pgU-6sk3(GnZPewTdCj52tNZN*Z)?>=SZ-2J_m@ zIw^g}nLq3be>o0L^+rE!ssp@#!n*r(x!uw!A|vzQ&y!0sMk%I?aLAsPReq2{#!ITZ z= zsD!{$;t73^rrM@Hh-8QzD@p*y(ZkzDr00whqaOr-5)RCi7#Qc1Y9CwBy$Sa{Sk>(O zJO{4xk1UC!d^xek@ z+dgMA1M#8NatK0 zZo1yb@1qVLE{~&};Cf7v8@>{Mmha_AvDc(K14CUOr*5Ix>98JiS`9xtsm_^AZGc}$ zwMNY@7dJQvV470_=}1cW4!LfI@RT1^fAOn zZ(Z%YZenSqT(3O%<>MfXZ+3W5sO_VY0EGx)5ol^}2h0PG2g-LxvsV^S)xlL_F*w+ zKhzx5NjP*^ceJD4^eLt9`23}&oRHk6w6sK!oB?#U{J$7`>$j%=KkQpY1f@el8U#d2 z5eey%l9KKk(hY-=Qqoy7xKm>-zcn{sTL9?ET&=&gXePPF-&s zQm~REebuuoj}mTT^$Mh>!b95-WPmE#F#d?TG_`=jeqiA;dw%NgqNH(FF43&GdL&t%Ytt97&aYC|cr-2WpgAS?@G@;I&QKE{u<^^5FiR?Yd2 zXtFd2c+7L^kCdHp7Y6-X;s`E}4jVF#yE|;=21gpWMJl8zKe`=H<$tISvhW;+TpcXV zE)?lg^82HGh4&Ktzn1_1Usr!Cl_e)2T;&iZF@{R79(^U?u$nC{)1R{X#vhA5VzZ7B zqvd6^jD7w^phB$A=y^&IKa|;Wyat=kl{0+wt&o=Jy1V{MO3cG8&yy8z#nKg2Mk@Z< zEmgH^z^lvU&O#sW^sN267wYxl!1}_jx`K1s_WA4))J4)36^zmmOe?2yOIt)yA#8g> zoHH6sOX*XI_k&v4=q7jX2f3t9G^1iEAJhd5bNjdo$@kLd( z>V-5t-r=gR=oZ+P{-LztQm0U_^;bsO_~<@WLf`4X0Lc$FB1X!#f;OnIR(GiGp?qf)t zKDUnooCp`fZ%D)(g4IUai_j$scrr45Pgq@35xMSm0+VEjJHBi&5sj0^)}lugI15k zkqiMP$x_gaMpUb&J}3|R+V(I;hO`$@K~Em)sr2SKk_nT3j~#*W4gaoe)RHEVm0%xt z;0*5i&?W zOV21EYZiH z?pNzUIYBput_XkW=F()PvG=SQy1KgHKe_uPo9mid<4%r5`;z#$@v<^vmK@o5CJqV9 znh-fJR2OqoOw(9htxBK8SAeFGZdN~h)}kFhw?C4?d@{epkV0ti6)u?(Dqz3D>1ar4 zkM|;FbMgx;szF2$*|>!H^&7l1wqO3+&!cuOjmd zRC~}UFP!iY?{GQz__B5@Wvhzzp&X18gwj$nolUTBGv?=^!kvnSE$&r9=X*JJMEajR zYSRZj8ujDgWu|$~#l8$bDHJ&n{ZmvApKR~TI`(=7llp$7T)aT`e<_uOx&aeruIccg zz19<&7=f3Fnern_>FXP0!o)H3xb)pg zM7M)Z_EVaWd0Q*DS*q=7)8azC6~~4r5x*i&V$Dwp>+HhWVMx{4GhC&}%M8cYFKwgH z-mxC8wDxDj&Le^x(R$W}Qdzs_<3d!@rpy_9b6^x!0T@@jJn@~M z9!9i(KBi9unzHcR#@=vk(KFnbl&cRZa-*Eh@8>tweOCf}u+vTxwQG(@ub*bFtR78r zZMLg&U=1Al-#j7C-rn4l%%DE&Zd=2N%cc(l45lCVf45OXva-F&nlsv-rOZRzqHW{L zyE?HT6lwmB6tijwe&#nX>e07#D~2#qn&n7hwsPJS^B$G?{@aNvL=|*UH*(%F%uDAUn`uvj zQt8^tZsaoD>5rXpJVUxOuiXM5-b|Czpjl6ACU$c&k4FvnPn}gEY~{LG=&39G3Qe9N1^bq4)BTCep+Zs^i?*BA-0U8=PsT1}_HkJne*rlfd|4%obc8xYXWA2YTK3#M}$>q{y6eWmb(izrP>$2cs!;oq!9Ql$~{p` z^qQ#lW?DZ@L6Lq|yxZ-$Y${4pPVGa$nTSm(it zEOgLix?0 z<{N!_)j|CUvN&ifRcB7|rP+kEqN5CfvG(X^N&0}LRxyE#3KWwb)rEHue!wRVJX%n1 z{#{7&6~Pu8m_U`OpaW$lIGTG6jHG{A883u27_+<(g1v&GlC?I>)Wo&PGJgE1bj8w; zzJ-%9nk^hCkm>v}WNE%;b zeG5{9OD+f{ous2u1c91cKP;os{dVcVv~eI@|GhM+0!Xmahd|E?N+zt2qtp^*Nrrph z+=}h4>s1nJ(SYzg(#2^_!!iptD!o5DFhirwx9|;^FKGBX*f-Pr(3B>A zMOgY9AF_eV$a_eUVF+KIwjw8>@*i#N_VzZsHS?gmf$aMbGb17AD(k6V zkZU>A8=~alT$fI!X^C-kv{+wsMB_A}qC4Mw1PETgj|iZZgk&R##%ZWRsXHA#dI#UO zbqn(V`lCYMW8cDTakl>mp6Nv`-M@uv!}04(XKN-{(ku2cw*8=rJ*nn>O0}*OJi6BK zZn^*@#7A;=CSLIz8AH!HWPpbKRDjj#au-FV_?RhR|8FFveeAA~4()DX4(odp!`n2@ z-*-iVV{V5QBIcu%o;R`5HXA*pYWbtUgR%y>f-AQSxtGO*Gk1b+?U>exix^=#zp6!n zdIrgsQXEcA?#cH1?WaS}rw3ceK@PaKq`bN7Qb@)2WAT9!W4XDZbAA4HJz;CF+-qPI6v=}kK1&q zHJPr%VT`bO+n;4*3f4bZA*(>5qmqwLoAib0(#z*O5Y2{Uk1eZ*{dbz5f&XY;bQgR5 zX1RJ}Du_Ar#V{r3Y)CPBa7=~AMcVeh>z;B{Y0j21fgH3U#DJ;#CBnJNeBzG62Pe&T z?Y`$bzT|II%|)c`M9p8w!9N9~?@?sGG6c3sS5&pNs$Zj}y(h>xMUU-HwxEu16tDLq ze4w&T61KZR;e{N=XlZKjw|i_w=6zAEXoG|E@OWHT7?ZHg=*4L_-s0}lEjXcx_o(fT zM!DT5@o@6H6)9gTrHi-N78b%X^Kguqg*8%DsY=$R>-XFF;{i*o?#5D}zQ#ta+ZKg> zwdZ?(-q$FDc=uV z(wtEdP1~mUQz*S3Y5)3GyC3brt7&fzo7S0U^_Fb1tG_4Tr%`^oR&3SW%4&l%XjwZj z=ZHM2IA1FqZOC)fm+Sv^wuEzu-L4EWz!z$4{^NTGao(4-BD&lmkNLWX;3qf@-~`*b zh4tqZH;>@ruKTg?nr1bQ=AsOLdHb%=tQO}8!{ifn#jsJo*E%kL%dt^9CwAyzd~)(G zuE4NopGx2}*RcC)`1r(j7^2*wh%YOfVZnMc>Q7fx)ef*szEZJ|th9ul3@l(%DeYIG zU-D;$1$QpJ>B4rumb|>%@fcnNRYH_WZs$bWO#HI5dDg)sS8DDurN=p2mGa#z+KfD4 z?XXAilCli+BZaFM#WaUsKqA;buUK>s6VDi8`6z$DNz^=J@RNm2=sNFBZ$Bs!(KgE4O)2y|&~( zMfz3IJ*H+{tbwL*06y`Ym_s6oDha3dFV@Qy_PsOal4oE1#;Jf^sxn5 zrirLY>gR>EFNZ);sI$bICdxP%Rl~ALgYTLIaA<@Vf~HoY5vN3zatJ!gAEtNmQEu3d zZTK){LrZ_k4bZ>A(`|)^!nAlbr_?L?E!u1yn?#}!IoTIYI-h>U{*{pw@^EP=U!JI;Lu0(nChmrF=vYvmojFf31CaO&ox;$%nF2`KX_i_cUlBezPm_QenxPlW+eR}`t$c; zpIw0x>tH|3=U$>BJI$_b0 zP09A>(>Z)RXSwd>y{;y7%+iwmN!z~wlZHCOSS?Um zu3fVJ<9(ueJlA`ULq(a$73n<;*zD)b-`?`tjwE`F8La^LPXfDSk10QI&+EHmo`CcfD_}#X&YBKqMT9agfY`%rvkzzDmenSalDJZ(rs> z;e3H%kP=}MEh<;M@4-_SUb9rbPzx$i_&*Bxxj?-pAb;f;U(O}p<8t5q3DeHNZ3Q=~ zoUdORlMwyovVw~MRC&(-f`qM_-|4qiR#o42vVoe+2MHR@K!CdoN7$&cZ*2(!eYBE? zWt=y%2HYU!Y<`3ObT{cKNl39BYwD1ygyQnH=6Qdd`Ob)!!r}14$?h2j=9uJGhfi+V z2IW|TyeZd<0Q_FZ%z>-F`j_)V4DjO>uyG{ z;eF=RF@JCb#DVpnS`u6229o~zaS7HtcmmH$Hl0syy4K8tN%IS{Y^=-h3lpeUOF8rB z$-;i&?jUAaHALKpGU~KdWjoO zD~#u`hf z(Y2W$^;3kov+-Ia>8d(VUHYm!(>I1(^P5zlA4efR|4s>KX=3uLwl&Is5;t2;K9K7} zT`8+jPG2xViEX1k z|40yb+=xB^pQbsa^_%q!n{IAMGoL*n996XIrYwXsDO$!x%b(PH2eU6?zU@tVBp!gr(2NOW|#=_ zUcUMz)U~}Fq~#Pv^$$%qq{Zo73hPMJDVBT-aa}(GZ6kF7&x0;wsQe!+lh4sVJsb#X z|LS$~>0m;ep#B~-tVB#TFO;c}!335n;JFW+0A0L@72}GCdI3b z`vgj_!uYV9!Ha4c%ToSvrTd2y*j&Z&Q_$rhFO=7(t8b%&&a$mryf z-cOR(Mz9VB)WoqB3J4R|eO-9Le3NlKu>gMBXgG`0*G>4Y?T(Tp{}+E|$6}=DTW7EH zCU?V9KecxE0m9hwUkgsL6|_U!yKXMo=r2QvUl)XkV%(W;Cf|PWd4^GE5Ly8m3HgjEWc?@5q-&24n{1weHbr-}Q;571yTd#?R7?jqYv`{@SYNZbpW zarJ7@u|j@VPzfy67)B`=tPi3)YP&yIyBl?Dv(9;&w^qzr;o|>FAkk?nDW@mTHWxmf6fs>|1TaVOZ7sKYW1+YVIs;a{%}MiX{HP1oQ(^Ff#i z2Sn*26P}=_SIyliEuW;A{ref-xcg}O{MA}OdsYAAedXoemoWzy6KN&-lS zHQ+mceaGIn6FIkSd_%Y^G2_6Kd0T5KQL>5;&sLGw6}pjs%1V7XV;>gk+`1OBd&6x{ z9yNuyI)X(IVg#9g!iLp`29yM9b$96DQOscXF6x`@)*1UT2e;a;&e!H_n7AdHc8NIy zw!m;qLj2os63y^gmyenngYPl)bR`14piXR8r0qF-3&n`ntyooWGpaQNMmBG1jmCdc zWC>>*qe;1|`ud^4E#`^W-{Lrww4JM!Z$4iOi)g=j1!X>3H=ABI zjTSK$K|aEctXFT+y|)=yOC4KzPtY5jAz0 z)^Gy_j)*+K3F_w66=UEtt&o$B;n6cbkp|28;S3nvU-7n4dM?6wo5h(U>Z9GWewqep z8VYm$3zV$Be0S73t8dn@3`~o6ucU(y#rnM$Vv$Z+0^Dx84f^{q#_6fg*39t}dn9HP zR!Lm3I=Ks;?mwpxate$_qphuR6qnug$By1?&1oOcJJcEd;?SstBFekix;jL+y zrjZ|iRI;(s#1zrS6PXe87x+Hx&)S~d&(HXdeTuE_Z{D07`zIkeVYLnVpyc_136fU} zW8-v{BwNfn!>aGQ_H_d51J`eXn~}4u{wudpEVj?%z8skZWPdkFtF@Vz+pPOD(HXW- zxGFakJp_m{N&+e*1s@7Qn6DR>oKQy9W0nJ#D-KJ77!Sa2fR3qEcT9Z}7ve%^e0 zH>lZWwVCNLfyAY>qG`Fnb(<>?HKzi`=t5LrnK8rPv2myUq~)K3IAA7 zis06u^0$JxeSii}JKZj0ysU^THhDG`{xrTnv#YpnnZ5wON!)i!xH*XaXvyogX7KE1 zX3M`jIGcm8&v}J!-Rk{u^o)`s;t5${Sp8V7glCPdleEH?)Mj3da7th(*=`F2(e(}D zTYYI_cXz3tee?5$5)8c3nQ1*+s{Zup;;rq^FTI)W=Pc15I>^ZUuS=Z5Oj@G7=L(c) zARFgHHfw8Q?}G7f;SR<+=mW{f?^G)0e7DN|Qv4q-&nJ=Zx3jQOF4-78L0goCAsG$e z>^a+OY6D&Kd!!gABmDH*(tz$^0s~*&-$T63AUb;uJ&@GrbO-l3h<6VOTG-%gpNqoYI6&8m~zVVkkY_SO_t} zY9SQ=mjw`bP446mk{st{Zs!|szTUSt?KfCc>3W4nUdkU!Oo#1scZR#qKfgI`7OlAq z!b5I{@d;Dm6~wjY=vIc$y9d`tbWg`^mn=D6pUd}oB$&_O#B7F9CSdK(E$_FRTXSq4 zLr$)s+`M|etp_jD85&=^^xC*6nfVxaC68Ixi%rKQ(+{gxNANNq85QfL7X>j>FU^B+!YPGs7QL z;+Z17YjX5c`&SuIJq;Hj(wl(zB4deHgJOUA+iO2R|Ldpvm0y|QpJRRcymmLO74fLz z@N?c7t+(WK*@E7#IPeQGC!cqoowrWu)+JXzua<^FjTE$Ti@!8mUhG&J$@QkpN4nCZO@Xm%STrZLf#e zwXW>q2<-0OrmKDQb*g_U@Cl&GdMLB=jLV$KUb$QYF9Yt5e>CC*>iq>;Ec55nO~#sN|? zdu-D2Op2ldjG~oedyuH(u~DE?LTY|*+--Q0MR0#Jk7!`1kM|v!z}(mA>{qPb`0u>l zW*hZVNc+bNX^pKPzg@Vr4I@GHDUns^A0A(9t#}UE0x#7ybqq4I6)n!dy=)<04kNzV zF1UE^%Psl4Des1x@{kf`~ zO^nQN5_Xc;PasbO%-3-@R>|j{;~;xaIe|jI#RX32iG;T=_U!h}`+D6$fS&~n!l2#9 zi_UerOt8n}hNo^0pV_y-n(W{@6>gk;bmjzp=bgFkXu*6cnMI4voA@xBe%x_wHAwn5 zWo^|aRCjEbTe1{f6Bw2!_&RAqnWg!}#y#Iag?-h=gJ$n0-y_bMg{nc@d!*t}7s?s8-&!g(WTwb*I z6Xc1mt5a&_xarkTDl;=wYH)@20+6fGujnuK?VirO*3#wq>TI};h-)z=*ylq(vlJWK z^cg(a$;-p-mJ;mF(fop5#N*9RG)PO%koyXCtn{9I)pG}(5?0TE0KpvldD~=RiVX2@ zi0D0~PZEYsxcYIPMi`Eq&1>rXHloBEx3YNC*W7d3?wol_i~gl&bb>Pa+S~IFSLFHLV?|9@TbS~zYoWq7>BCh+fwhFZkqEDX`_?a7YLivby`j+ z*7hml@_q_7b%}8Nl)Ypmo+3A!pX;(AZB_6Qe4fZZ8E{aA3kVgCzPC}%&6lPDO+8-d zKK(jrdTe#_pgE2@L#QN}_aVsXx9+tBLh+JJ&)=3i!}tqY2SH=6^S?|#GP6{t*ke~( zL~XmmjZ2c)s|18kpF<89Xh;akqD|$N%@|?tvj9B&N+4Qkg7Jcn2ip73go5=4qc(^P z|Jvx*=M@r=Mtp<02}?&=7^Vp48pLPU>*zp|aA-0g zJ&zwdKbz?%l`W>g>jD**w~blyw-;As5tBSD68R`lwvJi*!;$?_d;0?zIIn(ErMu!5 zpCNMYWj)mxOZ$U|es&W(oP*iqeSPqz#&5^2?}{W{6kYcQ@Q{Z)JmS6NRCHus64ClN zXAurF@v8FOzmfIfzKeIES)+=`0Xu;;5AuGV5OYM)UUkCt@QTbP{c)aEBOX-{#{h!j zTUh%rIWIwye0}<0@pJD{jOY7le2Fnr$`@ch}cWKa-bW0zBAe1wwK4 z4aNiLQF{sC$B3ra3-3GvtJM@m()+fdBXqHSO1mJbGLd4`Z~n$-Oc?^Q>4 z^y1%6?;{TaL&s0AR{!%Wo1UBcQkhFSJ)S2EYg)jV^b?R_{>2|J*-NY!C^t!AG+hSh zc-0F04qjcdHpo&?*v{f$c_V@z)rT0fBU-7cDnci#_FA2^ITSe1_sw}{WcEARVymIw z-{m6J%%{xDPSH4hLw&9~_xU%T=k}Xk)Va0?Nx zzhyX2XA9a(wV#>pVxewD36rzp(2iH#zC_*xz7tWu`;lL#)cd z^CCQ-7|s1Zf{yH?H+5fqMiy*=%L8r9hhdAyqKRYQV%1c0b$F^$`HZu(joQ{IqFV&v zAjY3Vc28?ZPU0e~45oFc5xCT<+C1vr#@VVu366-Ny$Pboo4^*32pw%mwOpF$jAgj= z?9ct(M)cd2{9A(b%(+t|Kb~ldavW1F-aV9O-*xOJ6ciIS_il=6`{U4AXyNBFZss2} zj>@)ykHpv(td#S5&s3HvrtH^%FP)CO8~fOYi}G?hzO&;G57%cY{FYevD&AonSDhQH zl~^D;iU$c)(#w5vmPTA4=glZ77$V(H@|dujA5Fqp_?FG59WJ}JNW z?qt6am{TK7n?q>jpSNzb-CUC@b33^C*>xBtLLbUB{*~FP?biJIUR-e!%_}DfH59O* zEC3l_z82j58i`kLvtkm@q)@;51UL4y?D}$b>HC!AeTwGhp{BOe*AW7QdEs9hDKRiW zxolr(=eJI_jWI*1XZ_H8Dc-v76O43v-O4|i?6Q12ENf_iaZn1(WF&oHhR0J!DMbri zHSVzbnw+#BDc&IpL~QjF4R;=@`HQ9uKSwQ{z$}Zu%5Bj=9WuM9MWa%#H>p=-(*&Kz zNRjEOKAu!US@(=Bor3c}5z||tkEuLE4|4BKjX$AI?WN|? z$8D!E@{LC7Ss`4iI)nYf$xv*2KlOSfxSx=W<1U_lv) z+{zd|b~x!yAeYPw&Q|ULYWGvR#U`^d??WPRy^{BS{ES3+2-{zObW~5tp(>(qLII0!JG>lkkm9;6)wA_?bWOBY|!YOu?Qx6|e}jx99}j(UthMPxp3 za?blc?NJ}hmZUA`OJ&6ofU8?78()KLjuu?oLIyzTRJ1#BOc1LLNpWq~dbOm)jU$jb z0Xe@PqE(|2W#xO%yn)zXnf`-AwIxYO(x7Eiyw`b7*pqEbPcce7e!2~>fX3R@0erHE zEEkJW-z4tM3bS+Nr$3aGoEt<~6z-AXPk2_T`4;*1&mpHsyIL z=AX2Ttf4L%2y+b<{She_-BBdE`vTjjdzuutsY(L62A~Mltu`n@|2wx=IQ^NVjq()P z`J}i24w!-KwW7lObB_DTM~k7iv>XG5_^Y7z1{;unDtjB{otp|T73?_V6 zS{8S)(U0r1W+}E&IUyrseudW?8Z3?raBgj5?d0ZYdf(q?W z!Rk^W#GQzTOLp|i<#PyfzoaY?SYf`-%`ZH1dG||ZcGg31W0VuVov_0IhZq`XMOHIFofD2LXV zv~WS8aMB*~6+JihyE#~>P>jSFdHnWGji_Qf$|vPQl}OM1o=e`$G%&q71T5wC?)tiY zarydwkhTTnKQrKT;DQ1l-Yeg7^5vbIvB+P3&gDzJFUs}WE4 z8Rd8#doGNQSv=5B6#j&WqIwZ)GMOJ~1)~r$M4TKg)Wr+i?%$~LLd7&-UjD>*pM#;_ z_pAXV4}Z{D9-cj5@cBRI6Z@l6Ws)Z#*Y-hRE7Ux*A#K$;=pY^#X7RnXK`l2E#q@x% zjTIUGFzs>o?{Bwkj zSr3)=ooaT0A1d0`ZnCH{Ek1cY1@o+@6dVS)c`pfHjYn%S!vPL~36ERXx5b6=Ub zn9zEg`5n{WXD}rv|Em}=G@H|oM=Q@VELs1erJ_}7V4*62f53S{yZ<9?GnuZrA3Zgp z8E~`({gvz;{Sjg{&$(@gcQ(e(jA}~u>olJCdH6elwMs!t)OI*bk-OXkQ+W@5%_F&e zKUE;SK2EatRJ6Du?exw;S9Vk)B9@CwPk|rHMEBq781H~3-2jI7+oOaJfU(#u%?T9(B z%;eW<$10SR4idn-0R6rx=+}pyGu#P=cW45wu(Wm=ic~frY6-ZrSCfn|_AuDy6IK8V zcekAeae`bX7VTPlIofXMBl932-|ygvh_Pg`cj?03&Dr9Q$^ttl4HV_=GYm+Vlksj} z>3(`$1ixf>Zida&b>#k2V?zTf9INjb!{U%Rb%Jmea4T9>Hw>iw!Xx*fhjjvuy~}PB zHvYaUMX@e8OYeq{uRofYAB{By+f=J{-o>Q}I9{%SExrW4-1G@)pNlOTm4g;e{Kk(^ zkOBu#iTOsW65?VB#_tKlC|H_r1qd2X4x@B9rttLp;hWvEcpGJ&AA93D1<5JEfmZx~ zRSbK<*T>77+xdsbrCHqL42XF?rgQAC8V`xk&9lIQh*ct<0TnDleja(d3y#~|>=XP! zA_C9i!RrzG2N400pYkAAy!3S#^ z6weBvT!7xX``UzqN9bIpDbff4B0jGoC{+OOqjo zz~$@ZFV@HOtA*>SB`bNKhn^)jaKB<}4sU+`#3-M%U>JJyo*pPLfUH|6%(7n{48M_V z_maFd%lX6U1-It0zj`;&C1SA|b**h~TkRs_bo7u={e4ktCI3gtN9m^30Xmo9NVQsf zdNVf-5#JkSr*CViTeTM+e#>nGcOniJt8Ez#;qP3^&Jm;h7H!25w58R-M6pJ znQUBk?)D5PTjc4pzo3#S+7MuwO{~O z?QDH>xpvL3di`rtYXHwHcV*H9q3-vS<8$wFm+KXD!K$*bHi+#}BuyPPLr`TjDgD3Mt=4sK%r-MSdQchSaG(d|~$YqC7d>fCp8Z z+$r1bSIV4Fat2Lqy3M*-4KeTENFG;}z@@&@i*tq{5iHIC_uD(@6s&ApQkv&aPr!W|0`W4#n^^V!ah^%ym zyI5QgqoEG3=5xcjLnn9S(z48JeA7+x%=VK@L-~{w109tu<MDIB>iF z`$#Qij3R+1BiM%yyhqHFZv4X~pK_0G=S>Su4C?A?o*C)+%l~UE(JKCB8d@C*FbeV7 z-Gt(&<{kr*q%H);8<7(9yf6H8{v z27qNVJV(w;&2dLI*uRPtZp%0!zI8W#LkZq>Xa0T$<<$WP%i!w z9)!+5&kCpS9R|f1q#%;&iw=b-_7zXZcS{>9iMtMxUr`T5=FAI0yWkS2>a4bbPv#J_ z_Xl5uw%(8z4b__?%y~)kDueGXD*KbXY|0A}vhdZv3m(VLX=?ZZM57yO1Uxt|4G zGm*Lr3ncd4!w;VojZ34-lwxGjgaw8vaICEUZx-B>jMP9?rP*9{PdOs3I$sW_^BW|x>rV(0h=Xe2`1~CL8Jz?G*2f&Jl^{k zz5GT~X?NQ7gxwJN)R zrPhy3twSS%2q_5?d(=^6yHV67Fn9V#&vxzHgyghWQs!q^CgFT;0Ex7Ncggf(+D zvO}tFc#&TGK8QoQ4JCQQS`OKpe=Xb;Bn%mqS-loLZwXW5(XmLt@*7%WR=bjO@=O*hon5!q#c9TleT6_OB;+;4+Z2CvTi}*- zzC{3^@H*LKg`tSyn#79M@1ExoK`35J=&?CLT(2mJp|-p9jDyua%b`aY02Og*B4m$! z(wHaaw=N}k9V0a}o+Ewt75dgT!NbT8mwwbA9n1T(%ib6r&&HCoejilRm3^(cqtU4I zMY3s#KieZJYd`&30Lp~riH`$y6JW2cc7Ky}D2WY!yD@scJtRcKrnbS|d$RWi^VMF~ z@v`UM3b2h2nte7fBc*X|@oB4zv?`HiL2&!KPt=S9yxfKQMXgJINZ1xd9Qrk?msM&M zH{*@lXdwO`0hqdR^>G)nike3vh^W==pfPl9e@DDGB~2a+eD7O;15XK&G!$!#LMa~-s*ROOa9L#?V$Obp&i1WEA)o7 z?G6YTxAK?rTQuBit>ud~QoxX&MYlu3*V$$C!mcyfS9H;2yq4!`vDmwdd$A0qzU{*0 z1!KKMtEGAgF_UpoN+Qj>&+kTB-4?es^~$RO;d^@$1njv1Ast*21lErn%ta_G7xmqW zTf60n$7~)4uOwe8TU@sl!JT7efKdcn{^KbQr^vSZe_@;Zo7alO`TDr;xS@;hai6Q^ zYh-SsWGq5jZw99}bC?}7yC`wilR-70=!6T0JT)U4;(D<2J|ee-#GU&qW>D>y5MsW{ zo!#9~%-NOm^K(GBi<+**hvk$7av*-xPv_lH=iNW-PAih6Vts!Cm5`DJS!MCe=d(qs z=CR^;jXvA_SY{%Ac!9mF6^#>AXdMyF8=?gh^#uxP`BWzbH?4D&d%rN%wLODn{ExM& zOqyJVKQjAD)LIq`Q+v#G>dShr~>9-nndNH@e z3Jaiq|7?WR)n0LkE9myt&Qq+qN29c`9C-T1-~%%<+6~DY^}-#ioDYfP`78}v=*>T3 z&j_kC3>-y*8;b*cpp1R<{?3ZwlDY5AQN_`p>lG95-I9pBJ0>Cd? z>!SbK`1Cb@!ZB$ToaSkrriJs*GX;Hd+#DZ%DBe~j%91)SIDf92+y6m?2Y>wSLgDg1 zaHaDeOuz!WWM>^lQ&(oaHr0V@u+1R0~$ztljp{H=6e9aHeEPYV96xN#mx1>sj)<>;b2HauRYr;Z{OFsAXH`w z)j4g8a=&rJZmM1%qZWRiSUhO%R*Hzr3942>4se3>Hb1rQ({Z6@N>W3070%^pGYlZNMvm&YP<1l7gR4df9tKcIxwZ_XnT6*^pmZ@$v$neT$U7~->|W_a*vntey5UZdat%aMOa zA(B(aY{(zyr)=BzLpzQipvOdkMC<9Ip&r+)RS$>?;UTn(i1fsUDdMWl3fLpq-vcSd zsB$HLJy02E9wOS~UZBgs)|PAvSl$)QZwrmj5N zP3ji?#7sb}$H*2zUYd)S@-Iy5^`TG&aIk^Xgg^06q-EWsZdT4*>FG4n^b582G-PV+ zaO8g6fZ0s^`#2_N`-Uq5-T1rB?bn_97?E*H(%IAan>!8ZFMev{CZo6s(y)Ol9`Lk4e%l5jk`nLoj-G z_C_IogpHqk23GJETQ?DmJ;T=T3HFoP-oNwX&a3OIn<3IhY`J$Yr&^3$~=sb>b*g2HMv`o@<1%^iAtea|EZ6zR>-LSns}T{PCOFT3B0oL&8ma&~w3pHM6pN^h#jD^)%jSBvA7?~jC8 z<{&)zWcD*J`r26LPkC_N&1sk!XUrjEQ*6(=LrWlM8}42?Ifz;d9|t)SYSM;zsX?O9 zgnS0K6sC8`Od?ByyrAn6!#4Mtk@sz**;)-hez&|65Pd$`FU`M=5}na~EKX{2y+Kn8 zDVCWdc8WQfuj+#6eyB91jC%+Rr+f@K=39D*&2B5iTrT#%_B)wXcXOKzC23t9BSYmC zgbMHy$ExseP!Yc$9jb*+N<*bP&-xl|Dg{Vw-nN%r(cBx%KgbaL3d!N|i50oMyA*Y& z6+HI(7q06+0EM<5F->PK?E7e}-w3?>!FIYCm}T;|E$`L&L*L#%M*H8+xTgq0NsMaw zD7+;tMpkcx?Dy;%z^#;*C21$dcK&wbb~)STHA=B6J{>rJf5UoE{l6MNEb*O;3!UFQ zCV7%sXs0r;Nht{C`CEp+av4h-C)$%q>Hj(5zhqDQNBpdA>BHSvUIkTo65~B^6)Nlc zx)ymg6}RmhO8yZtC>$X9Q!zpNgXvlV7u7XF3_*l>vqEi$S2TGDk5-=XNLKQ~jal^x z)!zO$61ZFJ`f{>x$>0r>cd9?H-O9v0^Arl`E?X~MHn|#4|3?R?Du78k?-s4!2Um8Fs6RJjE1lZ^FwG%)PNlpls zVCv8IYAvL7CQ0684_*#J-xK|Uu>$S?35!DF=>D6c8h#2~{!l}~&B zp#1rSH4zhunD|gmZKTqI!DsYZIJyskxP+R@_aGl!yQ)9G$TM%`2!4g_H(bQKH(FfM zcxmN<+cVRqulS#x>?9WP6Fp1n-8vA88R%e?M``jzdUtE&QTM{>q< zfA2rik}Yr;zAs8(xPFFp`CY#*x-AjK_0gaK*_-!LS2;_8oP((5sf(`r%RfjMt?xDq z=Ni7`7{ZGOQ>z3`X>cS6V%hrQb_&FvYXh@6dTXmksXWbVfB8_^BbW-@*2+assleQ_ z1|8e{if+~DASrdKe8#ysshi)p8m^bmwc{0_(j}zUV{#atsALq)}zl1GqNO}=R0srKnpg0 zYN}cuJD(mOroB+LB**Z7-f%o=1HHg)0hdlsTV1}&y{&ka1k^({_oysH`0LzJb~oq7 zuTjq%vL1^4mD)L(f~gygGSNx#(3j_T#tjY~C<_Ai`T`~PT@lr`4XXSByP5>P zPv_Lys_x07!j@u_F7Ue=>RK{Wfz8%H(pDsgf1gp$znl&Y*x!VvEphO5X^+R~d1^h^ zd47J@+7Wxropy@yG_(*)?M}Rw=cLH?cBjmi$gXDo+(DyV-vpPT+iU2!c81nLH}Mg^ z-0*g%s-$Z*y@gOQfbJ%#K&~)zQHYA)6@hY?O>U@z#a|Lv+oBsxJI@_2cH`} zEk4jOR_6}qefnV$@x?&a-~HRATf<H_4!a7KszoO1$ zrCPQQROfMZbYLhxgCg;Iyb%#m+tZ`Eu2|VY+XPbXQ$H>=7sE@XKdKR4My__Aciw43 zyCMF$6gQDu8aww=oYBgwG!h7Y_|HoncdL$I_2k-U&XxsqFWf5;!9`BWdhpAJ5G5XM z0>x2lyXxyr6Rvty%cJ`{!CLUD^YIv*ORv0P2H_I^`Ns501-p=S4|%M%oyDPX6eh8v zy}G+Lep#xV$G!qTj23Yi(+`CF)!s5XQY%Z%yBLb~gf3n}WeIQoDZ>E{IQw!C>&dRGzlwxW=Ntb%4(nC$IOYv<-<8{XeT^T0CrGb_28XmOcEq zId14*F4}jyUYSL!Uw8+JL0xyEc#>yze<}p^){P9a>$_x;Zhp}g?eFeJ@6^syw!f0N zuNBw0hmwz0&QO{E)UFe4p3lM(33Re_Tu8uM21E_n8N}(0^^&_0mYOZ2_<@<#CzHI|Zw4 zjm@^fGm4gETBXdP4Ba`kb3R}~u9y%;NPrlZYBx$8OY{p`9E^F5&m8TnV^Z zx*$ERf(NW+Pi#*r+s>|D@O2BotE@id9fK@}(v=xZ8SPJJRLfxhSH8Amv-2`I?&;mw zdc!`6RQ4+eS$t?DZM27!>rK0zhg$oR^4NWdKG3V{y7$Qc zRczhp3~j;S6p)=!72@&Q~vmR}DpDk#U_V9H{#5=G^eBDSl{4SK0 zNpP#{<#-uxqV6uMY&Up5QWZG)RMR!+@RUiOaX8|P?U?@!{dVVvn6ct2Z5eJcb@V3v z?fUu)j_qkMuYg`*P!FQeE1-u&59JR)RF3z$34o3R$A@ivUXNK(qVlvg)ZezYxgNa7 zQ!PNIM^YoS7MCuNBE-c_IQ!3s)HGg0qq^he8MN-Uw-G^$W>5ta-Pg3-8_l}zU-E$m z*cn0UD2-*+7PAGgsZ_EAT<6#`1+9Z;%QffCYU-?tU0&-3sEV1-*6aR#G#|21nJ;G4 zY$(NM%|Au>0rX#{r}m^ODLq}O?HSfAJ^_FpkpkBVSRdU7E!F*& zi$3X!zVikYTG2^If%&ocuWzqcK)pq9KlL&RNmos4gRL|Hc*$sA(OEuK>aKd1i59*heJgcNi+WF+Te`OEHFZR6MxRq2rujV+ zq5qgRs}_XP;iJD&4(~LSO2ATgI?RiPVClxSq6q$VHZ9jgwXJS8`a!@4Ki?1UK`)-o z9EP1!FNGqcgb_5~=qJcpk6RzSGoBv$@1 ziPQI}toeDE{0s?LXryp?c6le{{HtSalc=w5*VpeK`POs~54rdSG~*Xn))l2GW}fp6;fE3UWZ$cL5+5^D5y##b2`*o5YAwHKWvcrs|iPkvzeHh&1ye~ zJ8YU;E6>EFU95JY<2;Zej^E_x_qcf6T8oh*YInKLa2%@II8idoOkT%2Wr}5?NrXV5 zZQ`dX2i!2Lv8=-<5^2R04`~m$)4=dDlv&pOXlYu5tFKg>`Tgw4`N^>&iJ|7b01+Mp`{mjSX`=gZ#C)SR$Jy4>&HzzOiN8Lt8 z60W$IXYJNow7Kq{S&37mpA5WCBIzSV!UpD%Tu{ZUV8=YKM=HYevk@w~wdQl=ml1Q0 z%XaYK&nWrEMJVEu86-m!d6-gFxUd7IFX5zb)VNtM2$D7@*B7A^us=l!G{^F$wKa*7 z!Q01%IaOB}b;3i@s)`?yB=|kZzafjRvHRPcFt?Y|IHwRw zI4Fb^p|X6lNJEV0HFNjMG9JbX{f8rx>x?(zH#WY?`iqF@D}>KS{Kw{1r-N01(@z)r zbDXz3uAHZDYAEpuq?IX2F6n;H)t{hOTgIu|g+5;U5-I!VE&UZrS>w*7t zEenS=YcFU+{WwEukz>*_84h5xFBj{cplfO`K*X8PE{-qUdh=aMgsO)xLlNb)2J z|Li>C9fGr)XJ^9gMetImPt_xYPkFB={DVv<>?n~T5j0+Y%VD2s;ImBl+r;05k}jan zZI1g+%Fjj~pP@QW8be?++l~9-4``&rFb->>&8!OUfrpb>cB9RaTD3YfWxChaOe@uE zor;j&9^YsTGQaqj%7KaIpn42ECb8rn=_;@>(Juqgs*FDWnPDQxx$RU{*TWL=IM`O; znz%L?`Km>bj@}UZ2b8u&=3{=6p-LY3@>i5?rwA3ki;s%*l2wG>oH5D)Lh3CPt#7rLOqa$ehR_(d67|AK4)WdNM5rC zF&?ns`7qqze$!i&x=|y`ZcAK3SEy80z?_0rsGPThW0HQXJJ<%tgtb&HG4~%z(=x(jutLJDqV{5Eh%CF++#9V51!>f2p>NVSM0FO21oUVR?>2Y5C#(zn!{yAszRlLp9s7>1ARK%j#A=zvIe^={)7TA7zx;tTdPC-tqZF-G)||W4 zn3R{?8H9aq-kA%0ENo2E;1SVpJW($F9kuxu&+*S_x|#0Bf(8=(j*TCv$p`>6q)3%; zY$~4aYiw?9GC#Tr%6t#Rfe>;U38QX`|Jph)OBQpO zsm>u{)tH!yV#d{mNC#)IM$yT{Bv$d;N#F2^d9$dCjV4O`1h~Le7tN1#ZA9;lmdHv3 zg(1Y8YhAM-2kaU06V97DlRmpZ9?#k`@lXEGe$*wW&+!C@0ccn&oJ6z;Dyj`1Sy>fk zbNGZ7%Iy|wbIkwXNE`skTO>9_yFbUj1@Psd-1|Hxm-+T}YNtpbPXOaHq~ta2uA0R# zZoZVtnF%FMdayoF(la7Z7C3%kpvqf1;MzWMxV^&$id&83tZKGiIQI;9^mM|GU6K6> z$hGryTSVlt5VtTM$2ayJ_Rs6NU8!fK(%AK#GwwCm+XKa366fzix|CI)!e10rWDE>_n-s zX;s!APFpSgsG+mJnD{E1lg?CZBW%4Tm05vtS=HdjK-L}y9C3_P!A&>vF6@9KEWJ7S z@s(MRJglF^RUs7&qJ~ag+DmsqN&;uA9!EKfVI_3F;``LI)|-gS*aB~)2cA;YqDYUtNbrI z=s7<#Zog_!r^4etH8~(kmsNH2Ac3GldPD~M;BV!PTOjovrd%tW9(~8TS;eh8x|!1j)1MZ>*f1iM<^8x`3a$3*oFRYD!Z{o zX5$&*#l2CP=JwFH&`4wS`|Z|)E*ue{{G0<2 zn>#Td)bc(EB^{ctKtPYFeyvM3Lt37l=O)ak8X*_-yrV^KfSO3;DkRmD)8UPoo+=TA zwrglX6u3m#XJ1iZGOf&|?ulxA1TeX#> zd=6P|2NVC`InGA~ai6T!pO#Q2NTR+^7eT5E+2(Y4@yc^bwPq3aeJQVK#ZHLymOspI z8)Fc&A1Kt{VWcYwBT|1)kkg?9JuKiC4w^$|OE&#+LBq{?>dz})m{KuhR`7C(T4D~p zW_8Nb!G}wlUPf+9NYkDY*>C{S?b|fSmZTc}$x>mRCUHxr_4IxrVb&TLd>_)Vbn5N& zT6s@zI+89w-7x+q*h@VG@TMk4Cw2jthVqbH<9y=TNK}M%id1i zXLNiEX|R9J!r+>@d6Ct0PgWzwuoH3^W%i*K$FS9_`cpO{`iJ#o^qQG=VnCO>N`oAc z=J8n3SYNUNGXhmL_-iL^nC1Jk>0^pAjfPg3C&Rf_#UBmp#00{?UrWKOV29=5P#1`{#UxwL?~rWxq-5@0&9x`@EYw2Z?rD3 zip9iPhQ1T_aP`==GnDl7@F3KO7Us|2J!L-XV87gcFwBZO8`+~8KqHgMYgP$WP}g%! zn1&zU2KXnzzQ3`yv<&6!TdJzJUrWR$BMXky$B0NXK-33$XCJLAEi`2AA7a^BS-7UXhb#eUBgs-=$93 zXIK>;*!`5~QXX9LJ-fFEZkfH$QIyb*WIdOTe>>3h_jRg2hMVv;!Xkr>*KXk}XQSPQ zg4E3yjkgOv<~TvmacySEaw>tZ2r<*)_X8~eQOV$-H}#%9zQ@qLcj}ezcU)2EBkh+x z7BC)wrb)GhiV>swGByk>*%!*2@pQ7Wo|^^edg0;n9W-4UXEYM39}sYb%yYl~1Jx)U zYb{PMb=m$AU}>8X)eWE$aMAH0p+k;YW4ao{6y49KL}1ByPNKeyd|4^h)Mxu6km*U8 zVrZ%|b2Jxe@)Ly1yEN19}~ z?HA>f!GcNCU>5w6r5CJ(Ks><4k*>N`!dwDPBL8w{6_tNhjw8BS;VV z2;=w}YsUyrD{7n6C2F)hJ)5f<8d-R~e(y%Fg;{8LZpsjWFA`R!Pg~D>e0@ZEnM{QZ z4k0${#qeYt6%X`?u65d2X|Gp53Hq2%C5cZjR!g5sq~6BkN3OkA0AAy*u&qyW&swe4 zY0i%ce-34_;8Sq}K>+d5YhL-t$AE?Md#RN^A;rD8;^uLvu4`IgWVr0Z-c49dSX zZ|!7tzD7?C$5JfY_Z~QV_ZyeXGz|X&fopFLr#v(3sH86A3rA9|jlVbYlz&nDv7M;g zh{kLx%@Vfu)zAm0`ftm}#~c<6hhiCVG2b>>m1Wk@4!zm3VlfR(CYOtgqEF`pclmhP z%>O?NAeL0fsINqWn#LO^4M=xm-+zJq69gLzW?(zrvQnG-{e>hhD5;pA%zgdO!u>xQ zN&A}_fm9KDm-Vi|hztf-M$Q{CX98$ED$c{8{}iP|1=(!5&Ft`*w%UP!`$_Wv<9#A} z6qS)z!%qwX4c7+geyw)TxNqynMno67=l-V~U-1So_6UXw+Glt@RU>mztKeqX@b7U{)lb)_ZG$A6z1Z3-jFK@&cdg&Pgc+zxP6I zAmMo=<%rxzuof5dYftc3S2n0Yq#yML{_>PZIM&lbYAKp>9Wh78Jr;6ox<|$}HBMq& zvvyyo6V8p0FG%#=veSg@VjB39TNnm{pKVox^`Vc(9h>O0#M8zxVL+vBo6!@CG5=8N zOVAbBk>DMmI}g31+Rp-0V z*$UgCzkh}MnF8+PF=BJ`K3R<$yyNyyB&35MhzV2Q^`b93)$Aj>sY~3Mqt41ePWAAv zf*@Xe15mn;`NsKv;;V5RnDBR%(W;;kA+up?edl_gH&`b}cr6zvOmEI$v0Qq(pY=oD zgYGfz7OI^%o^%vTxqiorDTo|yipVwzy&3h0y#FrqV!qby#q0l<9{g0Q!CKYPM;qn1 z)yk3Hv_EG2%}f@n=@G)CwV6y@i4h5*XY3CTi;YK?AV$-rHV^vm9$w~&?+5U~!I2ca zGioJ(-d0&nrINM#W`GR6d#%;j&a9ZcyMaoB0Dd1AP9hJzzjC(d@lMLB541#mgA|pk zKrwT;mPIY?leH;>Kmjaor`vdSdEc8JnVLjOhEh{K;AbhR|2Hrt$W$q_$;BcghIGnH z9c*=fDo#tIx|uA+>M`!vj4GxUPu%FRYFg#t_pi}G&+(Akf`q>;EF@nQtyzEQU9y3k zPI=e`mvuY%1rbj|?t7xxqZXie(bZC)A_$W|ikNfPypSFE0WpvkudgGiAd4{s%iun$21G}JDN22>_PAH!rLN_vv#r7UYsZM)uo^p1B#DmLQ`TSn=Z6Dy_ zu&87J;0C1{);pwvOe?a}E$$CiCsLgLBY%2ifg`^ebOhCg+CI*#ss{?V(5t7kS}mSE zhjS=JnJWyZsH$_;F;OF|t_+HU+Q=>=Z88GaXvzR{??k-I6E8|CjGiBJ78vD+FI$qW zB8+Y6%ZC5a(_Uk=z%6{`1%3%sM!d%z%S|H};)@^}eOvIAHnmP1PEMKp&A zFy!R%ecDU&#|b7_l!kYJi#%>yYM-|VB1iuLSAZxd*J}Wu>su%=MB62P(?h{@{7c`a zvg7wAs!#4@e8s0J5i~&Id$HU++CWdyr^)I~GNC&`-MrFnP$WLX6_=Q4jTOWQTcY?& zTPh;q^dIG(isim4L@~2ckWstm&;YgkzwngYjzxcpn~?P~Fv8%DTQ@iCan+HwpX7y7 zIIw@hD!BV(a8Qn_OyeUcKY(q%yiU@mNtc+#g9kUTI9(2aZtnUX_nL_2@2f~E#_-$!FSFfk^K?($YEjlh)}W$Csgj<3*oy*sq2aG|?S5Sn#TqqPY)^nxeqzJ1do2R+1qHX|xI4p-3yFtzRy%A2oFq(NAZa)+ zz}(XS!V61MDW4Z|)UOc4YH#)G^nF0e^PL$$3p7K^jgKJVG<@GzXbC(ayx~GVH0cQr z4f~5|zWfLj3Pt=w;Pv*3<{Be#g@`slIgJ*XsPeirP7EX0^i!15f@6hP3~rICvu}gF z{wwS}LdDq68WZX90QRU4^x?fd-ryuPR{PbYI_BMRoT)5~+MUkiL5YcpIlc0|Xe+3S zJc7$u3?4Kh9q9Kvh3DIX*v=n~N0>;XLg3+4p@L`H>EqrqE$1w*6UT;PSNnZK2sa=s zJ0{8n$a>@-Cwf)=O#dBoKJ?Sv>*^XX&bdzo4uJ@YV8V>3?QA1I z3e{|bZa-{7e2+5 zd9Se@25-a8Lorr&&Na^2fq|2ZBTeZy!#gkG{GoK;B*mn~ zx2FFxuoWnHt+9df?~{#ekpLz!bdL}}jZUr45ia^p4qFEI=a{AB9b%Uwus*hqL|1gp z+V=$t(|{sJUYQLtazJ@Tno2}gjr*$L@#_n~r_x`fPj^=&XFo%=;$*TcE~z1BvYA7> zGRyRS;5&|bz)T%CC#OMkH@w-y9w&0g+$&B-Li0X(sq$iR=S}h%&D3L0?WCVZ4uN0mZ>ns|}Gq}BX z{UYcoGfP5@arx6)Oa{h9)Zg-(wYXZQ*`#S85Z!&GRK<=$C-3^jz)$6u=JwKPFJzxN zjv7?8RyWI0^+@y#m6`u!kmQDCt2+mVE0)y}1VtwgVQv)~C5dNzmu2;Io%kCZrKsf< zPq#kniJ=VFotgz`MB@ZL>+9?Rtzwr$FzJzsV6mw9QZ=u>SBZE8InTp)bL7`20(j`1 z0tD7ooqulSLZg74MMP>FGO<&V#R0)`w|c;c$e4tvF=QfZ*yI8> z|H5xbCOQL?LJ%Y>jXHR76-SNDd650zYt|+kr`-xVzuoDopbg+4$#o4~i?(5mnq(F( z6EJY|*&Eg6)!8W(7Wk;oS90@bdMSmjIVtFu^m1d>;_$9wdB$KW{7{GnK>#RB*_Ccb z5-m2Sa5RIvEiN$q?L|j`UsoSzC8uwWmC2Y?+tuUM3fc1?+YZY{%TBa$=h5x*LI4(` zd+7a7)72Rk%p1Ggd?LhJA74Z`CMfj0=}a2?*dZSP@X<~txCbiZG$Qlsnz zoAlKBqoIaSQ1`UNE+>I0N)8w0MI3+3-MQXoWcvVni{SUIks?dyWn+P}fb4%big*?^ zryxR_!l-+#22J^+VGuiW3$380D-65sL-#X4*|Ze9=oHTcX?%onpI=3Oqs48ldJb^{7d;u<#u@VXm(*DJp~Fg4!HF z`q(4Z7S{EP{Ao5E0$2Bma<$L*wLhnHROl#eAI#OuXLXNL7sko;+Zjyg^q45u<-Y5} ztwpGMr5CbaM%ncGgGIsB!H2#tB9vMf#q4myX$D;BwNm2sCNze*k6NffCX@O0jjzou+3amO>r~;rX+DN_ zeLRRg9u$`{xst$Ug{_U&qdmD_>4tPZuwF#cbli!0{qd4q8d>IN_P6y?oW1dcS_w)l6h(@?)c)79G-0U?;@93Bm0wHi3Dlf&r6GigqHh!_}i&D&%I;+rfHaRc_8|(_^A%Q zk{*d8kDuDaIDWCz=95mVTrF42@2>di3y3)86-My{7N&@MQFb&56{OTAf2 zXh-sCl|;qScu!q+d%iqH4f7`Tf z8)u$MQeE3dIWH<{wQ8%WoxSx(RW3X?G@Dbdr$}lDkU_8d>8#%jbNpFFAlQ{gfD8jA zcdy>;&It0(9FjO0MZ&RF3W+zyp%i4_ZE10rJ0FQ>EKK@AGqLrg#v{spwQ$yf+I}GR z+gG5XT~1U!G5*Q4!*>DRV&i~2dNC_dXXTzqV`J@{Qej%_H?N2S{i1$dZT*+2Rq90P z1I_ql^n)oj3S1pKt1mpqFfNVID0}w;-BSE{lA^uD{F*QFox;;KiUs%hy+N~FDA2M* zX-ofU-YDtHRO@_%F!t@s5SmY&KFRB6j|BY1aFrC+LYD;R2FBO9YpY_Ou8Lq8%@M*R z3@tZ2hG_3{@y~#g*5CcQM{fkmo&O0M%>+G*Lc?ifzEpp`-c#ar-lErUcgiXJoYWJB zO#UNR=q{<|^le`mTE2TYh*qzb)(+(EvovyK>lgo*|OqEkAj3O4GBL@)K?rH{@C zRpumuzBUX!kVRf2F@)Z8&VIoZj1hQS4T#iDp%0Bn6zdkNynRK&zh_&1%6h^U8L&pM z^Eh8TMgp?3lk>N;e}&RhurFmQh=T z|AFvnC4P(xacn=j-~=XM9teN^i{!I^%J+N&2T;D$cEk`!0MgWmvVWk9-Y3&YdNZ_BULaA*pARJ! z>3j?tvYqo?S|(N9Sgm>4-5^S~=zKcU4{*;RVE`n$enDdN%eM+Z-D_VjD@!2`WOUB! zbqC`o(BmVJa_^}rH7jnDnP3AH2DRXkDxEZ21SV4B(Gr>?+Cuu zP-+mOP-Abntv)KD)D)=Y?2ldrww-Cq@Vf2fyKNF+Zk1|L( zZ=(5Wg)UA4-5mBzVBGGinywq^Ms11{@&c|G`|0y&Mwjzl&kDX0Ef^AiMHA%isDyV4 zm_+qU^so~4htYl{jYO&lBZ@KD)vD1qIwut^dl={7@z?zkOO>91el`02Fq$#l=y|EG z-)LIFpag54)v)jt8>TNTfsJpYCgyc9M^cX1BYyC@P94L}qU5t^6uGm*LKU&ZpZwG* zCIRRJs*qfl_`kOI?BDIrlJq0b3X&r7Swq*2?gL;)GLb4PynX<1&`$t=?jW>_UR3S3 zXL)H(9(7<8ie{(4TRuR_c$Ua^cNQFQUV;g5bNJ1z%pITdwL{b*-vzFl4936K%36-yiK3DB5X3TZ(Tnxo2|+tV`2gNoG#?fMU(TbF zXUB2^Uc3;DsYtvGN?oov<0TP_MOkjx_fC*i-6N4T1nYZ0gB1HJP3zhA?wPP*Ra zep$$Tw0@Z)8JGHuenGY#j`MmfyCLaI?1a7@(n1QrQqT`U#jYL|xLUBSYBz5oy1smK zf07PJ7D9#=83VScSf!&fX+)i0ZIK=iVia?M%mu>*MIEhg+A4qVhz`H^v5 z8unU%xZJD_quNO(1x6X(!-B%Z<&}82HjvH z)7gcZ?Q*|)f7-ouE648+j(tSu3=!aN)97B5h|GK95AToJ=W=1u44{Cv0m>Uq*c+lz zrq7w%$mCbMv)Zn=FYoM-fKa%y%%t}n-HS)NTIF9#OwD60Yt(lh>vKzu@g2w&IlHLx4yB7};-szT&-5Zy;Z2#CuwAQR8(fTV3)noO)1R5kz$G% zQW33 z`tpA7*f=28U-pJ?iytFZtTTtlwQ+`7MsF1b!qO>rtD`_i3&RV^<;S~TN#lG(1vzmz zgtef5ynIF8nr;tO%)0M=Y%Nb7bcw_rN~iXZ^O|^1=o}fr&$wIl(3zGX=R?h$ygT|n z*x(bc;GR`A0X$E#!9Bapq=tf@{LtiX7K)N}`dLwIFq41aw`R#7VE^-uqUX+f zW$MrQE!ee$+p|xBYd)}E`FFpcxwfA4c)(W=?3sZJ;k$4M<89${+%Btm{A`Y`&N{-< z4bMpsh~}&aZHS9VOUw{`)?-g%Pf!fPr|2tz<#T_LQ2Ac3RD(s^{f`dfycPXqY*AjM z3bVf5MAk-c(baB!S4eO_PNkrPIO18T-%7vIFHZyI69sW(vGelt^j9^XAJnUV#zrbt z`;2g(Qow%Dj0ytuvZrMcLmHed_b9?4Lk^0>)3HRI83sSjtKo%g-aHk9Q?!@tTO@mN znm5qT9;X5(SVyz9!>sty;-opwKLHOM`W@_fibi04m%U+@-DIgNO@x#ZP#g9<4m528 z=YQrDG_wbfUZw{yOMzO;`k4~-sDl7C_%bbwSU{V;a%lqU%j*raM+_Y%jh& zM5JCQO9WK?{ttSmEs!bibKBdJSPH>!6>0h{5&Xj}S(hRUmFMl8_!IMUU9uz((NoGX zFRT8gbL+k1<-ZqILgVi$35oA0giUe5r6Rhs`&ICYDK<#$h|EuNhOXO=S+&a$IO4#v z7jfQ;?@Kd~Mr$PL1pBtY)M#MyGh49BL8%^Fg?5(%Dv@!AibG1fHLdDX>#by4VwI2f z#+K1n@b%KJju7OV`xmtc;^)B4^k$w?nkD4^CPj`V#(D06Ss8k;xJ<@tXA;-vBXx{g zaqULAMKIUXpmFjuU$&}~wO4D%Z!NnOML%Na`+`b;oLJ1}qT{aMIwuSS+wzydj&`RB zTVhckp4u(b%-YVfP*sa%B^oIK(I+QP@9ULOOgy?3c9EpmW4MbMn63tA(-IAwuhp%~ z2cHxXVsf6C#k-M!vp<@}UODb}T0X&m_8fT}lqN;V2|9cMy(rFbDd6WB*Ap$2m%XTeNoa63b&fBPN}y z0I#h307-GG>ik#U*=jrQU@S=qx-8jC8YZsXS1!7q#Nqr#72DC@Xt-Xph3w*$K&qkn zTH%X%tkcgbKpEi=*G#pz^2OEV%BoXX7^;>A(Lpt1r zV&36DueX#2aRq&(n*UIk>n%^o5P$}Xok_0uT?Zfl zGwtt@2e~MqsG#3jutwN$i^~^f&Cwm=S31TaLm-X%!(`bUd^>4%Fi{eXh>l?EG`2gE zrq34i!oSpbTs$20vrssBrpFHuT5}X6Sv#`Dps-g(%w?Cvq*+XCth7_~Bz=) zAbcW>Ydy=Fe8swOh#b64M*k$=nnSE>yK;ZYdzBRT>@6AQZi(EkTIK zMR_Ap*zM#e>dIKMchEuqY({y5jK4jgBDIKrJF8S`j$u-2*`Ppsy>lbAlLC%>cmO?R zaEVRf-WDij^6FI?`IS2*NEnU%GN(R8+DL(-@Q3SZHZYZWx(Lf}^%BdXdj;CYlLCkV zT9YgtIN4e$Fsx%ferk`sEM%<)bzL^2@^q#n0Zx-mpOo~yI^WnIUvtmPTAKrhlbBRA zLvI;GiK}EU4=XAuI@F&+fY*K{`x$~3Q5^+8OsDra3=u+y6L5s7Cu){(e1I;DTymPb zaT=jFi-NZmeoyY$Xn^{5tGLpsSV|6)JuSA%UPtkuw=}?sDun&(_MiaZWEovjZqfPm z8$QE1f0*%1V4jJm9`~_MdCF zuw~O~PiOOU#y%5CZ%1xMim+?yCYnaFTPp3$R5FoAb21>gLZW6448g|k`0J!C>UhCp z7V|?OB~G%ph%H8jD)KDk6=`c);g-Nx7O!L`cS799Rm_E^1xMU-d+xL{UcJNsT^k?x zA&XWTL#0(#hBAdSy}-+M){R-z%_H}6{r7#ZD}qtZ2loQ3hXXTIDG)U^r$69|o0Sew z4>(pKj=Y}YODl)gK^|Q<`69#tLaR(v5vJXFq0uLOT2;Ddu$GF185UJ*q&HJ{tNygl zF^!C4Ie6B;8+XStmrw8V2??9AJE_2p9_N%#8zBg#NWPyH;x$U2H7_Guyid|?Sw#JI zONqINz<_{j^5~uLqGJ5>m=b~tNZUDjyLSK3Twub1Z48{qW$cer%uaI#Ve9U9J^`=srJyG3+uZk=`feLZ0TU}KLQYFvg2+hE zzXB%CkBuu!(F0Qy7988xhN8+?9d{LoI<5kAbkdiXht9YtfhO#y&La^jlm4j-!i@yr zv-U#wXy@bC6e1ux#SMkFNdoaLgNz(+L*|&DnYBBrZY)aC<(Tg_D5i zbfSBET1_9x{w3@?(9_CwmH_Wtx z^o=LS9ih7sw^&Rm9=D}W$CqbfZBAFkKi@t?rm$;HJw5kD8xL`wG^Ips`*c1B@i?jt zBk4GGBaF>gK!!&pM6DhG0s`iic5OmZ<&?#>RO449ybq z$WbC@zHtqjhx>RfHl_cq(j#oZI4MWOss+E(PoZFwn@je8uJfK{dmHsp;{@eHll8SF zD8O#jBZ(0rR6KL8A_kJP1`WnJR|o)AI$yL@Y#DO3)eKQ-Sw*o;Pk|2`i|Vu`*P~yQ z$>ecCoe?(96c@-5AK#Xl`oK_+v$`=*aGZQ7Z)oNKic-G6kS^s-=HPUPq8Ce=2qW#k zI6dtt)C;x!SL+n52BL)}+73^<;u>4z5W1rNhH0mAzi=WKfb(`ihczFJhscTeSPu#VWG7Ho? *lc=j@&QNZF#LiUjwoVGYR`p(11-Ry z9iv8fA{m>%yb28yPjw3oKZ7bd7F-}QqGsa`=s?F+YxDe-Yz7(d(44cbPe>){^L11T?qD zm5_v55SiU2>Ovn~&-7+d7asTEaL?Ag#2fPBd_6PMBz=r^DkthvsohlYj1lmFWo}B| zfLn`D1`Avhg(E=>gYg-b(A1A@6mJ4C*GrqEUH)%k_!(&yaYIVFR%cp>!(+?#s&B;? z8!y<0h^M_AMXAh`=Gh?D_~7AylIm;%&xg!;7Lw1ljenlqpXf-0H^iUmzGv;mpfQ`G zaN_)e#)M!l5RRPs{x(5|NMkI6KV7B`F7=0nmwI=aCV?v~qYxJ{2ttYKyi*o7YJ5YY zb^i$P_&}q?nGp0}-aqGzTP~(_lHhHn7LzBkhKW&G8}eS2TDy|cnkjxy{Ex3Tf}m{=hHJgy{stX8$VxEhDH0GF1{)eQ?y zFa3_#;3Bytx2{g=ZQOxO9D2oFGvvg2&63N1Lo{FYQlhJMi14kc?l*77J9!1&4u>EI z%%%^_zCU^OBiV1i&kI4qW|)w;zC3I|queDUD@yNFEZG$=l~+SLAj9c%nXr=h98KJ%1IZRd+yTAbTROfQG|BhELgd|@XkD8(Z?O<{N-&xT-Hj{lfcPT8 zVlltdV_74{lM+}UIDs)CgifvEKL6BL(>o5iQHhKS>==SerDp9TYG&AF)j8M)pUf)v zb&M()AM_`+D2wXwwYAWc`_c#!chCmAix2}x!#fIPPqgVs$FmT7C)}z#zNpt?Ntfn#A>h%dh0A>8)hZ1KCc$AzD%5{k; zSwzOPef#=-TkWp6tknzMtl*AXJs*^y=36KB=l7GZwy~1JgoIe0x8w``*G*rnW)SIR zcH_n3QaX<{)3#dQSbs4lGN#H_@X~yPn5*^tt!HKZbbI$t7QYzjc$IW|hHN0V>H6tW zRkDKE=Xp${vcEciCNlZ;!j-8(oilQhOT>I58LlAj@diQf=%A2yjeiC2b%+=blapjs zw6Ax&2(VYBP%3Ur+hgt^+va5bMu*7$6M9t38)pd1S=4N~O)YQA1%-0>=1N-C$ImCR zNIDO>t0Tk=?uz&rtzfbC~g(#0`K7dknL+2c1{wAQM#|4_k#*qJC6H(z~4k~sszud9jgl}m5~i) zAKf;a#Xqo7;{~7!Rw2 zqDmBvFkl}eiW6EeK-ShxDIY>Hk&U}34%jRN^04BfP&(#GU@S9hloc@96>F(V_0R`~ zDx>8-Jqf`PNyU)aTl3m!QP(Bo;~Zul?~z*1S2RVR8Qp+OqaRM|8(Grgb>SQ|H`@U8 zP30!6__u@dna3J$R&sayj2b${eT=_K_Lwynz37;E(KqA7J_q%GiT?#}Jd_2*G*I=n z+vuF=5^|sR-)P?Ou7V(lZIcI}Tfwh;x0BLN%G6aF)+B#t8()sEfEeB|ePLo~?ZJ|gyr zCaL!LUUa?%o-Nk(UZeUD8rdp64-u4bdtUESuNBnMmW@+r$)W_<63stzldGhrcmF8W z(*771U53?zh*Pi#-!rlGM@m9muMq73{`8DjfWIe{>4l*x7dZXesKx5Hy$hr-#=G3d zR*Hph`qts#;D6E-Zu~f4S+3uh?s~L3z-c~O(EYNFFI&1P=+#Fn*m6u;huV#c#BfrYj9k4}YI4bs7yJqGGO44Ln;rc{q)(rIg%nGO*Uncw^K^K9?)xY0j4)kqN(Y0Sp1pt#Ry1Z>+$r(k6x zxE_2yHW9H~n9NAxLq>EJe6Jv_r`ohXOzaO&x6*mwc1no*C8ntoAFj5UATZ*IFs8 zQxjU?fKFFJ1+@4#* zTp$k~C3?+vO&*WB*2^W?xY3+rB8aF;++3!CSLasPozErW_vF^v-Tzo&;uq6ZWoSHB z>GLgxjr+z`#EZMo!%eKsrP^vx5Y=7=JHxq7hjBJOgZ_B=P%?fm_8dLHfFWG8C|kfX zGq_NmS=8kNGRL+Yt`$Zgcb52#7}k&XrB^2+R3Ny)?bg`gi|#oEj7 z${Z>lZ*xP)-HiT{4m`rSB8o1!kB;(Urr!=u6MS8%qy)jWAT6S`AQf^*pF^K+6V?3H zf5n`ao$5*WvY$;xW)w6(~`(95MBC@^^}38hCBGL%%HDclxD zc@yI)+l01m+0U?d(|}5`;3a-_v^pO@;=hd%?Nx+Bfc~P=oN9UH!yu+7O}47Gq~96);#;T1!toe0`G%h`IW`wm{e>Bw z`sEox3YpvkhCimpuhD8U<#Xisxt>t1qkGy8^O#{je*|fH$KSAQhexl&f>59^EOYhQ zKe^6MR3^!FT3|rgcjL@n(CwlT`MiC|m%x{!gmVZ|5QBSCz0oqKDCKJf+ZkLE=6KZR zJwY+=v**`+y)c^=mYZ)qvcexL_Dti|2rn{2{7J{FA;4&1YRd66!3WGRB_9kYv&5%< zqya&>WEOmt!!N$F5~-u#@o#=)l{+RVn}%&;m#P-tLX%QY@VbZJ`{fE>DO99s=U)56{js^@0{LKM|2sgj~e?!uDFm6x(h?;;bKxO9ay2D-JHf&hJ2D-+1o zmqQz#?Dr<%kVbTCou`2_x8Z&elCqppQ69nxuWibaUu`i{O7l-uhgLafN=Nzepoz(S zuv}7%FX-jd&Zp9Q@F7WqUd;uf$dDnKul2<`{O50@E~R>z1V?;P!(-jxKSAKuw2M`m zGco^dihdz9+)Z{$rcVpXx3zSh|`AoJlt1@;dd() z9=!op=+@htkCyKDf(v$w6+DwF_1-%xzf|BGLR1ukf%l6y3K`asLe#FaR;m`v=g;pT z!A56aUeK_aI1JMc4#OB!q{xMj`|0m_!S>UzJh6NIpJwJhpoyS7iQ+0O@N@)3eO)$* zX$utilY_aT`(YiKVwuE1K)dyNud(_j_NnatG|yCV`$o;mJJI-6`szrxpZ-NQw&ttK zhfpO}-G&sPp`4Lm4aL=(`^J(9qn>E!a+z=Sy72m>aPsY=Kntc1m+fB*%NPSaMtTz7hHt#6hUrZ+G-bTIntF->K zRQ7uXjA5**`I3wGMEQWS#Y{~-J+vppnB#W5Xn5t}_ZS!={QHv6edeRL7H!em3a^ge zSutmoN_NDXhtC7-nk=68vogV!-6`{5+llEg=r8vB6bie0rI$+{e`XC|y}%^3x+~~g zmoBgaMZ`E}jQqG&8r-T{YtL%A^{RfTw7q#EE@y?UESkdQIcJ;BR!zUl;Xm{-6LFb4 zyrJ^Pe*O}Lb0_5U?=oi4Qke5A?O>f-_4boBE|`11LCQ(gj2G=6OQQIhc&W4bzvP+e zLr;o$fx?Rsra{rbM2j!EzkP8A=g#=L4Lhq%loB2OD$`{*8;6la^ReyKbCj!8hBJe5 ze}A9_VW%9ZR)lP;#nXmKc&XIZU--KW6dN!JH0bP{!o``R5sV)c%u4M*R~|No6w<4p zt<~x!Or1%|;ihG~)MVi=eXkNdBnD6n`%`wfyROX+xpDb(IDFL?ChJ94)pc6lVIR1u zhe86Q%R3g^aS(~5Nl_W$lu|l9m1C=H+`Jn^K5gt_nb7p+fNipzqEdM(p6Pz7_kr}y zZhJ)G@qea-N z8`SAtR-*?upn=zkI*whz?bZUrsN$b=h) zV1PvFot?PR15P!)QtoQl_T4X3+%}4yiM5Kp?Wnt`$>RUtUi3eE05SbvCM19u;LyKR z_Gl=te2PraQFSxCT~d0~m}t7t)d8yqh%*pqc10m#cG*mOVM5+venXyvlcZNl+-f^y zhs^a+{hFh^OhVktOCqdcQ8p8b#u@6FT>dt`SF$d>C(uI%yJ4m`Q|*@`8t{2j6c)fzt4Ox|*x2@P_`T6ux{T>@we%xU2q zLHmJRhl)RqS;9mW08S|W$LDYxMvL01N+}~SY}3Juf^>z{XJr-Jo zrj=5bGddbDB;&Nkfbt9E&I1ESscD7p4^92RM!xuzME{wwM_A(Gq&iJ@xAN(QT2qb6 zv|wIod;mib9lG4UtV)A$Pw$LuAGwf=a?aczj6Pwe0LIP23j~ILsi4NPEDKjk>9WMq zOgz`>vLw|`$L#`{&ss8TE@k(`%08p4D@e2b(gj8zL5$ez2g0z^n~WQQF9Yo_teN-L zFPqVt4GsvD_?n2;VgHpz24KWF*o8gJs*pabYQ~WNP~<=%=EOryE#7sQ+S6KW5O%(~ zMdNnb<h{(};MD;9iNoJ5d$vsSl8xMWQrc8}Ehekauf25gSMSe*gB2?Yq(~=)3s< z$H8e92U~#hAHLgsZ~DFt@inP{6aK|)Rwje?+3jR{YMU0N{$c%mKPgeBja<2K6rVYH z1^El8Dg3*vE(}8uu1!~dg~!6AMLxIBkDnydc)WwtNUPFq49D|D6TAezNwp`m2p6~^ zBecqiR`ttfe_&IEa2^tiGCaU5V@narD-QXzFoSs^=@&k~{jjJ(0}a}n2b&!aN|Yd& z$#K~{yeAH1Yh~{}I}N1V6y4Khy8F-Z1t7*U>g!W?)TTvOR{Hyj#} z<5wh?3xuIuvoy2OYHqp@q37up^TlIw6aW=@KK(fnRc}7gcn36c^=NEl=Elx&*nr>< z_PoL)b8l4LJlK7JlxTZ=^TwiV2$BL?&_)MJ0I*XnOkM$rk-C2l!2af0l7spUKAnx0 zcO9bsg$UdeoBfA56GKLTL_UwrSkakI^(em#9>1#B{~`v6G+d#ua2&j#2G`3^SCTbg zj`Qxs7^9pPs-kUN*a?(*wyyHWJ(DEJ3;l zRekL;Y7uD6*K;0<@;GTa#6wRyCFC(Ll0fSS)X4m|zf1dKnI{p3SP;XCRg4G5Gab+5 zXa2oCb8}61m7l}}G}VOaF$A9`!IPL}#anr{I#RP^EFt|Me!}+3tm2Ygce+&TiqYiv9LrrM9ml!5Pn+ z9Pg9ezn1~kcLG*2a|=uw3_G=GH>ne0i=tnR&w-cGIMdMv?TBp#dj*Aj*9rmZR8YD^ zpd2+cKb_m}5F7iI$o~_Z7$lUvyW__gUNyTxtK#uzcimcQL*|1I=a zTuMquIv8H@`(15qzSI+uY*J~CV~S3X^P_T<;5IE&0DHQ~7#acV){V@DGR591=szqJVvThq8Kq&=IHTn`xvM@=O6 zl(+;!qj|Q9i$O^g!Z{}reEfThVGQ{3knyuj9%ru@HI-0VSfs;{21M{_vGSVcwZ{L3 z;OX2R51a`}oI=I{aRs-+_aszKUGE-#*PbaAxD-~1Ej(_Houz=Dm2W8^DDdk z%#=%d&KCAp@&Qhc==$yrk|lqVq^?Y>gAhk}3NAkQyv_+blWjBhgj*Km1+@(?v~_p+ zK8L@|E(o}sAJ?jU))<3X>flX-uOZlI4pxA7Ke}(?{q?l=PcZo4|B98Hl=$ib-c>AO`PdN0;iH`{Ag^TT12*?yWQG|wENln8(lFk{T5bb*vCXyIZ9NbLj zBgeq!cMRh@*{%_wg}i;z+(+w*{k|{MXuOsPO*a%uVw1sZI{fecAVUz6ZP= zn`(RE_J=4H{EP|rkm9`;Fc7aH6D^}+~bavn16^_VtRWb z(nGGIe`hu~s@dv97c-#zH=V~KkRVe0>N9L%xDMha`EvD+wBgf18>ib)_S1|8<~bOO zC2evV{BN50;V>*=zQWO$eHWe|&U?zdA8&?-UHKMygY3hHk3YX6$(1)^IMQ0zilV<> z?X{$gg&3|@J(Kqv-+G3NMiC26b>Tmo2JK{50dReUdNbVXcwfla+0}@;rlnbWS2%PWF8MsZOKwtitd+wZk;T?fBxc zQxxU7G!i#lptkz!RB=fH{oU&!R2}+WyyT*o>8nB^VUna^IH;x zRs^yYn=A14jaj3kB%DqISB$Tdz|^!mmXC<%(RQWzneWYE_(ulF^H&n1H~zNTgyDRS zA3T0qc(EfaP^$Y#osuTvr{5r-n3U(LRXT$eFHx;FUzoBX*2dIH}p7#T; z>!o|?zF}>{by5m4)E3kF!L>%i`t#yKy6KN+PP&Lkt^{xDX31~NCW{qmlK(Wa8IEwn zd<}-P-=?HT{=X~$#e!?B_ChqoKn_W5Rc0#uUD2&HzI0xU2#0zJ?=||yb>DHyk3|Xz z%Mm14&j_dwyl<;;>?Eo7@B=7!9_I;`T=TXSLt*%YB>h9}l0ABLF0HJ3LL0i>FX4$p z>HLf#U5($MNHN_Bmj3KXK1e|#<~BWimlci~}409ZL;bZT&v> zA@1da-i9Gm(#>b+c%k~j+p=7%`YMlaWlzoP?lc$r_!C5rVCs76xnSVlX0P37)u@19 z>ao!Ug=s_X>yPY}!QIXooXL54iY+4iWqBW@sG}_>cJk(%9kWBtg)13{ow1XNOh!366%e**QT?JA z&#>Ps7Y`gl{GnIxmVdTdZxohf&$5Io)1hj-A9=(Q2T*>)B!uHnBjIcLIP#&VtGw{* zOpOeByTkskq-yPf|5C|%xo8alnsIpV$Z3(`=m2K=>^YzNBM@Zu_eb(&9m>Mn{Wsu{ z;ovnzbxJ*IO%!j3Gx-zf|47%siwm(*j#lV6Cx*T(y4kK+u{T=UZmFVCq7K(u&B=Q2 z?WMdNuo-ONq11F`i`3E^2Ziy(SJN6ur^{!9##9TXVV#g_YIE{n7tt}VIC6kng?5+t zD7$rqvWHAHp!# zLimlp&aB2tgZXF)M<8H(^neQcH(8g4({%;YDTT5V+Zj^tSkv=AW|QQo9IWF?SDCKgw?Zet1-daYrMym#Qcj4y1Q;0 zLtQP%@X$PB%$D~nS6~!TrR=1IstCIK03iNCof@hW5FMb}II`o=fG z>_}YC`xQKv%le`zOxXcGr?paK+`NkYojT40+Pc`sltQpr8Y$mBt!>;SN?0@EX~EAf zDDtwPJ!($=Xg^lkKdW~zh;eAS+1k4CnA?F`4DIe4lb*n^#6%xt-vZzapi#D!jngj} zlG;XmEm4e!=@s#zqNbi8A@YPNkwUylI;NSXg~8al|GoRE zyc0Gh#<8sWlzFJcMxB56^-W;+jMBN2GC(wQ21qOv#~1cpL$5$pZ+Zi8tg=UDf~S%G zd`t3!p5|e>2Qx&sa5M=j9E+12CNV8VS)j{PCZkhT@*TT3qD$0Ud=R+1r4hN|G1eDP z|A2PgfT{$idJUcCc1c0C^KGV;i0y@6sFSKML6e2f9< zEmnU|Dq0sra~rvCdAE9Npfx`^5fG>184y5(kN@4i8`>0=SvM@uV7KecVn#iP*@d3* z$*+baT*>$O))h+|>ec8k`9${lj>3m3^0Kr7ky* z2~v+-z_!JBrsW^0$R-7AUY+)6+e{(2&}(|%^XuGw zKn|$0p0Hc#_HN%B)ta1RL&s-2b(HV%>#bjfxErkZdWZ~@pD#fEUqbzQ?!W==P~}XB zje{Tu;$ASAMrny={UFQC{PFVreSh<`d4p${%sU(&2T0YnT>h4P&R>V;}zhbZceX)_#t%GZ6NJXOXEO zarPDOMt?%j=AT5SQ^!t#%u4kaqYX&-l=&I-)6b(@;49^w^NTSlVv67m380_qC>Jme zM&owhkqywB7zeDHN^Fwye*gWQ02^lOVdbXSy$$e5?O7+#!xY6~H()r;{&6UC6#Mkx zmLyysmUak>Zo+H%)S9TBF3>A7*$lKYsc@uP|Cjp7;AWT5nr<5x0IjLvhh7`o&MYf=wdLLj z6&l{JwsehJ?&x_S?JMmYp;=+UR9C)XuX{q{N<%9X4JJ8OZG;GBeDLij76;GF`gQTv zwAM}7Tu=ck-Fixb;6?5|@;M6KaL|51Q|6cePx_%-^W1;_97;R@Nn>}3ZM?VSLM;|tM{HHR*{mn7pa=h{q|esBMbH*()S?t^OybQv6VTQx$W!fb!H}Kb#c6-fU4Can zcCuPne_?-yR|_xx36|O_E}O`5w5#hAAYidcb(iHQu^Mv`RtW_cc#)&T>T$2HbUdYt zR|~=}$f8DhB4no>f}g%I-aF**&5YA|e#TwDw26p_Dj@|xPK9&{TyUNY)++DWPZ+uG zm*JMB-a+54QL29B4%5dk{D0WHqBB^|WLGTIzz_Xp0y(l}2ZQ$po*#n6~tTmNNB+orqLg0sZN!_08kZD z?4qUxfou!aA=8ahSl4S+IJcfRI$1tGcze)y5=!nHN|@wI?e~y+f0Umm;ioDDM`gBr zT4=rjZa&Cp3|&|Hd-$ox?{9nObBA{t{|&yP#yD@HzQ!i+#yKT*`sJigP2dJGdKw_+Oyk2f}E z-Mj`ghK8%gcg|yf`#~$C*y-fZ%XZ+Fb;}Mf%YY4wYn3)ROjiH zT}=l)*pmB z>cSyc^lnt601K5N2UKJZ)r;O(==WrUNamxxeasB{53(Yz6VHrTUGJiPgzxL@eu}dIoz47+0 z8sp@tM*O>+!2=*Yh>C*)HQ(iEn(qgO=w0=}UE*$1ap%4@PA=^sC6PwOQjg!$cEKLA zwnRX_tYI&9QjtHpwCHrK_YPA^ft{!m7GR@7r`~q2ja9S#>-X|vv!Q$-ha{58B_V2KCbm*P8Y8Dd3fOoBURrGxfXCZf!EgP>e&aj`LDu*)6OiIz@dvu=ds=P zhaEv$7120S>Qb~~9x3N~#aG8|>Kq20R*kt%U&JfS?~2*Vbx%K_d|!KV{rr7YeWk^& zF{xa8F57+@_M)rs3sj%T09D{yrq+NJDq&%&czpbam)>g25&wA-=}q7|QfRH+j`>QL zX^ix@5!hcF;rl++fDzM=h?aWs5`Yc3VU<9NU@DAIK3JegYyy$=N7O+lBA4EcBa(oR zkY0`0qJNVuEd{UXI`~V@9@NufGj$J9q_;EWjG#irtmX0pHKJ4tBo8bby`Em$eZYoc zo6CO;4H3 zt9!%BI1F$cf_>R-b^;gW&DB9+D;M&1R#=;O=K((BeU?}2$d#7ys?!tmY7^NVA z`al&sR1!*tjlCs`TDEbq+@vBJnf!sA+)k+k$3njmb7YC~FwD%>rqt(CQqnaf$nS3M)05)L*W_zQZ!b>w$;z}D}^A>?j$TehL}Mi+sL|1 z`kPLzmskEEXol6!0fLP-O~ATl7JY{UTs|@9TzA?5pa{YC>A8M&(f+V|yzu~me52O1 zSY0i7adRvG?9YQ&s~4efOO{UYFCeTezjs6=fI#+D$8E;K_RiW zsKy_)uov&{06*aVaXn!2a6&=1;XZsqNmxfCCtVe2`QnZbuKMa@k|~BJ{?{y}hYxo! z#{E*+AP`xZ)JuB@VH0s8{JqC~1U14Z_Eox-0bl9x_tfg-1S+>dm`KaWP?4H8Af50+ zP1hc7NutH8(rrEb{Q&q}UD7N$4~kXqEVWJ|Cb=qV zN)za%AFTtDl8Fg(90maoeuW!X2`|CyZ3@U)oNPybAl4XuZwJUXzQ*Iu6H+uWXcA45 zb6Xb6al;9kH>IOhKZ1y<0<3L@A8UDDGdCRLHeCUBTupYt+qg;&?aw;QW8m*G}_|KJfh0kmsNgCF?Ku8!zk|AZDE?!5nx0J|$^ z`z0O&7~$zR$oC7}=?#yFzyCMe4j$?K2fo_h8$icB@u+7N(?QSRNAY0vkq26bH)6_L zKvO<3l)&v6ZRMH=Qu z#Z+VX5FZ;@RMod&G<+8$X*&BJg9_eDjkS&AeenC(Z~5L$HsN4|)zFxXPxfINj7Fo! z^M3Q379*!tP8o*7J&k8C}guY z=>F-%pnx`c?qDaB27A8T-Tr|Q21@UZ9$BMFOZDG^BgyR%Z}w|o>1f`c;I*paQw9$v z-P7c{;*E^idM88$q6sdr&zKPgEe@(K!i1o2OM;jH=J4Gp0%OquQJlmEIbElJ{0!73 zp{ez$om}9p+jIHi>}=GFTRi7}QWb;|{)5bKBVwZQs1X0|?6ME%D)az&dyhD_&Iu56@s#O@&@everLQeOwKgE z8=|HLbtq(!Nev1;Phz0J{x)4_`GAE69%^zrdU{Jg9qNWH?r+9J9#3t*OFrV#E8JgY z+$DRtT6;Ip5AMXicA>_q{O;;s2J|}*=9=R1RJIKE)_fG@Zohmtp+)$#cl-S(^q_lU zMX$Qs#^4|S1i8Q0QK;d6sn16<8TDU%}B1eDto%glb zEAg?fN`LQf#Ac-iiD59ZKux3EH0~8@AKLcyyTNuQjz*)g@an_p!^)p?^yk9D7Jyr{N~8&@mxy36H#wnuO}HS}t$ zW$0Om&#FJ^_o5@g&To?!^A-DpC8j#__rW-{`+>T>G4+3~BM)@hJmYSrIw+j53I5Vd5&cPbNJYVQtyW3hU&V0uTza)pq#1HoHtwD z=|VLZ$u=f6Yaa;Mbg6&N#(=tQS8K8_0`cSEQSKQDl|uJ*b8{uQlN zb6s#JX1uGHyeAI2&VSk2Z~0xt__lkWKB>^7!Hl!}6+15KfshxZ zPA=2IcYm$DSLngMTb!>a2JVcbPOO$}2{&!(lDmE*nGjf6x>E63I^=eDCg#bI^2D+t zrFPvjgp_gJ>p80{TciH#duBf&#T6J_yGj`GQ7OB^b>`tT_~6xaPql1WjvZ8esQlM= z)np>5mT}yZ&N?Z=%i%ibYkoi$9_VWS`oHaTsg{QQI0$!#KMp6XOy>SUaPb?x=-yJ|T~grP*ewWxWnwRTU<VL z2zo#jU0mh82c&E^;sM}9Pb{*%`er=#m)_7W=X!Yq8Mr8iBG}t{`~~0ozZRtkS5%zVlupz|2W?_cxf}TQ@Tyv|`tF zG;v*n!XW7J=X=om8rpy{I$-sI8oyctzZPR*UJ&y=fkQ9)H3>9V0jQ}%>4ZuiDixEJ z6P1%+u~T|hQIUrz_Amdu9^Rpp{}|Ab!)v>G-0eSX2OrlYmQ@?ZW4h0BvUH+Hk2Xti zS=^SFkOX8Y=wGZ@&7fIE2#)0Ox@GVr@$b`Zu(2yenBu)#S?b=E3p-=9tf=dt;VRE%I0zUc+d#t~-9^eDj53)Qrbe$9F zz^w&qF5gb@+j^KlEK+_6H$altZndJshQ{~iX5iqBM)Var-*}RQ(I!e>C3;^Z-lAq3 zbPw-Abg>5~0iP<+KwvMPHeE!f^6{aMrS)A>^a-p?csPuvLg6GCsQg)ZNwz&(yWYGJ z-Vq6t{51Ou$!D8Q>(g58J186NU88aYKfIl~TraD~c2Q6NWga$le0;X-{?I??QV z*1cxb%xidRem2(~Bg7d6DL61kmJNTR-=n1-9s=TR_#XHI$JTSCztTq->kYyEgnL*2 zm-m?J*3fH&XTIu-o}g45>Po~aFw`M;_)7p5_~^bOtMaP6o|-FZN;~EpC~;MJy#Sr# ztsEmFJ1xqv;|9DFk(M$mP6*qt`&!T-HZ8n_4gQg_>zm(m8##2*0c{ff=X}Z;NAn+~ zHDOVK2qCC~E}fuK;^cgDp)>TMqJiu8*oz`}yH$C_f4`?_UC2NeD35o`PKkKS;+s6o zh&96CE#c#&G`2%8t>tUZZ1$$_I;U|hZlvd1RT5-&7!iwOK9RjcJFSFp*wS`_k8%I~ z-6o*q{o~Qmn_DyTn_Gyhz>PdTC@18L!IV9|ilnEELHzL^^-n}f($SFUJ;dGs0l1c6 zkR+Jv9!nS#^O4=nU#Fn*ABOV5lDUUz;OkPZ3nQN6d^Ic2XZSsg-6!H2fD(6QF6mJ~ zA#MjQ1*s_PiUc$VODGTF3N&fDogqFdzwy}tJm#A>02y5Vao?)va5fwDmuM-1+zY$i z=?Gk~0+jM}LDipyzs-7h?=`-mcK9SyqlLDx))>2xel(f>eZkAG(mv4)MF@C_p%z^G z7K=g2Q=#{e6-4~@c(~)%>v^D^@wrlR6744NhmSEExAnaZ+`lL9XBZ|}Ar!gbBK*4^ z*7IgBH?-z^kUw9m#(d)SSSVW@B~|pjL&~sRtFq|<=oXlpvDKpNGCe@A9KT7S`a%2-Anv79qD3p&OCSkue^A^w;~Vh!JN~$me&Tk{=1%VmhD)zu>eglAI9*Bvd^S?R zP~^?xQ7k)EQsjr$KtFXI-|n#`1E1`$%7BikEN|x=npAoyEm>eyj{Ge8K|VYxozI%3 zotUr_01t-AJybq4LwSl9w|2DycE+?$WlE-h6A#u1rjEpk_;8rp(4w%{sRzGk`suG-Sn&mP49mOnLdt0+~+2K_{zjhWzsa>o#hCu%-v-lmpRnq+i6&ad3dKD;f>Ev#)$t&AqK z9u!#QaSA-80VHg?bR$7b7~*~6h;ZOyLP9u#+P_1WMh zw}W&E-#8B?2~@cIyMW5Q|lBt1l< zPZRmh-@6*4&RahEfN|j*2MoGsrN;)JJ3@n;Sq2+tXVvYkBUgq-zkZiTyGA`Jtq8lv zx;pCe7pe$#tnpNyonh}E&BHtD|BT)waz;k`Mm0QZ}x^1GPemF-O>l{ zYt!c%7%$kYwv5;koBd1x+OQAW+ra3leTcvSb9E=<0jrib|Di=9qCq|TjzskPO5N4Sjo7JV8OiTawEW{MDHgo?m2b>&>4AxBewe=S zN=BI7ud~Hqj)pS^@4Iw8gKI7(?=8_*A&u|DI_I{sC>L4R?uROZ*{N**I_`f_shE~O z>!bXV{1b)Sf1xp9DV*yUQH$Ro_Z!-<_I{Kl+yJ#Au3dbmFKl?fAu-y9C`z3)@L&7o zBucek_NaI9V$3SbDzNBtL8Z`&CN!)5Wh}>RWiL_0NzW{xdc*&$`Z5Xt&(R>?v;6d& z`Un}&N))(`=51Q2)U$v2QYYVLCK6n}ar@9Ku);}KTrePOWw{8_v%7GrQi!izt)oV$ z5*aAH&36t6ga*8;*UB{tPq4WLhsLPeb#TWGxxuc_Wz!Fq360`o$A1?RlT`Y@bbA6NI4^D}!2slv_ zl*2+!J>!cdiVmlE3rEyB$lxIw#2fQe;a2itq9o)@r`Y}G+PA)6@NMj^-zGBK_}?_? z4xF`9uW}m<5c5PELPo^5xQe<@?#?g`B#iPe8fH2_X>>(Na9R!6g~Tu$#oDOO7UYm$ z*k4>A(~{ofn0V8R@#0^f@W?)w?PgkV+g3~sJ91%0S(;MI*h<-og?CxBCqkC>bJ6cIo`LltbGZqKHOLWj(Qk&jQK{E;o+YtYzxCv z3Vxd$tTi7XeiB2N6R@ZzcEICT#eN_WdjM4LdYH^yEHhv^N%uD8m_Pdnue0Oa<8!s? zJ%y0C>Z5#EWLvM&K6=TP_KHyU75Zz;W<;}iAE`0Hw3&RH5->oVd6I8@GE#I$9FKh} zeM|)T0QeF1^-;#)?=iZCeF%8DUoNVS$2x+Xj>_I6`P-?Y+R)gTV4tQT!UeFB22kL= z{26Yl#O~IAcfWjAi=`?H9OWf*11pZii1ZO)TAJvho%ai_o=gsux?YHHY}N5+Kgwv= z)0o(P%_@9u2qyB1W0#O$_rHx_Z1Z!Z`Ki?(foVec=?!2SmBs0F%<1>(MSH(SE{14c z5|Khk^A1a9w6sj?t+<-ATCKB{1ljoPZxj!Ik5A~bDhu2k^kec z))F7qMU6O<0hb~2Jg#*~-4Y$(RkJNaJGk?7dnC9+vIhS0oD$3K&PCIQ3y8%M`|$BT z1XkAuPpp`92wa!=Uhlf}PrJft0H%?tFqdiPXV7Xmh!J|yBMl3#;Y1><0QyKtba(t; zc4f}!uG#P#zt^^Ehqlhwth{^82>~QhuD3tJdXnbg%rQX9 z;lE+yLM*_^=le^e+R`m|hat5Zy$#EHA@sf9nk%Hu4!RjA{~8z6m^&$~M2g?xUZdq5 zyuc^MQ}9g-WqZ|Zc&}AAOgOYnAeGV0R%$GbF=s-?)@y7}BDI z2p#P6#k75z6rDv7TQe%~w2l12Zabao~ zw$A&u3WLTHxUR};(%m_(iLq&pM4y1ogrs*h?KfN~y@5^(R3e) ztcIiek3x_M{;m0cUn=AW94m&y1ipY7b4ic5G!O*KqSY;B0y~~v*6Qpl16;8ON@HqR zXvpJp#!kWObqoUxhZ;%wW_}l#nZUkd#p=ueVRoaID&aWuszEUutSNoSLSM4?#2*up zQK^{KQ*3x$wM@Q+oWNbhC2XAB)0l0I0vWVi*Qp%QF~#XO(7k=Y@s2#ARMnLwt%L#; z2O1+5$`(Esf!vT>M@@xcF3*{fpD6k`J?H)Bz&5~hy=dR+q-9V0pNN`aLHyj%=JP&F z=RpLEY=X#EZeo?b9#NIxREF98`w;)H8@_wFq6Hrw5UBnj!%`$QYj1I3asA^Mb+(V$ zUP$1yWu~{+rGD>QwpJ#kOKV*@M5{y3IE&uJN`r;*+Ntu`2*FfOj!ED!#~w9^Unn#p zp@(j=__ypjciBV9EJ+TXnznoYW4fdgeba#=D@!pZ^MBK0drL$SkhLHy2Hv?H&YllMAW^hG4C6lYn zrMXBJw@*%iVURV=plUrV1Ha~Hn_V-k;N@kaZ?=>DDz$pci%r657Zsl=pz4*hHF@mY zz&qVM9@56%`Px|u4`e$m9ygm3E{)v^+M8%?@1FQaRLZejxgV$G)e++}GuPb8_zJpZKb$q)j&tLE+7O1K;o3z}oui3#M>{CtoM!OP(#oTD6eQ zcQFn|zddRfMznezw&g}Gzdh*%NCiSG7ngnte6)CpxTDzkphiI5c`4z1p}jLaa3rqO7PZcG+g5zTh^4`f2}r3J%-0?RM8$c*D4bql;HP4 zD7PC7E5j z+{ikPGy}~ojV_nv@xczY551L+g7yyE+dFDP>_s3L`eNKKAw_g(RVm_iRk$4Q+CA((1(}iL!LhdY zB;kIt_ZUyG`S{#XX1Qfv6vgtkLZ=cm{vUr?L1jWcXSEMP)R8Z!i`Dup&zY--JFAh$ z%lX~I^LK2-k)917^re5vnO2qA#eoC{e;JVTaXG3s^di#Z0SK_ml#!UfmH0Z;tZ2RjcGmyO4plxCbb?YB(}EOc*zXZF7IU( zH`t<}YVsLY6P_jci+A>Rv1C6``o>gXq?K#NYSJ-qkTA(;))NZVLQ0g08ZTe+yFFat z#2wFhHuEtf^p(Ih{qjAWyh;2t=*mzfQ18Dm z^2nPc@YIrRP- zKxhH>?d~J1A|JMmNwK1ZH-9o))3!wB`tqS$9sz|CPNu9DGY?+=kPvXg;QUh+udOf<*r?K+*!!qU z9kulHfWv`Y&Eb&Z9yva{Oo1KgT*i-wzSpT}`=ENvAR94Hpno)ty?i2<9R75&o}+0* z!F1WvxZ5SQI89wQ$1%Xvrm|)*F4z3FNl{yxLM@tEwulK32KW{XJ$ZP**-dXk36{!) z2RmWyBYJXuh9Ejq5qNMqU##+ytt)k3B_aR^l;E6zi9=57&B+=4^f!Nr;Oy)i0y=ZY zB0w^M@OHPg!J;W7Q9DMcPqBr?%XWm{Z^ihy2(zi7!eFsG=; zenZN+r5XIxWWqNkra51XLK!fs%bsPuWcU_JM7$rEQ`-Pnj$R1xA zhG=cn;+FMYM4bI&bn3B1u{2Hjw_sLFJA^e*SD@i^QFU2d=2=9Ao~bOIPZvEy%i(~##>nR6T_g{jFitUxnV1qqdQPSLm1HntmZIvBg@G23CHwTaK#t9@mIe*y$T znhRJ~Az5#p{ZgqWmzL3iMie>?C(_BM*%kcdk!^CoT8h@^q%x16gnwW&0KU5 z27nEKAmqBY#muW_%>(6?lhPcgc*Hp5^?eQC(Rj0~75=;Pr8S2I=dv$QDHI3Yq_^|b0_ij2hGW!mNX z1_m|zrODIb97c{$Fpx5xwKAE#w6&SZ{GHHRmv?!#$15F{KioWg6n@`A-Y;p9m%;>r z^~w4#0=Oy2NweLb*@8+>V@UMV@UU)0a^qkAW6CI5D29_EGjI0hmvH#*n$%emigoEQtA?6<`D8fgGp ziD%U*^{>Q0vhdFa6UtcW6ei97)zH76 zP$VAkjvG`fOGXnRi4xW_3x9-PU@@+&M~HUo+lonW`yVf|0n|YRu;HGpvHxCmtBmO> z(`Ox3xNLPDN{(7cbY1J+jP3qz?S(>6u4|yH7>;sU)Pq+CT7befE4wvHTZRT=Us%DFs3a zci;2+AtZ;_PqcR}z@)5$d!k!~L(lP6qN7rkOzVfOfXHlWfOj%bHog0T#1K$(1>!*S zppWlm#yH5IDts;sE5h$7i4WO%_fWu1{i&DEod&R0;Lh2nKVnSb&edmt*LN#Ub*?+> z>eVc!B`FjmNb~gIX9($I-DINlE9jYaJpN`^HL`nS`~|&R$!|LO1qCZPo^OT5ve|{n zy$Xm!ZkA>Tj|7`I(yb|Gi_hd#M9kK4>2JhB`S^WnrnqRN193(!%5wuY4Q#}MqM*a9 zQ`e$aR9+gDYwL(`^O%Ak6GjM7e0ws{oC&%elcfAs3=uzJdTU= zzs4Ze)@FHof9}(rbceCfKOnBZbHn>JIh7e7~@-*10w z`-YIVFxmYbrcGcD0Pm7te2gThK6^?9ayhKY{$35X|4bWo; zjbQJFq1!J@HJ9Ve&0AMwP%KhG;az+vpUfEM!K#t)Q!6|5ffB8l*V*C(TK`d&M@y|e z7c$E3obCPfk(traoLc=^P3K~E)W1jkGZ&$vXE!X);8%FTKyAbNp`w`t1&I*sF|5-*`7=+l*J0aCW?3YPzrqFt z1m$nbo34`1O7W1W_Jzg?ls9*Z9rYR_OzOh)eq#>Bi3UTmss_B zX3*S?=ZEJa*BVs@F-ZaF76!*-+a_#IF;PrQ)mzkp}!{2>HGmwZky3VVJ*{aR%3e zRYI5t6ItB{HpAti`3XaY-|fT!8sn4(gw#TOGt$%$^GqqXetV34ih^I3Z&IHq1pTX2 z^*Wg}+wz3}mN5oIHk%CAflT-Z2&krDETM;HoAasshWJY6QLeKWo#q}%h{@rm3?7Wo z=eS&Fac^AipNB+;q9QnUHbu6nkIfmU25%n(MHBagqG1!&9t3I(XUr*bqwK zd>;QG-pDd}#VSwDV9!?GQu}8HYsq=}*zv1b)cTgup5+4b2VVM?+rTtdjoFK?er%g{ zlC1yD0?;#>6Y*_037Rod5RqygrLl`i+Z9AiT5PLz1xiyDKp1-}RP%_o~!)*0lGi`N2u& zG^@$=>j&H;UD&r>>h&%kz$Zr5CCtA&*#xfPm)5^_|a zTwABi-m}dA9OVY-1~?|gQ8kG?%#!L#Y+pAh7N=#I9ok?#HX#0_J6C|*{+U|b%)bl8AAuwBq}O#K54k$fHYEWo49Uf?9<%f zn-Icc=T0rJx9iJ0yxN#Qv6NSt!O|#qT9A6%YFO@~3q&0N4)>Kn>4TgQnxR`YYiexV z2r~k^cHNMntxurv!kjt>Cp-`mVN9ct&VV_RQ8MGnc4~uF-uC*wL$-?AwSz>= zrM!U-6!w5iSwc9T!>?Hw?*&$)F(T0i(pHQF0YRtcFHkS6rr%?{4@XN8LK+)UZSF<0 zzxsK$;rR}eS++4RX|QwjUh-MH3c{vj?#4<*k}|ee@LgApQ{7DbfBepVt*prpmS~b1 zI{Wye27T$Uq<1)`Mu3mCZ9 zedRpnvB^;4O)SP7vW`)^T9yy0&J^i1b07JGMXN|FHY*l94}ZDJyTt@Q?&;_DHfrj- zN8_m3nbIXd=)Pi^JN_Z5J9hkm`G-9P%9Tx8nSVB9ob!N)2+0qL4^~A zyHKHX%LAvuiS;gnZAShin6`FS^(Q`DY1M-TxR5everZy;wi}^7`aRMkK7hV&q?#lb zU?W-bZ;1xmPYX^0?dgQ)#8jfZygY`8+b#)pV{4T#H^{DfHS4ot3WIt1!mNC5(EJp8 zdsS**DjVWrO)V6qjRF;SrMX*FJhAnfT#Yssihm(8Bu#j}O>v?MIs3+z`NF+#C_bRQD8u?WypQkMWy6PJ1a%{B$+2%JIfzcSfuJ}`Ff%!)_yr#F z%XCk${SFoCm3cNWV>!5X?uUVh#cb|u#Lo|YhBTY|L=lzzjx3=6mT}F}ImepN z@3ZT{h_T1^0RJthWUcXj7GuibB4Xm=SMd5C6#3bFv#T8__O71L)USU{Pa`=$k zNOy9XY81-0DGJ|Xjgt&Mwej#iZ2R!`f$<-WS=*3fOAeL>J2V!pQyGRA_`|a;pE48Q zk(F8J334kr$`V!SZ}b&gj4MA(YP&an@|HQgy*}*4=qvHSMzIHVJ(;{m0!00npW#B$x7cn|# zF>T1K*_fR^JhVNS(}_tATUI%&wk5~jy+%?b?4+d#RwMF zYE@GeG(0}nm`f0@$$Kz3#GETpZDe?V9X%xzSfI|$mr6K{6-$WwSKWVKKADGJ6kctXpB-!N~Y0EG}*+|Mm*sB zu-ubNcRZ0$-(>gpXIY!eeUG1vhWJl#dFYaa3`8)i&=5w`v#AcuF6dS`oYInREli!F2xY=3VGjL*)d!Z6a->Fwu@3kD&eHvgJPXWSCma5Z=`WIUr-ec~d@$TR%_l~#MN!^o5!on%t&B{2#`*Ue) zk{ZQ|Xr#~=+Bn!C`|8P!@%2|ODwahYH%=~>e=>r^Bn%q{%clOAyw5Zgeed`k+>RsK_C}iqsPa=yl`uaV?Y1bu@?7d? zGR2U0LGHA?DQM3*QzRf+hh1wNtu~H--#K|yQRZ$xjl|nO(i>i^_2D>dyx0x{r|Zjj0WJ=2K2qeF?|@NGm;N!&E#|5O=c))ra6}^C~idN*M{yl zCW`ApN>XK{7`Gj{ZV5|PyMCm~O0{h%4t}s2s>>P4vfmq=AUU(G zI26ml=dG+8j;P9wOQI>Or$IK@BVe$^Q}?0zM=K}~-}KT3Y!tmy;TMLf7M>%H zV}Hg55@P-+p}Prw(0MPAOND}83b$@6+4QWS=S!RCj=I=u0XLQV`t$T2&}sa}&~CM$ znha;1eyuS63^{5&l2R=#R`sTkmDlknFF-ZrG=C%z=X=Zz@An^*DB3pKIX!sbe& zOVg?G-HIlyE(?#^B{JJ=2zoNd3~^IozYc-Zn?jCY`bh0;^YWg?{!E^*d&gPg1F3%~ zmz8{=)YVN4?axNOm%X$^_m4G}EZkEOZZr4$S{GBnuc`9R;i$i!^h`nho4$9losSJQ z_pJd}$=sQ+)){a&6-)&nqMT^(RE#abmAsysC8aK{R}6>ongh@>Nd8 ze5-%j|MtB7mgi`Vsv*Kjd!yf)rJ3 zk8fR0H>q{&1ehp3%QNJ&$PL3yWV&`cngw6i-@g-cJ7SECc5Bd?+0n1H0_}jZukIoE zrtRcvSLgSFw}DPbPW5m=!~2v;i{70gEg^pjw|4{nml?S%9h>PUfeD{_gG80p)NZ`w z2GiDqrsYC6I!qiDxz8IpdS@OR-Fp-u)xzyMCGS@!r{Z*@J9g*?EYT*0N)^_$(E zCz_NG9lg*Fr^{R!A?C|{$KkU*2379GPnBce1giVX)wJ0)i|Wqn`?JByq{c<<``~o@h#)G8|gU*#}o;7K^dtdI@Gn~&-R|7I_6Mm7*Nlip<>4*nC z=0D5IRk&O+uKM;P-x;?~7}X7Dk9Sw09%T%h_Cj{I?V{>)dxn=|*hU{;E(5OC0$h7* zc-xKAMa>^uD>CcMIfd8(W8IfR0D!4-g!Z|8I8JFY1sB zmT$`(F9EA9aH7rur=cc)Bb*9)n^BlE7LcNWww4SV+OzASjTc~IeTdS zYrpA#$te>>Dp+oN`MpgT5`ZO#iaJCkhs$Kf*e3Sh-)@3OW#4&v1wz0v9{-<}cQl%C zrZI5ptn(!%LC&n&uu%>wWRy+xd18^MhK~f!tr3a#buT6(+(TO{<^}JPlmUS4FQAG( zvLqZnJ8m-dKr(qdd@{GWkE@=5;W2v3yyDOyjS^?I76~kiMy5np&v%3h*nL+va0SZ% z3+d2!e2E(H`&0DkAvw&v6d8_k@IO8bb72kBZK}`J8G0Lcq>IlH+(p<060~%5&o;!F z!X8JHUm6g?ztOAyY|HQhcaJ8x1_}}x`cdBu(1#fCIdAS~at-(9-AK*H3wfQ|?G<$_ z&D4lEcS^vJqf)|fkikPj+NK|khs)d4{oO7<`RtFumwU~`D2(FpoG5*BH5jrlv!-nn zbqrSI5*e@C**UnJaV245@HX#MnO>*T!~$3M@_&s?OPKr)Dm!#pgWNCWAoCU zMj`orl3P=g8Li0hk7xh|%Qj9QKH%$qd|Lc z%9(|0hLwMoe{Eyo%pC5}!^QrMQ5Z=2FqYxy;Z+WXh?iCGt=urmiZUNkOu?-&(9yN8 zGtF77mJO}(;2zpce%~=ipt*3klFc`iBEY{Zat>C#?nk)K|iJ z6*yH?Je%9+hh?blnUoReQ0l~vAZD&b2!x}>g&@lB&ya15b`zhVm>`&kOk7aPZ1xqh z-Hmh)=R%`J@)2}*0RL2brz(-^!w0-y&-G3dZ4IgTH^ywL5lrzglDri?nPCC29b&*u zvf!4-a|mmzy(NXzhE)6)U)aRAZ4WSI{ysh!ibwIqcKoL!xw<_Iz#IYY1Ox3m&{gT5 zaw;5HxNr0Jh@&n@$#ON$prTZSA|5Mcn>FOZW-_PLf6WEft!rw5Zy>~lWB3xdtY_TwB>M7g%mTg zscK)vBM*Pb$`Okbb1)o>0f(zhyOm^eORyLL0~o&Sx02d9=_GH|?m+B<@_a40i&Sip z*>7xmlXp}aCx2_sa`NcLrLlEnKEN3RWZ=U0vr!oV(b1Ekgo}eD8Lh*}z9+>Q8;63b z$s~r&4kst%)DqOm6ohj@`%gbQBx(yD;M4)&a;?&uF}I!HNNSH&`Sm$bT6D_aJc(xw z5d7Rzw_+o0oxp9k^bq#@U48{Il{Nqt;XS`zLQRE8UPg!z+K{NIsO$?E$*94q zA@K6TpE3jBj1Z{45}}Qx^;~C*TuD0thIp_yibKcXj&u0?qGlap~*|W%xAmToUf6UFHiP=ES&zx{mRLUJ6Spf_Of5JYn%uYl56BZP}OOGV%MUr6vOYko8%A& zo@Q%lkRG#XZnU)E%BjHwdWibKOlpqSU)swXOzieRjZ=g*!0cQgE{3e<5xeTJAli0bq=b<-B@5^x?@A<$Cd`@*rHX5qv zvI9~VHbPLuba=+|_BeHtmhP~cTq*8K;>YWGEOIgk@g37Cim=_-BAZ$`<#cavfw8v7 zHd#lENFE23egYYOK&GzmTXkk~CM`4ehJn=Jo|3rRyjOAOcr{?-_GEJbEr^B<>!jh72r;kZ> zQ|QOcp~7zfp@a4$lseJx9!{HGf1YvgQD;a~KCodvBgzwyz|RftI&Zq>_}?fli5@Wl zNj+Tp#+J#(V~?MU1pRK_=gv84zit2d^{BiGdo%9E&_7~NGwyMqw20*CI~A=o9@&ZU zZ5*A;e3qtwFsypA$r_l8$;jX#$CkxG5OUPpkw>`SNN^#K>GeO=&RTtNoj5I;S_JB?3uwR)(H{2q(z;Q$?r67J{pb- zUD5I?j74`$mk$ARNS$wp3f<I+1CN|rk@AI7?;oHZzI*eAbB84d18{3zmzDf$5n z{p^gg{RWJb7~kvq${5yE_|>oz+{NRwX}nhF(!KUOEj7xl7*R!@kh7-Pu8P%d9+$+U zKMULT=$r&(OEy*4ME82m#gXoC&rv)v z*Juk8A^SPgop#emFbYvzL}N=B~mU&-m_>NFh4-fX8Q_6T6|x zG=sK`UImglD<86_!2B3}O>{#&z?v1qLqOc+wBo*r{DTze17W|v6cQ8y3gMigrLizE zjd)?6Vf9BQ*11geTIrbu<(mY*+)<1i5>9Z``?w)Cs-0MpN{6z;ih-?OsDI+hD~l;@ zm?+PMS!ab1W+-M@nj$$9haD@ewK#|5ZJqzHYqaYZe$|iJ0KZD*;;q<*X7$!TNP5zo z6Dk|1eA`crnkYyXH`T!JU*8@je^ z#CyqbBDDJcOiOL|Ta`gCsjzpK!btylz@3p(Um-7jtMHRm>jib1r14KN%Z`r^LnCt5 z6Zv;Uf|kZEW-K?vXNA@a>Zgv*73gX)JohOmrzwGTF3}$Jp7Q+>cNb||s{#A63g29~ z?XyZ>q#uFeI9oyAD1Jw4qF$Rqy$c!4fb$PXyyon0LUMF#=P$S=ACeUT|WE2IHM)%hw%}1sVS-{bq4su za)8HWm{A6IeK<_>VMW$mVf}HBpKo*J)9#-ar_}}v`0sFF;5Letbk0iJK1J6qc`*d; zH~nZ_6c?aVgacj}wxBoV|C-zrGDwf^2Q)d|Hy21k@ftqd(scfOce%DTsG3!A?;9#F zR*|MT!+$_^^Qjj{rlDd;fk0_;O~7=tyz&lsSBy@@rHX4*a@?#$L1@J1Y+j87WUiPH z&zTbau_l|gdD$~3wo(^n48Y00??V>aCt3yM`VlyT2m{%#;0S73VUMa3>7y8IZzo{+ayAVLc}28YH<#nZC8qyy0rE5pJb z5%WU)kq0yj>o7Di>_>(8oGee3|J;4CqO zANmd&76ku`uJGbQXknUOdad{^mEr}*1kwKLQ@r9a4wM>{{Sg&_&=GZ=<{fk1h7Ce0 z3%mWNW)w5&f%!rV);zps^I)ghz=23kTOZ?rvyamU>iIe{Y~gAEDu{|Gd2hNWd=TO( z%Pcv6~`$Q0PD&jnK;yos8++_k**rcu4b@*Vc!KEZ0P%N1p;8IiC z6&S&Tj0WgLfBL9PgCFG4S8x*^bV%kd$(=-Lr6Lw;`W{#FNlIN){n+iCux~1f#?Ph9 zF^YdpXxj7W{ zVV|T}U97G=;gjF6rNUd^3U!lY4rV_757!l>6}~uAl=vI_2I6Z2RCsVL@df z3z1nu@){b?xydCNpQ|kKlz0d$nD^WYqNPnp{b&6ytx@lK#(Qgrp3B zQ=#68CFE9N%bl{14LY44SwMIb5KL!18paCTkf5Z+RG3|6h44be{NcEG5Cd|^p~9e# zIL&s(%LLIa2kISI8^5`yD~tX#;(H->e18VMM41*C%g3foat|97h$NBwEi-S(8%*au zMNfxps-?2@Cd)&pu3+#LPphKB_Q;Nh*9jW;>o1&mxn(|32Fvw_o2&$9MWZ$QpwNQx z9V*PzjE~7*ke=Zh24{ZGCF>rx$ZA49K(UtKsjS}Rsm_)X&H0LXvshAqVgxaqGe3rj ziCT}o4}hMOc8kKMKihSc2TE~}G8_S8a~$B*E$8hiFNKMA9JkKaZ8Kzn95R z$e^l^ye(X0EPJKZk0x_@D-3sE#>YfQ5 zb!SYAIE)_C)T5MpT@Z%etHiK>5rX(<1jlZN#|{`ZDBeNviE(PSft!Bo>rV-0!G$JY z--s>GYHOv`BN~@WWCRLovQU#3{hy< z0z};lo)j?q+o9oiOD@&BvZI0O_7@OM{^?MwwAq(x?vZjP)A?BsZz?0Mddl85S8(Dl$XX8=b)b!JoKq% zH_}hjM&r_TG>>FCvReye(tegEUq9ll$e`qoP(s0H~k#R$ycdu;(Uz#xzyCXQ&f$#I3C8ht|nn2S*T>=?1|z6 z!g)x{Ke1tDxlG@8i_$fnb^GzP&Y3DC_VkH}C!VrY9if!kZ$EdbxHW#fcl^(QMAp}?j|JoF`u?VC%d!eY-W z)sDqf;aq_iVvklt*oj2KvG!q|fNZ9aDq^mN<%b{k>8sjevcqgURySqjQbKHW@?sxk zyemrtUF>D2`^yQFk&ng{|D=`AIbZ%m0#?^}NMTwcpkPUTV>P<;@A~{iTg|`NJj(Rp zV7#QRRep9W7sVRg59`@-6Kg)l?Yp#5sYyLwBtoWnp~HqU-;o7LBi@h^6zBHdZoD7a zYMl-fD(KC8ks^k(iZ*#7^&ERSLB!ws=sWhk@25DHe*p;oQqedS*jqGZEMl1YIc}?{ zMP~LpY-tW87jS-Jair7saSyx*^APvGG+&LK5#~0)_+`p5YXE7BJ zEE?Y&N*upZyZsOLQNa03uwfWI8|1aFfS=bZ^Fx7t+1miaFKby&BCxy@|PDZ?kN3!4JR)nZLp~|Q3IbSFKf13{f z2Jwc|2TG}E025%};Kh;&pz~za-2}<7iW6#`eLu3IXZS?g#U;{3=hY%p=$JnoL4rHg zuEtFjI+)R^pz$F2WV$>q{#2#+Vn%Q4{&ph0?o0O0!99wsMV}U_Q5aSz{CAdVI-h?9 z8)kgwfXk%RfiPFF&2sp5~?=5o~Oz7gp}04@6gin4?h==>#gHK`8Q0N zSu4x9Fi)=^vRcA?MF^jyW-LUM!Qt?~SS!2gp3tLsMrj`8GP_>EVcXa_==`Yq{9k6Z zWj|z^dn~XgE*+ZRRiq<9nD!8bQNj?U=IB|slg%jMmJhVz{tV!me_ycGd~`T8<-p;T zG82&m=QW=GYwu%bL0};$iQTkmZnbC@^TIq6TG{6(L@AmW-xJqDaw%^EE)W>T&-`xK z_!rZ~O)T(m$9U&L%Y4CeHzY`fBO^zeBHbBh7jhDmnuxvCD(s>G#3-%G{^}99y=k_CFirxBFc&v zQ{uOO&Qs9jww;(8{2!dXc{tSV+drPttqsXm*@{AhRF<)g%9@aD*^49$V(g5`t&))~ z*_SC|Y(ti@3uz_k8}C<9Hv(ypQXBE$8_< zU*~n5*Lem<5T4$)qx{soF&n7=T68J*VT|M`+7(PW5t~L}gdLb=-JtFto-01(rU84l z*0_K9m;ftAp5&0Q%qPllkDBFf7Af)y7UEowtt6yfcX$S3yC5x8?#U{-z5L_p%mv0x zrYe4rzktIJWF0F1uJ8%{!{NNJk4C3)RgHq*YIraDA1au$d6q5x`A75%#Wc_$*8$gp zAbAI)Gey?^q8yGt*c`8P9y~ptE_JT=GdBjP@#Bx$WtShh>I<47Zb;>2<#`@F^2gMPGs(4wILK^_4#-Kq1G@Tw z2k{)=r9{61wAF>ZDLU^yvmckb7bmiT7FTaBswa46 z9~}b^Fx9>dzILq%*gC1n+9!Ssu+C^n9w_TyH)Q71LY7`_E#k;hZ&bXp2PRM}PlGn7 z$G^N%JO2j%WzdEHhEIIm=GjphyW20e#7hNPH4n($CuU9=O66ypiKw5m3H&A#BE#B7 zvwTK8d_3*QcZW}_*b@2HKx5g!a2_&v?NsP!#c+>7K#O7YmGH^*CpQ_OF+nQ`F1N=M2G7RXmx$z_JL*Enw-;f~?5SqwjCQ*r{5 zJ0^gTuYUho|Bo!4*2Z3WHR}N{?UX-eGQiFNx(vZ0!OzZN;C*V-x(xJ8$h755(%2QP zhV}P*OLqdjWFJX-=s#m0l@E9W;9$JM=(F?Xo}DzyG(Qx_+O@Z?aFif!@UE@6p^qM! z{n`&$64rH-Ch}yvd`rGYEE`8wu^R3E_ySMf4W@xpmR$NyVLvny5aI^bK?A$S1MG3Uv zM5#5YPTZH-3r-pEH@lj9U&H(p^OwW@`~-lU8OUy{!Ic`)>&lZNM;;0YiK&ZrT`BwgPGE&&UTWTbDe$X`SlW>P z$@NH-&>nkWP@Y2%To~jp z_B`^gyzr^#4H}eW{SB8UGNy#dyO1H!)4Y6S&vLFU=n)U7J&_B|bw)QdGN|XI!{?|x zi*Ih@&KlRm%}$}x3`AI-qRX(Zcnfp29J^3fU1negDq?8r8(%iw6`lwP^K9H#>&PBB zcYGc`^P_4=?9msx)E7m{B>rLc(RPH&Y=o1UUfq2!-8aS7h*aU~w_7_zWjOmORIfv~ z6e+-r2J6?aA`|zLlx}2GwBJ#*%6u<@r{Xsz7(uzW(W~GRsXbZ!PBn}H&roEUD~s-v z106k&G?)m(C8pZO4&A+~w%js{aJ75d>19C{>s&3vnkQZ4SpUP}R=MiuaU-~-rnn-- z3Mw(=0sA7SlWQoSwN~{*Ep*LR*M4K78o|og=s$6P_8WOFxrhD1eB#hGF0w6al6JvGGq&LXM`#AlzQWhh z^@Lx{;;r{|_cNPeel+;Gge#BbdAidf2X~Uvqxerfd_o8nn-&i zzQo*Hw^e$5#yRrtZA!Y`jQ%j5XzS#Wa>+#w;?9^$>Na{-0 zhp$a-UDl8t=9?Y6<%BbVRZF@D`3tHc%er}FFQnXu#9isi1umv5&LlkNwlNcD7HyChhVXp%UWyYK?B7$3FM zF3Fb_4PNRKeC6{tFIKL`WkGkpoj0~2dTwh{N8W5s$7{O#xa2u7Y!SL`qG@Plclajm z+;`KG*5@Cp?-OOM$^#!9csE^mP+aop>DEOt(JT3Vbqu)zhtUAN+FK&#Cnqmc7DlvA zK@m-S8q-~IOyE@B&#&Ji@|4di8){b26O)Q-2oX7Noj&CUTb(^H0fz^=8|;r!d^_R! zlp+U28en}Zd&9W#5ga#u8XytN@~6IM43et$veOY?Tax|# zeM}Mz?|cqqKPmHENjaXoFsjx7zKFW{q0499p$_+s2c~zgpG_LHb?DLkx`=#-U=t}% zR#c}!Im{x-T{!mHc~(Kvx^DAAf>Ph2?9jtE8qISZK|k^=Lc(TbOq-=_8E6#y^CIuA znCq`81BU`0ZNnkZgYGZ1gl+W<)L$#caLUL!@Xcfa1kKc6Puecxz+2yY3Bba|+fk+BHbksy;?B956kqs~;Tyx!DQSfaT#|!H$lP8TNq4Bx1V|$7 zET~s?@G5JcO5+Kc>SMp;GKXT3i#t|Jf!9J>E~9~=2}ARm3EP*?DQWK=2;(X|1c`~i z2%8^rl?8nr-&FQnW0#@{3f?Gw)P3?st$*=7D}zD!PyZ9oE;ZjgnI13ZN@DA=tqp%6 zj+A>F?@%-#>xFz(+M#>UeWI!I!1GI@hhJRhdfuEmtG9iAHR^m2V4qAI^6p>N8e@}@ z(&bdU-7(hv8iOKi54UfZ9?y4kBTp~Sr%5c2B=~P&|pPpJK z)y9PK$V5T~VtPTVnX;KCZUBEGmwEkd++gc5K@DsqG0EOq_TB~UULJ|A@lPE_WyYnC zt@1;al4$c@_UxY8FV85YHuH^eDlKL-^;CRp`>Z$qlm{Ji_GtqvU{JZHu3b@<_BN1V zWZ`4qpdQjI-(m0v05#Jd##@olIoaNzqD^z=%J^bHZI&apov}QOMVR z_5E;`-yZNqVl`GHO6ye0MYRD^U{E$b;?$4XA`K0Rb^p-G2=Q2;{TWSQEIbOmz5V%G zp68BEf(~VEUHzOHHYWQ+Mql=&x2kV1f-~}ngGzvfLpF~B94<(#zJNxoypAs4T zL)R7-R0|FB_e7C-A79;5eQMzO15n${xTI2H&e&WYtrGfZ*L{d_dM-2QOb%=n(CDV` z6-Bt(`SzP+V1R=A9}Rkx)iB%6Jko^b7;#j0ds9b~r+biSWOM$D>bVSi92r-(5I&Hb;o{XZS;qN(YePPkgv z&M66}>e{as zFg^$|TK1n0mn>w~h5!7aA2{W(UlppkTFwP(0!=9#oEKwP3-^Hb*cuO0i&#_JSHJDK(BDtf)_m}^r3XmB{lvTIf}fM?8gJL&0u z`9{H04L9qtbrZ+D2p+Qa(Bi9}jB&Bgtmyf;jf8TS6YsoVate7T05@w^gG!Xjtv?@S zRlj(fsHOf%Vn%*Y^i(__W`o+0!@7qOxYaFXmn<2F1Wi;OxzHD47%VVw4tm365HKO- zz7*7NMwk0<@m|&j52}SJ+u;Kd%x$l!$_V3Bn|^C#uE-?yRPR_lN?;jGvAvagcse=R z?=sr>LXnqC^omk@twJ{M>-n$lPZG8h7ZLT-TUKSc)UnwyOK?c;cLXL6xBU$2J}>@>(BbT0~^Ub+WffXJ!5+<)b3sBj!vH+w!%revJ@@ z)8&K?!onHV7R&Pcj_py}w&HuqVMqBA*#P(eqMPx@I&W$lwzqdKJo1U#Kt=_4YW`v6 zs}z3ecg`=iVCU}ku-*FdJg`B~vdO6+b=vh>z9 zZibp~vQN-Zk2GnPTsae>XEk>BvA@9g6B<0#D=Q(U=B7=$>*v=kth#rV0F2xPV|OV- zV5o_eyG{!@WE-GpI@qurG+TW;nl#8WWBTWpb6fK3W)d}Q7zA0cfTkaTc%3MXIJT?g zIBRR3CSPaii2<8ZFD{@^*{y29`oE5SlUu}}-n5XMl*WsF+jxLSoX$nx{PbM~RDNvXjc&M%G$iEt0R-$(s$PvQjwx>10|YVJlvx?U zy1erAki7SWs?;f|3Qks`wrI;oiC=iw*3Z|8%>Hppf3j5hBsmIlDQFVkJQU%{v*Agl z6il})H1lk_x3;$J{6IL_{J7b531;qEYJ-IF^L^w$cvKr&vyCPTfr=;TBktF7UUB-O zn?OmQ#E%}Vml(or2rr)z{~~W)6L}Pts_xYZnyLLPuSUG=dAB8Z`{W*&GBla9#F!m> zq=dc7JzXMgeOxy)`-*Sgv)2-@r2(u!ZdM|I;~ysLW5g{44M?})kfS%nl3I8CggGg+ z^$FmGET?4&0J*nat39P9MO0_@bz_Y~)1I4(+ZMeby}fbb zkGbLO29noEeK+ju&*T&tv#&jA##KEjGPZvA-smfyQ#-EqWa$Vehd9LsVJLQ#5ceYp zl-G=k6?gdP#!#xcvc+RNnM*0yUShsvT=8^goh76mn2J%oW;B>1X`11jub<$H0J0)9 zDy@*V#c>uWUQ^Y!El<#dlg@bd*7NX{v_V^=$5T0B&By$1KjMx!jzW_--DN)W%LW8q zL5AHG0IhVJBPJS&P!L$)a$w_`9D}#1Pd^wvaBEwO_8B3V!A1hVD(c(C7RHr5WT3S= zMGd+XXy>N@l00NW^Pv8C#7SdB5iw2}FeE7>uIf3a3lrcU+%}L>W7SWPxw#r-g>nWY zblQ{#$|dO7=v=_ksjejVa7J_d2}qIfyJTp^YkKE^E{7RWhj0}9HIdCFdSuE#SU^Yb&$ zBcbi{Ty;ZUML$Vw%&hOH<%a5Igz+7-!n7fMaY##$>1@{YVz_CIfFcwFDm2U2^*&4F zvVZl`^80fBjF|wTvp zU%g~u>>-87IH5Jf0Im`a4C@6AQ(7WK+j9igb*CFfwycWw2sr#Tc~(qu+C*(z^IBS4 zvllJf-RAa1r?@`?m#Nlv7&YT6x~A3{R{4S7>K*(Q6yPHfX>StVbMjuNIHa@TE1Z=( z_bX*LXgyH)$((uWK%D8~y`#_L#Fdj@)m~-Q2#=&b?pEIu$7w&R&Z+%UC?RATExW}l z6mtNF!POf&UV{z=g|v*m~%nM^h>5NI{CTNlRc@`8x1Lvqub+OQVg0yh!4UGaZzar&5 zh`!csIYJniV55B^IFlKHe{A<*`3_$4P7Q!0sCJ+wFs|g_1#91`Q}6h;Z&+oGz0JWr zkuYLkgR8j|K8vmvDY8df94&Q3!Iay~%bp~Oqn*~DRM_cyr);&Q_^j?d<$*6M+<(MM z?TkV4v(=e>era_}JN2q-kLtHI3cHku{m?99=$lFs&2(sNioJd+Ng&`)KEENy<>q$W zHRuwvtlu{xC}BBbc9nrn3fg?7$<-$07Lm6Sc}c9CbA?M#Y*VGhkcTz&L|6wiLl#h=k{THjZd zM%-N<7Ij{imoxGeAW7@b^pA$m+fWBBPZiV}{Pu4tJ8Qh|g{>s$G@VvNIU#_NIE54X(S1QlP zHEF0fO=0O7G%q~(?O55VR|5;uY!ANatQx|vJtPz=J(|r^Ow`F6h%r_nDFHND4hmZG zc9$69m0aR0?%`PFfppUTk9TiRrbO^n#z@z?@Y(pzkH?7qFob<#L-SBwOJB8*-#%$y z^1&jJVQcE*amMNRdw6?Sn-trc?B3Er9$-u$E2vpD3BM>a_rTqAwyd~yl5>HMsBhhP z4QxSH!<$hvl$zA51kQ~Fe-5!zW18QD8X(4*TL-4$0B|Z~qO`6rTN9Y`?WH`6Z1{B) zp7Rsl32&^GLl%qMiAq$p`tTdCX{Y-53>6xC3EGGVxlB~KDnI^uKkK@C71E}$)2hsV z!9~g}=hbV=%A1D)_Y5mpX<8Dt=gkn5#rK<<92N)D1rv{qA)ScvBd_+f%=!<1Trf&i z9b75|dh{P_<7{k>U-Q~I`?Nf8#7w_{(sd}aTXnNJ^*|s$`ZamRI1^}`rQE0Y`t%CT zMCTooNsBAT!32Sh;Fuo2J7)bN=Wc|4O6~FP3$D1vhdceRn)@?4u{B;UD|>C5)a8?Y zY0`XAVt_|~@;o9J{~V#A8|%gdFmt2WYZY?cfU$RKkvPFxd^EBJebs4HE%3>hT^!~A zU7zH8U7Gft@JW#j&!F>lK39n*ig?eR1om;zYi06gZJh^7Iewu#HLhsX6T3>zL8iI& zaUSgR?h4Cm9G?0?5iaQ~a^aIZ@Lf#%le4%Qzk=ge6KTikpCut549r2}(M6Bv)4UXF zTjuclS?mX*2L%GRoa0XpW!^GDIy>1K`}=I?+HAxuleld(UpPwjDTgOi;cinF8Jt==NI*&$Ir?F8iQz z=)QzcGXaYPKfTua^3#iB4UTL_A_dn!^5mNLP5{WeQ({I3N9?u831so7U!BgK%Xp>y z!lJ7w9?>evPnF%7gb1Uq>z+ud-ArN3QN0>~UzzGcM$QQJg(#WhHkf^7;?W*YpP zlXf0TY05rup0`wOq=9K_n#XqjnF}CfK1=_Cc_-f&;l#sfy;gRYKH{#f*o#}1@ie$Z zY3l?>alA8f$TJTSksBCKyansglD+)kK@4xKU8Qr!bl`E(l=IC6x{trEe}a*qca5HD zJ;T4qfT0y1PwUu8e(Wivm3vaQhjnk4S~nIR@-*CdAVq(tf3Bgzp%ME^;6%(Rgy3L(9Hdi8u~oHH zucmS7Ptktwem*73NpX0-vf=6=W%+EsYmg3wr0#G|tq9mTbW1bO&=wdIq45PbC}zNu zQyIbv<&Q4gQcMMO`#~H_HUozX<+w2NzBd)cZdF>x3dohA5_q$pu7&ENPVH&uz2)}% z!2n9?onS3^U?^ONU}up6F})YChhC;mL-#L?tG&z;*l5FJh5es8LM<1icl zUG0p+j|@&k9yovU#=-Lk4ev_2hMqVYdGZ`@11qYY+^>e%w=4}Lng^hX>tSKLfqtIr z%~&Y1dBEBdQPSu+wuv#(79un1#nPa@eF-qybj#Zg6*HP8v6QA#fVk%K;X+*aMI``l z>9yU~b?*Gt>}h%BQ4y~?^r+%O+Fh?%g+GchcRl_5dIE`<%5nNOW2^ZUkedO=DKJHe zALn|Kqs1`Q(?4sfRrO5;ou(}r8?O}l&uE~rCIe#lh1W6J;5_cIBA8=mlKn z&f0`IGk$Eql^M2`v1POqC_u~)oGhPP9c2pdEP)aA&g8ZTIV6C6`sA|%?B@=!9nn5; zkmH$l#ctmF7u-#~i?d|4YN2vFTi-5LCFJ!OW%3uPbdg%HyRfOt!DgXy)C)>W^*B43 zixe>_X#yB6gzpJ^ih;APx1T=vw-!&{*F6Xd_c&O$n{`PDp84!%@~NM|4H|r!!iRem z0jZo=(eLO)l)|_JcR7Y3yq}cD?Ct1DA*P#=MS+`L^CGo`R}yQIjq%b<)c~E%wu!71 zvBDWM(DN-Hmu;X0RgB<%vgpWik7>uERLhq6X0+-4W3Uo*dQ{0e4mP&X;M7o6th_fG zMCe<3JJ2;q#Mf}vbVNUb0l)8!>eD}?gs8VoFCB_w9BQpZ&fDKjeHC!570vDJwMT$! zhc}hYS5`5PmZ2ny99tN-=*;sJziW3k*GT(w=2y!@pE66ER>qqFPGySaV(@*YcYy;) zOM0MMhz?`rJfR14sz7&Dq-kN-arGO-DZ0m9pp3HQE=?7x<%Pqbnm)z(+$3`!5QS`; zEu@eF`LnQf0@kHJ$E20dV9h#P1di@T&kMk~KU34Lh11k=mw?hM*4iXaC{wiBvYnNz zC8(3P`zlwt#vy^Mql~CjW@Im~Y5lEDn_bK+XU8dQv3{J@s=VS?S@v2M*`woa=se1k^36>iU%m6#P0%IbRzM6c2XbKN_#khh>j zYfouh;{a7qkWa{8VE?%6Ohu!-rcZEX-&REUuGT@j+jmK zOx~#tx99f$^xpczZq7~Zs?NqyQmGfNf$m4!c2huAK=J$hPRqWKhV!de_78rTGs4o3 zbp$o{=JYD8jW=cOV|PUWk3&A2j`{Ijg;`%V@r&ee_$AeUiQ~t}BYZyF0$R))Sz#pE zvLG@gP58d&k}+s?TWVtdGqlgPBdzxvmvH3lnxma6@p2ZBCWoaBa=$z-2*sz%q?_(f z?#n1=if9SDu>Yki{}l4FV{FP=N^Q1u#)E3;-GZZ%*Ns?9=fwE@Co@`S|H?YX`Orvi zGYy1U9uU|s;noi7Q80jCE}y@ur0F_rKCG;%=@1c&ZCRNDo?I5|B>OmR`;hIZsVN17 z&(*U>EyU(Y-1ECGWy9-l6L|Mq$=?97bk31RCS~BetpNK%Pht091;);2WqQkca86m3 z9;M5qZ+2mz`L5K8Wm@nxrTuR=sq0@ld})x?SM<-%Myclx2puXYF|&|XR<@wrx>3K| z>f7+JoF2P-Ta3p=QZhX8=&p*2^}rc;J^lNW&B->&*HPgrBX-XR!A4Idf=zaOXO zmPT>)P1Z7EoJidBD3l)%8ST?n^v{(m=d#Z6WM~j9v#dl%>;^P}V|)Bt^yyWcGo~)M zrIz(u#HFtjC+M2l&?mE5;4SVdT9^_vp*ElwJEu97>bEB5M=_Vdr8nn_ac23fGez6P zs+rZ@8*?5g75eH3_Lg*=CE{^seS)h*({tt5PwMZRZx1wW0?rY)%|G;h-Ei!kO%duTUV1;Z8gb^zB`Ewmuwt)e zPIx0>tZxTA7us0eORKJzV8Aw+7ez-2UcLp`xoKO5u(~B?3FE$bQIuIA0t&bFp*$s@ z*ltmx61#fc2;YtdY*KAC+!$IF5xL((8kwvV)F=K^kW)`BM=X$(X_JC>lu{@Av)i&7 zIh%Z0m&<>SOrpKqg$LLqzGcCy`=bYH8-iNeLV-;lMc$rENy_9ATwO7TMoBOp)1WnQ zmHkh)f7+5?`oVSZmu^Jb)A=8Eb2w+tzmIGcXJed~VV<{v-rX7hUd_$azhpWjRswTe zxL@`>vh@lZRG50JegFQt7}il5#1z`X=U?78JA7$7{jyly=V3B%@h&2uWoyI~<#-QV zL<~%{iK8E5XGVwYpQAo{s2PK})$!8qi1q`>sh{9lcz!R5d=vFBV7JLCM=@Y_JAZ^a zgscnpPEpu1GFvzP`m;}KeU5HR&&s|$P#0=kY>Z=PbGwUi0&jJ+c8xY)saK#o7H!n^ zq!LGu={Mn&*<`qUqj-uUOg2kfsQ8FY`^qO){tOdV9@Ib;s(KC!zF090~HE%WXyhs?!PCEPKvjAoI4On)@gNe z>y1-jR>L7KnA^!yGGN8D#(0W&D3P#95Kr#63?CGY;xTV&&oXS&ZgtunfP1 z8_CaoWS$TKo7fS#rT9mwQLBo!T=>r!<^6INZUq3(W|l#^lD!s#a(&jP;8*6|{(~s| z6a0i#e_8iWRlE3;e_8iyuxHTV_u&^V1}2&_s`B=7I(~9^aGVW2`Gr>+c*QFGP$~3j z4Sk8RH6;?uotTOR#+x(JDxN-Ritt8i9as_*D8ul~?5h&R__n!cclKFV@glkU#4~=4 zq?JwlyAK=vj(rZC5$=#v+PgUiuopY9bIGBx1qscSJBEUROW~fq;4(N1fb8fbpA+$7 zH)nBxF>nOg51&n!epJf*UJnb?3o;(Ov_BktE{`KJK(|$lv=DZ6Kll-uUG)h;3?zDD z02!sM&g&(4ka>SN8p1$XS9~6gen#Fc?I!@_J4$b^lt)Bt!Y%0md7%zu1+S;j{Q%V6 zt)VM-Dm4Z^ES+}Lk3O$xYtBwTLv(xI7DibWu9~K7L~Il}x_HheDC7d|Z$+^P*T)w2 zZLNzzCdCoB?@r3!iT6~O))YLq&i`$GKgzJfC~Ed&SNl{JN&Kj z{vOemAgLk}uc%hU9vVg&r%(7)zNp55W{GukTA6CU2pgg0vt|9>-Q|Cpz+X*&Z{>M_ zH|I_5z&+b$OOy1w{+F5_W@9wi3c=MnqL(4V$_gjZLZUGyAW}>ykILpo+>^t&- zIKyCsHG~X7m*$95U6>$lVwWH;Dy@a`latkAyD5O|mh;$C=kR|5*gps?OHB5pzR`YI zD${}n>iUePQ-q`4_uG1Y&W@0+|MwcU3iO0;QBinp8L4ZKE6Bh{Nd)cENK0UKUkfA z06F=SdzP;Sv6a;!K-)rIEcH2Wyl!hN;Tic$Mr7D~xNn#50H%N-8)U@OT(Tn3$9h4l zK>Dv{%MKls-On(rD2Pa$t#EV+F?QexQZstq%69JK5IDM@zvC2a_{DxMAlHbi^^^2} zO#VL=_b-`fRlE4Dk$E-?xP(;RX9i`iV|=^KYJ4JIqY~5y(YTgRp&gd*Ldz!_!=B{# zz4>72cZdEp$7}I$MHRL`t8C~5p&CSyh1X3$gOdVUHi1!xq$7MasPC?U_Ew;ekX}<9 z5uv|-4|eq9X7N#U2hczzDetclS{->S)@-*$ZM+!IFF&SY8CS}$wA#B@Giz%5qbHb` z=hiO*CluSdO9}|x5N1W2QBS~Gm-ogkzWl?@_*i^oq~(vUv01+E?*S=eBX2ofj)1}s z8Vv{;&t`G=3o(rnu1xN>s^0uhCiq_(mU?p8F`ys-81`N+d=HPM&Ru*=0vlZ~-T3L_ zza^_~Y$|9Sm|48G{hC}DE33|5t7N$glhw?iIDqE|7p=21HOM~}_}^JUAOx>J=U}#^ zrKY|`+zvN(s;;gj6j!gzh*qeK;Ux}H27it9zrJgw_bkrTxSk(Kpt9m&|MtiK-$$3D ze7M|^=D92^V{565R4~B5bCnclinnc`E-%~J5*F*Kusff7;tZNIkhk`W;H{vrx?1sq_qY8J^QCj4|}&-v>G8?OqXvzYq!nURK$#Ud#-m!tW#M zTWCnlhr*eW-Mzw((ivC<^MjIkAS0mLOG#0>dOGk(-^t% zAJtgKrvhx_kIBu;l2TrCTvB$la!OTA3x4e zsx_@o?$e;SV&#=<27mizcgGV|4z5u_y_TMq&*J815PQIgjE(QGn?teyi zw6LJWtC;|8+8z&DtBIMK8B}v>8Y!DP1FQ21m~y`LwHFDY@xG*=z^X*{@6!=|m|bop z%g5m0xTnEYt3gu$%{fv;c9(Db!yEYzS%^FGOC2Ox6zTo*KmKm4f76=ZMCU(y-r9Nb zu6+lBw9s1yUeRUM43{div;T3)3z?%o**-AS_ZRA^u9QEn+r5;%MaiNXSyyc)P=f>$*#V zimY<|Td#++JIy~SvBviVcg$_C*@5QPLcsO@K4eIs{nA`X;mrq*8;QVW=@0P=$AxZ zd>kEL3n96bK`2hO-SCz=6m(+=sib+0Pl2Oj^!*NFv>FNC?AoiuCaF}*DeQ81ib0)! zb((kCk!hU8CVtDJbI8dpLcL-d#ENMeDf5+{->5*{jvmhs?lwE*|tm6Eg7NlZa1i9wZ!Ds;G=Kr<7-a)NpkkV z5y0gtXE7;)0iD<`%E^%`qUH< zhW#p#rMkdWroJ2YnsXy!*7~GL#IVM`=A8~k=(;++%qwJ5s0_9K5tGorDEW;#VWrX#uG2kX-y@?$5_NMin>-@t$mr|(M*Y8jJNNVK(=M4|7MOs&2tCSwQr z(L?hn%OaT4Is#3v-`?xHJ8T=B-Tf{`(y;ht$HU8_Udpd|e-rrsU04pVVXRqO%+pp6uTkJRI{Q`~j&n*FtyT~3a*$_a%#ziAiY?E&j>55KNTmhHIs7k~es zg!i`<`-k>&0U|dnaVTmv&N(L`+a&@eg^GbUR2%2+=wxXuFdy^s`Vm{!$skHT(Y=-? z<%%rs(qL`w?qoA6j9&EJco$6n+Pp#pG0RkT66zoXc&!|iq35}-R`R=qME2eOCCeKj z|DJI>FY%3m9Ro4Hs*Hb<>Q^E7mjv7~nVeV9Y%Meit75_C&}vzqik9XMUo|AmYjFko zBspOhHJTA!B9z%mZ*=ql`-JH3pPphBqw)$_$wHz?k`OVGzZ)%(-Y??fS5f`%&7xZ5 zhIPvWFflwQK#SyC?aX^`qE_s&Ik(2=LQ(PsPmutUrIR_OhnODFh-DVLSVQC`$LrY_ zaijrd3Oa3v`y-1kfCx@46Chgrzqkp?LcfHsp=;vbGPE3V+DpCgYAQ4Y8K4#93+>19 zsGz!sa~}+Ihc!(+jHWRB&wX?}@)gby_~ljZ_2&F#L9HvQvD2w#jWF>o$+ zta@YvG(4uSh2q8doE|zo?6r4kzY$pYchHOMyZQaQSGWgFg>xGQmGeZwa&%(lb~Lq4 zH+FVKHT|d;d=(&YoGYV5Z{cii&^eM)h|ow$XPeXWlI5q(w-HmT_|Flkn{Jhz}`#w56ZDJlGIwUsy zcmCe`_}tS(Wi5W8^gSUf7*ZA`1b^ug!J*>?*ioCLo!WR`711en!N{Xyd>P}Dc@}vt z^wp84UBco&?;QVs!Os5#QIVDxK3?%5?K5xKsS@I_&Galr%;Yc18ct^s)e(IG>)^~a z+KTprTc_$bL#Jr!36&d`)~V5BlU1X&O?#kUM^2m}^}>9Ax9fiFTyvd>wr$^Q=4*}4 zYw2;OhZ3`ztwEt4C@K047wo!#;PX{Z2j1Jka{+ntrPTqpR9DTGawk@OWaj-a3r7@emp@I zNz(6&TXZYKz*o`Qygyj_Vjv`}w6-sTrtv_8?p?J{d zCeyBs-QIFGS?da!AsR0klZ}=lX4@x?jYg5?RQ%jfL9Kj6KPyHhsOb&5Cn*lR7_PX% zut<(KhX^-f?e;Wod$#*Jm{__8c;o4^IX9FZfdlk9?1A#4p7E>;f2>wl>Atz6%LtO_ z7r?4V!WNCLW?hglIz8!!^26AB=lEDe$O}L!ovfkR``RO?Rl08DS0;yihtc>gXM2bZ zTw+JR?@T}?P)4fL>P2bcIsmEWJWfDtw34hV)Bq^F2P0y6BP&`-uLr4^|_>MQ0sJ+9J@I%vJhkaO#wp zCD@{@TZ5KW0a#rfp{6X=#z?MO5BaD?6PgMVk_)MpJ3}tE-k32%@KELAq}Wu=W0NH< zpQIH3s+2smF=R#6!@9Hr;0h+ahBau#(Z=oO?}nt#%2)>$JKu%Al}xLf)I#bj_owZx zb`}G%KO(u`q*ZJev7)DBo_H9U98I3a~moPXA`qb)OYq-^*D(|--zFkq(!T|jz+L-2F? zetgMsC}*hsG|KooVCFW-8Cj#J7KofIO1~~!$&pv?@g?52OFFKrX;d@SuL0m>S-=dO z)=&grB)ddRIvFpq|$b8(_=#2rcWL9%>lHW88C>g2Bxy3)cB5IQgK6zLD!b zZ{<6kp$%XIcy$9BFvHwKJMCAkL;5T1e7tKfk7_Y>rgrLx_p3Hd2}uFIYh3}X^~YN! z9CCLpFq`fQ@VW?alwBMhbu5P3ub)m}Oo!v=8nS&cHILP-B64u}hICp}92z&&WCkd% zEzzpCv=2PlO%HtTb?WHEx#V>sbHN`*?ZtF9zGgtpOBTFbCJ-JM< zbOGk*Do$J%?E=KnM%o?ll2%Ht1i#J>!d9M>(j!d)nwj00Q@IxQOp3Zp;aS!Muh%#E z`i}ZfSxi~fy_r;WgVI*ihBxc?%*1H;t<3f;EI6lbn>uzK2PV`6pi=P4Ib#rxl2N2A z5^f9NiGY;ZVT&`CglSn2f? ztB8rV(S#n3`=t(8$G1D+V*!5%zZLgACqwG~oZ4_@BN$`G z?6_C(;ftJYfL&l(kh$9FKHZ5}<>!^|B-@KQ-majN_+eYbUC^V-8SWTj?G= z0WTptTHrERlcO4c8X#kV^1#IErIuo7OAt> z5fnnW86J%mAfdEu7CyL8WCv)z^6p^Y4vns?&Y=<$VIyf1( z9kyEy##yVngv|Ta5Q@H}a5o`~rtU$v$d`n2<%sAbZ?-f2%&vtrxX+-~` zhk@XdFI)wF%a=MIBm~jg5g4-!$;6f9E?PboE)_%i+m?0~8{;!g)haSP-E%$jOc}mb zA>Lqc2*y?egGLX@lvjeb$H?YhBbOwFTxKbSc!MrW|83-IK?9&AyyP@^DE)dBtha}# zjO~ugw_>CxmjX&mM!J|q!hKoQ?r}wiF0AS9>8AQsTBOBmc0oLh#UvEFz%Gug#QQzq zIIK9~EIHq#!Cj*tuNaq)DX$1wo!jyh(TXR#VD_qd;*{g4f7ybPsUmA9Ku_!*IwI39 z=!BvZX}-q&j>|%qFm<{!U^$(?qSwrx>RWbpuroLrgS9{yYD^ekB!cg^F+$L_0DyjS*+cfZH7=Xy$WlYR|m zS)G=*m`^ONl{-hqGW`NrAZ0u1>CCdoe)pQOKSCM;N*&E}2ujhQvZSnAYJKP9=!!TR zEDVS+vsbhk>spNPDIajpQ`pgz5@}TM8v4>%Pit~V&Q=WT#u2zIhQq7e9jN&!lI4cJ z9eL#Rx-Y7${Aq=J3bWFM(?w>S?r){M?BUMtCM9OmX(06 z=pb4zlseqxe>taY?yP6?pv+>ew+T`rt`sv@sdv`A9OUiTF*IFdOzVkZW>*+C$(s^3 z&pM~=;8i{HfIA&`z&&U^k|AEpr&y2l0exGuD8JHfp-9Zd-HD`|)jJ%TA~tqSMzYzi z?>u~KE|fpnl+-?b-E{K0ii(wHhqD89+JlRFJsQ-n00))54^e`HMoMbSx<;%q+up-x z6|om`hoAJVg!`6{k7eV-VU1(~f~=M9A6+SX{H9*!Ia_|7KkwV>(WTa=#!L3=WIPb_%r_O~9iuo|=n&o}Cz)b8bSj zZrt96bp%?uW4fdR?H*?#;Z>51BUi!~J%y1T1)jzU53~C{3jr${4S)}3kT}OVC37P<9#PpokkW{+wpO>Wboz)0-cKo%gPIR783(U)Le4X^CN8Sm?Ku`4V4z> zoVit#9MfDMWuQ|Gj5`%Y^f%24UmGriY|R{ZQbR0-#u7%Fiji-lT*g#UJz!`#Q46J7 z5e`ErQXLTY%PPX_08n`+z>q$na#~|ZdJGxv?P4CWZ7A!MTv_9;*_XCgVCp$W1*=gX zX^zom=U7~}l9e^mW2hGmTx`eqeTX4-rtbwbD9%<<)3nCa1S3BB)k=Z(I(({j41gZ<8|F-8sbN8XAKvCJ*O{7jY^L#nbK^BizQ?Z!BD8HvLd(!)*Jej=CN}2Lo60GbjjK! z!H~eH>A1hvXyP)Fo<-`&j;tjwRD?@R?0(?XYeQppA6D7#%y}2|oVcFyLG4Nh$Yau$ zwv+A<_?|2u;Z~{Wia<%a^-R!?l;klG_iVZl<_HTyp>32{u8RBgY9awtELZJ+?WZ(C zrfB!wqP9)P-d?1CH~stwadAuI{*v{aAKsX3wgmCnygwZL+H$pRo#lz8tj?&EV7j6w z*Ww;Wi+Ke`J6%!VVXv0(d04xCrP>6Mxbo!X)ziOkSO2!r`r8KaKU`DKNS5D>?3J&= za^PH%3Jz-b2iu>MHv*spt+|-Tb(#_15gcqs(${BPcn2U=6BLa3pz2;KHe{kD-D`&H z_r0Yj2a(4WFg4Q`?|EO63Ctat=rDL#(x*Qv&rdFulb!r&5f97q_I-hfnP{%X6Ij%2 z+i|yMFa7Z~FVkA8-E2Qv-P^f211+m1(*6SJUsBHtDp10j&puY4-NsCO>1s(zkZTq@ zbL+st{G(5`PWMGivv=}*2V9Ro>3gJ%`(S=K(VV&%@L^-e;$HE24Wu@F6pp~1apviO`{-ci5K9^6u?u@U`jtbGCZF$YR5n_GPX zUa)n8Zl15D6+`Qr0`h0G*}2;A0pLGp-|6?^-J)hIg$3BTuCVpSB;B_Pil2C#&KW?;vZ9k2-8@e zy+3lRLzwL9fQR^Gww&c$b-(N|;$cF$lv~QXl&rkSq74xXMde*19|r49lCj?=-&SbE zxipUmy3AVJEAa)jgq!_;oPBj%RBhTnA`&W%ibHpoG{OLaq%=r_(%qe+NSAbjbR*rM z2#j=h2?I005Yi0!JG%Qk>+bv8ci(;f0%p#KbDyiP@AbX!69-^Nbs%qH&3Pyn zy+Un;%DAwlFpzsDBTDe6@th|$?J_jlA>)1n`@EjvpvZo)cO+y<^2Yw^RzO8)Q;`W7 zgIR0#uQM}{8*j5r?=bpL6q^l%BEDHZmZ!FmIf2N+r4|AkeBeA;RgNF}ZR z*kd62ocOSP3)1dWlA+sRRAsOg?pjMeT^boynt0%3T+UJ`d+eyV2T9k<0Ai&NC|cLQ zMCov==b*pfu*+C&psp&5q#r(&7S#g6PPSkzMe1rV0 zW6;<_ZT(TTW#-XnWs?(l5_s8V)Oc!GQ^JyMh2<`>8jwvgt$Cw7RVvfd`Cuh`=S9a= z4O$%s>J6zZFqR6^Zgow+O`=oB3CWJyzGJNk<_gkHr)zaW$d$91}DWo{R>0vkpB*^rY(e1M4~UR%4q~F{n+bZcZ=&N1Cp? zKP@qvD7@05si4_XH-yCX5V@0Bp9%1-13iURi|Ax`YM+8{pXLHWGV5sfv_Oj&^kZD> zrRP{_`{h_uWU8Lt93UwpJ6`FdVhZQQq$stlEpLTm{W$AX{w>w4o=lDmD@gKI3w@9D zx(sl%Lb-(o#J2?CwNAz+4BOhcT1SD7d6le0*bPetfr{U^VaY`g)L-Z*oXG<-u2Y9! zZ>TN*bSUyTzG?R?c!BG}9^3i2UuvPJs;&lT;-G4(Wg+>9OSGaNnrb+=Az!DG>&I?b zr6up%U_^xg*SVCBNwSo~ri9krNf46$1EIWX{;9dCsio|io?-Bwu;(lp^8&$_I)n_BQ519w{GnQ9rPOB?NlgZu}!T!mm^7n3Ryb6bT!cs9jeqCNE)`)%Z*mcu<{z1 zFPh^r2zzAD6O3!zp-9sKn@TS>G}bQHH=gBLzOuB96e$oAMC{MF2wS#W6R8<`mXJWk zy6Tuk>&BRuZ2|4YupduH@@Bz34HcZfNp+mtB@iO|IkI3fwiSv;>o9T+iKekU#E6zq zgN|`TFMr99KpVtZ-kK?KXuY{M^j#TbQWGdz?bvrgyyXmamJ7gtZ-1yCe;nS8dO;Ht#ZMUmfNW_no$?6ljVko@`To1?GS`j_nb;$D%7Wm*CQ%*%UT5J z0g%;w^2Xq(rm703wQ+$uLG-b_Dgi~f#(?v?4MF8P?=r|C1r2-*#1-epRFT+D` z0J`@ywwr(mRdGc6K&^TjolK#QJzk@GfWcSjmg_rPY*+CxOvNv`T7^NXPBo;jH%K%Y zrd~`xM94A#&FwJKSY*1ZF7I66W#&=Sev$D>Q>!c?qRTHI)UFYAV9Zl7de!9m+_$0< z>0H%(KGw4!&~TtyDy-ej>qg?cq$v;YiyYURE|OBLoa>8AFnsB!ja+OV)-BsJMz-y- zRnU>KBu+VGY{>xa)|iz-HMyE$)0lOcPBnQn8+_WQBHWedrJi&D-c*`Z-^-=f9T!rQ zFQZ&a@|$uEbtVrTCkhcStn<7mN)xvlhv%Jo#`>6-%eTA@2VGs+3f*l7LLr-6k%2kY_F}Xns4L-`0YXzrRzLlO_2~_#OOM) zeHT{V+4#eN!o`OizqtsU}c40LloS@Ta!r$N@4=h^1(_geTL(P$G6U9d+EMv zDSgrE2N2@P;-CxYzGR2fm}@^rIe-$7B7U~Jwyvq^;Gqlv*a7uR`5tv6oqeahF z?(`~YMX2$yhAyuYgwa+X&p0Y$^08A>nKvVx>_q88bzHxpfJznEB~0RTb?T`vd#p7SoKY7@xhanUd~w< z4_qwq*b7zUDN%DXh&MN1-MM*S&iirY(&P=B9;BVxS-Y!gSS18BW`{)XrOnk`1?{ljN!ddwOO47<1q5Gj zD5(6aZyBDoBK&`|`2OnbazjujO=)y4G3 zh0ub-JlC`+0NF@o@UI;UsfvD}$*L3W>D=a0y{ox!QDqj9@7Jw94zW7m?d`QxhuG?w z9~Js;nj|1zB2=P!HW#=wk;PKHQreYJg{IBMFq~z%T;cNPd?gU%7!X@6MV6vd^+eD0 zDAJ7V+Pa$)3TMl=CW;ZO&`SU=fg!?uPxC>i`9hY$1rL2K2ZbWHrW{qt*5x0;RawpR zNvk60qV>7&y0(tm zwF;j;M8I}&AHKCVMT~$0wOx5y&$t&TTBi`wGs$!q&M}aAarB<=qTPLFA^*_>S)It) ziQ%P5vmuY_!OPXFFnvIeRKUhIme9LBMHKZ`|*|MC2SqAqei2u_*Kgn*U5#c z03;~baWLM@rRiDx@>->?t-{69&khF}&uvwv)qJ9I=%J{i>#FK66xGB919V3AI}`)N zyT3s(RZ%{pJ#+c>9_))}t>&`}-4tx5JNo=}8TRLI>fCmjqa8#2s#`U4bN zOTlaDD)L!-!fHx+i_h&R)Lv3UE6$zn0$~2zbZ&9k^AwSITU-xFUEh+XKbDRJM zrqNS%mKhU;ja$sikR{DH_Q-w?eRlS&GHYYeBo@O7X6cuyE~L(Rk4>GCB`Yr>T7_|Z zTSf*Eg}h@`*3N^jR<4H=ld2U5>OkX@6p5ek%e*as~d z6-UK<$1MCXCh4m5ge7B3(Jc)YE2Gv5Q8`g&*s+u2X|bgOsPN^SqtNiUUar#?&jCbe ztK~RR_uYY$GxJMRxIM&j%tJ`A)N4U^ye?|YJ7d9Tw6MJl9$}qZOMVDLD7iY4x|(*b zDwOm(I#}xafx?fC1}>Ts)0BY0tmkNhp8kZlX#F>?tsMH3G>bf?Ism91gWF7a8nUf3 z>ep5zDEh6p3?hl5t7bHP^!z3!Ep;^weO;A+AxTd=11}l87V1NOS|B*)XQu}zSwBr~ z5KvmT^lK4q8Z;Nj`fmpBz_qWg2sRAdBM1F93~l$C_G*E_Iu4GB)tuSxh4Q>tPn^v` zBjGO!_vdOXm&%T*3h%kE{)H4n&rdrZUs#g#gVBB`)s$iUB-MCu0MsNZMw9;t zx%|@wp9^R>Z@T+!469}>PdX0=VeoUva{DZsO+Ss_WWDea*A#g5+fS|rYrJG|BjFFrwIA( z1T01J&urg;&n=yH^b0MY&wWqUWlL)w=a`w278xzrb1j+e>Y|jwMa2_%h33`)>#jd7 z<4-!Cd+I)mZ!Z{)9fT3V{{FZ7O#Rv@*vbG9Xz_@i{4Tctj8wgnAk;cL@SkhPZJjq0 zy{7s_L!6p=9Xy|i0WN9n9PcW(pFaIb;CLAFqL8r7oSM%(j zDaZd&FgEv5+bRYPPblj5ByOx~vRboew78~4D**Pp4Qv9CPO!)jee^}jFS~L0fwk?4 zD776b3Mby@TVHU{8RG)mZd@Yb4kho1M9!jRKlqM2@1+R0a;0L z^`8!=Pq?Aynm?F%Lq31Ha;nv^0pUY(yEF4W6`3;IRnuFvyr=0NX0svjJqCZnrLPps z=5s8+PGCmvkh*gQO(L&e=j8gG*MdX)lNpxR3#=_W=D!`kM*X7p>Yw4yyI;@p-5`fk zU0begPGC5#-eL_S`bK&EK^CtKqp+TKfe@dB&Y; zg5T}7EasO98UGa%Iu_5Ku0e7b=l~Q>(zL5CqJD%e#eRXxf4wW6RLr=XFTZJVx*562)uLOT?u!(v2S4^qQ5;bE_ z->!zj({O*UZ3=n)K*BnsanjZnCSC}5S-ROyt{s@j7$6pxIilXX=eEc_^y$6*rBc&K zd9-hdt$&a6^jVJfKe5cE04n#m1^9}QB||U(@u?HX|`-q6%(Lbm2soqGrWk^KOKN1y9xm`PPZ=Wn@RfU zr;Zt9clzJ|hIoH|185DMRqABsjE4YM{C9=^^9ue9q`$}1Nc@efwR5AI@nGAN+`R@Q zhn~^Y4$jM&%ukywSw`Hr9`OoUP9=3__4kdA08esNcy(%RXyiTYqvm-(&Rw84%41O5 ztlK&BcSjF6mI273*n7Nyb)&t%|Bnd%+l~M2uL3S;VWq7D`UkRUA~zy@-uneByV?Oi%VB3J(jvBeqVrc~{?#8EO?{-_y2}1s!FOEdN zJ#bpoPt#sn2hthl-N(N>;eU>g4kK7D?Kk>qB73a!rypy6rp#biR^w#V&m{HJ`6uY3 zMEn?gfJd51MuUN`99veR{Y!-#r%r(L4zh;LYoI-?rGm_VYUb0*&wW!X`U8K(@iBtM zDm4ujEtduD8=8jwI?LvFhUdWtX6sUgDHkFO^wFZldxZec(S{tAU--t|W;c$43D*M% zp0iP+SM!6;KS-JW@%W#Eeg$iHy1(RM%mGUaWrGF|6+0q_kyA~VY44f}3T$EVYJiWK z&m1i(aak+<&1@8;v%QZ`cjg#GzjoV`bS6|}{n@kbLnMUKM zjSbqRzOUeUAfWQ$!X$!6TW1|`B79DD*Y|CJsAG#T&T8h0ip>3uM?XXKGY#txG zGiy6a8-Lr8V)5*I5d6Ae&=*FS?*hA32$-#(WgO2x5#t5ce#wI!C4cjM%xB)iz(Phs**1){6!G{kAbl9G*PMXiH zVTm?)1~{z!7FQ5Kzv7Cz2zH!`pCs&l#u9t?| z_K-i_#n6q7;Adc5!~E4K_;y~MYsSs*GjP z4rHV#c^aJG*CFw98z%NBumj+~7KIpa1`bm2qBjdX4g+6=J}LA)VzY%Cc8t>79gas@ zQw9Rd7>Nfet}OkFt_$5$X;DVCdXe>0+xfW6Nggt?e?(N^kOZNhRh{I}UkUD!m`5

4tX&13uJ7Y^%bSup_VWZ`H+=rUx#iSegJY~uzfLMpBzF?8WA z%j~5#fX!}yg11`uGspf;6c5m#`Ehd#1?A?3%uOuqkMp#)eKB5y&@?%m7su)ARCUP~gZ){s#;+OtSlYc8#Y?YfIra+HDOt7iPRub*!5e zCbEh7+zxH0yF-ddH#0YvA>`1$tehP4{{B8bJ-JB7yt7@@gY|v4sOc1&jP(x9qn2uC zjSM(1{jgU$_wG$wjQ8Snj^Kk^&&BYS(TM)SkL*zzWj)%*H-|B6Z0CJ0lO5g^pS#m(K>=b*mmIXv(BSl*GoEAL@_zsFpD+E7e^uaryX@biJB8kGBd>&9<2FP)*ueNI6?@YWzwW2U ziAvWU>vWo+>hh|AiP>QdE%fp$;*nn2!+%;5aGwc2R5>4~&?15?J=FZ!zapi-OE+5; z%?a!!Uv1#isds8SE0tsDW#|J<)krnu_$35oO-#-$y&kA2Sl4Ib-kywD2bH-$;?ch- zC!2~gyNe-7Njy}EJz&h{PvQMXiTsZ%m8nqgki3+e`|2J_^dMBpgH}dqFVqm&To0R! z`*rbzAnJM!_|6dpy^6nE&gi7)qE5iS+~zyMEjn=1ojwS}RB^E2FX>Bc5RZ|G>BFj# zUszsIqn6x{4EPzv&Gb*@W24+k#z&r?-6dnXKqA8`D-ZW!T1^6ivZ{M+I$>&YDsQqR z!N_Jb91`6foCn6XjHr%V>Aa|jKzcxED5%L<;IrtxA*nR0Ms$rJ>A#!dkOBREC|XfT zY>nX;oxtOwM$C%`ctv5Mo-{#i%)&>h)XH?IZu(XO7sxU2`Pq502*IhepP!#ur8*s- zm&zZG;t=|VAZr0NA5eviCEvg3=>OzSMNFu)JZo^cyq!Vj8Vn{Y{`w=)!-oMV&vT8m z2)`C7#{r_&qeZhA!6l(KBtAaBK!*Fj=|ID{Bj@1o2@M@Ri~>_Rfj$OxjJ#db8Hb5$m9lY8@DaGD-!=GEq2t-D{S6cxQ1@ba}y8x+A zVxr6ntw%jpby<7U`#`{_OcH$Dp|SY-ThjU|%k!B^fi(vG@Dem74n9FNnFts}fZHN3 z?*#>3rz{%ok5h;j(W|Na@7a|55PSQsAN2f`wO{{kWW3MB0P}o3{-{zunYAYfyTX)%J zFH$OV_UaW4I1D+4XV*L<;lg`0o*reaSq+Dowl(Vsm0uHAQl<}E;JyRam9tLUS9}!F ze9RMz_JV3xTz+ zi3}h-v#y4$GmCjB*wZvnq+8gz4hUtHX+^7sudhK@y@Y~S6@Lqe%D!mvXKMu9?Ge08 ze`Y(eW4t1JB|0BN#M2h9VHszZKfn2xtoRR~031c^tJoX-%qQG6v@B0ag1YVyprYQP z5g4&Z%N)D9x|HiBvg#P&%uKG&v7}Zu!jz`fo%v<19ldG=jVqn!Xx;}Y-#%I5i(v5JBz5k@9`hIclry@KwmJ0kYJu%7FXjodN z&8qqgt*9lBL1d`3l(9q}=SP-W-;-o~d|J8c8Du~0=gCcFla`5xh(UN6QLXW&gSH9? zVv<$O6yjIcXq~NpOg6}!DUm;|OeUQ$ouV%D?n-nO%tJS?d{+HV;&{Y$L-@y$WSqq3 z_N4K#aavwpg&b-cIw7IC?+#!~r0RPJ6*!hiTOCxKD7j-3qa6Op5DN?I!;ep#KF_*w z{f8}7|0rOr!hp!EM{Uke$zEgqXJpRqrFtb2@j(33b8%7sq#tV0GRihR?tFJr+s}+= zaiw!H1G5c(M%@2zF#6XIvGH$hsUIBPyT1~O{`SR$JrIp$U%ep|?3u=G#@!Inn`KuP zl*kVisTNCP7Ba7#JgEXBN-XDXN%|?Qbqw?u&FA6T?Le^F%k;E@dYhVRp8B}X8THpg zwidiUdg@QeN|+AK8xf!BkTKB+5_QfbeNlWS@s{p>Pn&qi)@RTD`2CA4nWfHI*waun zTB1e;vq(l>%Awv~i5NzPx6e?fFe)DSwbMRNjLqB{ud2CM)_PLaY^u)RF^#Uy{jTBM zGozUOjC^U!&C2cicmRQ17dC=O!H|hQzOxl&A*41%&k1w)JR|!dt{L*BUC=(q4Me(^q(H%>s>+|GYGWRr@@iZ^WL?f< zqnh;}#Rm@`8lzVKyI0|v0~@munNQDxSwfYL&!?GrvCa_5NX2S@S&t5 zBm5+zbASsetmWfLTGyy(-gUQ$ouF84zHn0F+`SvfaP;Ph zFFJM@3tNUJ>z&-37bl8o5Z&vrzEAM&wiAnCO&3P@o*jQRelvUx8wckievO{A&4?hJNK%YI!HD zO4_@f9?}Oq1%mO3@Lq9AC0|xsrH_I45{%_(;-GtG zDJG=4)pXeg>49o$*w3DIT7Gao-0wAn)o_}yeyHff+>cOS-#Hb;E?JXCK4I>KZMkTe zX84!eU_V>&AincH;xc}(Ok68ECx^NU{W^1H`O-!0jIg@N% z=Y6by3Du4=N3Po+4`^QNJntxF?uVVSj_djjx1RV7=eF5JXHGNU7}WDMX(uVWS?=#n z<@F)T&*YBhcH>ptqBFefBz%mTUOY^y_DVn0xI(a1!d-{=>R)6USGyj1KS#!VHCYkG z;Y$BtdwAeP$H4Gtl=C(%y-?qby|#^3?9VpfS7ZAb`=|N7BRJTQpQ2MvRruSd*}as? zA)mUCn6l|#IblDxzeDQgvbw+6~qxGVOcFH0Vg6LJ`v#FmoLFcMUvQXHI0ffWA=8wGG*h9)35vn`)iP=^B z&y%cafs&C?HAP!H=tz?KHck1DRQl)N-{O7Nsx#YG6wL3~?q#0bG=0>6e}SWjx6Y}? zeO0Yoef-ruE^Fl~2#AQ>ETk6gfB!2xS8`}2iT%+x1xQ7|Ic8179yZd(t4>Tv(lUFJ}$Av)agmg!#+p8cZ;{>-hoxXn0J+w#W)vZO^Z%t_>m!T)xb3F zvah_WFKnqNVhQP6)GAngJ#s9Jp?LNr!Ix-=hDG(UxZ<(&&h z+fIYPWs<%#o)a|-1vLin18Qorn_Z^PrJ%sVkr6yBZvWGG5v9+0vVV9((N9D`150W4 zdCM)Pr@702WYvIzP%-?#`$yp9gbX@bQ6y!KDhk>?KdEG85!^r`^|Mu69nnkie&gq; zUhVHvDlw^|!<9MW=1;4e9zDY&$Pz1$rN$Iw41`h)6LleT6&3ymobhjJH@*948_3HS za;aRxxNn!J85!}K?^)=-x^a(+gm+t{PtDTeahhP<=OYjQc$@XDVtFGm#dX1#DynCA zVF!sjQ5O;v#Gp8f@AqySgFqLLQPHrY$Rtb}gxY#g>ve!HlEQ3zpx5EDSFt42X)D zJvoogVwyd@3JU_6Pg7T%rV<6*lYZlkx9jcLCDg^+I~y+0^`ZuMrS9;ADo@n0GJxik zdL}p~WYBSQ`}vs^%+u_XJ^Y@%t%BSq?~etFKC9QU7oh8_ug1jNT{*eA8RqJQua3$8 z?z8kiu?{`3TgxrS6#be%TbRg)0dL=;$_{^vd7JZ$hPPkTOYh)>EEaH5mLQbDkVj<; z+3NIt??g-kR+@}Fp5C)sRL#LSP0BWNRJ}hOw9f0kB-#5y#>6B~ zn}&60l39kE-x6(`bWIrU18-%h8fCoL5pIxvB*VMrxjYf7bh1Co%gD_=9-{+=8Y#Fu z@Ln9Oaxl!vTXN3t-6AAo(B^36xTZ98>R8omu5V$IK4e6FK=s{*%;)~>oHNJjwm9h% zqG`q!y5gey-b0BR^?Y9(otYj#MLChek=TAsF<%Bj;XTv zMGw#zM?OCJg5>0RDon4M^6EIGNB0A;oB6>(ZHCH8i^v>$!j0|lJb;G)SdR@d6Moiq z>6@V6fMkB^#R4=@^|{qf+n)0{!^;bmPpP)a_G0NH+ORC`6`8fTJN0Hp1TQLnc}tM7vJeOu z;MX=6Z_&D)6$W>M(Bif`gxUR^MF~)-t0>qXEf*1=exf$Fv&&3>A@?>{dI1;uN-EGf zqO(*Z!pyD@^OeyYrX9{^FO|@oj0ox6{S399D z(P^{9x)gK2ucG-39o78c!Ml7~hIx~r%dg9Hlpn)GM>=_zDv<1QB}uIC_LjaLvo`gL z1OQDl=U5g0+~Z+d%TSP7F28|EY{XMpRfA|yamF%+<(=(g?6M7cQm3Tvo9Yj)aDt=A1MM2Cc{zEvq z-ZPEX|2mQi{6KA^TU4%}7C!-sBCGX!6(6g^E~hrrl`KSQr<4|)k<6_WYj~D)Rv&?% z6_ef9f86?Pm9Pz498BOlNMy-p$r_^cF*fZ3Q-Fmi4R~MXRvA!*wBs=X?`&ES9-#99 zx^P+w@|(N&9#^-;qnK_;9Z#mpcaW=gF&5>$5kYZIF-UtWp6mj?C9vnd>8|SiZ?eRn z9eyOiErKk?^cQdSxbgCWv}lHFdp07gzs?n-zd^xL>gEhIpGZO_t{7KIGiKFGi==tq zi6JCGLGf*ussRq+vMI-E%Hh*}DQY^}6Vg06a8W_9{Pm)%VOcrUcV)*)bEpUtQY955 zNkH+)+$Gg@zqMqMvu%Yy{LK)t{Qdp+w8T-p1b$nej&Yhk@8$f|x*+bf_PemPffS&ok-+emHSJ#e|BDt)^TJ-L8a>IC;G{{&mHk$xc+lnWXa*ir%52 z4{K{C5`fur(tXme83^+7U)w(+w2fmn7M6Q&tAwGq*eM0HP$^B678{={ z`U>bC;F2Y*E|4;;#>ua$eF^g=xc>ZL3|5~;+p4;%hDQxH{kA{rynY0&3^#!PN zmW_j#y^=)*{vxYODueB^CfU>iSSUMQ_6MP3-%J(5zIehq1sP^;K6qoj%B!QuJCu0eq}B)o~x2f`%K{W_%rnz>p%&!72*|0=*)LXM3G#R zhEXPOV7q8k?OW4K%swr@K!Z=|>aa zOAD#HE}7Tq=;ptl^^GRT!b2gn#@LBeWZ5qs+s}FQ_ZqN73YZFLK%GxY7T=_cd^G&C zG^7s_yVWYTkLws~6p>AU`b-oPQ^rT=s+Y7^)agaoN{X^f)EA0U1H!=j@6&MP&TPl? zjsfI_4xDkeMIv}Lu-w&Pn{K^INK3ESRrpNOr}=ddPnNL3CCyhlif0^m)z18)LqcL= zV(=;lZMPpYqP{`q?+^z1*_U_PA(E7HB(lmxe%61YmVe0N zUx%>3xX*!ozc=(O54{Ds$`rfyg%#V_?+7l2->`Ou3aje6nA@-kOnLsO+?|2AF4D_{@qxE zbz;zi0W5e40(<9Ptcrd2y^MxdwxhpFz~r9_&;O7quzZ;D&F&c6eYVv--R69Xa1_wv zP%;eEwc%$z^ybXv7JinKsHg4|LyrX_of+ddL{}%zgU`^O(Pa4W1xn68kirpiI!aFO z^6EXNYp}kDQ9(sttt??tSpP-)G(7AsohZk$@S}FzEfz-wqqV}%*t!MLp%uF4`Q}sKJX* z)#iL2;b##D$>4wEU(a7?#}g(pG3mpS^btDlB3YfLY6o={8cF!Xb`pd(ITr9_JuyJd z$;m@OV><~BjJLSNDHYdpw_j|Ts3^?K>-!=RY%*Q3SnYjk2gPP$=X*IvL+}VoAw$SD z_WO5A!u8O=!iMFmhSrll>kYH27pZ*u6>aBoO+K&}n{O^tNzpbk7;*aoBg#m7-~Whm zdg_Hs-5YAc5c~sej4-f@=!cf+hgD5(G)5xUK$NUJ5vl1uj;oP(`dFCCvd z<#&`)&sS(P;fQgGIgNfqcax!seZg>cMMprs+&XvF){7n6mTS}gYPZCqD0KLIogX_jG_*pZWLe`75o-E+`h>Aw< z2KFZ=BVv-{5lju>$ydsoY>y&PrXS??^Lyi)+cF2KsqrIJk-WuaT=^HuyU)+E8s6V| z+*pr9UZlCJpiI#cd|cQu?z1ZI<)7-$!_Tr%Ea)msji73i{yQXfAE>YrUaPG0x7;dz z688tzt&9fZLXE(bj25GP5cmv_3}safD}>AxA9#~fpKFMckG*Qe_eZm8@w4Uv&Lo|_H4$KmN_H`QL)#C<&&s@N2|Zg2ml5RCL^=&84s+mbor^iF zsHszrPIIr03t&k~<~);p+bb?}`V7-2*Vu@bdI7(0-aBn|f2ImrO&(a#EuZ+UMoH9? zl32v;Z3KyT%8OJ1@gQ6Zda5s9oQ^hBwA+31g%1}FtNnK5EP;lYbS{ap#tvB_eEy9i z-+gaM0l)q5{KYM8J91g2StokBMM?6o$h%43LO2OGWls~~;x8E(ioOl@4JAw*y^!r6 zK;LJQG0LT(W96B_8{W!OW&6+2ThcFU9(UP8&x^t~H`M_pp;*)lNxxAF5#kj>8+b=P zM8&4Xme#-Z@sQD9S|L-^m4>zp?aStC$|L`JTXtPXS<_r9zmrOT%IBqzox7K8ORxTCYgx)@?YR-p({Aea`Ln3#M6UV~)1*M2*wOLA4`&}@I~cGugJo%zSq zX%Ys^2yzHUWLjLTV!xt*zOc(#kz)lhPKHfOeR;m_^w3!K^Fyl`cwgU?y#|fg_T%-? z!;G%CsgIA1d!F88scA>TM9i9Td!G6Jst2RX>O+*CLvZE$*y3zH#@-Ag3C7DFW5zrZ zU5%@f{c=%^61X&8sMx;>Y(pBKJrr*oNO&B_9%rdWFE`I;dw(+#nq%g?lFpPZY88Sq zjRWO*h#;6|AO>YLRQ}L$VcUIvd3i}k?2S+GM8zh9!I~tei-8V2iF`GF_g99pK*eO- z?_HOuC&5da<^6NAKeBYo>^_;ajcT;HD?60E&#W@Y`J85_Z#8J?IzueOrTe#x{>-7({57v_OxqDy$c8Y&< z^qqtl#j&JPa(N&`i5C1k?VGCL4^Am1O_ejU$M`EHtv%_R8&$^Dc8gxxjSe3!kxKqN z`a9$PpI&6~X%r}?u+m81Px|qLQ^N1!WWL*Jr*2sgBWjboGFB9P8h^AkdzgNxu#X`^ zItJCZ@=C-n8_U&~aiGL}M@8^2IxIx9gW)HhZh3*{egZ#=Tuv27Q}L$5|lLc z#E-27s2c(w8@sthL>S zDCN)9)5HEE(vnl@1@gsXM@C*YjWN8sV8uJ0-VP2iR4XwdUopWro83>fqZU^VS409v zmbu2B8P|1l;mepsCdIDNGHs1$bQ<{G!~%mW_9sGGRyxh3=$4j{A<5Y~^Nvw}$95^I zF||E|Me$c#Mwl<~^P698c@|^jlApLZg>5hUi`CmMGX+Oya6&_^We|yj`AU14V@+yr zyE?^9F>|C77!)UcHlA98=EaQAQ@3a{&6sr+2XO0?)+o15wuA&{UM)%Rce^<>J4ekT z)uv`r8@e{533ozGq_5r52F}9=A_ltQNkNQ;mut`bhk28tRG_P?1Hpj;Qc=#jLXa0I zFyUniy^AfUr5cKDZ>Iyx!zJKEliRPSmA#Dz*m5568`|P$eV2WysDwb=*K%RHS&ybI zaOUUk2rK1k-$KQXk^oP~F~pfn?}}8rT}f%zdx^;S-+AJrZ1@;#^XX`NNkOO1>h-sJ zm*m-z*x4Ef!*{0@@Ye4Ot}yQDqPb;~34WYy2^E!(R3ZlW)yy0uoB>Um z6)t(3_}`MpcVU2M;6hIOAnOxJOjzZX_8;Sq?0uS7p-K@4lFt(<(BdvLKQu~@y|j&a z%gq#|Y_gQ{GGzNsq7kD!D&<1d#=JZ#)JR-C$34l}-l(gqSvZn-%+M$ZC;sy{Os1f>>}g#Lm?F89_djyB7k3~Y?^}NDiL5s1RrNfNu6$OK zK@GgpIFZX(s=o^hYC1DQMG1aS@*X}{XT9E?WRN%vXN{q{@=p6ErD*`xw`(&^blDiW zUci_^^IvypHCvbQlB&m->47}^j!yT9Ad`LRRrae!l+JDL;?1BKDO4R3Nk(eX_ZDk~ z;ip=)W`8{L|CfT5-Am)J50tJn4)<-sU+d{o1CtX@c7=pE*}@1eu8dXFHvs$UGUod$ zC~diExLMFP9t8ykgW5_^S0^IsLy0`ysGt%>P#Y!JXh^EJE4S7R4SFXI!aYpE-zy>H z{xN(0R`Ss+Oyz6J0FRE!Eme|LjjS@4-d4LjOPw!o@Co+2N|T88nNZHPw^Rx7%Pp^h z24gW*Z^=545zdjIE`0n7$$Q|^+UDh!M0NW@9(70!A`f-*-*AeHi!+77%Bx?GKNR%9 zi{kwH>_f-<$4X3;YOXsAD(9yN8egyDc-SCx@T{!O@p}w4S@oOK(J!75L9OZH3V0h6 z#bF}iZm+zaF=@B=gRvGeW;_$JxcuK3{J;PbHsN$uqh?#_1<`n#(B#edYgzV68CV_IXOXvjIOe%y|E!TzS_&u}2lzGX_T@9$|+5KPLJz=2abu};0s2;upvMxVVKH5E~tc0PZ3 z=R}N970SUoAnS(DSJ>)WzAG}Qs;cTqeD5t%I8<^MPChnkKG%kMO1Cs!UD8)}p1Sys zd0!T2a-)gbO8z$D{*L|=GZV-1{GZs#5YUHF%HC0bEmc62XD-8a=lNtjdd!46=89U+ ziDd6nCp{l=DMpSpM)5}Lju1|)y>Yd-x^+AzrCU>9gYi+ib;VrbLs9PZejv!|iyUDN zRf0nLM?Sv87LRBk6ZL!MwztHFfkXPHnpQ*JnJC^ORw zsph;^C#9gU&hdA#Sbmrnlt@pF8Oj=;z#SGAXYp3Yvs!A4XGrn6%Lie}M^q^V3W%wE ze9+y<`$l#5yAe&1oR=1nSb zeYNOyJ`U2N6d`HhIL%-99Dd#JHa2o{wr^Z*)Ga4L|52?eFc8ghH0M2+gPEZR-x3`0SftY@tHYrxUBDA`So{7(3J(riQD%X_ zkoS@|DdOAP=kg}NVW(yl27FFMM_ZG(&%4{Izt5Y}GfRuc^Y2!xjMdwc7!&OgUujM< z?@i0N3F$KJV$j+U3Z- zSHl@BRJ-@ab6H%+XlG5xC!K zU#Jw-i3WDrGoH#$SLkQ+lQZi#yL5XTmA=#mUh%c_^f?W9l6;@(IFltGn0Y+jM0WUU z8%af4<8?7aEiNpOYPY$y4P1M*Qwd@~+dAt4_k@RPLZMRqGhDf}pdp8hqA+%P8#411 zJvx!#JR1Vyo+JvCY|q5#SEi3ze1c_$JvK2>d)v%(DcCZ z=pU<&$@Y8i%9YdSIBe zg%~)q>hol}68fp`uA7o@nyXbED_b-2uS{rwic|-@=~+@VK`;M3 zRP+NVAIHPlj{?tL3xLr)h3_;>E^9gq)k~s!M6Y%VD*M9FlViw)GWI1|20vvE=MYD^ zP~Md&2S=DN`=XKWXWXqOC!2I(KLPf8o6h8tWXWHmy_>!@3g5NmLV{7YiZo-%H=&zE zrL=2ya{NrLS%$$^(fa-`x5YXfj*i>Zh9+;Xa9nn;-VZZQpppGr+)u$J_xEOIXrw}( z(qF2V01-NT!-*g<`b4@R-rZiJ!kq?`NF;?n!`{H;i(Y|y)JXXg~;IDA)T>?%}k-O!|70!nvr ze{FxboHlr+*`oiHxEel$AJmwF9rU}HO}|BdoK%FVy5k~2DT^PQCdhtv>pJ)7)913z zU6DD?Dle#yL}XKaQL0(7Cp3BY;=}W%Ktv9IhkgXeHEQ8vC(35g%Or>}k!3{l7uS)- z#Hk({N+xdh_Q|KrX2_((i^=AF?R5EPW|R=yEEDQezj1lOHvP~ufd#8Aq&7BtqNfnWa5_?-0{=i3e+C)(qISWr$CsvGAYIC83zX` zMQHFKZPVOXt28Wgfm1w9gVh|H$6L_b(30JYUa^61qw~qM)@JS6H!XTlPEz$QTU@~t z=7^o|o#HWytRd?e{8N<0G1-H188J$gJdLnJmttKy_j}NoKnJnkc_Ai5Azem?RHd8$^R@*;@B2c$QnTJe4hH^GkGz09Z2Y1hVhvXOIeqX z&hwxfmoyVd4z-y)xsHI6R^5#;PMKlfP~7`VvC^RddJrgGY8C4n2H zA{um(mg3bJ7Y+_FFt`&rSu@;DD z3#Xe+9bLp9tis!VwfxSdwMd*nr!maxHf`UWImRou#>8ibFI~*ti#EA`utNFI_#MYKV3d zCre?-A5lLLZ_Voi-qm!bu*ch=#KX+=l0k^&b1p$Y=7lIKWA=lFcvF8nW ztxneh;q#6*aetT#6nNx>@_oSA-?IfaozP6`vjU6~m4Z>~r3;~_fFOj-sPuq{xVBvWMr(foS}PI5__Zd@rTf00T9uN!}nHmzIjHM_cW=# z^&_i=(jbw^eYz&Mwg3IqaI96bM?qa#F&W^FH8gPm6pz_e%8cSRw39lmj-&hH_#|#UJCy8Gs z&MBl=@1O1t7}e=w_~MrcD+`N_SFVVhY!pEgNi9x$!z6D{eDyi;?P+Laq&M!bk zM_-0^G!5uupDzug)_NF1e*`?dS;v!>%<|Pag{t@$a2HJI&5TypU#)6^_=~eKe_X|j z`xz{>STzej%+A!=AAEn9x;q;z4iDH>qOopxSf%FLoTOZp47K1g!IPaGgG z60aDB62?|sGx}i=x9N3#IrwP#4jz#|*tLqRxc>8sMxWKciY$6q-0HtvZ|eb2 zNJ_Z7^sr*ZUn5zz`hR0mL;(sBAc9FtoLonMv*2wmi1s8Iv%d=@6aaq6!ufGan%Irq zQFL=>o0ulrfpt+93ND#eI}v)3i~!+HPgYQNJnw88hx5ig!i#fA2Czby@KRJ9hJCMv3%RFd;A5jv*OuljsxG!F{=4!rI<-S=tp%1kWL z^aYOFc)Js$qddLLq1=41KDPuEOjPceA$#EXmqN#sodpLKRiW?B7>@OL!Cyei@_eiL za-Q!I^Fn=YQ^Kk7`;jonQ)ovthX+`N3c2B{Ij2-r9udU-56p91bd`97=>`<*@A-9q z3=kq;2qFp}6`OZXm`}uGc4g5U5{B{Ve$*>gA~vsqQpY800l0$z{8`c~Zwx3C3f#Be zlgj>Upv{kOu^>QLpyI14KC-WyM>#%U8T;6X@&DD2{yC(Ei~Hc_W(|?k#uX7z5f2b8 zyi1r2{iI_u(HRu_b2~0|kz`t3*ko$fTv{5~P2w9Kzo&Malb&oz>QPi&45{53+&Pag z;FuSIe{j!mwwMDx298c*K4!VvED>hEGwn*c(@bHgpBR$k1Ky#2U`rVEdny&a-wNAq zTYIT;KHew%9SYxfP9EB6;P=wF?A#~9!1TGQ{ZYHcErgJzHUK9&JTITzpwj z!7ZvtU{V0V85==ElFNE22n9SF%gZ-Fu|aYB zKWd>Wp53+N=dqH--th6wQbp5Xsw!+G@faGEu&MOYEdlp?fmhSnL+wA0RQUCuMnz4_rKUv=3shrjA@8ve7aYblnh~znZ7*~fO9&& z^y$O|pZswTJ6){DRQ07Y-Mwa<|m;AoSl%;U<_Getk?q{IWZrRU0gaq@uTdT-S1byEwW#~l1NOr#(c=muPVZKNdYfU z#9Y}+Tx>iPA=BpTpJQpN(Mk9e0l_2Gq39`1l{zF;nm(s3S9!-G4w3rf?+dj^lkN;D z%|>UmLJPBnhMWCLbiKr{feKBykIvsE#~0 zj^H9!o9N?ok1}rtP-otAcAY+P5|y7Kzd%GAyG-^9YjgR)9<27-8>9TC&YHC4U@c zhIVT;U<@&ehX-Z^qC^E&)9dx?+xE=F@G=zmGw-@DTlN?{VJHdXoHuQgf6RxjddZy* z&}O)1pFQBmE|Al(&#zKp2O5DNZ;p0Cy4o2edL+W_9b3?dgoonZm0sn&h7LRfDFS@) ze!hzeO+;`cEEtu}|1^M2ei*=5ODVzOhgCzHx6LT+tJQ3ox$N^)$%O(gAs1;a&?D;R z{6w|R6BX09j}@zGUK(Z}+Y87gozd z=#j}|1LLHRi(`$11kHvu5L{A{>!Z9o`l?H(oKA@eU5d`-ywBkz7F|)HJnl|&5HK*} z{A~~E*+OIGtJ-P7o%~d*X|d44+l^O5w&xD5jQ3_*ah?#_-H9ws!e;=U?VxaMKvjZM z_||u@3Voykv^CPaH_ncY-3psXc6x-;<=o?%0KwU^8D*2-Xrq|BWZaHv>8TEr+@VHU z_${Obs{=^Xq7Ie!=Y5zvUU$p1Tl5ognYQiYzwl|C9Q7B$A0uA2burKiorDv}4dG*N zuZGsLVrQGV1c~-&$kY+xIRq2yztphYrc)f!Yl+U`_?9a2V(>`dZ3!wQ{E^t_&h>n> z)N1!`q!d=p;+J>?XrnHTamjmbFG?LRU<_i@&20|j?zK@0=478?T+~VK)XH+U$G({O zl$Akcf7TSSuKV(3_ZPSAI!@z4DM_Sjf!=+q1u>k#Z~_!Gmdv#ls2M>wxgE4N?J@Br zex1*)TJ^@z`UQ6hDqJR@evgHMilfvCPk;PIotV7W=Wty9jJZH%3#rc-D4mKkHLr2j z*#T~@Y^2)L7yzWLz^7K1qwfQ|8`QGfM=e*T`1wp+ zhq`D(p3ZCvC1ubTNjJh>?g(k`xr8*iK)O3P(wSvc{(_8xHdmZMy1f{*9SIm2X8R#(pZ@%V~; zn-we9_wI>)`>&3jMACRl@rtXyqwmzTzsb;XmbE;bVYU~_?aF~uT6$aicxS@0LITm8 zdzB202@nWOe*nA0d7)G#gISQRsO)Ze{p1Hsu4xl`vpd4wgvmD5o2*xwK6UD~OXv9A zR6D-e@Ih>v*Fup4$ZBjS5rgB!ozO21=3>PtALg%?ot9Wy9?O}P$gAGzHkT_GS&8PL z9&HO&gGE21m1kh1z{85Z#HoJTWk1}?c1OPLkxVt<7b%%ZrkoKr<1{Uf{h zyp9oZu%r`7X%V0S*7zoaztd0MgnrwaxNxDor5?C^|0YQ-iXGeGbqA^2Vcy=ETTL1} z(oFwurt1)mhSWnREUZzt@$$WY_|N5^)Z7fKXY=k!&dd1%%uJOfJV7!+@2^nGN*gYu z=kVjv_7zA>II}sQoo}oaeFrn(+=^j{T`#IPN`ZYsT7op$mBo#S3R%^@$@@l7e!1>1 zcjkldN;F?)+#2T;C(xol?vTCXA!WOWlJq$k!eusU!2mZ9RQeH&+|6KNP-jx6+U@b- zHt5NZM(k+;w7yVTFVKMrUu7WjNaFFfcIIxzja>wkK+#goFX3R)-WxLjbiJ+EO_;S@ zot{ag^Ftv%PAs{B%qu)=axn+VChJwID*|8Us}F4P;L4-%Rj1cfv&*3Zu{dn%(7sG{ zH%kPNBc+OM=>L5MdJCRzNabI)eqJ~M%M zX9Z7}GpY-K#nchro-Qwy8<}{Hh>CdqiWK5?y!;kBw}SDhx&Q&$yI(i215W4C=I{|R zKp4nb7zRc1HaDZ$D{t6kI{8ibJN%zn1R6PY?U!B#DHE>R?m-^E@e3j zey;Pk;Sc`4k*6W8`m-#svD|*f>VM`GX9+GK!`_xd3VN8P7glq23DEKVMmvkPXW!J9 z)NwL&2m@jlW7zGDF%1^|W&|yqs;@#i7rGQ9>iF0g-}XNO~5B7l~5qw$I5)*J+#z6YK*Al2e zNR{oJvg+fBib9d}QQf?U>)>a!38SFv$jHdYooPm0XQikIp9kXH<9IYX~|Y(6S4^MMZ(Hj8FJ~ybqQ&9w6RhfglLEc4M1Z zI{&ukPdHlW$b`-tkUYy{LOH%&+Yp+OTDqc5x~~%6+b!8riIE9->S{NCr}XinW+HX& zJdvo|PTLg**Hk1svt1mNaBY=GIPTdr4@VKrpg-j0E4;^&34LV6iN4I+qn@H71H%II zg+g2aM30JxMg;{0w4{aM^J!nX`Q%BzZ3-9Y-)=(^&9bS|sc@_mfQWKYX(PIO@}9)P z?loG}InRBGb@mGi59CxGpVEaP{82Ox5uR!|;w{S9iMwN&eF7#(1-X^ql?B{|q!En9 z1&--1M5}gaRBQCdpSoVR3=pdW;E>W9b4=K(xc^43-teL(kZeb){vMQo@M_Q?)w!>P2g>QMaTS<3GdUHOgoWljL zh{I~MZjo$aiIXkoZUmM)^;&GQiMB|#;T-6T7R@mJv*XNVb8(9)ujlMJJY@HyQxA4? zdM_cv5lHU2Pd|Sa#dRbNxJ6Q8gn~BreT{dc=_W)1M#0WO(QtD`K2NuO#oyqpnLZ5n z+I<+&yIT${jZZ9O{i|_m`J2xWtelYjyNW}Sp898YKs1be#m4*(X&IT!kI`1@EVqO- zFZS%NhqH|JDGn!_8S`jYIZyQkvauO1{>r{BC7Y|E;+jqL8{F#((y*@NqTZ>$^)l~8 zH%NCoV_)9PR)w#GivjQTNch8dauTkxwoLkmKVSBz)|+xoo|bH&Gm?jkysm$V{^eo+cpNuP|Buv=DM}Um z3rJk<_eoU4UFyn{Zj&Ymhb=vxgPAYCJ zT$Q4GYyR+$mFYx|2v8*z74&UTxk%0ssHQ~#X9U=f44q`f>%D?KNSeeLF2Kg}kLI8p z(-A*ENoNSpPaQ~R#@>7uqmbXsfy0uP-B|SwRt~$PmZoEZuqSob04(RI$W8LUGGMe3 zQ%+*Li#@tR90fd_{X(Fl=w~f9`A;LMzRcOJw+TLN%_CA`USEChyD_6urJ6#p({g+t zwLDH5H4A-8P92elv!S5tP-b;UFfZnv_36SHUb{`$`FBQPl9!vawC6o2I4apE% zh^FyC6f6NL&T>8rmA6A;gevGJkkLU4ZPW_I6fn=daW(p2UfGPRnD#qGb z#~vGzh$mhWb7fTB&t>#KuMqQ;oOm1f5ImSmfsme=_$6tHHA;ryW~%9#Y5axxDHA;DlIfbe;&VFg1eAti({YwUJ)X>1V)el;1$@tga zGC24myQUH_Lk{9o#P|`{7BV65dvLfSVpCGM_=GtT9$zu=nQ3HI&j+7ujMDKq%mbcf zXi+*0YxQz=CNpV6rfCdpWbhi2t^ShG&fM1)guotHxTEmoTn_&k6O?<-KTm+w^o-B1 zxs}94sJ(_6s6!amNyw1{Z*tH6k0w@eAApJhn4UO(IxZ0#tErds&n;QRz3(XD1t!rv z#rOmwN$k;Vm&%^h6SC}=Lt~S^2ae;rkYgSg;2|9>_9Y%Q6U@#pmehwb*+n!Y1I3g| zf9w}|!aqR&(HW^nz;|^h!w}`b8GSj@Hd&yXX&Oh^=ypc#anYZ;{imywJ@$3;9n^t< zcCgl!8!vLU*r*7td+c3LCk0$4vtKRYi2TgVnwBvz-%=;CP~cV>jAz^IHzXg(`IF-KPuGx1V=#Dc`sn=udh?P@sz^0m&0^mcd-Wt^J4?$Sn3h(1C|*@ZoEI8)*dZqJ#R>^75)W<|qua(ZK6bX+jT3DgsV zc$IG?<#3odE&eLt`&?+aJ+xxYi;>m^ex}?gqGP-g zz{>4(4hJEKc`D^s|IYghE$qTvoUJn`{NpP%4)rXu4g8&6WnH_zLGeM3wGmww?CkM7=}s#ln)*Yms=EK$WIa2W+Lbzz3;M8o6<*xQHm3&-4OA_FhJ~O+dkV8lZEo!KbkR`J z&iQQd&${jcc~ETPRqT^&f>ev2eP%fJ9`i`C$k=B857VCfet_6R;Ow92xEaR)^flHt ze<|Td$D2Qz3Vv}pr1|dQctJ{sO~CqB>cAvQjn9{&PD{7LmkSq_|M35xd4bpM|1tr4 z{YRD=^Z%Izfbs6VhA_40gX+V(04X;3l@|I0tO%5i{L1dQ1T+E&LGLK6XO&K!f@7*3 z-WoshZ_4&dC0a(J&AFx!=}%1k9=|pM!jF)f8gwQSy#=2gmZqF7dUy#s0f=lFa z>4*5&fe7yrB(3s<-5(eB6l=HA0@NI@u^32zeNwt!7eO#dCV3)Qt~QHx_%HK6m>$^$-qs^})LBY{7Q7UFw`+_*quS%4;k<$B@skP9flp+&<9{ z34jZ;KW(@uoGCX&-TD-}n(Zpyt+0tBqU~}vV4;rDGkO~^LFX_>PJLaJ3Q-0yeeC%BqAyv&eZKvfWYBi(EDLByU+)EgdL`JxhY!W*9}_w#U?u?Klc z-up0e2;@ztE6JY%qN9ayA~zr4$C|3EN^Iha#7$q(EmJEz^|yPVIJC z<35jcCXZBiD%*DKn5FYLP;o@{JN?RnF&t!ZF{TlnI?oL4vpvxx)$)q4Uh9A5X>=BCV`g175fyDq%uLJZn}^gU5=JHV zfxl<()@0xG2H76gprH>AKR?}jiQN%ckFdwViO#GbPHdQ!6=bPHt4}M;>&z^&80%N- z53^A$0?55R8I4DIYufBkdgLRGl;H1zc!4KLDm@#KAg2h>9fW4Ig#`P-W-}NC2m;Fb z@~Y;2?Gc4r)tEy$RwwY3$ zO`3KU&Ynm_)$G}4zg4g5z=_7r2#^^lhxqL(St{;Mzho5f zMu3PwFU{Ly5A(C1&lBlsJRd*0NPBPU)2_u`+*iF#m^-0~I@>Eqs+iA5s#Gf>Whv?A z1_lO3=cL0+bo#MaW?rRB8^-7zX3AS{KK_t^TAx}6&PsvU|!^!=|pFlDPf+}}3) zsZt!vk>BVZV_npCt@8yyZpR}H!LOJbN+D}Aole^TD5EC_2ggjKVK}uppIV<5aW6H$ zo{=rIy#cbyn|QI~OEdR6O+|)Eoy`4WUZ!)gJ#4v7KXGiOD*K7O-m5( zs7rXC8gW?0LJi1@F0$KYe=BwJK4VCf0od&yneULJWCrF)$1m025J zTl3W6t=6-ROyk;On#ZJpG@&z(ogLX`(ar^R|7ivp7$=I;*Y2)tHc4v8Y%= znz%x&IQs8F_YDN(fnO?J!$A~&*A%!5;j1HQ%5)_PZC}Rn07vv>xH#hT5g%!y<&ZZC z1KSXWn3kGs69>utBzb@7xbQMfHxOwK%`zqyq2d{gj<~8FG~s)s0&u2p$)1X&!cqVv zCrKoB8MLvYmx{P`nJ#J(G8-%Zzz`t>`bl=Xz6eHYm|GnTJUsKrze|$}+@#+RGkg_5 z>-o@;OnbT-`zT2{uyc_csBkqt^40$m69^bKlGKQ16=!f`d>>+;ld4_Z7)})ZZ@1MaIoD%RfJmz=Pki#e z&)HCf`gEHY{ln`@v;2<_V>?Fz05GdI6D8KNo`4TkxRLSp(3J7zYFO^@V)Rmx@zY<& zK~}yrIW_B!>`WnvD9^i~*t`Z&xN5BzliqpN^X)lhUh73FgZxo$bG5OrMJkbZHK1Bf zP5@_P3L`FCP%3NOT1>V-mP>uaZ3A578Gr%I=xnb4K3{&m)pHjQ*%gUcg7m4)8liV) zLd#-+_R4|m=VdXL)r3ZpkoW#Kch~Q#)TWe6THzn5NWdlAv(5||FNLO8Ur8sTU3X3y zzq9>&9{%4W=dt2?xVfasA-E3!0ReAeWpz)Y^4g-8*CRfh(Hm|IO>JEsl;lEm&e~%gueLANgsBn@=MP z7V2DCk>xlPI&gq@JZQcbJDMib!55BqD{dqm-Q(F2;rTV7}K*BxbFg| zG+wVZ!X}~j9iA}C0SO(beiXGqOD)f;`x}`i*CX89zEan9!4wd5!z+lrI>^Aro|gkN z)WDw0xgzaxxZFZ*vR<2jQKILxJDNPV`kcw4b>8?7b!0-9ui>&k`R)ZJfvh|3#P?)} zV0-b%E+O~rnR4F(vHLggq;#?eId*u4olD3(mf?3#H*;?eW!_z=snn1M=xNHyJ}x(=bF@xX7&#hCe0T-+97qe z(c*p*zcHq+ zD$UU}CTiIjo_O*19PCQj78EGDH2Co<0~do2oi0mXJod8Pb`k}CY`4uBu+Efx3gGmi z_~rM|i>w?qbiJ8r2f3f>8};Nge&mT-o2+jgXi`{`3saNu+9m3kuOL5r%HheSMm1eOqq2`k|4Qbr8J{Ggi9ncran!3~(pn*k zi1Ai_KA}^UmEFYMdwN7CF-4cdGYC5Wjrq6`p%WJb9~|uL~8Uv*o8V=RxvNEI3{x^QOSjfY5|>s7tDXRef8@E%%>h)qxv*HG6j}^>%mKRiu+z6-wA2ZZiv=bDcoG&nrJu z{B4c5#~bnaP@q4ZV=8hRVc;V&IC?kp6&FgUz~ shVF)FJ5H>RSgVd-_UhAMmqx z>|*6Q##hf8)}pFp*Xo!ce-Fc?;PPs4TYHmxUyCtV5N)&6#My*3D6zQg$09#~P61!i zJX2)w_B!CeG#J@GEaOsaLz5OCY;)Ibds?AP-o`dZa8ZUlUf4qCG%;FgmMlVl8(^F; zC$M|+XuYJ9E!sLZB2WdUZ?>=${m;@C5D5)IR+lN&u&-h>*vHo>DfxGhOaNk-xGA_K zsgY!7Rw!5Q^)yHgo)UXAI_Q2|ncqBIUgh+DAovGndnuuWQ%lYj*{C<|ftFgrJEPAZ zbAnT|zJy=Se(`iZqFZTo{uYYp(f2$Ko9=OHuqFa{#i*3X zS$q_$7}zf5T1W6Lry0y9*QKgJe%TPJkSu}jp!a`Qyj(}>Oqos2I$wZg3i*m*7$-Zs zB-N?3s%foc(&a&6F-D^Ba(7kP;{4yuga=%X7KtL4QWAo_btD3HYQI+=3%N^& zqMu@7I#r?>9)Te=T1}3X*q66wOX@&Lm=&U&z3&OXcTG(9AQ9>iVBA6zZL$v3ZG)2H z8T;?Fxc??cZJ;^f#_dKeL+9CCqP8TE&GZgJO%z~;YX6ajlGS?5|B!w+m z`psTXEPT<&V`lllDNfT>8eR@bB-24>_m8J_oS_=hQeK&ICO_ku3s9^jW`BOJn3K?E z2gsqNh<12MnqR&xv|;>atNP{j`4=7|><5iVqaHTbW1~;AX}=-G){zUJE^X>M%=i|@ zQoz@%N@sLHW4_zfHU@>}d^ub!EWC&DmOj95D!=l9_Ed`3rO`~jy=0GnoD|QIHWRl3 z-bL~q@4`Xy@{kO8+o?@jE~_c7hx=#(30T4snk-DQSLq<1w!kDXydw*H*X4WIpB+0r zNF{mEE)qO~rJX^an&G4Vmt2=M1 zl+yVnfUy{w_#YDR>gp%HW1Txqbiph+NTmyV-~@&}_0o|sL{F{GFj@lSy&1b+Zj4n@ z(g9)}KILd3!%4BRv72cL39yZs)G8L?NHxgTKz|2u|E|U6vZ$M0RQ4gHvkvCwHILZk zh@U&6K93el7O5qNz0VJ*JBgU)Lk8q;ZAzKEpS1h-z~A(5va#p6-uuz_P$RwPxV7fP4sWpgjx?QmT%uBs6poZTz3+vk%{>?t-Gm{`s$f64B z{Z8qsDMBJQQ_c$x z@|p(6vycszzim7bD=gAk`pd8wB40_+^H42rsy*J(C_;N2CHrq^?J3@lJ-Ke)f2@?qF~_aO9chh+mF}8u{-xQ7rLH$sSg1h$4meeQg4~ ztYls#y|>M^mZRP_MWV(47!3Kr-pN2Qs?E@q?%K?>=P(|p0W3ntq4yF$h_FIV=D3_N zfJyl>JzQ5~1YIJ|tms{bmy0p<1&i?mi#FATYVGA!STSU_thu}nb&uF*vV?O&9^U8b zgb2{-lFV5kTTr@f^xTGk^`r$f^g&Z$){L;{?9Pa_f_B70R=CxLrCsthX1IlPUnlXehbm zi~OiX+R~mxJxo(CR+@6@h6B5u=JI#_HglM8Y3zO4wy#3Fh&b925SAsnt25qXqc!9# z{>FiGo8S$S`Sdq8JDd9H_GD&0;!8L+;e1zDg6@O&UWU7+ux@41U+y1-&_|J?7p?V^ zOB3-t{(ai-v3L81`nByO!7Az_Jxf*^N0WHzz>tTyB=excC%mR9tlaOgTIwYd-GFac z_ZNU~;UJ9Lk9>W_gz#vvi0^{@CDsR{#M8kgE7%F;k)Q}i>;d8DT&IvB`Hzu|uY0=q zx$90&xq?*#__?LR&McJLut8GWxu9qK^eRMZYLL^%7$|#3EW&8$yFH{@x=zzOl~Q4n z%4@S2DKo-!UB5pi29B7%W~d;T1mU9OV! zq~GS6eZ1VcKqXpaHe7x7R`v`V(=`$y%EL=bRe;4E(eXTdlsf)S>(G;0G@6uC7oA%% zwR%!X%FFdEnQVzSA`E2ZaUE}Y*j?C{2u@F+MIQ#W{rv87sgYpT2nnj6=ulDzPm!UT#D{Jh86*t{ky(Ur^U>W1In0)mF}8$aP! z0(&LMkqbo8El1A>>wNZX(?#rR!4x8F*?HeSdd}Kg5+KVuZiRZj4*xkaeM!mgZjBN4 zUdzs~j0DyVCoMa9II?hRp*PxS_k6Ps2PFqgWf@~}Aph5|+5 z<2-*Qudm%^+tGggD0JC7^9FX4pdFnP;NBhi*#bU4bXb5G7ekd|N45{7WNZ^TLJ|W z{U~TMF}nigqE!0kRW=u5BWL2e=5xm!5h&5p5N5#oGqvgd3fXfU;UdDO)S?~rg_Ne1 zHUKZh-^A=6mVIk5wl6oi;1Kuq)uyp4F;N{$xPzppQFbSy>*X_C%mUlyq1;C8O&ok& z&%p6p#fm!Q(cTL{Fq>*Z6Jngulf7S%ea=inm!oEs?Q&d1Nb%RIxdN1{ukd#tK}`V= z=;h&Kq)|!BELB&6!BWL_^e_Q#!^OchI@WB^g$89VDYg?i`@-H=>DTMeVH*w5B$Cq8 zkii)BPaUeqsK%k6Qw%b{uxU(x%NM2FKEj#Snj`Vj|ALoTL1u@WyE~rEjJbTrZMjQ8 z(*lmGrfHBM_Oj#Paa=1KpEWI&Z)}u=cY`6P-b{V5X%QC)3k&Pq8TVUS zH(ZJ*98~RJ^DwSsH*_DNuCZfFF>pG>No^`TTTp5?$Hstl)eHkhjTuqg`u*!^_jxy~ zg5e@!FMe`>CY?s#X0=_b^Kn;)hRQm`#l8VYNkH~1-&5xN$x0hR@EE}kOM;Sejx%>S zvf(s24c-UYy?7DecZGxKBjXe7T#n%YYM(MFXP6{+uQhYMp!Rd?M8OBx#qrdbo*E`f z5{5}sIBfYVY-00}>GmoOOdxvaEfHBZN({cu^0;I{A8X# zTn}haOSc^Pn|-)fa#=`^%x?(y7+5;1mpsc9I4^J?d?!nu6WxFjXxrq zC-O0!_3i_H*^I57j6Q3wYaWvrEv0Y35fTLCosz&Z=0osuprk<}Xpej=66E|ggI?VjHHZ>gd{`dM{n)vt!W{S`+I*n^nMyLt2uw%iH||!25Cm2kwsXU zsQz@AF{lk?tz8A=u5UwA->}~V7kRh3h6&Zc%D0(k##bR=;OA=DG23EBbuKra#oh@$ zNhSN^s!F14_r@(8#X>pIhP4!GY@QLcnjMnjTN`XwK}^eas^*@AkEsIXdadN9M~?Gy z9HV@LqEE#m!LS+F3$+5c5UuIk z(@-i$MR+!QnvtwVd2y}|ADQ!Cx}IM~c=0`BvU$p%=jLL7*y{J?-Nd&4=g9j%1|og1 zuso2?r&=D^S+tL@)nQRiQ|kZ+Ht%jyCKuEaM?*-}ud8k85i)w0Q)5W9MqQhG+Wkk; zb;0&vbi-CsAv2y1r+er3g^38pr9T;5FX7Vwk0!#`Da3em$hZ;wIlVM2a$V6i2dv9l zN0k8kd3x7K%7-P_3Ce1`S;>7*cYuX^x6iNKEg3pOT7=QgzU7_fFk(vZnFkHr+2ZFE zmp9DVdcMq*Kx3Z!*d?Znjrl8@jO|s?bHnEVc(*djOW3auK%m~hYbS|#BQph|gr9e6 zl{NwkHJH-fn^Z_%rv)X5VzO8{F8*jD0oY(gRhu^##jh|}gil7Tokb1z6M~OwYtQ?# z_hT%+Z@Oo&4rFxw?FGXW8S5_CVNyC^ZV{h}qjK?_kw8pyt>3q}+!%dqVSJW^g9 zFb23|l12uUd*yjO9hk8>EMPUizC8A=uN$1~*FDy*)u24f9W!84ERZ#<7ng0FoSkfq zQwpbtV-e?kUZ)vU{xXcr2^JD*-O(P7X!UfKa6-8Ueo z`%T$PJ131MW%%U%izgG(5mEoqCZ)B8^FO0W75eW z#UfbZ*X7wkn5<##t0nZEqRHzp7h+JW|De(q$gdvmWG8@?<3@G89t)Kq8>53iq!s%X z5!As5&EEH=8e%?h3cm%%D6&&StI4F&ot&MMcFFaWqVjp;Pu-ii)vZbrwv7UuxK-TC10Z&GPPh$HY}y}&I`nkv58y(h6Lmz&K+SA0(rgnZ@`9Curi_L= zxY0%xtb2bE58?XEBvB@)cxkApRB>Ev7OF(_J&yzk(A$b$M6qe5mCBaCz6D)?QQWTA zS7EVX=eKT8=q0?mgG#U4T(>)#xMm11!052iy6n8%E>v;bY)~V1;iV0}iH3zE`T>$0 zxO?(?dz(m7QktLbo{%fCbT8>Vu)oiv-WeGkHPAMma!dYg zns%Hs*IbnwiU9vuFs=y27CzF~@ro#ej05XH;CJ($uAv4&E+4JhE=opts{@W2JH zJSBz+1~HQy)+l@#s7gh-*1Qzsawf-@8iyuw-kWw_qC_+ z<>!YH1DQgFtneXa3<0yhbr0k{Ye+x@mh;}spcPL`9^5C6qXY(GJEzo(n2?FXwfS$R*+52jvmbQ3 z9ATcpNO#Wlcs*}GQTQ#LOzoL?A59o-Cd=Abn_4k=oAP_sud5=`NOg`DXaDZ0qD`?_ z_u{0lM5v)B8svi1*)qv5pZ;PTe?XBGGc1;6OTYmuj(oLNGI^hrS_Bo}qFAmn+QPdx zp3~*YT=^!vu0LqSi-b_+QR8-i;@mdpziBz#%gTnf_m{k{`-(?lqPt6^hdnE|_)|Jf zVZMyjiV;>WhOBLD(*va}UR1x6owB>7uW2GcRFMLQ)244pkm2fuGGi;2xHI8K!*ADU z4NBuWJ*BFy4;5(h8wn5h8FOW{)a2SAY&J7W_ywL3jjpxEeIKne17GbrNR%N7QaVBg zVqOkd+>WXL{=fY{#@oNefj{I*&hQrLP;njRz#L36LHcE3(_au(uE8&Gai2>)=dll zO(2&U1arQhs<~KWjdmtDKpR|r7|r&-`9j+H>ZH>mXUgsbLWVk z|N9@t(y_9gR=)yWr2Aau8yvR=cfIRCZn-oP$|;;fZ`eC3(|xRug8ukozXncML4pF9 z5LLKXY#O-M7a1=~ipcF8mJX=scOQO@->a@b-`rb~UgmM;FWbzr=3xy^5R)6pRb$BX z^})nY^y;H z#>+1;WJ1iWmlZ|5|Lc&1ri+^{ja{ER#zI?sG(oX+R+H z0pvg%5+*bl+n|dtqUwDCFCy7~m_5kitTe89WK6Ixy*!J4*apa_%o z^BA6ZH(_;j(t*d4IS0IO#YR09uVF8fXebo%DHp8BC3syOw;dOs{`L3+rBNKHNG#Qt z0IA`0g;f)7=U_T7CR&;-!yRyXw+Zdz5`Kn+%X_5@cs4wFEm5(d41W=7f94|Kw17|4 zOE1R!N=wzUk{)wY=dG*AWwQbgnfAKhe|80uWdR3T>`g!19w3%}RyQ_r=)V&JE?@(M zANKP))gU;?2pPg&9$V$EcB_v-ok&1HX=#LhbmMZBe*x4KCuhm^v;rA+bu-1W+wGW$ zkUl}g>u{kuuVNWw!pla>@t357lZFwr*fkkY5oAzNQ8H=&Z2GwFf^syDuQ!2-4`E+9)Ymp<_Fn9ZZ%-K;1ky)5bKT(seS9U%u(^C=$SR7yKO> zN=H=-+OpmAv6a5~?<{~z7Qa+)grI^SQK6cb&njAt77jb}ULW zx9xtlH&RLVSP*o5%rbr2F5BHBX~Y64zu-95Fm^+NXQdf?wpkNBz$FGv{}#x_=Y#=A zE$~eh_O=V&x<%Qowxo_km$iOdb=6v5zMunvF5G*XkZ3Ny6@!mhCmHUl8jP0?wsEPS zaBxoWov`kH--wW3!A}V)$v87(E%5hmSl z52btti)J|U^Xf2Bg5EWx(SN+q1_^rKj}c2tkHm_Q3j}vd5#a6{ln`i83dZ&J9#tJL zH0uDd7&Ov$qM@SS4roI1cj=EOfHea5mtMg?&A&7Oa%$e-JbOJ^F+>$(4Y>%zobU7?HYx=q#9f^TM+AI&_gT z!4ikRWFpa{+lo4jloXtJ@m*6-ZJrZ?_ckxs3zazPlfgkW{O0pgpm9PZHVo@V5G(7S zq~JpV(3fNX!#OhZCC8OG^*Cvu#R+B;+xKv08fbqj2y72Yfk1n=_2#`&jzGQq?}BU5JK8;6?nI{s4H6l7NJD9JmghzPW z6@B*m&FDWm=gG3`VCk6;$W<;IMrBBf8n3=r)0k}PY*WgJpWu3e+^mCdNukvyngE;I zEe7q^H_t|!WendX3UJ_SfcJ8XGXr(W%?S?u>c%?x&+-mcZ*|eyB`|`eU!J0rFMw6MtK>!hgfh%^*|AW|NJVef#u9g^_l-MgzOP!REl123U;YTm!WGqSo9KZE?B|YoFZ&r-hRjxc13m1T77G3hh{J7ouj zr^xp>H&3DuI*t7d5^PCRs({s}3D6b+A zCbwX=xk;HoyXN&4GF^Mwn-C**abRRV`wP35b_KPND~YoC!=?al3zssO0|%^>BBpm1 ztg)6{6o&79{=xMls{qVnh@0C7?uM?fky1T1v@qwaUEIYPnt`^Cr!T zsYQ+53I+BnPyC6?5#g^1tNy>|X{rg1{?_chg$z;HS6TlagFNAW6oR~AiS2Lf&+Yyn z%YY3Je2KW1@po>%F&TX3dpwt*Lplz8J_>&6IOXal72QS*Vi@OG(2(~b&xJpm92|ZO zb9Ylb+!iZ3lhY^Vx5d9E9vI%`)$P95eQ2B`$00GICx6Obw z7~5Ri*=M9N6tK6AajC#Q*5<%-s`Tyx_=Sht$Uj2c)2sO|?B((>E#t;V?5PBs3%$OK zm=^IOEV~;jW743PG(2Aj8x>?MWNT8HO%Vf*gNc>fuYMR%2)+CSamE+ARs}P9x z#r^7ZFi0xk-JT*Wn`uR$%naoHQ2`0@Jd;rUry zf2|4QTS&v_)i(X2CbAX)zm!He_f`fsQV6Q!3Oly_-`7BMc#BMEZ*mtw&&GYNl>Ynb zSHH5=DlP12;uOCIA8d?PcSQJ?c&XkE-=$LP9TfW1<7G1N#xkxtm|nb}xg^ESzfBy1 zY5jK`Y3aKtl#^EjB=ZNb!{%@;$(#a$Ip=fi3up?7_SISulPj_jB zoN?NSMFO1udRgH02AfqNlW}~;aC6!A6^sDWXuT`}r>kn`E1TlOg86dDayhNjKO~Ps zBYXlvGY#5Bsv8f6Oxw6449l6t!dM-aHBcIEHQ)1ZZ4eh+;{%BXD_cmh+K4?B`s}{b%=QqRX-AP3bieC<+ zlfQVq?8s@gn5R4)-Ng*H->sDf3CF*cR&qlPmlpDc=`Cah8mf$U3V@Oig0nX2J9$qe z83s7vamy&)dJ=jSa^3(XLP3i}pR>JrnPr)~yB+J@_NCxX$7sins~CE(IpSVS4BT;% zicJtkMOUUly+_os5H6KamPbT|vmA$XK-bg`gXvcE>Qtp?nA{r?23&Y1Oeov^v7x=! z+I(MTd8KKB$DbFAyItX{*F7vjNsA1qDR+Qo4W^XtYJ=m4_#DzeOg63RiyQObL%ffF z%!co~ZsG^#)QXuQ)4{1yyjKxJOQQi?A`V6m1NAaq#(v;>Zo7B@xQ`ult}k1xdT&qa zj-QwC?GpsCX&l#Z#enXiH~bA=m{zF2;=XLOO*PN1 za(gLM3xvk1Iqj6pKD1fPjmpl`o-#oB!Q8q!#oaE@b0e)rz$TA&-ua1m1~=rENV7&Q zZN_jbh$;egKiO&A8S>Q@mlp#0?{>Wm397W5<=1Nz864WkpGSkN{j2}Q`kff>gUc^1|Yw@vbwtG&ds3TS(%Es?tM zuZyhh)a=2anRZXt19U{H+H&=J)2=t}^t|Yxf{>}v+G4^(b6m$dT}nX`(d3d7i*sTD zha$eH3=Z?MG{gh68Z=wyS${)*ihc17!C4x?0)GzNIWi#rOfQLCy#`$aB$%Y+#h2uy z{mU3)${rb5Xc$Ds?a`!fxf#DRMcfaq{saSbRQANJYLaN`G@K-!wB8{jOKlBA`oVit zVP_P5O%96mITT)RQg7*YQ#8MJ`2sAXGg4mK=!mHq8K~nV-{=JW{RX>_#W=csp!bcC z_1{T<>DFpJKbX#6f32a6`6)8$5QJO88t?Y^3KEx)7|ITNM)LWLOk`zwK(wUladZ3z z5{?*96(_BLnn-7ORA7wpKGWeRUyq+I{S}AJ4E~$tuT#tj`!(m>q-4mHQ~hJh+lFe9 z4^$p^$259zO=Ihw=wYJFGCqHChM}QB;ScDU!nolnypFpiDsK`73%>0Q&w#gf{2xz~ zNUP4+)7b%1CX>$@r8i%I&2o8c-+qrcIpvGCeu-1oI zNZr*WMD2g-G*(Dq?;^6PW;5#7h_89=dGq2Du?Rg5F_lPd%r7Yta{VY08Odn0lAvtl zoO;`EDM{)s)#7vzzMcs}!I$@KKPQ^1;rkuMgMalc4t} zP^9xnP5g^e03nB6ZV7{()nB`b(nN!eqKnrOQp}6>Q0{6O?4jxM;tuORyE4f<- zYmhWmj8-Aj4>IX-e|fZ6V(7X@qPnx2VWTpeow}eI0lmfuQ@k?>hT@ViOmvF1$vYhg75S&m45@=agZjBpuZy{&RTlh8v zHyeN_#z2XAp2-<={!RLjoiB%HJkn8>ZK=i+9;>y^ zZYI3+9CMzqftHU?;%lI3lg~2(bi4U`i0mEdDyL0XU!S`78L;eYOijpr4#YfOWoBP{ z#X9=ZbZX7h(R^nVzW_-1!sUe#6<;V8Y?aI7d(*{~Cza&15t2%IFE_mJgrjOYu~)&< zFK~$0_Z`IHN`Q>cX0`B_kV^1-|Z=1&I=_eZR5%cxaY^?SZ(Gt{Kr-BF#7lF>Q1 zdm%R>npgAQ=GZeFCYafY88ql|06s4=Tb)5OSrDK81%|1x_LD@DzMZ^7H{Xbcek)D3 z#vD(X9wfmSe9;g8c4cCqkE;5-q`t;v!UweMoKhVoiTw5eToSC-+WnK$;Vk72mK8uv zMwD4|{@Y%o{FlA(fZ$_Io%QGC^s z@?0Ciyeq}5)t4OJ3iU^z4dH_Bi5^H0p5a)8ySE#TQ1pEeLXiyo z-7!^e!jC^3$nluj*w{!YK-6_EEhY;z_#6j|L=(WobQQTWQnUm?RDH+PB=^=^+1FBN zbD$aU&PZ`hMQ|lg9M3|E{!rZC1PHSiPQe&b!u$F@#RDgo70Wh202Qy;8Ar+adrJ z^KI|trzM3wnjurCKi?^~2x~u1@sQ=%;cE>+wu#Y3c@JoB>O4+;E*Id0k{-|6iN=R) zT-1|%3XGLxv_trIQa7tv(Zt>>$NyrTRq^7>N0F&umfubW+0HZeQot8;ro(km=}pcc^8+45{360UK&zWt<3>Xnr~_d zjwoCb?IwoC66AOsQ_Cj?Mo1*&N0cW_yrQcD_m`Jp5UaWtn25fj^=`t6^6j{MyR7yVb!TB68Xtp?|dA$sU zvN>&Qrnz0g6YzhpqmM1}{@~(^kRrLEukXIYnRd6zcv4bnHa53mxP}@S$O+a~OJvk+ zl1gUOLH?4|f%Jl&oLsI=Ke-8m?QHEQ@8K&B-1a?=vH7gvt6N`M&Wfh`o?#8@=6JsZ zw>`b=LDpAPLxRz$0IG0P|CG_b*WeCET1$Bcd?-ROz$^Ah{^%-~agSg#3ff zRUwNKXu1i2h1l;h{`!mUq+kks-0F|QIb#b`%={pC zIpE3baa~lV->!|vbgz#cO*=f;6{z+t$mA6$JWao@qU9hp`^(GqZ~A@jpeWVL@74!RMPiB`s?v@&%XbrrRQ;_qana z1d$Uk4=F%j7YGZ4?Ca}GZE(&$v03{kPUZRPWmuy<8DRO4V#yaNaV=we6HE;s>{z9Q zyRG1SeQ5jQ=y`S+H#It%QM`2YdJ8iZ*Ap{i^k*6NqB_*KJJxl965?tTAaw{*P=oq% zuuGnxfX}Z2CL#`1%iLaXZgccP+t&{{3Xyw#Tw#VXs=xd>z$U~ z8?g7zk4>LgkZVQdMXF?48i51Cup)1mxuK|PNm7k(2DdG-Y5ME{;pfKbSTaEu-n7@E=ZA3w#eheC-0f`bnG$#{l>b*R|iZH4b^ zTlWL-4llEG=PK(3-y~=zAt&X|+>cPRoFWn9aa44t_pKX>7kdK{df|$r9$c6bWqs=` z(~*K|T!;9^bXcqm%0GVC{-lbm?MLh#@wi!QSaF z_sGa8PR3Uy30Cxd>9GY_DdDr(PIegtuRqv5Nu2 z00bQR)68z}VaU$_$39QzD5UmnSTKNXWYZjt$D!>(tYQc@KAyO=kXz2Qof(mKpOS zmjpt4E&tm0$O+|)W-{oL+N9UBQ!(h!h)$Yc7j2g8_ikYrwE-lEG9`vMa+VZT2u8e% zh`)>)<(sHsb_~adMBh z-JcFh6|Po2sZ6^dI}Z2=$9RH37wLQ4jmkaM=&W#MM9jV-cJGz_cT===Df$^{HN;HE zmB*R7)Pj?KD_9cpn65>?y8f7l|6heeL#!fnc#BY|(}BVd+wXs@)SSw!)|(}bx3)M@ zKT8XG$KAB+%wvr`*$hbH;^_yqhUR0xXmyo5Mfsv(eTxMJYMB7L=2gQ<70Cb{L9w0^ zOuTXMk8Z|z;~$8w`BnPyHb1t6V7>(GFnk@nn$AgX^>OJ$*qQR3A~Z#r8xW#}FS%^; zeSH*S+gnca0K22&(OrP)>8yy3UT$1dht16 zyMI_dQzN0f|M3gn87;9%42UPXgZcPpCGRDy0m)v24$Gz9hlJe-fT$g(Ps{l88@r^Fmn{QhK{D zR5Z6en{#=V4h`A_!HVcaTvP9i-c<|7i}evxN8^q(Du3{AMCW{yA<#g~J0EAV&t5Zx zf13(f*mEn7Qb|Qz@5xs>QsJ%w6u;P`p_jqH8q$uYEpn7N@r^gsU>~LUqrm$TpY~tX z8br|L-ok$f7}Ccbs;S>%nC_PoopBj9>3-WjW5VGdmlfs7aFU{=o))Ve3o8gBcA1h~ zvI4e$sHE5Z*ku+uUytr;VYNBdg!Tof)kpdtBTMx*In2`EALaP4C_X=S0#QNY=5HOy zheU|a7(s%ptQ!We4^5*v{5mfem9N7<4WY2x@vni{bKrH=y+=JXbVoVrCUJcdpZ_># zRN4GsLhzb7;8nODZ$bM$jFAYd2k~MN)!&q~bY>=uKk4CAxWSj=cI( zd~$*7pD|5yhfBtlPrxOLjLoh>G|mIB+v!+2JiZuYyfn4DqY2N5Ce-kz+2`-X@)>Rk zBj5474KCM=HE~0GZ21ld$(P%uuU`-cmmnOXJ2 zzi$4otb(;?exNaJa`#Y(5zkL?uCi1pDPHVRJQNo(Z~4f!gSxWg=@)$683>sbvA}ix z&E?;T!Xdvm&wZF7cHgh)w4%v`C=7f!Rg;+wkV8!)GkLIea==7Scv&iBVfA6xnLFYu*R z!yzRt>HQdFF-OdI&Skqu8S{FAyjW+%w6soe5|g;zeSY(i7-{snuba`2rQ@ll?P95P z3eTDc+f`~v@AY91r-)syEyMje<_&o9E>$FoV64Grz4!*`5X3}LhBMs`GfEejoSs%y z5iT40LPPdFKJZ2c%$B(E8z&*yBx%uC3O?^)x=SpS{HjCgySD(&$w`shV*^Sofo*$< zwY{@5ouCFo(T33dpO_Lw-dLo<$+31i+%Q97=eoZOuG{|uyZ z!6K-Y&`gH;erA=%*veL!W;aD!$_rN{7i6uaj7k8#G6fpXIGDaTxjM#e{An1hA^-`r zx_&_r7UH3rN?fROoX`hHh9}IGr^`ATkYOdH%kYIMw%$o}|4FA6v3@q4Iqy1*EacPv za(mp%%qgH+Gie*OZ}npZYoW)er@jaGKlJPW2O)`yG(&m;_P+zY=QW3+KiLZv+5fqu z-1`z()%sl~)aA`osU$a+&qm(4-G>imX7c0xhEse1vA!{S? z%QbaoUk>{W9KPmC1JFzzPVW1V!R9wc_i-unv$KlIW)2VBTig%O_dtn8p*U!FYj|)} zRLS{sVo9{Q5*?f@DoUzd=}$Mx{p=g%=U|aDG#@iN87E<~`3l23ozBs{_0`O`QYpZHvwJYI^{GO&UU-!`>rGPg z9w{j|8^M1!E)ejq%n!^!e>&^0`#rGX4U(`GvGVnah827Fi06L8#l>NhkyQ$QLbyVF zTR(l{PjC3`eS}ghOPVHXyaKh+OIDRvd{GQN<@h)=B(ixO)>0g64qq{rmf6rs`CG^l z?0Zc&1yn4ir)M~hGy^L5>Q06VPubHOAq5K9GBJk5;@ViQsY7243VB9qz!Kf^hEVt7q!X9UccI=0{N*_ z%IKMRK<;4?X6xs}uJ^&$s;GIuuBF)wY2LjQT;zTdHMqF9cpjuG%~ShuLHC?Jsbcq3 z#dUC;lb!M)@Bla*;M8{me9ni)3bcb(ABjm2nwu<(hSvf3iyoO`NClBr1iR&B&Y z?hD~9{}UBm$Rk5Vo_s8EQn&>0ubzF5LA?D2+P5RN$8hknXZa9;|E5A9v-I=Yz`%zK z!Z$58!~-6%0R}w=-sFf{8+% zWk-%#TON|wT*ylA7pan#&qpve>NP7!F2Gk|c?z#|^)wfcON__tVqPWky<_$NT73RQ zh5mz0EEL`%^mg@(8U4p)XxhXo;<-48ha}8r;q-Y93KwgL^%h1x$Hjj}R9T-ywwT#? zt?3!IU&YS(Vd#NiAw}j5?Z8gJ2*l<1ajtZK2c#T4{}j$wU}@+SU;OZnf~5@_?iFGc zU=7PZI0-G1?WK(^;G-JBtUW1TuM+uMsn1|JSCNpl%*}A{k^Qdiv)!KcBZh^oVMzx?I(^`7b3=}Dh>K?zn)G^qf+Z9BVI_Lu%1;n+NgNHognj5_H{U!cry z6q|KY3AV;~dF7tv$h)-^ZozcAvDJ*h&4s|^f8Yix2{a8@JQDa;*E68gF}jo@A`Rsr zY=4ScJV3a`xW9S?H7m`w?IybIy4$f&yxc}WY^T!qg-S{tj&qrqeMzn1Z&?4Rj2YVm zC8|jU$CVQf%iYwSOMQ#^20zLGR@R8+oUKaU4ik4w!tF`GusUlETD!BF$U$vohx)I{ zSdnMyI@(NW|Ca*hjNoHQ+2o2uY6g*t03)aF{Y^F?(Tj6;5pim;8S~2g`M0&j6E$;L zL{Pqq$V(q|swg!*nOUdtB=O6Lh9wu{To;;1x%Qu2!oLU#*>d2p$asHm&j611^e;-p zRQBLtiT2qeuHoVOjG3ypj`dK=>9u_1%_;7>6vDKFu(f8-$};^BGo-jDddb&c!eDQi%R$4`+pa-9F+Qr)bqzROh7VE}ZzEDZr!?p=*wi^yF~(F!n{3m>RKLiqSF4j* zZ=gX6^|I?{#Qu~b+;6ob1RmZOePJ;*C@f;)3C(9|l}~}ScQ2S4$P~(9*%RR@!OVFZ z_+;JcICN`Z!9CGfVNNzM;X$GwL#9;WWiV%}@tATammzqTaaQ`3F|zb4qFty#pLzi-06wI zE!xJfpw(UW@@fOF{*-QZVi`3S|J;Wge;|di`z$;rEgI>e;wjdqtbR4S%)3Yq(dgUpgrUgo6eW=N;-ksxF(p;&ycJ3hLM6Bn8U~>A?%O5F3q;&lYdo^ zdf2h$Ym@z_wgy@>u%?=Y{9iK>o_J9XG2NyuH|5SEA`r0D88kZa-q)`*Y=`;ekMqp;+gB{#dY07tdh_4q{lik*s3#Rg zlLXAhx}GZ~S}jz)3sH|1|Zi!xTpu0Sw1rkm$^to*DhfTn9Fgf5?qSlP}0bxCnWhv+7CVEhi-`93OvY z4aL_*GTMtF&|qSj6Z++E4U)zqh?lSyP%z-s%18BQaR`MV0mm0vU2Kr zP;Mopq|hc7GRDWP+7Zg6xyM+@w1seoNtACi{SI7awn9ag9~uNnL*7NDsgYfYbIEgS zXz)-miISrGma!nG9Vk#7>0#8YR+E)Sx{k|OY(WcV+A=bTYVO^`8OF`}L3pH|uqXzg z)yY9=Nwh2ypK@)BjBu;!ug`;X(!ng>_w!otme=67Lhc5weiBc(_%7cmuQ5C_-061Y z=YQM(d~Ur|Nb2xAO04U-a-B1(&)Az&U*<93lvArzEgDcV`cslKphPl+0%}M? zgp!;bf+Do$nNWr$rtwWjTxzQX+Gt`XGrny7Ky7>}<8xPhXwBY)3N4uxrEq!2S2HWK z6ITXGVpAFScWelG70Ve3Tzh{6!{2FQKMv2hwr2yOIM)QSyGONswB+Xql!97U4hFq% z(i+b_dD9XZ-&ku8g>8z>aM!z!a4j~|iUytmWI!^75!@z~Ll=HormmQIuw8yG(<0&p8jJ-1P&(?uSn=1Wk&RA0xb@zwm5$)$g*;V`Z^; z;J$Q)vh4|ITaB-tlPW(n8&nSb6nkSR~-v! ztPD3Hk5~KtT*l~f>;47naDd(^SWhol|Nb+?ks7_jtmNjt+gD%t^4rVpP5gbKxyLGB z_FDYQ(}(jD?h17vWKdn-C!1y^5@FHdrUl*MxK|nwgPfTYec9qtuRq@sl1j-ey+cvF z_D$$b@SzcVpR16qp!_SV6csmdqX#JdO_0FH+@uPnm(Gxp0SV2XLO0sBJAy2u>a%Mq z@qN3^1m+376(CweQK2_ajk^t;Kpph~smOf6FJ6l=SIf>W=fF;TK~2lJc05f_Qp?pE zi>)P1zvoEj=vf*xvNHQ*#heAT8?7-eJH^4~p=Yyi5$((uPbFoxy}^%I5UUe=COL-X zip%lZi`Kbb+V+uOI^`#vL;Yb3M18bG=vNm1ekYSefQu4h@v${O9=9gm(f`mX+{Cca zI63FO!*x7=VMN8ERN;#C`U)wmgo;33Yp0Y&7*QW@Uol>oJX?>gM-Y)~f=*4+XhYKPPq6CGu>q-|lH|nBDNeRFS z0SghAb+8BvI((WHH7W_97)wJ`?L1961L96OOb37pXNt3NH$^x6Suazd6Ti2@&+PPUZ3{p4sZyytsOZT_z@*$7$XZ>rtsm(G(IA6S|J5)$K+-rQh>L9 zzX5C41$s; z`gRGy{_}9D5vpP5))*~+|5YM(u1*Ydf8Yk8TWChz%<~h)IMjb8~-C(UvWu7D%SLvT0lV1HHr33Zqzyj$|%v#KaaoZJeNQm4~WO?B0uRWE`J~-I;0i*1UR(@z0rSg#Jdhy+d zCayh#1dLsOT+!~{`t&m{!nwA}QlI0c)H^RhJr)3%3bee?CIM_WOoO=0iM6TS`6G5s z6*8Y+w_ruhM~8Rw_9$RB%r9R?=1%yjHwW$2i%fe6yUkY0(o&!%uOgS6NxO&L8adHH zd6U%_*r;DxaLbezd3gyj3IrlP%@FO0w6=w3&d<70##8#eeT* zFbvbc_XX-nD1(7)2d!|lPsddCj`zU2*0H7T%Zp6T$iu0{`W1I_{CstX{nL6$<`GnV zH12;dbw2MtCP3k9WG+*#Kti`+xWcQ!Q;X-?QvZv+uMDel+uEj6B%}oCQd(LXL8U=T zy1ON%OG;8wKtfVF7bz*yg0Se8hDFx`7V$mc-fqu6XTR_3@9+G1E?pPbGv^$0jC(n8 zYSD>4Y`}>aWQewSxmOX7M*-5)tU^aAf4w0XC@otNs&FB8Vlh{e$|t`6{;or&{vixF zh0v(C4rJD=mxMrfEm)G=h_bcHnw_?ZnOWKAmsipd_try-^eP`mt}dHK>YVRnXJ3Nl*U z-Z@3;^_C{3W;?D?peCeJf%Lw_Na9m=CGyZPl)e0@TiFZXkndgiyef1v*b?MO8deeK z+q})AR(t90wk#%!r8xIZkCZwYIn|z5r&?<4?V(rPd86Usy7O(Z!3jGasKe?F@K1>s=%gxuz##h=ZVOpO7G|E5AIwnEexqo zM}IFwzjxp?lw$ZNQ@w6<_765}dB@M{nWv#sX^y|d6WnT`9pN4HaSmEs;cz1c`FU>i z0{L}IE3;3zCh4HrSCpskfc6d+m;ye%gkM#k2W%*^vi4I}alNj<7!Fgx%6Wq_Gr1XV z*_05W!Tmxje`6d|#gQ^8;&li@0gL(Au-cXWCjyRdwP}2dk11LtE~EDRVXBinL9L( zN?3zT6|mrNy*av7sLdEg>b9r4(o^|-=Y>1zq-J8@gn_PdiYAfWh6;JvGWOBURhWl~ zJmbNy+}to?Ghv6#22 zNh^lgV0C1dKd#a@k^G(k%9)+9JTLBgp z9iVcS_R(G$UaW01&}4IMPHz$!nK3Dp0r)8JTgm7EAgW-*Bw|rR)TJ>V=!GAA@ZdCD zQde`2TeIqR9A$K|W{oY2Eu}6UJ$+Adgccps^6S@FcUi@QZoz*ye|H#wLC~$#hgR!$ zV0sGHBTux^;*sv<*`nPuFFHS~X-@1UzYsxZ1TGDIV)wv9f5zE-`P8&uhtVe4!w&~3 zm?T`iyZbKnDmZKkcRHU*QtxsB{j)Lu_Dg6JqQi#zd!U?~bVJdA!*a>~F28ZvLiF1t zbfppRBudk682bSu>HBkuxoW~e~g{y1wzhUNjsKgSXbExak?s3yY<<|LN1_( z#*%@m`+&75*C<_1+FQ=M8ViHNs#ic!C>{gfu58^gT6A=R2P<$RRMxn@mq^bJ`w+L= zLS2ScFRH}LQ4aHG>A^o;<@6)HcWuxWejtC*t(Ji>v;+kynfOJ?9v2dCiZf1PQ9GEU z`O_Sh>5-8qTSwk3T5n2Au~pJZHXa5NVT!$C+y{>*vX_pbBdn1gVh6Mid>;E8y)miy zX#OkMwW}G0R-|R@i|_e@m~(1|^2}F0sE=|soD_;i#npc1tH6j_1E99;icZXrj-N;V zHc)&N@VtDoleX&N9<|ilQ~_j}&fBd+lcn)o2zS3DoCo9%6C#YB=jtUMq)H4=Chr`R zO&+9W=b?c3cChxkH~b3l(lHJk=#Ex|cUQHfY#<^>xwJ4)sn^0CAl9dSE`-kE!qt`V z7B$O>83wBXk`NT5MD&St-}B!&Mc7D^37XZCzr6iEum_CZF4``3@j&=Hd)Mrvp?qc3 z^$_()H5M&>g+)f9a^a+zFd+}C4WRgH4}UsrJiBkQE!9d%sGaa7MVoW?8?2A1aPYb* zUvSca)IhFjV*c0-i9LUZ!`{w->M`{nm~G;n^o{4ociS_yiIW^C8Fb-7_a1-6d0~97 z!SFxn7yBc^8x|;z0X-L43whOdB@7^`|Oj|4N@zt<>N8N{qgZTMfi{+jX zMdeA>Fe3GK=1bj*Lo#-C+a`z2F}Lp_ktedn|xCS4=n*F-;_~XalnmgI;$6~EW%Ai zywKSz$}VMtp+?dQUXTq_iEYV-F%#sZ$8!MI&!0k*bkZBZ5_O95XDfJ{s|bOFaP6uZ*qHg(|TfSULHHmCMnkL1%IVKiSUDi2UFDWkx2Nw#P#3 zh@k+vKhL%&(xY^7ga;_S%2*hB@hcza9feLj-@o6Gp}|Qbw(b*kEMy;VS}S&|+s4tq z8tOEB(5n6I5(F!DVtDZk%!YL@&s`EH7|B~BG3Ay+aEYmvps`bSb)~zddZ>{e>>(r3@%iJL`J*zQ=J$LrACqv~hW7P3$?eFn?yTwim zqot*#2$bx#t z5V+3qGzR`LNhcGmedg;ElE)D;Sl>mS>h}r#S$FqOy!95s*gZc;;E6G!!NeA%&9=wa z08eF8kJTd(@u?IS+Wp)&(dfiYx6&c!G+Qf#xC{Pg%EZLFGY{tyJCua5xPT8ncN#|x zczl0ZS7w+N3A9WizY{e@aqYiGcUe{TX~=3-3_}Cn^q`-}C5e{1Ii5&QRr^H^VmI|Z z{eoeXfC%MJzsIY8z}GCLlx3Gtz>{#M{B?RQ$Ib4o5d`vSH6XhvSn8-I0CKC-z|!(f ziPhInpR(c6>b0TXvN;7nj-e*)?X(8P17rCu@%Htcfo1$SN>Uo~HZWLxgM%=;p5oq% zO-ik#3f+hBZyw&()>4;zvp}9*l)JX}xuqz~F$6ty<{m{j6{TOwqQ7G{Pv=LT^JiDs zp-HqR4mO4q3#Ip)^7ua(XrqiFbwt<;QJ=1Bwp)&makVo5CwcvQHX9r_CMTi>^my!U zO#?F9x5;g9bN*R)-GUViS2?d}5{&ZP%*>4L>qp$sr;qRF-~ZZ0PuJ?Nf{OAQ!MOL4 z54|!6lp^l%3)52D9&J8kUCm}(QBGRa+ks3#CHZ)rE<)?<%^j6cbCn!}>{@(K-tAkO zXEc-V5e>0Z`N?U8zrTM&7$*Btw-Rv~k(9)=RxjhjSM;Ir2vTmffQgZf9KWR63NqTw zCDEMF*UY0|_(L3HJLIa!M{OQuGJod6vj3!pDEX2zg<6lzmAG6NZ*;TIt0={%Z&dQs z_5~49bW$?Di6$b?+7ptqlV^*RkgUDnBk-%PflbFzu?2!DBcErVGk`Wb)mckI2fCa5 zQYx8v1Xts%k+{6?7yVt-muRKmj6D~86{*ua%P{o~ZHc?8ll46HXlWs8F$OACfsbx{ zTI*`KaNCd&tIV1~1Y9kJ+v8h*ISF#RDb*qK-NKYkG&yi)Eu)k!ahOSX>6o4Ij4{6@l4 z{avLtQpbshD~rxyaMr7vyl3`nTHh(=z`6Z~M?M-}rNP?AQO>%9>xt(kyX%TNe(NKy65~2c| zo}9@XJdEsz5F3(?FuYi5sOlVv80!^@6R41+y2qO^@XpdZalmzJP>O4aUB%6Y*@xSc)l0mpK)qzW$2ksVVO#%R!B3f{T07)-1BVOE@|n)ZJB|XsRMPH%d>GwVKR*qF z=%odSR7gGGB0FtC@?|K0IvhAR(hG+0YtitLi@JO$#cW;f5pUtWCqVR;t8zY5uB47j z_g??ci4#V5Qg^N)zMl`f5+#-eViFduLcCCMFh_VMtw2FyjR2y_JVfO(z+t z+Jsf1LfY!oK;1$Emz^akJQGhF^_tFPn0hOp(077O6^pq`AjSjTG5z=EfR~w!i;bnRkgVSdSEtfTHwBV*Nn$4bKXg&V@CKLr z{}V2wKQiOsSVGXvCzPOp$I`TX;#>Yf<-=-D&y=JgB!)?Xm zmwoLXo~4&}$-S{WpC@X%ZOsyFPSdVl9y{8Iisg|n?4Nhuj=e2ieRl7hOe!ySWM{+A zI8vJixS^y%4u6&zw$c!jF8Ydg9T$U7WvCo4WFxMVu9hQ?Rpd2rh7R!CB4JaG;aeT9 zqH?Ri7gezN8hSYP76({39rF?oqobdqNqtlzcrH=UGYKblF-1U1$m}x%D)QEzan^YO zeBsjnqxy6GD@GICbvZvcs_56R4|yJdr);iP-F80ln%SDhaK;LB_odGHrGRG-W*wVW z(;Rm`t$NM6Zp3x7cInUGCG#wS)r?86a$jwzJ!Qlja_Y?*${)~n<=PoCn<7vuZGKTy zf`*9j1-EM^aWid^gby@FwcQkl+0{Rj;*{!9Iq%gy^VXr6w@TPo2R1ri?-cclj=X~tN=y2l2g%Ok%Tz&UiYUp8^bw zUUVQLiV*fr;`%pH{m1C)t?JLr@(wM+M2~lAa$6BcjiSAtO`iL<3N3w8dtG1Lna5+{ zwr?@vRf#NYGuV>X0WXDZN?&+t24YC9A4_A4Fnb>Z*~^zlOt((2Dyz0H^8ziFC2mzB zi>izbo3l$iF;H5;yJu+W%s}6a z_aUKipz&pEI6=_lXN`m6`%y9`CXWm72uh+Wm&Eu)ff?US`(Gc#ya=NyG6y9y_072X zgR2Bh-|JpF!fmeA5}^qvmi2rg++FfdtLmFc%h8}S)|;u_)!)hw5}vdddvqNBS?Hi_ zmHe#lGnS@{-Y!x(dss}Wg5A`8p`F@qWO}AOPWg40E;iZ44&$9uSpz1n+tXY3w#c8C zU_mr8Xb}-;2+FKRQ5vc*j%)|Ur;lbu`g4fS^;~CQtH}Y{(Bv-$WShbg^Rcz$V=@ z`5l>K6Ei3sB%T#Yn(edct+46g_!7jl=^A1>?;UJD9}8p26jR{Y@y|b=DI#tVEE05p zag=*_R)7tfIg4FOZ7*PXg_XVB+5-6x#sa3xM5V&v5YQ;uKOm!dVz`}MU`I!HO9fs3 zNiuIS_Ycz6G@;FLP+=GjL8_^HXr4-#n)SB{CF(4I(Br2RyNkoJ(}u z{p96y-BLE2&aJ}~?WL?rE-PqRo3u$!HWLy?d0glApqa1U^An=(8(&Bwos-=!D`u_8 zxjZ1d*Pw!ED~4!_kaVv}N^j>CHT1+7MQyc6!G~hPt9!#n^@VCZxn1MHcLDKFoY$Mx z@(Pb~_rcP{0wxbFe)o-CNUOE@rxZEIv)X*kYs~tLEU3DM$cO3cFc(`dtcUc$1RWRa zv80v0QbmrcW+F?XPV-f4wwhhScsTVj(ECA1_{cm;AyMak1lwp!9*wEw1f`!swU75z z@oH*ZQ$ayNJLsu#quLqOQ?2_&*viV9>?yiUyeY`Rl97i*%v4=syUxsXz`e!z{=1 z1|PNH@JS$??Exfav5*v%u%Wx<;8yCbJ_7pp><5=g`N-(m!bd!z!p&`D9$&HT650o4 zg0}P{RyCqnW`r6`P!lB{@8C{Oy#YGSZQh!I^F#3S8}n%G5fdjz)m=AYfwOBv6+XK1 zUfbSwXqA4Ls$l*tdxp2DvlbC+rny0$zxfKJ%~32qc-R1=o#gt$%{(;TYB*_=JHaTP<5J*W`nR5YZD*m6*^asMu>mzMW1RkvoeelCd zP1RA#j}O^8MQ$9Y2xpw4w&z23z>=!2ag|(2E|or=@o^GRzBs*#>v7Z-+9d1E<|MKI z20@?|sOJZDCP?R(7J}uoGmR=7pk>(6SUC49S|qSND{xe-?7`b&qZ!3VAC(G^7>W{e zTQ{8W_iMCIQKX7Bw+R!;dFf`l!zpzIJnPei!ICCsiV;E&NUTh{Uqg z*N7r(4)1|BR$LsXA!9NsR8J6%wRZX-BX*?fE|$EsWzDJ=3rh?rBg^o(WOzPX|?hsBzA1Oe?pfOJopaEGXPnSzkr=N(}MlE#SW560a_ipzX17`^puL-p=VwoLknCI~9nwLt_LeJx2pF=Dr z%G!~R(LIv|r2>$cw8iu3Tt2$>}Lq~ER`2?4D(Lmcz1t&NqV5c$Z+h_shiKx{WM zRsx~Y<-5bQx1)2DAsWJ9r37rMF)``257(~M2MKLHXxALv{~}*H4wxC63tQ67E)*2eucvm6+-b38h7=!ta=Vy9&Q|sPfr&G$HaHX=GE#xDe4z}fVEAY4JEgN8=VVqKO#47rr0D` zQO$=^VzJ&In|=2fnP_b%ddAMZ&e$a-6WZdp*KZ z2`j(Q%`X{hvAKvahSF_V#}6f~s$av9ID_cCvZNJ4`s2rMZ`}~^Hneeyd9@Hz9Xu_n z2Dz#9rQ=SEDv|MSO)94^5dP+YbjUI4rweD1X@lr3W}?LAlFADQWUmW&1>5vPucDj} zj5eoz^_r_5UbSo4&;FGc|H_s92Jy?@_#gM>RQ4i}*5|M#ZInuCuON^ZYKnbhM=e#KZSs@a&v!lbsgkF|tA*v6OHyoJ# z1Cpoj^Cki+mTxs`-b2R~ZQ?K*FWOc)8r4lU{4xYV4>^~3klG-yy@LO-^|R&07)DdhM7^ycm7BPt;TqvtIfcuzoybRP5;1eaTN#(`>U zAUHTk;Db{rEN2V6pux=`lW98FbcV&7~B)w6RH>k!dU zv~f@j#6Uv2>G^P*hhpGN03$P+R6y=g8h&+?5rkoms=JfiDIE@yRI*+JeKXsRav|}q zbOik+l=`C4uvyD2PXkw%nLNm^HiRwa&KD3ktC!RBPS6{m`V_2Rppk%=KnNl4(p z_Or{`ILyfKh(#Ksv74y!b`20zQVocXiy%EVea7*FQAo?TxLVmFYqOqoyZctmGmsTU z#NZxoEmgCeuZp_WwFxoZUt?q5^-~BuWsmw7R{uAqAN~NonAuuPzNGb0vE=*V`8?sR z)>e0y@-(udVAMhd?W$l_qmB8AyGR{TzCzF{vzR7?(j#5Pl2-Xq#8^!Kp*Kw>FD1Qn z>tPj%Ql_qzDR$=*TX-qlu1lx|yl|L|Wgh-Bq$smAhZ995i{uX-bgP-M;9b2YxjzPs zyeKREszmA!rEFM@vuIJSLm?V(>_TANyu`0AF>?Q`IdKpfw%;lpZ`Y($Fb500h*{p| zCea_I2uW%nvVe=b&>bY#+kD#IXx{v~=)EsO32UrwipxbUTq_>eH-RWjv?z;RR}Dc| z1&8LSs%NsWug2oz9?IzZ_L4V{`veEz_O#S`wLkUJ0NL|<0u!GTvPN)|$wOFEzn9q* z9~AXq*5uCdu>Ji10MzXANaqKHnBF~ysA8uki%U4;a!B;yzCO3_MrcMUJTKlPbtLe1 z9AI+1l`3);m$9vD9lv%tIMlcx11bO=^JUqH%CtsAw-pfR5)Pr1cJJLj63}MXDh*YrZ#u69`%q z5psO=hLSb6Yrf6GhGyrUiRYKy`{ByUt~o;-2BGxp>DR{p!+L)4`z>Y2o@L-Bf{^0J z<*LbtpY;#Cb?omInQQQo$(n(ih8%Xi&i7lZkJect<~rCg`(ZX075ZsBTfuEM7yI+$ zL$?yr6*$$&TWvh~Nl_2>EY9826%6=Opb-Dg#YEIZf)xu3>)l?=&N`6C7%KS8BE6$o z!GJvQK-kNE6CCc8G}pfqkWRs@r)AcAp;#NCx7`_#b98!Eo^!O$+}xV$<$ZZ^UL9zZ z-ro^;dSVk`fg%rs``Efcm{VgLBV;F}Ab}W1Jpvj!obsSmQsrb1!0kKr2xxv$yRAB1 z;vP2djT+TG+edMwZ?_4atZ&_~SoZc1sWu7xtO&tKB8(3}!(JYuyP>uPN8ltL)l;Uf-& zv5+#`7ziiyuM*rtt*NmPIpO-81hu%h9RD<9(S1bA)-L;#n>N?z1k zE7WM|c(2qcLF0F@6P&tCwsnoM7A-MEQfaCek6@k|Mwq5MHRUF)>-xzTa;S3<(e-0j zdH)@7epRSV2UmR*qdngbbKB=E@fIYaZ4LskTdo zjlYE#xp&gsD22GawS^ad^NeDzfA0m4_ht>5_3Y^B;;ohMHRzF;HNZ>ju!Pe;3~40K z*SBr?LjutygsjlhGaH1RIUhE@agSIZ z)Q%roiVrvumHQm+=k{0Z#MGpOG{0!*|A20v@pi>-f1V6!2a+)b2nG;5kk|LmL#}gV zwt59~2k7~pz42eB*ovdxV?MgCo3Qj64q;J-a zDUrk6lHk&9M(I+8-RroChM?>Cs3)ygk19z>K!CRLm`LKlv4LzSk8vfi`B7*e!xoZS^A}E*+xg&c|EwQ2I-w7 zsC-&bJ$0l1WjVxF*J~A|0UodaB*Xs~AX!3IDol{+h0WcM`6``FO@$@WsA>p~>MAuu z0H(!fjF6wb=?!s@ObP2|nJN|07~wi>oY36w2mvKUL%syGC%5 z>j_E8MV17F6e`t;0O+7T7n1uT1$2WLCfEnzrrt0gvAs zxKxyp&ZERLHG8bY0m7*3RzB>_N`wZoGfcQ99#8PgX47V!%d^LdU6P(!Ze*|XLM5{c z>O<@vtNppj!2H7_uPKiXx+ezulRpU0FFN?kH2+oOiB%{;4s}(YYf5jOG->hPp4nZ> z_Q(r*eXC-=PQ|~W`{n_Y8@epL;!W2X(VAsb-Kpaj833ZgpPa}@1IQ9Zn*{?8MOyKH zefvKS3&b2$$n_-`2~HR1Fk7!{?LFyc!OQ=6k3)#*TE_x#yN;cD(`s}mlU8h4Ng>Pm zdx@@6RZV;P6((B0V8ZRB>t*Nv_Odl8Y>qk=<#5l9xh$zKDQWW_*E z;l(s>&O&_Y#12o7Q1>dhzW~NSwNV zSyT((O=7p38eo8bBzAw9)<17FWt=GNg$P~al}DHiX{w+cNfVSbR6g~tr54_GhyuH_ zR<}+xw3o`Z8rz5W&~B;K!L+gI60m>>22vN~e$jnIXDSLm+^ zyQ(&0MzQr+*S|t$c=nJxB`*!n5@aE5C*OJn(6pA|$GJzM`AIL~>^(cn_MRrDgE-cFlgu%r8PPcY!zeMMKH z&GbMznH3vX#Il@A+c8V>6Z7BX9(yBq!rztqXF^Fkb*5qpk3!?)O{b|2)31R0&|@mU zTN#u}L<;cjcKo%5o!b_$1y$;aBE%3C+U)PB&57gFfp_k_&U*S2L++#BEdA;4F8wKO zv~KfLO_4pGt<(Go8w#6bYG=KR5A8%`0-5LIXz)n%k-o?Z)tNUYeMXamfScDJq}N+i+LAgU~1y zClMx&)v(;_WrtF9yC}@RFzL~N(qX25Lzu!F+28wJ*`v}$Pk_WHg%5P4gs!Yv(&~(`zoLbSfy5|irRAG4XOD<3N5b) zuFrCkXnxb==QEHibjXG-bE2f?vY;ymi~`F!N-%}FXmfF8@4J9*vzH_DH(f>z0W8Ap zwWLksweqz`zKhlC_|>s2{%|Z&zw1~Q(6Yfprx&HtPzvv~0XBZOWK3_yYc|ROurhr^ z3@05Z+4|XpE0o+*ko8EfS*=H&-)M&;_g8~oy)k&d-!*uA)fRWh_4Cn0+NrUWUS5*; z_Af6ak332fB%N)Z&xQ2?<9nhVPJ061vWLkax>WxF+QeJx9k+h*sEax`9yR)R7oLfk zt;U*I?b9U9F~zfb5XmDO(^I4UAk?S!G4(RR=`x_*q86CyZ1$;hFrv4z^gbE?*||wS zxfws^cgKH@+f`j74QuvNJ0q`k6ulgjQqJB#vIE0??4?uE6458)1eE_VLVlc+?g4js zOWu6+s~N5Al`OqmtcD~v#PJ7vjKRHDyL{T;R6BhYWcRBxGc50u7u{TTq`SgzC33FW zc+9IK6FfclAz$Y{0D4XUY?`3ly4shLDpu#27iDB~3s&*jt)zb2<+}|0!B6I_$atdz zvA?SW;q{``HCpbr^I2k_NwU)`+ycmy zkLY7HkNSj#dhoZMoHk^)a5v)4nOv3-++QG+v(4L+I3_*8=hM-+S;wS+ExZOTVz3xSQ~007%mR9-%hUr3BYMi%}4y?e080IuVbVt@!Q> zyO&>_Sn-8H(lfNl$r@Z84#cKGIN!)qui4(l1Oo^PVwm9r9Y1=jVi|(v^pcBl+3eF} z#<>%oEx)Z>{#d~YhFCxGxCQA3jza1GvOQ^C$|PASGuNnW@ZImQ@+Adc)SIlv&z=7T zM*jTm&J+Drp0{S?iJKT+>*~xn(g8fj0ut1CNiMIu{OPCPxmN)F7qeu{W;-3 zHisP-Idh9esmUcUuGmejNAKHS&#`0<*{_6EtAYZKk;Vz{X(#9yWK8!$sj*^%Vi7HFR>+(oBy3Wl zq@(lT2sCnd!WB6{+Yosje%`)jy#;rEGmXGbg;YVp9OHhe0hB4Q=8rJZ0)c%tZ&OCA z;`+Bviu|IOcPNj)L~i z5W2y{V-s|YM?fZTn=Pb*K;pE75I?EOO(~_v-(OWz`?9)`MPw@hd8KkIdDLBT07h)CUEpH|bo71(ggr%^KDvZ7%p8;kn%T#oLy%U8k=cC4SSLz#)hM8LA=R zR;hb2ibP`>2d{47;#bn35rMb?4kcZx!Ml}QT@r|LRc7}|pGB2r-0_l2r^AbaWrv4R zMN3PY4zPAtt;uw1q|BOmo7rkWY~QLB5byB2yREI#XzDQGUKNzDlZ0B@$p-dX&*nH= zIIL?YziD6FqImR+EA(xF1Jnn_{+5vVJop<=(Jy}cFAx3?{|aK#7di)2hH~AxkS?e6 zu%6qNztI^Sf{-~4vr>3Im=D$|6=0>b+_)7Qml)R0Ma)PDj?6T)wFYN`-(Hq$tqz$h zD8aHLATAfZuufZnsnPvIw{iZhy{<-%yJTjEKB+`rb*C-krQnygq-0u}BBkq<35hnm zUB?Y~)|4p{q4y#;9Tnvl)x-gcG6AR!JjGhg_uW%WwPbj1D6M~=@Oc1{ZnsaNqZ_je4YpHmvm*1Y(UvjB(1N8Qt5UtD2 z;r^e)bX4E)6YSr$Q?z@Ae%5w1*}Qi4@XwPXCbfnmSz@*}qpe-@j2jS2ZFNi!gl6tA zC>9jSQin2zs?a)VCwZuoBrNVEUp^*-d&a!5F5F;ziGr^Dvo)9K88>;jDDEqYYZ0MyLc#@B|6nwf| z?Y;Af9$zZYS*2EcwYW1&Qboc;)&V@~7=w&6;ZVa|!)gdVb!(QB1)r^7ZW&b?fCNrKPiSH(zS=9{@o1yzpw4TV)`l5{~(;dcJRO2^a}+4n>zj! z-G9aO|BslW?lhnN*$d#GjOf2O_0P8Q7r0RVS4{sE(|^gqF9z|`q5Ru#{}t1(B56S) z=#p03^g%(Qj}w)k&AbA#tpA3^Syb00JF0)30qVD57*}dY<$z;0Wu!Th;+*JdEK+Nh zZ=uQ3!oy~WBc9UbmcG)^?&P^~Tk!<+7h zEc3l4TR=5xSC8pdJ%60ImO}8R^%P5krmK|4vj$oZ54z&9cw=ood;_ZBedAr-EP8!~ zOX}xXjzg=ICIkdZs;Vr&RWD=d3tEehC5h%&3^O^TphilgU&Ga#;P9Q~P0Tv=S1{1> z8ow-f?pXBG3yS%p<6|j1y>vBNsk%3`cQHMwk1Za1v(j&ftup4De^ZtXNbBj%&dk)- zBM4rmf=LLW-sAndm#5cXRwg_g24|V5Y3iC_9jkv9LUPzW1qzo)4rp<0xH=KIdKUIB z_i0&_8QEN0NrM+2Q5-&$_kaY?CoUw6?k_s6c-2q+$aLko(sQ-#V}lALSm|>>_{WkLlxl zg#`j4@2=i=PqL3whUoD6^H#dr!2!leWkjG9M1_(hJVPCQY2*=ig0C`_$)aHmICE?jtY z_%_W_F+GP8vbH|dt17O8$-fn~g@E2!35iS~9w%>D+TWz+J7AQ&3m8(( zQ7=#v>+PMotXkVQO3?I-JwnfH-E+3}sCqi6&BMGYCkG0)1)o#ZayBpG1Zy4ciQU)ywO6w=Tr;hr}Vdbe7d z_zoFkgZqx4yq!U3d2=f%N)3xFMIV#(S)1S|5DRn%)con(0|k6yk`SDJyQF5>o7lQ; zu4Cv{^(-6qcHzJP8|HRH`mu%o6i{$1j|$DQPfcf=Zf#S0f`1t@$^Hnn#;vBFf8FoF)tV7E=z8_1oKH~TKXGNIl{k>hmVHj;a<_>xzY0L z>raG4PSet~qchaBYbcqBcC*LA;*IK*bb4N4AEEj~N#BZIIWP5?Y-v_N?l1f66>E={ zuYM61q^WV)?E2q@U(87SG0Lz%uVHCHU-!KHS#sswvaqjQljnPfq_+m>5e=W?Ulr- z@lk@?!lm!yRC65y=(m6i;_@~YlZ*ut&TbKED!?tBEjyihc8Zn1yA@G=S_G-B@1J`L z>#Gv6VZAd5d_^%0M<+`tI_4&7uuD}t85Aa_vf|^*#^xHq7B*6A0jRv6&#_lcb>)4Z~M^V6__dR#!&l(}q zD#Bg&$2{Z`QFiMFDvt}E>yjtBvnW(>j2qq>)mM1-EUyZ}R16-?h(~@g;k=k0RuB0? z@$^zI0P}d;$NNb5&a8DhfjIN-DbdQ-!Ch->4UMzbY8Kg@xzRjet{zuSty|1r^&uAy zq_A`UsVN82AkCE;;BJCPeMHd7s{YUk^q_NLj+$==Ix>0+-8V`X<`WsNnw#wiSf-d} zeP?HIHt+ep>D1X9HZ4#$P>Ni;ajDf3i+p@!z8mY6c4yL8%S)#i_I_u^a!I*ZXUkz{ zA9XpXd4^WY^%Lcm&{R&oZ2{(fmocX;#qIMV5*I8eF%;yTH?+E26_EGz%#Eg`iQ z@}ZnV0|PCsl&We_gKnCor6p)&`dxK0Da*v-3UKqA*sn-7rt zz?z#L`Oq!MYqr>x(<7IP-)6aj5Z`LK0@aZWbmY_(wDQ$qzzEvq9Hq@RLc*o4OE{-B zTe#E6OKB^+QKpQB|GdRNow*^TVWna{#M*X_-cHj!N&8htpu=GivXY+0Gb8&a_zX;c z=cDw=H^&Ait@!Rio|u2sl(VxU6)i|AD3m&x?{Et>Hcn!ggN7~VV}+@lSm-0e0`wVh z`PvcGu)laKxLAdOi#0#c=KA?_yKkvjz^S;ool?z`&ffkz2N}XE3vze&fN2l#shOI@ zPe34$nYn2~zBZuE06`hRt5A+W)ioAT+%uX9D(eV5c%c|Cnz)7*D<}(Cx8OUE6ib#H zK_F*VJqY&KFP7n4M%Ci_w=g8KaEWjLDRnmqLuIoH3Y0v23dTvZx%@A@4LYBm!jet) zTa=;QJ8I`DE4-{R$vv7_>atd!z%8@LI)YtjvjK8A#1Mp5J&n3rhON^Fc(K_iTdY>z zqPmNFz1^p~ z&pB4aE1KWxa}u+e~D3F~-=0^v(Un6NjOPKf_%1{|F%Bn}zCXks3Wm$pl71m6Vkw zQvhay$svJMI6d%`V=Q`YG?V*I%r}x{?=7{fTU%#pyb$sJ?~(~MT&ta4?{H!$n5t?Wii(J_g5sv|C8Z71Czw0PWCquU zg1K=sk%+Nzvlh$dRrc>lsCYZ_ON(+v1>)>VxZgHd4^?o#C1tVhv{}#Ke&1(!$USYc z2*&P2GAX1COMEa9Sgr@yUR80GeAY8SoxA=nfD>aD&qBimM3G;2Ru-fGt6 zTwY6C%O*^j8@83X?e9DEn9~e~?@u~lnV!3juk&g*v%pS7?(DCEtNY)=RHz?guJdvy zo$pfEP3zzQvK%PfN+bPL?dT_pS01Kzby8GSrPz2eJtxNk3!0(>=~n+?UH)C{CL^e* zJME5WPyE_eadviADC_{L=!m9FcRldOZ^$p2E_vYDT3b)HqsJ63WI2d-_jwMRSz9J) zH@QM;6sT$zAhH}pn;vxCIM}_fU-ns)0oAd*4q`Z4B1=Npnn6 zQ}K`thlZy8%svGS;uQG(;G5ljw@hT`=DRC)+ufiW!`1xYte`HuHmOJc5@VoxSM2EM z$e@L70V`LG0T-CUpOWzk1<~*yg*z$JK!z{n zt4zdPwlUd+Lvf0_PFW;XX1|7hvdRv=L0tkE(S&k+hD~Lulm8-4aO3p;Pluhkh0M#> zWaQ~sWhq}>Q4y0UB>fcb=+{lyC)K3FY;I}kC=8tW%<})@GuZVE`0T;~okGvno|v1; zX^B^za2)RAnRmcMSNkZ+mNJzwe6?rF_kJ?}tFu5_gp;Z!$BE%CSX-m8Q7jM{g62U) z_hB)D0lq1cv0krEWvNPMByZo@Xfp=e6>vuA{v1J`B*9O0ZfR=C>BP#dAYIEK58tx4 z;K{fBYv;w*o$8|uv%obTmRAvDLtqUGw30||eqw=Mv(9F^=Y3kPrsq3rGqd=8_PoJ( zI>ns4Mvt~$YxoD25>MfoGEElEI_qg2GQ~=}b$N#!X&pw`#`*z|_g8uw=xS?|SER!eg#rNe?XjXFdZw}g z8LgL*&09z%HCyplsTGd9UmvaVjeDxiUl86*P0$Y$J;-Zn7UNerw!~-}8=@ddskejQ zV|Z0U3K+@a_B}{RmDVP|xDI&wp8I^K%5qTZtnSQT7H4p~ByDR*Z~NE{N)D z0-N}&FW=qnTY{4YN1BxAU*!_s#DC4LNy=kZuQDlJx^5427<_(^d~)aoZKXqf%Cwxu zku~6NoKgfVXMDD2N_AOq05{P~m$OaVZN3j*lCI)FcWq}eQC>HGi^p7>to0MeaaVlH zI!|>W0(@0uHw8(bP=Ifm{*s)*0zwDW#JBt^o#e;1N3c$fN5qmd6!EM}an$TFk=GrP zwn8DD#ONYfXSrOly80mQzID1?>9+30b6>)~mGdfc_ReStlJ{)gS{zjf5Y)j!wR>b&PY{Zt+ASU+7CT!Cb`{j@t8& zk8RZ3d;<9^tWuVoXP3|7$e$@(Cn&Mb#-m!KR~|=P2kd)En^s@(#2|n)G&GC`XRIsT zC#mOKy_+y3(gl56e>x2GGgElB$^E79`NP=DLN}_O9bi5xblA)rt~5U<*x%o`@92ZY zL!xG-b%cc3)^eSvtDCrq(g+Dg?P@t@?rWpMFXn zmwna+IqA=_-je3lmeX*jHr8%gGM-E6l#V+?iDK4XRI0YYd-+)zGHidS71W`B1sINh z$pC*ovG#oGqfw6zH;C;Q!vievC;gC#w*xUuMkk_9{rF?>fc5uF}8!R!n z+>8=@SGVla^str+ZQQ(>$`^bOs=wQ0vtF38_tZM%{yVL2%EM5ZB5dn0eU!jy&eHu_ zcBLio$JFdpU%;(nPGgZmY=6$-LW?+JGOy7-E5`QCW@6ulsQBQPr0lUBlbJ>C73$^I zttp0}00fjK{DCup$pU5rC1=2D#|0iy=J z?oIw^Uy5l49eW-y4rZp+kz-Wep6`3NM7Z?`^#u*_8eqbFqT2H_cGoc%tCRA3IZpOR z_?{_O?{>JB@^o)D1P6NsujI|g$S4B7sCZ6fgH`0dng4xL!WhauhBe%8VtS3H&n=A~ z^OzchtREeKd9loPl5O8}!Fd`cwXU;Y#7gI(mz7tkDm9x z1Bkz*vqa!G`@Lzfo4$DzUeRVK56c-9ZYp#6u>@l;tgQud$#1G9J=yB78X;RhbZ?qv z(mv@@f0}{i{FV}pCLQWeQ~kuc&%Cpnll?5b^3=c#{yjQ!`jdS`q8q1gC;(?OTg(<% zwFEH~L-ZG6!0XLnB%2-R+SV|ympOc@ZR_x`+=Dg$^G!FtFffjm5erOn3YKAprGRAq8bZMzme2+O@3QtwL}(W(#+Yx;h~eT4iIo# zeHDA@_po-q>X_zprU**BZoXe;^SrVueY0G8OOsPs8JkIiGx(1;mHf-{RTLb+1J~^` zQ=JrNw!kM@5T)ZTN#W}9b|nlvW0@U{yGHcowHkm-|`vEQJ|Y$FMUi5 zJ&20KevI_JYM8FP3UaP=oMnDoj&^E;Cn6@kaFvqbv{_+Ht2Ql6ocYT0jBh%CyxaOY zl|%O*v>(jyXX;b&TX61+joAN6^RId(F97qdwKdEJK@Tc7wt>h@#%wCwAQz^{twijH z*;p~Bv}9|->CD3RT9pFOxZnkv50P2V(h2gRqcLc_wwBY}+&qEW8;%oZI*4_1;%JER ze+RXfA7O9th9v%vzBAV+n5Xp%Z2UC&OKwNtB`WIPd9(tySLG^5Mc-}uVEU{I^r-c; zN&F0c0g84U@opGO=M%3r+g?!~EsHTsVovzM%&*Jrb1BLkN=Fe7B4Iq)cLY5Lc-?#< zpOWg3J?pBZfenxdb6T>Okr_U5att^f30v$8y=C)Wa4H-_AGjxWIa+|BMw?g|pf;Wb zr%x1(7L>#~7#haOq;V=ER#Nv5y=Bj7ZS@i2bO|SLs`2i{R0~@N+<|T<#l12l0;NH-zA|5nU4B{&QZaOnL%rM++^QWL|snx2sLiB%UhM zen}d}1j8hf>^2-CEtanY+}6&yj1&!djT(Wmub7_!+AF22w+mj?7(c-idd9?zbA{Pe zUl7xqw3dqYx(;mb&mrJpq1?dCOpYR=%2z?i|TDEsP6&-(9lE$GS6kCbNBCOAn&eRi1JOG+nfw zu9DXiNwN)W4A$*^jE;kBHdeRlx+gRBF|JpObB(9mbE}4hN(wH=OWQZ2>GSEM{W%REaOgRmS2!?~S$r?>h-meZ(#ilkXX^1&ObDT-`6B3hPgY zOrT-!k;nbB?TFknb#i#^J=sIvN-0;^f9R{upVxsfS#4#g2c`bSKKacR@IdIkY73wk z4=Z6T03|gEW6>bOd>{@GJUp4U+i4gKYt}N1iQ+Fp1RsQbTpoeOGtHt7`@~Nj$VVmG zO)B7)r=&{nNsWfPI9Qx&g9^Zkf#1TTcY6Ln@`n@gtuQWadVG!fo7Q`>F|xO02@z?v z60))hj9MRoJHu%V7*V`Z1WdddCZnm_8EtAXOX!Y_B%9?%*_kq3mf}ySmYu;7m15VB zdF9cj%H_=@<{5s1dblD{adIX{4!uDlNEP}Bry5j_?;_>IkwJCf3y#3yRmX8I)O~hw z`!@#jo0oRRZ7tV_=JvO%uB(p@yV|Z0$GrIF=N4$Js<63fkdN5$^!45SCa`}a=zQz<`N%l*i3iM__*kp=cg;dk0*iO= za!WE({%7N06#fDrsx|n2v{Z`<2)GO<_*u6{zWBDVxOg(LH!>!7fj9ZF!g}x_Q13pn zPH>88tRH<2q+2zE{{)>lPBN^hw`4u~wi%g_eev$M96WjMQ$wf)Rm@UntQHmCd8O*H zBy(F#u;Y`r=(mc6&A7|3tD9GYTg=`RHRh9Ivjb7-_v|Cw+Fu2>U#AHAW&kcytAWA^ zZ`E@BWz#q<83acAD`}GYExheadNs=uOe58+B}Vw5TGw#a+&Vd;aQ@@C<)8O2AzXW| z+lpuHfjAAH4@y>MVa8tpi;ZOx#?z~ebLJfnw+IS4jf;+Wj0%@5=|bYQ(=So^RvKYaCqMSb)*IDx&YP2OuhUOBQqL47;mmqSa7 zWlBO`MaHsqi*M_0-P^Klbr(ihcjSJHgnN2rROJ}D)?%FDB7p50I=?HU%c<5-^$8E= z>Wm$y3m%data7on1G(P+y!Tql*UeghOOc&7oqq}*y?|QUq&J7B*qv{n4Lg%G+Ng`ILaf=+;$k@Fd<1} z5hXU-7Xp4Nxu~{^t9t^~4blkO*Zj=fE(*lDZO^}lCP966c~dw&i+lEr`O>7QK39p{qJ;2{nO7`nt#T_t8xHG-TURz!VGm< ztyMyPbxm{#x%X!m%WfOb-&>S{Sdk12~M`k`hps3RQCL>UbQl6Qd97%67 zKEi+)-G=RM6`E$mEiW7t;@6V1dKWc|Xmau#&rz{C54^T6%~=rOAnX5fa(b;_@!}D8 zHgE>EBqm)k;>yPuf3@_Jnr8u&ygaJSkdNQFecZKd)U+!9>#x zuMbg9BkqJ25RcsfhEX2PNP#Q0SqGqx@$)xig{9~Az_VV#WqPj1Q|$RxePcj>cUhCj z%KfoxpLu@zfd+1Eh&rqRV|Rm85(M<5cy4oDp=x{RzU*9xx$XT)VcT$c>2NjAGU>NL z#pZstMs_=!36Q{8ZH8ear*#6Ngcv@C3+3Po>7aG<`;1$ zCMFI4I(3DGGrQa?1p!%xgQ+RCY;pBj?%2{gseTtNEUZhg%-}#H_9JT$0Qn2`&jNoS zprBVTV0Sn#gjj3K{^(q9_SdDF4aW%8&>U0Hd1 zK=#%5Fu7U#V~xQB(?t&js0+w-k$iC0<7?S?VpVpG)@{wFDdTJG=i54O&KDS46_#C* z-N!U4_Cqu3QNzMjkEDYl>Z++QpLO9Wv(Z*3P!5|n-jA;8B>;HS?fH73wZm&)Mrtze zL%M9!y`g)_@7y{s?AbN2dB2248=`f&;mPU`mv14iV}4(1q>N)H;*MjCIO!59q$KwS z!NA~0)V+QNScY!0U3Ix9J&Us}OELv%(y^P$IAZm+>?jldX?f)1dy&Vfwyj%J3Jg1R zh?XV7`a_)#19UV^s~>`}n2xc$JcJNIK9r6GLlZr37>q8ffCtE|vdr$A3`Pr6h2W&T z2x6{&sO^I+*;B%7<$A8LrkE>Hv_<7x<}`Dg3{^lrVcYg>)gf>*Mw2qtJya z;k;`e(lVn4|e zV=1$j+~Na31D@jD&4@_S1$OzxRRk1tyC41{vmX*tBjj0?+9gc=Zr>ECTpEpWk8Y)U zH?-UCtiCSQ;1t&e!HnIT0v1%yhi8_=Iq|E^JUmj7IoPfag^N{~#`9!}>90Amu%y)y z2Bxh-bnh3os$#6mM7s04az1?f_RRp+8A?981Qf7lqlm3`yDTa5^Ql@ETfAF;exZ>6g#1`DEGN!=#=ttF{F`tfOxYs!<`a>DDGjA@9buWMa9 z{GPnWtHfQ!Zwviee(I9`pU?201AXEnh{o9*Kms%z{&KH@BXL5nZ^sgM*moT0Hm44? zh+v9+3-2Aj^|-2HVP6J6b@ohc_S?%vE96i@vKzMbtDcNU$ZvoSG0_S0*smvocoI~H z|D#pYpucMP;gMBO$oJ-MhJ96=I^{>ML-E#HtPwf3)haeT{F8|x)y~uSz%%_x|1wUl zol~&x*=6FIn!WY2v8%kH?2{f{5_GBI)mu-twWFg5g5k9JJC*M{L@$yc&y<@3`JcNJ zZ`>3oXvI&`K_C`&a2gw02~qF0Ipjx@MecDi-bf_5Aj;+Zkqq$I1eo+JC-4iy(2jzxM%L}-{AKlSK5#nVkoSFdr-#l~rJed(Lg zi9_0K8JK-I1#sRlvFauIpzEnjv>OvvopnR*KzHAE8ekz4!4wDrAo|`-9=T}tMzor$$L^eI6IeOF96k%?x`g1AHMws!PenoUpF_qya!m8~cQ z3iHV70D4*Z@rpSj!l0ffrjIs4dEO2rE7CTE~r1Yjk>>C-XFw`gpq=$7(Y41_8uBq8$tmLNyDES`E8BCp_U@DIZ<& zgd&EM^7U*~n49lQY&W@LTz}6Bo0`@2?)Dy81G=sRjnC?aXf%uY*CGuSDdyK^!`Y8C zj<7@`|1Zp}&DQzt)GyX2hUXB)#s9>HZEL9m;{*gQyerqXM2H=HTh0@Pp2Ti4+l*C$dySW(&gFTMS&wr!ah{D5t)bzO^y|mMEc-8l7kb{ZsT`G=btA5y2wlgtzaOKaq21iX0Y4u7 z7-c=q)3l$A*c=Ozu{7={NfjsN&D|r2W*0vnV1UW{-ZtRI<@oX8nV7!R;hGLbN-Pi4}XlVjBUydHA17kF)dopV1{X!w!n z=9ZF^6Z;x)$B1%q940>-?HoNI@4Wx<{!`dUv3&`pm^KyLW6Y2CYk}hoj8)Tsy2SZ zZMNk(R}^~R?8WxZu_WQ$`z!Lt+f(VIHIm(b6T_cdQ?J2jw+#={k^<&RB~WIrBf(>( z%mEYcUnv=l^HN_ko=Bp>#t&ahKT{$UR-yLE)!Aq(vOBC24+r`}vYhj+3Pco3Yc6ve zDwPs)DBhQUH!gUX!P0-^O~SLsA>|bb$kI;aZ{nd3Ys;6n-t@d9didzGq*iUYh@!6# zVZEDaiiyhz*R*YWb-n6Ko+_VGEArg{$^Wp6pL!Xr(GtAHnDFs5F)i6@X&%q4=IJRL z|MuW3XoRM38xA`Cc8a<@SFiGPw1uqjwJ|xj*@4JGAbp#-E`tZ(r(g*)(RNKX@2~gC z656rel?1aH0001mz)AOcl$4SvNdZyO;0hLeu_$I+wfUs!3E`wf00^JHzdTUr7UCdb zx10fY$FsDG@Z8yZe3WliEz9^YdbX3Q*q$#vtDi{?AU4?Cc=_tpmzOhS(%ggnJYkE} zE1@tfo(7VDE1h?2?e?I~S$6HUo|z#ygdmg`lu0WaktWQgeZu(oDJD-g^~7Ca*=r}s zvNIQaYH>ew{PxiX;YWgjj4&LlKcla?daFM2ak39rnCF9EaKfXHX~&18HfkCu#n-3k zklGr)EEi?+pF@J*JA1L$*J8Z;1l*%XmFQ{GFOMX)B`Ij2^sNOdDWlN}#&&E`KFckq z5(3Tmp9ZG<#qFaU*RpjjlBCIZEnHVp6uEtP3GdIV%Ap~F1&8v4fbD}U9nqv!xBFj5 za}NCQWTs!+%Z$9IP71!qc1vqF9;~h@MpUpXc@$~1ucv{?_em6gVf~ad=Ae(P>Za{mY9F z1p>UhD7MYFoO#1AGkcGkvB;bN*v{wAtAG}t&mWutC;I|3uIS62S7LS{*n2NuOPsj) zk!CxR^Oo=^5W)IEQEkshqI|BPRz$n=;a6jYisI+zCPqeU!*#3O3@nd`8K1n?R_o!v z@AIb7$NQ~q4>aPXI7V*iL1vJKQrHPW-ghz6&gWf=<7v=JK#Qlkf}@mF5gp)BVQrER z+8R=UB&nQ>*CpR$=$e;1&N;5u>%MdkZMEL@`dQobc(rIn<`n={!3l^?z&z>_8{!|~ z`h&Ut4#+2I>T7QvmEOKh`H;Nwtvr+#tnc3{z-_uWJLtDS*}YUxhtA%n-PIg)X11D# zJpCTci*i4BM)k$5JHqUtJga7OJrjQ5or`!GnYJXeg7{aI!Rb^1-wOXC4HORHI_3_u zx%Sae-s)qQu>VD3Zi1VJzhZH9a#bdC)~}z-|0gvR)wL&}dC{B8yiem2H(Zb1=I(3v zh7dfx8G#FkWlv<({EihPpZHR++!p9`{Mw7`WFIw7RwV@7J@5(g_JmQ=Pf`5ha0P!J z({CiD>1ERdyIdQX>+W*@yGgvUir%`#3jp07^GP>6wUE_vV}fuL&&^He^+&xu37JL+ zHp+>o`q;aulDw~UjmTi5waH+t^_#U#;K?lw`TC9~^+tm!sNx#~GANN*I}(`h6LAl1 z#Qze4DI6Fa%T;DT2sU~bk-((6!J5!cS8)~oj$IeDA`l_TL&=7>Y1>HJE#}=hh7(;n}PX=Da1yy@iY-U$z@fHK?zKVXDR6K1z3tOr~nkRPIBYx;ZhHg;hArrAE|Wk(ygAPw_!&o$?I%f~x{Lu{c{v$~?=s~i z4`M%XOAu}SDy~-Dw^+NF`e3#ggQcv4|;_0RbRzcN2%I-tczx@$y}Gn?C0J z1TlUs#C;Ko15>*Sh1~mrN2P4hk7$~IyjIpyi`}7~PVjr~(<~zqn7P(-wjQ5?hk5-QrnhFTUO57c5>yTpO>NX#*1>1d}9#hlxIblAtN2 zZzTw>b>(6h1sS;#_>Z(aHevA5HAEZrW#oGfag@n&QUthFkePBD@NSIn|U2n)(uVx@eC11z3v`^1M-aD~_1E!0>_ z*W@qk`lWh+F(lfo=Gi=V3o=?CQO+Lc7X2!O{r!KA8n4~9wMu-P>@85JBJ0uOBUx^Q z5e}7AJq2I$yYeQWAg?__Akb`+?unlvGvc;I7%LK)4Lbn}t4a@hNeG}7pIvQ4fb!#zP&yVf$M%nGQe>Js-JeyCnPh%IWBX@4GXN&-32%w8DTD_L}8Z+ZJqw$HtWs#!i?Pw%^}s=s|ZlsXkpprb&hUkHT@4(MZvq z$oq$l@kEgbA^Ky#n{g2bOEqiC+lAF`#7OvryJ=90@2`#{;hw1p9`0-WfT{Yg4cnE4 zRgv+T{J#kzM~-n`lZaquqvzGXlBw3lq(v{72k?t^Lh<{ zaG~pNd#x{@C^)tgKeInKy(o@OX{gcJ+eKmIdvMqsy!4_m#@Q zv#d-GZAr1(P#*sARUiPwtbp_zQ@f4~%?Vottc2@ttsyU&e@hkBAfc@KXmS}68j)7v z)NLV6Z6Rtxw|aNkhpoI`)OMx2iGb|o0dtd?Mgj;t|L(-Bjbf!9%bN1`lbKR*OB>C6 zlzx7Iy?^Qqw>?gj;il8&`GM{=<@m6$@+iFe*J`W7YfV#m7ns~`Cz<|H-8brBE%m7n zd{wsIy2OUc{K!6xMpoxq_uM|P;bett)4`at+1KpdZ&TAqK1HLuVl9oAjP2mN9~u`j zxa?2%MG|!WQvHR>+`D#yfngd^RiJ-S#XmhPmO8(gJXMqvNu6ke9oq>K`_T-U_wn+T zd$UzL2Br#(g4gX7)X@^=IY_gitQDuBm>BCWna`Q}dv8d-fn{W@rz@%G9cAg*;HK5f z>mM+rDqTwTFDrI(&&c=lTYbL9_{wZ?o;^$8^1fsBw-{Z?)7peU#DDvrX?Z4nj7A>q zD)O}&j?4tA0tU&afEEch*IM8A0hpS~29>K($f(+vN=^x99ZH)49z!*a#sw7|R#kirbY{4yFC6R6OBLGay^ZK!% zmP{hI;I|(zX#R`g^y6W@otN$q*mvrPNL&^1MAE1C(fvLqHYp79*pqFT{T0=QB=jJm z_#N|mwBp!VeengA!-Y2dZ7F5`7kxbLsXi|Q(ll<6vzJA0sr_7)8nM1fCnRouA3N|PECc>* zG$Sun!AgT4@FV>@X~W{WZgX%;)N8_90jZ~J_dY-aVJBiwru5*k+0JH^#kN2N6%%}w zVe1zu6Fh7(srT#n!dhNH-faYolNk3J1P~rxoQyf}gS@T}>pb(rrEi-*aZlv7R!&~` zY|cQn{iF#Zxb<>}xONl-@=6^Lt2+}IZ{M->U@rcN;}wfOVII&3HTb#1%waq8b92+n znfJC=6|5CR^L)n7DO&O+pLuz_!tkSig#cRg(YHSzdl2DsWLeuC9u@sm`wyUCI4t&T z<}AdeO^tjVvPEcRc{t_^s3$PQ*yNGatlO*=T>ch9-n<%*q^O{9l&=1IO_2bfs7_Aa z9-z#%JnQxDMAAYjEi0=c6$+jmMF3^IKQW)kk@Tv=ojQE|Uu3uDTG!6IBR#BHjcKmr zOEgxD0XF_BuHK{XnseAi4dbNE24$Pa1*4i^t2okg(SeJyeir9gFJfK19+_+L-3;Da z;7PvcWDDw#9{Y4-a94*Ca3C!-EkrMwz@obnIo-G*Kv;?O-*QF{34^;mpYn}l6F1BJ z|6ePaiid$atA~%k@TPJ;Nts#)UcF`!Qi0d$)R*}N- zkrcE1*s1`HypYBkgZHruDyD|Gjr>?ut*`*qF!afj<1c(HoG_sc`klDx#}U(xVi89B$GiaGi?ksq0R$>{6ok+UQYKh zdr+{;iX-F>WO^ng_I!9lLL#%K?wYu_cOceFmhP{zS0RnnflkBF$ zzlZj9@h|Nz4wrGbR=Ba#)y2P1kD|&rS5SURbH_-c_`rxzW8o%`-ufa6qDK+-gY>+u zQQI$h+9>qyaL~5kgwSuK!`~>$V&kI-e#IBmn~S+uK>g{k2)C=-kT=n7WKXhb3*#O> zkY!3@2oLx=Y9+w~2$QyL5gSh=yy0oP^FV<&OB*U=60ds$ZgPfL2z60%ZpStmvkA31 z7^6-T?i$X7=PtQE1Fy<-^512+8O5?Da+*)fwFeU(JDqLOQNOkNeaPcjVR5M;VvE^i zM|gj~a!)4o{Pc*~uABt*yuKu8bo7s?R3}i^VQ0TyhfCO_$E}|$F@J@qgg-ZYJN>^A z#{Vg9xvKqk%Ks!L!dt{gb}BR_ZXr=h!g2$q>3E!7lJ&d#?BN#CNcjc@+ZZtPEc|H$5 z#;=OOp~F|VrhIw<@_r!eiA?iDdqu4lP$D5P5HHVm7v)3xXktoW7H|~pJBXD!cGq#4 z+v39??5kC|*C_JA?i)Rdbb-Oi=q6?W2d9e-f^l>JI=B;vEKfHyPBq6+=%<^RHtNbrO~?? zY_G7SbeKy?hFgIvoy5{RH1Ei2|DcBXmbdFJ`E|FkEd--PZ7quYv7DJA3!thy{QkCk z!dRO1uF?hQ!V%7#*?X$5J@%7nF@u+)iAQrH+M^ zB-aIISs^Lda_3f9OSzS&M!1WN@)i|KJ7P3nMzjskB72%G;IFu{;ylDz>EBd;*Em%@ zLSB}1PS+IGHaGes!r?k)8PxRLswU8O=`w#9h3z%L4sv~&EA5sk#lwPW#e?cE8@L7$ z&0@QQbk^DSJTS?q4atb1;DZJdKiFL|O7xZ9Y-u*}AP^(z3ssR7^lny0k&0~C6oqw{ z_N2zYl#73PYkG#dMR&`dv6j^8*?4`m^81>$yY||g^QHe2=~xMNLO#7x(^d!C+y3M_ zch;=QZ2ONianLk=oj44mtz*riHLd5Yh^4kca;Ogu{*tOD1_OBWBGTDARXn#)o2GVi zq!#Cwt)4HE8<$wn#P&;I`P^Z0w}i}Mz(q-^i!7Bn3;uP((Z2l^jw@f-1j=kmSuC`9 z4c0sR(6+zetbcP>Tqf&mtG!3xr0;vbC@As38E_tBAr|{#BX?>l9SO^t`^8DaVhFY?@q8}`$64`>u#gj2)6VClSK zhl!}t(FGxbdLl^;?bTctFItzy*Wxy~k^O;Cxl?mY;SQVb{ELg_ITC#1iVWYjr&Q9X z!>Uo-8z&r#se*Oz$nE}rJJAnc30}fm%>|<}YSy5L-*}dRNm-rb1b1W-I+ zDo4)p5Eg5wPYUU#X)WhHv~ID!FS_VCIx!k-)Mi;1n;-$?PYeA)w=pvgk*t<02C+mx z#q!%Z_oTB97PMyhy8jIt4+?)JG7WG68W6VD@xSwm2Yn_xDj50`7?zllXEUPjH^xZO z;S%ju__bFs-@y1vWWmmVxl;7p@vFD%@6dpBDWb8~{r$IE;kF%#-#%baN*Dg3#*ai; ztPK!M$l!k~=Tf-z@aE?3c|`&l0ekYTT{0Re!YewSY<^Nysk!J0h2wE83>go1WkXGi zOiX;**G{jRcGo*YnCeR@+|8+7l?pc`T^21$#P98BeCWU?{X_^ZC;1t!7pH*<>tfl_K}t@N+W`S1>Z zMhTvxdR*<<2=h?68yOvTY*0y8@H#Q=FyRP~tdL9e*KG>^Owq{#olTYF>lPi=68;-JgW%k%pqW` z&iFFZY-4uc1=!5oH$dm+r^~=LlO5e!T>Job1&hT}sDL)+B>dA8NfZ7k^2TLk|GFmw zD;?UZ7d!E@0i}MaM}+<2FjuB!60_N4V-0JXPAgRq^q1@AO3Qt?zS2-`S@Xka6<^}- zPqR9mtm{$%nvHI)*0zLi!iiz5s3uoi4zoEwOatT58fECfYw9;vdI25rEP3y|9*Ow! zOhNEhk%Ar929(M(v75Ke4DxSXm+iBuXsfLkd+sK4d#pNUXsB$(l@19G*BXcvcr3>J z0K0P|=*PPc$NznXf7l8qi)w39@PLK~nfzhfsyHM829=U_$FkP%&5!2EBAJgT>z%Se zxmNQIwKJ1T8a`==GTd0O2{1_Z7H{0>h@AhBC@l%abx#NnE5N(pn|A(6#M6)!MG2QBQ;69VsN0A~VH zXnNB{FPkqwt`)wjc*iZz!t?-b%kOR7`%wyy+h$*euX7bBp5q@hYb<9sOcUmMvfx2Z zZBhyJ{)#l`R-`$W(Y{{*yxPTJVZg_E1>GH6NB6}Mok8ez=TYZt)*r9uEEQRYkj3te zt+~CpU(72BOlSaSi#8ftbyZf&+?CX$6h0*Mb+84j=E;J-UsOBgn3{Cd*^nL%&4u^{ zU!E+n1LZFZ(=Np$A{>L#6>9O4fltGV`Deqv9?|`~w-@lmAPFW(OWndWrrkH`tPo9^ zdVP*y9XPL8fvsKn$I7Ih#h9h{E+bM%%oZ|c!v!vpB!GBXTHxB`c@h%9yt$aAKgrn- zu)q;(C)(SkH$P#_-TuT#35q1SetME+vTv11sU*qYdVtj#hDxo=8Z{Ot8Op4JH8aq~ zI%xfe6Uo|f?s%4~*S%p6zomLc`KW5n74mMtfHf5LgWEI2MKhc<$KaMV!UeHbliLtu z+nNem(N+rqF0E0dWiD&FjSf+s4&y6%&F8*$8jl-$ZowDpy`A>1n=i(S-C2-0Eigb9 z&e6_WaJ4x!6r5Bj>xIO24@%5mx5-U?A90&=SbqW38kKl%RIEdX1`sEX-Vm z^)kwHu+(01;V|H^2(N~D%LTw?lk1Blv7S%?0G+!kWcc|-o_AS3M?G)ej1eCZSBur4 zE02&Sq`8uWL~g4Q7ps*49u;Y;Qb${yg$aaRP5LESTdWuPQq4+E` zyuwY}wBu$VosA;1L=O}eK3d;}ShDggJ9C|w4=*^o-4DAqP~qSRp1t|LLq-uj-82^Y zPH6fCxi>l;humRom);YS`*mKWqADMh_}Lx9(PVh50{>)w7n*50nz4g3-Bhl}(|#+o z)f3^BRMPD#ok-!Kh{Wr37>u*x`O12s+8#z(*wG!hUXJevE&Ph30lt&)9dd^;1x3#* z-HOD9b<5#wpL%m0w&6hN8jH8f|E63mbpmb)K?$h=W{FZdP5|z7k&0;D2&u%b(Yg4rJ9`V2pYrPm$x%rA4FbV#HS|u#{}MIxsKYLfVCHyo!HT2 z6B%_Qv_F8s(pk&Q>Gdndt&*~_?H0?&|0$7A9GTYOKw)OAJn;YJLy=&}JqPu_@a&(X zvXfP2_E?6?V(8#BxZ$_o_z?T{a9L(8E;bs!%Vw$%=V-AyZ?dfr`8+D1#e1_)gqjmil2g^NQsT!Bd>-DkpM^Za5$*ibEN!X=Z97BlSLFP-xVTbl8xsxd z)tK0T!^6kgwQEB>XT-`ZrBaPygz5SD`NZf}PuJjzMf!&B5I7uia`GvIjW1Nx?zF60 z9X#IKySwVqqL)YWRlRr;@zu;hH2x_Tvqi(1?o23$#hL*UbY#VQY4O!vSGBNvVyJukvj z$m!Sf%d-p}`>|UR+B?;&w1iNzP*1iLff_=kOud|R&70vv13}{ZH?HM(;Ev>x|O3rqW61R zykgzX+TF<{nY?e7cF$#@F9bp^teBlxwG&QPOl#TRCbjsY9WBr2UUZH*C+dL z{A>FA7cr3>|9S-ldD8n!-;V%0rd7zhtp{F!o8U#ezp&A|#gS(gaCC z`Kz@vVj>;irPi9AFANtD3>$$G-vM1{3SuvFBd{|d4_2!JBY@R(& zKM>_AvRSJs!H)o+G$i2{q+DN-vGGM+#|`Ujy74T)`cZQ8m)`grg|>>*-xWDoNMA2g zvM%_pPl+%}23B@GT$^@`!KWp>#?QZd{O;XmZ|7}mKoJdD>AKGU#p{1ii5-=?kmD(X z@M(XI&*0`=+!ikqJB)gXGnw~QY|w@Dv@h^FOSjGELr9^`IY(&|M^ZL7Zcz9+cYb(> zMgVAIV*|4U_vK5y{y+ETmu+r1?nK{cZbSJ4`ux25#p&TT5W#ovI>uM{d&RUQKrx6S zI1E2`Zn(>iVE7rGA(cU@Uo%WGjnlTa=5l9vJQOIC7xw?L^_Ed>MqRru65QR3Lvbrm z9E!WUOL2F1in~K0xVyU)r?@*5cbDKN-?#U><(%_3`SFaAjI7Kx=XKrFO4OAMVj#j3 zzDR{{fd&l??T*8$nyHz(`X{(&;avS&L`bOyDRA(?frO@gG+wPFjh$Zm#`U^R1@0mscW0 zad9H|XbD2PvTxG6_$}p3dQwv3@zsLg-xAWQA7Qsk{?&UnGn$7zunNBe)zrJ*MwK<0m(E&vvm= zA2J>F{UynyT3#lj)@P~rY})^FZ%@X3nb&K%=9^9YuvZSRTa1~^a)w;*>JT&faHC#zhC{4s`1hLr~Ul%M_C_jkeZ@z0F?T;XTJH++VOS)DKEfP zI9A30l>1Q?OE;VGr4fQI6XBk(w7~a-zT`*I(Pg|iclgI&)o>6aQ>={oS)tD6{@FLIm3mqj@_O=!6@s|mSa69RhuHjOGiui@A6ka9{;Eg{pN@n)&yq8}W9Y87 zO9VkZ)&DNE|I&Z=yk|wdVR#+&KcC!m$kQYB*Z7-E)_a@#_2?gz71g=I@O`XHVx14t zBZ(YaUE*c=7O9ZqIUeP8S&}5R8lyhO7iwv(AuQ5Kp{U=gJg`t$W#wx1K&ZTZ2HdtY z9|N;;%ov~4VsE4J+s7I~83^r(e*BFYU*ebM^j%dfHD*-|CqSn3jdWjW%sEvGy#moJ zFk{-~SU|nQOna-6ehD`=cCYk#%8W1WkVM3(MRtbv;`6hw}keHenmD^p;HEr>}BLXc= zwz!%*z~Hs!?Q^#F7Op95+e z8<{9=uW_K*ec+cNw+J4V+g>x$?|^9;9JaOq7E1S2MH!p!Z#4pYyI5_9u_Ha_ z&}Ev-L?lq_1$Jk+WuA#$$=gS#IgS5|A17V>?>VuDf&yvje_s6W0kS6Vbz~4VtaEB! zT@KP+^Vz8FXrOy5Gf6pME(HOpxh!M9KNM9W?cVwb%|lL7u1+#ON0=9j7!0u0$Ei#S zx>*-;5J&>R;Vv4BP|BA@kDrQ$j`9pq+I`wPg%3na*(Se|=u(QDQlu$hZ7H(L)v8?W zgEH^EIOq@6o+{!72LUurEVSsRKz%VLdS|H|nZVKyxdMa|_IRkpOX1!=+3d_dilN`& z|1EX`>g2ev_pjndVZSkY3PN?xt-2 zPPpD`u{V8IFJxc@$DWG@sq0k&-XE4d|AqCMtVEoFc|sx-5SS53PNFrR$_nf4xurq1 zupQYSGc?-i1B;vL^@G2FKDDV`O=*nb;AVS2EorwTs|s8UiHkso+Xdohi9BOnNf8TV z3-+-t38Bo65_X3>@}I$Mhrz%PW&(F=kK<>uKI8uWTAzY_hI(FFwtr#>EO&=2eZ$wR zrYru3<+L-2QR;-R4Y5g-fH=A~LC5!x5NdBTwj0}%xnfVSAatQZY7{&L{BR{AkU!_oEoQPB$rJN?` zsK@ukr#>Sm&8-*r8Nh%Ui6Q#bfk7T>_^%LWW4wdt{{L0Ytg*^v^WfQy(&H@jFcESW z&7nPQrsvp^X$8$M_$yA!$Yp#db#*rOd(jO9zQ1P9i0DS#v}LjRq_fyA18tL4GE!a_ z@KSBb4g>`>8D^LMyU3A_Ibj&B`al`kST8P(`;`QSP;Bi=n*qKxD*Pg zp!17t{kU^zvL*_(kw6wbn#y5hYvA3s(Ln5SL0VG2_7Dh3u}vIb6U!r~vZCG^oe3997#>`k_^U9D?d zk}hC8ZTQgw#w+@tN^-3Td#!v8!@}&y=AUFHK+FJceU6B$xh*iyn|DgvoBik_G2?QfxW}`ImUY zZQh zVM3X=@K;a??JrY`ySwR{cmHTUTQX)5Q9L=Zx>vrShNmA&67AJ-dC355T|2BT zs2RI$*4TX3lU#Z=9M)5uYj=Bd8W`z5l1_<}uqf)9rvA+SrueYWTWubj1)9IWLP^2F z!5I?UQY^>J2@ZOHHJZqn)gyXYg)txmrHt@6N>@~0am+-$p^hLpVqDXO^l&NGP@lal z{Of3f(rGrsblUErQp}@3%&vZPKDq70(-ayz>UcO+_f4|nOk0#(C@l#PAYplXxXNI? zq4`$uF22&__v)@{>1{NZlh()dK=UlvB%w09CIP`uZD3Q~!N#7nQ-G~2L?Y-r=!=4q z*{7b`Gp(Y>@>4Z)x6rEb`X1UtWN%@58pfPnbdj#Q^3MPz8MVpt?SdhDxdP)KoCl|B zCbthj+(@RHB8!OOX$}^x9ww-Wt+eM028Qv6TH?E1C{G{BjE&`rnd@#*!ldwnXu zxgk*VY`K=3I#wZvS2?J#8N)kbR8p`WDM;~Rt%VZ;hm_^;Oj=r+)2MJ^Eg3U;!Xqg; z*~TB~Ii;9&vCRpq$tb{Kt}XF7ZohQ4{otv+Zq$M554c9w3pFT_7;3g7cv^cpC#x@< z-qPg0uHpisK(UN3sW2tSpFGhMN(O+JY_SpEf}UvW5042qRzZTuc68xvIn~VKffk*w^r|8`gFb&v_Cl3lyns4kNNy^HJ zi&&Ucb6XGdd-YJQ9xGl@OPa~+lOUOy5<>UqJXLNUgNBPwY>ShTJ!=UyF+W#RV?MB2 z_B!4d+)v9})755itt1Hz%(^GVU@h(&msJ6%!;>vyU-&;LEq?B&Gbj?qf+>LNn2y(6PzJZi%1u3L0oc-${nU$x*od zB2JZ{|Y-%~z*%frn7cdlaU}hC z`GW*{sk91|SDUA|8~Z+X5OwoJQB zf2Lk_OT%Wh{$C6N*yiGH4tx`fQkAgZi1}H$lmRUK=@Jl}wl>h}F90pjzKk`VAGLuU zGD&q2p}2usTcP$Wm|f`@bJlk+@H&&1%e~fQEuo~!_pO*k#>NF_XtNl;J&}r!h@#Ne zZ>?OE@BVUj(K%1-_*ih-!Mk7K;6KHm0Zp? zzK-WeRAfimUP)uH&+KB$oTw7j3e} zi+Q}zAu_G)LzOwr5VWD|M%DJ*zoA9hp)mhWy%J%iDGlY&`_6^6)7$69y%DkQkYhQv z!>g^MLwLxN5l{QY4^Xxf%N#U`e7>*WNwcbRs>AN4a?4ePplxsGbNGxmlg(HS_HydY zV462^gj?gI-{hYr4lTZwoO>C}GIcl-akuYYFstV_)<4~$z6yNQ`Aj=#f`v9aXtp=M z$LAx@^I1tY_YL_r_XR0aQnlMI%pkpC{_W8YQj<{iK>LrkFwYkr*s9ycdZYdyrW0<< z?=AuKWz6;LS9X0fc4esA~putFIE}gT#UJ5?`#kDiIsPb4*s=BQM0vPuCf;%i2@KJ zw&fS$KY5FfyFqc$XCC>`@O;IPoE8Y8qUH?9GOdvwfK_XBsVB0DL8>eCVRl>)p=m-G zCEroRffaV^61Fix!b6unngwBeRYh>`f>JyF4yge1Q7$YT zwsxxV&uRU~G}-FKXkuYnMv<6!v+DG|j9FO4__PY5MS{(yQ#_Hu?IjT47P4xm>mPK>R=fQZ?dus@Lcbc+L(~ zj2FDY{-GiEuf2CGo+yKOrO67*CN)OD|>(0hiUFvss1pYEk zK{b!zU%{e{f0(Q(P)ccyS&SegG0OI77fPToma7~kQ~Di@r{W9w|6ZhoY3aP|8c33K z6WZL9K=ef%w=grq|E|@?2Thbb`Qa?%c0vq&Bc~#}nQ1OvaEitWuV*VhBvn6~ZoaG2 z-61F^tiB$d9r6i(M0d&N5r}NrPOSJ+#s1pW_viHKbQ+2kPc16R?_O?!U($~$`d!^r zV$2fieev$b+*ugsES)gqSBsd@@ZYr0M%?H)Yfh zi?{RTmGEK+d17QV{ZO>XUypUZHw$RGUSzoCUZT-$H#{+ z6kGT{zy$LqB1hbT);MjPCVf)qwfN*YTYfpHcHO_tAFq^C`h_;z`n~!F7Q3AiuNiPcJNz5Wb9Unv4pwhs+e}0wMu8 zGg>+~N#|Jl&xxb^unIlC7g$wjhAGri&J6{6q}CD#s`$Kq@w>yF%p-$3f9k+&csf8_ z;6oy1Oa118j-Op>C&ZlF0F&ey**?l(!0S#q(77|qV0CB&9M$F{Tzq5^&}FAKTE)cP^Sr1jI@GN_Cng`TK&F# z$QE&A=U?GO{8G0rw`$5C1xw&MLTmlUwz71M&C0cvxQ*G+r4a1*VrRzsi^V&H!!z z2C`alFs;Jvhj{U@vCe&K1Z`XC$_;S}o$}PeuL)^)<$(?ej*+rAwFWhwlrlAxfo#;i zzQgXFiv#(GBGNMAW~|D+9~e1bVspYhGJy5S>aqUz7_3M4nf#b7Y7%3JsZJi(^7soa zwcWC}$E{lF*l~&!JrbV7u(m>72oJK0!dqy>nvyQ8{Q(p&&0mc2s$Le)R5+s`c0zpW ztnXyH2p-w_qrCF`!z9Y~w9y_a7A57O`WO6b#|;3#+pz5(NqHhBpfm4Nm2$58>}|(l zM4c5dE7EGrFHs=_=~XhzB@TEkcNQUfI8O&UJGl87)WBEgL{lEAd_)bNcxTJwP4tIu zU!~bXev^4jR$6zqr1`zXv}PP0i?}?iVu+@)#iWsC@vx{|TUipdTD{F&d7cqz0~b%B z#r(N?f#|E&_p#AwK85W`={Sy;GXE0eMV5PCI)g4ig=U#_T`H}qX(>X(?%OVA^NIiQ z-JIInOKyD=^hksJ>R)-n2bXoHRrAI_l_;Q;@#mmiFO^rHr<~Raz<^}j4@afEplKMB z#otqI0r-t6XvtTRc7RKne20e$6#m1n2CvI!ZHa=it-b1kQz-xbNkARJ3U0DqN^Cd| zXn~peUoL-6aRX)%IOEk~9ASdm_w0MNO?ejNa59nD$p)H=lmSoi7P66%2UBFDB+RenW{F`F7Z8&7Jz4+vH!t zm6XDfcWux8?O%Le*RNQGXFzC&lboh7m&%!$X5Xt&x92J)O8tV z)#7R!8m=cZznu0z)NUWypfo(XmQWpgc>ZS`1X#-Y`(Fj6{;=?6d=6gKI_8w(f8bt_ zAz0Nz_Ep(Y86%VdDQ-4LORpQtMNP2}VN;VL;TL;!XxZ4|)MStK;&d<8%j|1H-NmKk ztcYYDlE3>DXik4gYpcm?itA?8dY63(Q7GR@!o0-!4X;fStn1K|u1+E{EeL)7n@Q)} z(U0C-YF|d}4rKEDGskmFW=vI%8KyF7XhhMniG>X<`yu$Q;K)s&?+qt=%gA0N?PqY0 z+zWbi9W7RRVPPSg->}@<(SxQ}+^y%$)ii70#umOb&hci8T{boJgkjSPCd4mf!a$6H za1O67@{mW`gi)~&MWI(@((X@Y`@)xD6t(q}mHI;c4$Pr+M*U#8(ZLdSqie@t6)1U5 z8Avp`aNB~p6gAftRyL7-;8wR!fkph6>td*dlehWdjY`vK1N`5Vl*OBhouv&&@vTjD z-Wx!Mm72g@hE>TLe81aQoX)2=_hM)uI|s+j5T5Fo7U+9TyM5JIA`*7~J|nfG6)`q) z-dbCMek!OCK*uIHo%0?`;QsHAxLN3z`{>vzs`r!>HB~c=y8cRUPMUZShMMXkro3AH z8s$*haTz{Tx}IF{LsrwDZJ=MUQRF{yC_%c+gT`rEAPgg9!0W5fOsOI%O~yBhguuWo zij<5MtqF>OD|+^yvf|=FVvwaB?k6UvLg|%1cA~?g)5&9OB~^S?eq;nD@BmoPX}?nd z_r#4*?4GD?R0@BgpwBe1g+#l>;%Gfwnf)326)`Dg`X?sW3g_5z!9@Wgl9-pe*pu7( zySh`xPJvTXGUTFX+@uu!V#XTQbiNsR`9O-X$!`c^P6D;m{jQ{mlu#<4tIc%zpWWDl zgF~ihtCR<$3oC09%>vEpeg!e%a3qDPF>YPTqC!nJ^W*+3mT*C(MM=qnd9|3?gVv1b z;b)+^$3}wMdZu{09nEbBa&LpbA{|_|&?UZ{fBU|0BEYKZSL^{6YZfG$4TH>s5?;^; z*IL|Up-jhl5SW7ZxNta-Qr=)vB*@# z1I|1l{b4p#q0(}ZRCs+q99SsNcIdjU@4MShhHuiaX>mEI;|?2p%MIa=DQUY-mGtQ^ z#b93dD7GmmxQ)l}SLO0}hC{1WmMpX(lf5&(tLAq>X1qLHn)?Y$qd`fCCu1UWP5{X>N+#sKgQp{ebUP(=TejpETeoM5j9Qb#3W@95xoyYiMPnYQ} zsyx{U1(t{>_chYlV;0hz%sr;vHlLJ_X1E~F#lO~plLJC280yT1tnbe^`mu8f9lL2w z5QF^hRU_N~0o?7#q{k>KYBk8{My~szV~>Z$3tWhyu;nvfaF(icWDI9nV>bKLez-U-ma`DfBsI#(={0711ps#xU8pb`s?LCT}`3sm`zml%JZlaXT9 zmr}kxA(@`HgfG97jvZ7~p^l$-@K*W!@abF~RtqL#U81a-{P3|#j#LwML(!M#9w9#< z)vPL_v?`?Do={4+ z3NJ*oc&Z?AdW~P99L8^C(jo?Ce>{a`uQf*T zovnmD1?fwjbZdUwRm}J>B)o=6KBrB$$hIx7 zJCp^R4NNqJju86E96NrbeOk9fG@)mx$og5ZrTxn4Icfwo`4&4P;g6o~{qpRWl`f)A zzP#pzhG1Ec+1C>ZF%Edq+~-@+QL#~_i8CD{M+!; z;URr^mJ}T4;pI#;{Av(l10|VPY>2c_riJ2zW??M8t7E%Sk5HZ&IZ7Q-4)`3~)Sq$i zq0^;Tpy-qRKr2=5wKiR-oyYfsuR^q6S^7gur`?I(;wB&%_l7)j7ni3|Zk=9HGc$co zk_<$;s)$vpRZvB?o5jl^g3HH#=k|#=GnGf~r?lA`V!Ko=r%G*qR`lDQcv3MdCG_)R ziLsYdk``v|4^unkO9|tgt-LV+^(J~c^U*AH!szSXOYrqB0hkxXi=A;U-Yd=;yzyCh zGXoHx-!ik>u{f3#M*cc|ipA3lDE+?beY?7wnV`k5CTbF0{uN{ij#_?xSO9-Qi=LCy z(}fi(Uv5`QqJGln$~`P^BZY@jdirI9onXc8wd2(*h2mR#5{8fUGI6 z+>|r@D8(x$pz85LaVOnA3JGt<74Y&=Z>itscz#P5^ZStT)-woc|KNNmFi4cudO=EX zn@`(T>7o1fwD)>S_ftf_mxdU6h>_Xx)eh@Iz%+J;JF!4I-wJV01n75*A(K)YXY=b` z92{iA7IOtHBxLB54!_Tvy&vV!`%psSy)2N79J-z;XjJ~AOsmRyNT%y^*22~l)`UxP ziI*)7%v&)!7*$V-f!*F67D#lQ;z}xcUB-C?PDHW-IQD zpbOWg8uM_-wbN;y2KIHCD1(BT9&@0k9kq4KnPZI&L%%;D$g-%Z{&yr@bb7ULt-XHP z+CqBJJ{h~k3qD^tra~OYO$k5N;2C?6Xa#|KStvyd56o(++%D00_*Iz6&aU$ZX3qlAn?C-pln}t8mRrzXe7^2z6}BX&hD)u64|okkGg{eA$S#y8^UV>)h*>Z6Jw|0G27Z|jb58JhWb4P~Dcss@uG z`YOHVsJuWksgnzDnqe@8ypxvGZp$OjznyW|I!INN}y>+GrKn z%M?1fs;)#K6i8&vl1X-VlM^!CAp8MBZm6i=U|I>ypfpw$b`micT4?M!U?_Mf&Sqw{ zraN(SVsmjpXqIb$$?qS76HPRXzt6{JS43tM9oKQyMk*ysH1TX|A@Y14&DXUExazn& z+%7F4m}7|`f3?i8wF~-Ea*a?I_;2!->6X%1E9pz`$%)!6zCJGK1DY-eM*ICTum`CiXkMlLWW*5_q3jXv zn@ue`>NB~~EKP)ylg(`76y**dk?9>^@ybWp4ttS1dHFKh60!T2K@Cmp4f8|oV3bDDfjriN>nhRHD1i_F1e zkSSRc-)Vqoj2G1}sTJAup3gVw&)GCYPMcxKN$Egqax?f%Fb=s4uZbH zARIjc^p7?f1+-Ks$qlu-w*JZz(*JaR4xQFj5X#{27)$@A9qD%B&^nj&@>+bUO@BnB z3}7!Vws7n+W6M8dRqx@i7J~mqhpuNz!wPb;MbOL0=t8L!9jNn_52aS*x~`O@Id`^| z6nx!>Bto+4d@=_084OowWFtm-U!L@Q%|QRsj&R0hy9*MG;cc#<%##*fTjd-XBlEEx zpW1{qQ+bWQZC~iMz(Xe5*v|b~L7AJ^ATF!1<~x#nM({$Wg&Qno*XIUsf0%cENQjcGZ_RNQJS80JDoqMITA?Es8ePuc19Tad$*<}IG=;q zR9Q3l93XqLIPoaq9*uu6r@F&y%<$?-msz(Sp3Rp|?+D)Q=$7&>zb{ipRPgzC309Nd zW{~wHlQB|XMg2Cr`E%fTdm=g8sHrGBhy#+g`Jr!UEFMbQB6yg!bNC9Ry0*g0Ee-}% zwpg$#LNV;gH0-=CCY{6LZDr(`I0q7j& z6J%q5Hj8L$!tg$BAzo(Fm-0lQ4MeH8l2!FoFFAMSX@T+*TE{ZrH8KNj9&-W`*i@vW z;#r0()bI4`3*0sCL$ry~U!P?V2j_dT;;d8!55Qxp3jH>0+VK=R*+6-01Fs8C%*%MFiT0y$GpgjF>7m1nwm76m4H)n|IK+HeqC~W;dacr3Vx;JhN^%Thx@wR zYQAJ?ncH?H5KZU<+fXqZ9LEwI6IwwstqK%V1o!4GZkMGglQBox*qtepTCaqiXlfL@ zoX)9(6fdXpIJ4g zoAXGLaYq#P7W_S1-{HtRm-C0Me&j}_ey_Zzs>J#5eJ>Z#r*fi2;C<;4qa%L&8p)@- z85mUklA)8h#iTord80qUPIb8&6(dULo|`m;L_7R!^?tvOspqz{F9>*Xm3%EBLGV5e zG;b#Qw~)ziyWTnvW1{m($X}+W-Ys|GVz;a%;QIpazJJw!A@3j&E+Hb9buWyHlVPG# zfS&dx%B1+Ou_G3ggYFZJXE_~x3bT!7u2+QhHLYUCRoO2Kx0F(ya7#O=bl>Um9hgEr8!T~aY_|_^C|>t(5Y4GO$O?C_j)O<%G*V6 z;l#H)$zo)85YWb5N^V-C%+`95x;m_qaF*p2C;9AtZ9ucwLpH=e_?sq5La$P8M!Xdr zyIzQn*@_tL;SWa|uT!Nwpt#LqxZ&}%pPBqsvxCBJ9%a%uyRgQ>?lC=T>4U@95U)yp zwVprcSHhlzBUe;=CWRmTO1V@|f^#??AKOY?d9A z>?q|w$Y&348~=Sb2JKf8VUaOrihG0w?PQ1>aW8Du)-w1uQHG`%_S>`W{{d_+S*56{Jn`u=Py$ zhxO48`2hA)KcC8JKW&eQ-8L=nPd5La&b{i?%TE%p9Hcix=lma#BRH#;r6G_3*LQID z0tuhHYVg4#+FU+{xZe3d<}e*Y`4>E|wWpW%Z{0IKdHiAx=3pfriInKPjqF{$J?kkl zr4(N+dYp01x(%r3B(WcaIGs3F1ewQ}8@TVU_q;@Wc;qv+f=KV;Tu!LY|8uYvB=if0 zct;iED)}y$>Hi&CMhXiW96Ujh8;xJV7X2lSXKG+P(E{U;fxDrT$8Ch^7$}7Ipr-R* zQE1rsDG4_=IMwSogU-;v!CUtyQALU?CDdG>f6_4|9BaXSCZfu_?HQ|o2y8!7B5|Jw z;q^Iu;eVkKjZ4S8a6IW|$ zU|QW2a`?V|!*1PlV`-T4F#0pux|=BZMWQloG86gk4m{0EmX0)M!7<;(k5LZxbDraJ zDS+QNq`#a2ek8eaWul%WV7TN41PZO5>kLd!$8#n8SgG|eoX&kq5<1_yTPKAC-5)er z{nzyTpLQWLeHu&jxoG=$ukY#09!Z8!l{l`#CmyS}lIuc)A4Ns^8ce!cJ8`5Ry9GuD z{h?nULW1vHsI3^a8?XaD{zgkhZHJN%NaP7=dv~%Y780aR?>lyCDJPBLvTsL8-*gVi z*7=@z;PdY4@W1tS4{MeAJGU3`g16L%R)RC$Use$|*l)P_K|9c9^>+4lOe38% zn{zl?GGt29yl};8YRjdlI3a5sqbnH`@x>RJWD-R)ZWyEcJkaY+fx-sh*=VMm$`YoL zMraj>V^|-L0f3^J%&3$JXyJCc&;VhU$!>OCgfayGwm8u)CA}_s9ZCxOcw%*gQ6{$& z+s1^jf{zn@L09f7+#=b^oP+OJWjZ}57uWB}`<46VuB}=c7WZ_KGvn2jDx!dJSE;sCWib!ZPaZ{bYURPq;=^p*^?Zysuy5((c(u7vpfeS}%*YuLl8&uP*AAOi zE=rLE{t!Ju?5csJoNw%$IBKPO9iHNjJff;w;3-wB$c(c57HmKdL&(|bg0T46`yd!) z6z1M>8PvavsGbHaqmo9Tid>xZ{k+A(@^Qzy$HoH&F4}OTGpghGdAoClF|)K(fA#xk z;_!K3$k04^hhM6JaYfKVJ=zgE}orq7rA> zEQO%)KJlXtYep3bI_guDQHj}T%Y^(uZ>XE%IIM&9Exjsb*W$(c`*=C|?HZVEH4*ZF zu)vUK4!(Ww9G&TEVIggnc*vcnc|v1K3{jJnxp6e~$BQws>zrk6^pQhi!EkL5V@==a zVT!H*Vah7?$|+ta=^nG?f^S-km`3DDz7UOm&_7U9hgr$dxJ*c$FdFMd(d9_X%emly zr|Bj@MXCfxzd@QQqB77h+d%&>!A(A6;ohy`7QfI)i)=92V)0?38i;7Uyfz#rY}mDE zzK27MrIN!Si@tp=;x`+zCllHF|LKaJ;3g;@jYA5O40Ue;ac}=%UgTIw8)m_I+f}^+g>_KXJ>kZ6-T1Y__ogUpJ-HA-Vs> z9)?sXa)HycvN-cI?)xZ5rR0a-srW%y$xhkI{ZA_U94e`^YZ_6TcV!J6ZilV-oNX*% z?OxOo=BSEFlumIw@RZd#`?D+7%f;O2e&t5*bxZN!D$Ul1ZOTvl5rRJF%QuyRnVCh< zPT{n?w0B>i|M6CJCEf36)`A`0UZc;sEVVQ3ApT3QbM5_eg@U9%+ihDtv1da%X|9Ej z>GFU7RHG0=MYA?pGnw9$Rri&~Sv2B3oAFWDLf%+kIrJ zy}y4=3w}U&Z27U!V1O2ioUmwOf%VNvhqJw!%G+(HU_}7+3r`dnT`>CN89e8>a@md9 zUc5x*Bk3f6H%1Hm*X{8k8n*NCUtyt+Oe_5IgdM-fg`-#Ga*HO-6 z=4FUYtk`Wtl`S-i)kOF62kqB?%CPYpEYA5Uo_@z zU@@-Y-T@wzV%}F8MvT=d^+yF9+fy1x63fHK&krS=#$5Pm!8IKJB@Ba7f-p~dpPUd$ zg=|U32@dPlV(NFKLr+fp4M6UZnjj(RCbf?yZyQVwcfG+<^v=CU{##CC(tXzBlY(M) z_(qu+nNp-XC;1hJVKd}YWA^=(5)$|b+=!OQg*;yBVhPTM%}@0RWUF=9z=?hs`xhan z6LL>kUbd?|+11d6(_40|TynIQulhQ>+B&TrsDe(Y`BY3l?=My)K~7-|twA*zE_uWL zIkM#z_|vUu(-g+1Hcv%N+^WFjO22BwRBrKpi>upi+?;Ks zg}jK8a{bdSkOK%LkA!*W#02soi1+9o_IMm_WqK$CnOgaL`4}(d6HStToOK0s#EWtF z8d#p3qF7)CK7L{Dd%1{=ICM&$~wQ)2iWh zp>-}h4Zf6LFO;Cpp7*5DuSlboB;yf6S(HXRUGC!Zl|rOfd@4?MwHp_xBf23#&?4qQ zOTIlUP|UISEV+X|{x=^c2Hxwez5NX%*u99%jW+(D7R<%5(qdT&2R)w}>v~z7`|fgmvM2*u0I$U&tw=P_hH1D|l+0k#AUg4PKV-oN{@GS9&9>Q0Y4Is_A@Qj` zq8r0}x09DHNDJhfQD3b=hY_h5m#^xmllnT8fuRjGvFrWqye|A3pN#Py^#wL5-T}Vu z>_1dA$f;c@RgOVw`L;hrtvgo)KWlsImA7ODX)$<1M1QcdI+6`Iqk>6G4zXE-Zf{3{ znj8WaeR>1Jv-kV?Y1h&P9YWTWGe=0O%*V6&zX_@Cb6zeuk-c0aw3xtS=0mkodgmwN zK$i<^%N@1p{j+cWDwnznSDn(|Fueq5pTPdh4fzJ!hkH_+{^U(+<5Z#4-05QF4cO$O z2rmeY-N??YkK2M&m$p>d@*q8<4s`z5f;yiV3zT#T=z5y6ITrcT0e|tR*OGg)?aN2t z(Dgw$u3iaOy0%Cj#7^=zVei>?*?U)^hp6%PG0%Nb1|V=%81~*HgaK3&i4>fo!La?) z{gmdJdHru-`n{)CP%J0deFoq)jrJ6Ti#KscBH(}T? z=>uH#pg-}>AxXkjbufgz$D3Q7KD778Yhw|9*n)8noj8yTQ2*m`Uu6J{yQ<0sgLdaw zFBJCncIM)JQGx&Cefw4TH@gT$K-XUsDsnm)1pt~2J9A$T<_%QviWJdfF$WU@=Emgb zJ}y-;Cf({%UPZ=&oQ!q<-*Xo~`$}!(!**tLpj4XYTYGwJ;os0s`w`ZPgbqhGAP<1} zyDNMrLS6d!@sXi#7^0pfKL6K*XmUSf5fM%y;l*!3W=liESz*a@dSHvamy{O+P$TXv z84N4NI`=1PgAZUfTM!-rT@j7zn=JK~AvPmy;>+l*Tz;|Xv2|z?ZI~FLD4WJeZuz0y zWV=p)Cf9}p)@~&9d0T!{K@0_Udy!O9P~L1Hv6yUTspIqdVuQ`7pHPe4wYi|dGaPg& zh>Xon4@w>{4t3dO6Us3x=k|nknW3ly0{sl}=gsHW6AiU=09S>{T>szYk&&-MR%{Y` zow9T!hCsgeqrwa@${B#Pixng=EhtONp7wefFvGa9Xk;S8%n-F%+$UhZF+rqMY0eb< zaYjgy3(vz{QAQHchTUKSv*q{7cFR~0MjL4lWw{~^hgTW$djOY3J8DeTzYj4f zP9mPf7(1`iJ%5}wGDMtCg(-?0f!6isSHbtIbjL!>-GQg==tN3M^p!)s6wwU3^TAT_ z{(pcVa0X1vhb7(&p>tIERG1VF20|*n+Agcv&rmP>hx08MK`N9*+I)-kN8%4Z9Gv7N z(5kj*8^)N@AZemAB3?O~*!|+GWftMyT;IKd_&+ zC6BV0NuZI@YXsM0a?0Ez#ugZPMeO8dxt9-SS8zzyU^29hpNlQtJm$^uJ+e_DnPzhk zRM0#;XyokTemE~HzaKH{$plY0fs(0~YBfE2&LVuDQm#HQ0gno3-Hbufo ztEaMrO2sLu09E+WZngPMR)h^KTq>$HMVQC9U2qxuD~?ghz+oy9a42H0?smv@a&YKh zr69iY+#h?XMK4z!#a)UxW$2ca*bh~$x?G=4v{y~@6v|Y1{HlzO)-LNo54Cv{kCU_N za*!=@{-i+YZr$wnSSNG6TACc(RSCxd(Z!w4$fmo(1<1f+rY0VjA-vHpbOH&!E4NM7nX$|K`R$pf+udsFrbb=x3JQ5I7ZW6Ug(UJyYt1)?Bk{+;6sJNi~sGM z;cMRdC=pejTn1|p+0)v0g@Rvt`K~dQUr@3_Xi`+!(Ncwq7MJzt9Ue z4uWBju0e&EX^^@8k6tnOY#VKUIVMC33NjSNR$M)w_Lw>?R+7s#;WKGeqz8s69Ep@| zfqO28Q>HaVFy2p>@{$c)jxKHoZ+PZ4l*=sb$KzJJomZvgjNkEDdS8;rd&dx@cV)-{ zEoemSQJmk+e<#r@{I=AqQgo^*dN~zpFOtUp3FD%ICLl9{cnG)kJYp(NDTr}i+>+L4 z3b!lmi+Lht?-cUYom#TQeBva{0+>t$YDNcAMHIh{J16D(zny3zI#T7yhPO=MdHl%X zZAS4l0Km6b0*f-j4_9QRYkqTE&_IR9|9m+K@jP99pR z-S_7?ui{o_qcORO`*7Y;yE9dFLW*X^x%w}8o~=e-f6@VhL*J)V-jJI~$-Hn6?r$}c zaQq{PD_Pk==$Mh1jk}2r9AAoM(?kgTahfB_nr@VkzgXU2L#?CyXoPjeC}L24+|sMs zAPj4(KC5H1iS-iFk5Y2Wh*R@XxF~U%vr1vnh74E4%k$ebI9@4$TjR8Xb|^Kk(xkIp zm!&X<-JDJOQAaQIg*mQyw%Zu4$!3GFhk2_^C-LI>oQ~=zjj7CaEBq>v{79Mb#!{3Q z88@kmbSLV*>E_aRfCH-JS`g!cYgts98$m#a`g5E2?9CWW-A`IUrtL0dCSszU8Uw7I z`4u>vzbOMfAuw9qJW(TBk&3PFawPS{$c}^|k&t_{ae$T%b!)aO7v#I$wB7X3=kIQg zq^P7Ud8T+n6;Xs*_8w8oDji~03uStwlQ}whvAPVNoVNC(is`%)v&ka~_0cBE+Szry zc1-TLX7dO(v^jaiQe7QcjfSVl0U$m!uS#^F*eQmU#`6^Imw*YqGTmfc&_@ABd5pINSR4;ZmL{nwHV`nn}GT2lrY#6oyxvQ zxI6YboR1P#EavOx=Ju@rMb}1$jqR-Nw~2am8Z0Fb`K3vCKZ(bt&20`6E{mwnI8Ec^ z>s5dhMj&5iNK=gC9p4AC z+D)=;a5Jx$i6Zl-BTur+rnNC3fV9}J-$qD{fzRLwfi=s^OT>Meqa}FlNs%RQ*^m<# z!?wmQoIc$9$#!HC$`7YL52?|?4$Acbv6lxBjg{~SfLSlhaQ^%$2&G{Akm>e#X~sJr zWGmN(6;+IZUH|#R^+M#U8dK1(nW@=79TSo7WP_O#4f%FSq- zi_Ji(0!g6wP$CXA_haKNYX!&vP8)skz!1ys;_2){&^?92f;+?QTrIE|sRJB{$5{TH zO$?;%D=s>dB6_)D{21t~HU@hEGDQ7KlB_3);P5$aYoHP9Q6sJz`Cn0zy8CuS+Tu6UI25)Q`~GDNFd?^+Itb9XZ1H?c@nBr6!M6(IKp z>Js4#qsX2AB9X5QkYJ}!6Ui&!y1~_V7&G463 z;N@qs)Pl0#xH2|FZI{;Lv*rE;l%d6PyfIE<=Zhydw!p(q!UFN%rfPl3Bnw-ul7jo% zq~1j`zxt$3l8g5jK03#!*0N7&_iEDY$6Po2sYb4YHGMQ%#W*Q3ZO5m(y$|Yc4J5^- zh_fv#=B#^#OVGim-O;)|@bV{ScCI(KfGf*Fu5l@DygqAPfmG86OX4xPu(L*FAr&ZX zr3%et2Gf^f^K_wYJ-i(99=USaPq9T*lXu0K?vEKIKWb(ZLg6$BfO&B}3(x+d&~RP@F~oOVZS|ihfkU{VJ2D}wgS zuDYm*<~0>!rtii`|8jE6IYtk9_zG^-(-ZEwkf%&@SgvJH6myc>>z$mNpV>>FFtZOU5H2^o5!<>IUz}!+26!UnysShF(peFio zzQW!SoeXzL89~n^6m{3DFhd8@lJlQUtowf7eH7h}!yI}VNV2No;@2X&GFiIjvUfZ; zO^e3{aV2#=R66}!SxUd*l-S=oOv!(~8O8!>1*I7}F!;D#G`(nt0+0$@6B56i&=aR1 zzAE*N&K==V3Bho=%$6z~_*xIv&kAt`yK`R;jtN2iq`T)Dt|z?ssEx89_MC4LF!sb5 zeZQIbuFW1q$bRo=e=?tNKF$6kgPfH$?tE-ZRp_Di546$4*~|*W_{uc9h%gO?Bm$YW z``;YOz{&YmCz6@Kleto-Y>SeJy@Lz(3Vg)mh1Y~_G|;M7)DSFfVhOLz<@KI@Jt~WX z^WNQeM+m)J$&x>PUTjo2%cH*{w zKLbwM?sjFv?McG38bl`B$O1A5>B!wCP)4OyBa3d0PgiP@sU@{*Ff&8BYa2HrFzr!F zl$s%7^zn6rok;A><{={uh@!y(n4H*!?bLdOs)s`cMS3AQN@7hj0dpO`8yp4p`shE==rkY*M_P4>RP0=dW(IBjwJZI7I@nc+_z^a%&%?Cn z1=kXzIA2#mfRe%KJG;tOrb^;Fq4yCXzK5@%d`y^wQqh-p9)~vTz*(YF7oxBf0=kLA z$??cHbOv0?v6=lI`D?gmxHUtWxl?-!JXFa?L`kC&jIaghx;%&wa5-_=@n{bo->R1V zPFDcZjVxtGN}c)N=wXedrNEoQ)x^9RTWhrRc-b;b~``e6Ip0@d^Zs+&gaHRboPRSi* z)w$2LaS9$SJe<0dU695DgdXgnRc~@Kvdz~XF9_km+rDC9s)N9}(ey^WgCp{!RxSvDxb!95DI7f0VD ziYC>c-s40o1SX*o|RF15VE;4A`HWVFSy*#}} zE(6w%R9={mmt#8_=S|)4FYKXVBo;qNZEbCfBI&kg?C?alyWm=W-=0qGkoOkSfEWL~ zs;tjtkSGKX<`OH%u7+?t2$)4=HRUP(_+A=vP4xDXvV#Ak09l2*M%i@rq5(HzK{T*! z2lrUPrJ&oT5u1Q%?|FS8rw$2xYn3-)X5KSBu{j(+IPWJHPUSv8@Lo@P1pXuqirtpK zXMv=4FfV@W_&5R(uGbQIJfrq%Iju%Qln_WAsbp14W7k8XQ;WVQ0rUI79a91>8 z43{t%Npf*v{)x*g_fAA2QW0`yxmWA3B-0*-v~3<5TXQPf{(^Mm)0*LR_Qkmf_I1W; zaKhcWKQrD~jM02P+h;uQkmufScx^%$PH0FzB&s^c&Mw788ot{HEyc9P^%h#kQeYg0 zD}Hf`Ab^SLKTqV&hip03{VMi*n!HHxJJin*(V~MajO3G@xFqj9VMfdt+dmj^{j%-| zU=g#)8wMGE*JTxnYbYZR%SBQaXuG0T#fAl0?hfQM0bVPz-aMEHjP*YMNZp!gqjhyS z5hV>@$UH9Q4&HQ(_vRWK$}1^lqf!ueo0odpHK^q zzm;LLu@W^Z_)8_%YIw#SJ1V^N`Tl1@35WWVTuj2S5_e+z;VKkSU!Rqpup^0j%;nm%4RB=8oaptV8I} zKS@dclaoyS#{4_#_?YL!Q4HxksR6dMnmT4NH__e@@`Ii`Z;X?rb_C%>?7kP3p6(nA z&AYk|ItzXMx?4GYfWuz>q3$Qc6$uhI--~+BHYfYM64k$)gh%TDDoS)Fw7&tj34urp zr4mlu(#ZSl_AD2HE{Hf}Y2H4;N~OT_z0E|i`%DyL*D4IiFQnbLB}V@8pn1}zVNpt_f*l^3@?|i3=D@_Yw;fc z6aepgwErRX?i=Z;;-f}wZ)u>IwD-2Dd(mHGvs4@6|8Dk<@u~Y{y_x9w;oM}o0EaPe znZpanWNYh`&4EiY>y`FcF$?7ffgpcf+2>f=V2=GSwf+y24+dKsv`~EkkANJX{t{dA zlwQr@ZI@c6tM?!@EG+;1F+OB?!JWyOGzDYr!nDAC6MRIoia6%=BcQ6BiNcIi#r3A#39aonwaQVR= zwH-%d+7m2zOs@VAV2?sXMePxZ;)_@V@V7q>pEP-_s!}vqvxb0R4^>HRm*iV4-d@%k zWjH^h!0YjPBz-S27G=Vs)(WzXfI_D?1+NQzcW^T75c;*l(x%fg-dSQ?;qi<^$#24t zcTYP#)8c?dOXdP{k#sv^{e`xcSeon^8&i)=pr@P~mEuy*_Up_CD+FI`!NO-;MS)bJ zmwF8L)5{&lE)ghHAB&2ANa<_ljXT$m!L3u3@yrZQYu}+l@U%j2^eb3I42|ir=q*fK zbflJP!ezk9N4pwA+f8D{xH=-enIt1S2mt}q+HNMc#og7tK^>3yZpkN@f@2EX zKh6i(PQjU{3G{jw^ygvbhv^&_yB$mA7(45`1$x{)GwG{R|Kt;#$upqkzH0@%AY%-k zMg`Dg9|69RKJzrC@v#*>(>~kv{S-Xc@}q}h0N<-+VZ?6h){%5)-AOy+^XXMZyO#=c_qI(;LIxXz9;m?X${5^ZrHX)4U*6t4 ztFGfbxY6ZT0XCWiXzB?T6$erj68m>J5guee>GZ%~(h}YGzej;t(#!jOhw}L_#E9-l zma>-nk3o^d-S_D$&F^+;C~^j4+zRmgJtHclQ}H=kbM%V&ZgXnpO9?)Qv#S19nvsiI zrE;C_xuvH>$I_$e8T^rUuXmi8`Q;~#;%*NO#(T$z4=okuh#c}W9X)`uU2`Gx{?GpT zmE>|?Q7J*`zujy$TV;Qzhee@|!n}EPRBJaPTmerYhFyrWf@6b^@mpzO%O1iq?C|53 zZnkj|lh^H94+En?f>rAWhF^OfH+vmQ1CjAl?rV4iNMPZK`5jMb2Fy=Wcs0zkm!YK6TZG4hTnv2CT}{0`>qe{!j$AMqqoA`4fG^jt3|g=)ubBTwLsnmDrS)gl`4IqK35Kb%R*yfpqtN&E*J`kW9!w#Tt^ zEDktCwic23WXmJq&qA=n(sq0)9n!B`P4M=D#9E1+( zvWG`r7@exdR`y77b##OaFHDyGYd2W;@B?;$`kSL@rjvWgkXWP-Ilse4?v4TqQRe)| z_!V#ku8N45*e8pJxa(@|%i(N2Y>WMojGz=|Z7|tpqc?L%Nb2Q~m%u;)@(GjiAzaHw zaMG?Dc5k5(vvpE1$kzRt;wq#h7@*z$F*TsdX%skib!5QJ|D@fz6ZiJMG`C(;TMNH0 z%Le%K13H|ZE7$FOZ>}3c1;4d*1%g{Kq59kQT3U5_^TVsMW(Y{i+yqkAzrkdta0eS> zRy>?I=&CV7=z(}mhGm%eCG}3hLDBZB<(n(maY_Vq>Fmn4@qmgxp58NInoDekSSy;s zE~Ta>qlISxhmvCyO-9F70#MFA6;1MtH?c3R%K)94Je)tZkny*Ok(&=&6a`frFfWlC4u| zX$)GR;G+132rt3ArfVAg$YyCjNf`qEIxvrD+1ba;JB_R$wKgNaT!wXNs2j&GS9Z9Y z@G!o(avg>!8dLL^Bk7Di2z}Y%-#OnO4zMK{?DO>bj3ptzH|ioinbKS4J^yX1XU7=Q z>H0xH?`B@6WdYn;R*aky$Ei5$k{DZoZXf%6wa|P?Zd0O_s@xAOq02N02wR6iObjFq zIIyYEfz_8l5~5(JsUTGoM@WX+Ei%?s8HD1fL=?+BYR}=9%T-tMEk4esgfHP=|Mtj0 z*7W;A+jmc1HL8AaC1Ii|B+nsqBE?o_Sy?Quzv9x`sa=r8fpoF3DIs0c9JJU3|BnU^KO00*n=`6T45AlQ>IS zEmQ?Qdx_^q^=v&1(D17J590a9Jb;x8XN*EIpf+Z* z%S4XWrvsF#4ibhYAFJ2n+R&8I`$02wN1pPKZzr|V0BPu6++wm?_!M|1ElL&%&-G^p z?_tHNvyb}Y3GJ-)wtIw;H_URa<%?5M@dl`8KnEo8>tWvc@-OUU>~AWrZ3NL0Gwegf z&FQ(c+>Y1d)L?b&VXimTw#(NWd-v;VNOPBrumk~&%z}xeFx^kCdbh@@J8^_Q!-=@Y zefu@HmzWcztd!thGGdQgbdlqlI108(%&L6v&BV(~>$bs`L81NgtH$K&7FeMC=To(=kD4~=Y8mq!rKf#m2M=RM# zq@+fM0KyU*Pnsz*o~={8t2T5m1&wBh5KumHlhm8x{3%y(A-xz53>`1mcl0cchpn$b zaWEvIF`}?mS|4AN1g?66N6(Q!{7?Sq%fW@gfugpCW65UF%Jw=MPcN(z%ZJ^B8$O%g z_!xb;j9!yPdngfoucqlIvb;V#0gdeJH_w}!dwBiL`NIkmyb?yWFX3@*w(|F@0fQd4 z5b(%aLcSX}zqXMscpr?bt=(fuqpmkc4#V$yq68>>Wmon6KIg!~l$tJ7eA=UtV!Fs) zjaqJ$l#)o6IH-iKRAH+w6Uk~3Wf8rkbFGF~rp?UKr=8HVm2u}t?vfxmV#sCUG+(Jp4=!UjT_nQFO>YsdmNqRH_ zZ)BDQskzyrrDOOFO(|4gb%{T6aqR6UaxaU4Y__7vA5S?`LOLvaCi@y;Ux9-ritYUO zM10;6OGB!ugaKlyhAC(Ce~RsO1>VSQ|CAi777z~o;IQ5`*#~vs2kP1TO*M61_+3)L z%dn5Er~3i7Hg;NPmyES*KCi5OnQsR8KEUeh^@KR{UfR@ITj)k+w$sCYsNKR#RgoZB z;X;F`QG>(l4UD*z^UB19pIzrI*oPA<;JB3YNq+p@DgW@{w|M@Wo53?2XaA?l1AI|S zGcy{{wkX|^UmeLc&Dt>!bk2V7)9MBK@S+k4_-b+|S&c6G8`vOLQ!yeT(=*{Z6{j=4 zI1$90^%nO4_T(2spi7y*eb$Y(vYM^bj%r?02%eDYon8E*+NsYsEGJW;7$QF!G^`s2 z*%1?fYY!IOEPp3e>@Q-_&!%Lo2Q8@2;vipz2#Dc#%;(&x?1|l(C;S43IR0PJ>W;jM zk0;3NBnAsQ;y|+o$&!E_dcAkc7+LNlvi5+nzhJk#7n4mSs)7jl>S#X9*Fo%GKhsZ5 z@_%juXX*;}WR>0?ja0S&oF<(=phJ1CfQX4uEh8>M6`!H98%b%jWyx*%iU<3yQz6}H z-Tmstoxy|$)UH`}hyDNx^fAwugsqsKpkz8;amw`-Nj)1UD{}}!b+Cd_^}}9T6Q2prmw@zp6s zX|n20KU}Ki`TKy35r3S^0t&K-#Xt{&J*LNWn)0q{;T?JU^rOPIr@=fnF&qG%gpYJnZWEX~-Wr zJspe`Rerd03w>`6M(m~DNfO0K2-YCyw~zvgyv%zZ%J?SY0-43mQUV`EyGNo}_qAfc zrr0BdygY-hF2R{f)+zhnS(iGT?z3uY&u~N*{ zf_tS*gcNnv`JD4?k)R2`az`>F31Y{+3ra4|%;71w;wH6}gEDC+GRD}J6bx0x8Slu@ znN@k4`0m%wEszX4#J)$J<3jDrbIhiq(Jp^po}N+yZoz%XVQ)VeY` z!|~rJPz46>XNJFe>qIIRC0WWY={-CB-Zho^&@JH_!_{#Q;W@{%g0Kphp!ZHr%iraF z{QGi|9JRa5VR&nNqa94T_#>}^#47{1t$-gGMHtYy?*3^kg`M6VPvm;8mN9n4^Y*H6 zF(oz_{(&!;I@1|ztQg5N|JrR^0Ru|iRrhp|bmvjYS?3#4*#Qq7AH_)Yo@lH>=S*VS zUuc>Y;AX~i8ib^+9l@+lFSU_qWmr$_W`g8IUaQtaBp$Q*WPmeV+0Q1e;)yq2Gsxh) zYywTU+p{}@E1-qucoJ0hxh~IG?#jx2n&$3xTToHAdaiJpcwCyS zVgj=1Tm$aPRP%kklRk!!hOfN1JrbxrZrGOey}^{GnbIy@n{Z7`|IWku2Pv_~qb|2@Bk9uM{@`z(lZ#I2J{3y{vm;~P zAO;2Sx@6y=j|Wq%zA+;sV+-lN~d{zLD!^ zrTf#BsM&H2bYh&yN~#|m2Z_<(u`RyM?QLOdlvK0v3p3r9g$S^xNSk{knqO2k)_WWz z@aCVW{TRe`M$$SLtB*B4Zkx(W zO)lM1X*&*L)m8|RLhk&`X+z|}-w^l5xeJI+ zD#*jrDHLs44(j~ywG}jUlE^5E4dG__gr9|JGXc-?k#IqW*L6Fh49`tS{wg9Q4HB?~ zT%LHP4gR@~$tBK38$FjMr#;`KNqGcdKM+44y=gFU0MKRy?KyEg2t*noqq%2%ho(*R%M?rrVi3Ly}0ju1U#O+VD3o3eYUwRJu` z-$)H6p6^cdDRGY_qVRPY?w%60{}SyC#69j>LcGgwV#8B&bK`?;9iISYQ9_f0)y_wK z2U|Nkb`FuC?>>*eHJZNZnm5${i~~-m5<1J?I2FfoWGhJIhwj<xCw-)$Wri0( zYrEcv5)c-7Ftp#iDiBeiMk2Kqd1$2(n?Pt*A4}p28(!duo++*D6dI@@ZHj4AtRTb| zJ%g(oA!MSZ{gUZ*h28PGt)N)B0v9E~hOTu~G@m0DCV)=NV3&kQ0`}WDs|Ay>0>9A) zld@{9^re9}FH_mA$jEaS2=4OE(|Pdj^3sT!RXfO`2qfRxB0+(Vvya_ew_$oFgq4z{ zscd&f_qYs!FV6T*IpVf#l#DA$MaZAu4@3-gk$!8;tXiWXe26txlKZ<=$ zGT@90`c&U6u!%AYMy`fxX@NTLfDmUq2=%QnY;?yM!p!Nz$KTZa)yS1$T2Xu1=#sf7 z5s8Jcu3#VVw2H%yrNK%jV#6zFGhAOHDpf)P9BB^6OoWr?u%1+VuhS~+3V>2Or(XnJ zEATrqLwkrY*u*G9rpG;(C5hKdCSj!Gln+bt#cOwO;YESW9*ZmRx$?Z_LSxHT`2_UhN0e-92>B zT+s&RRSnH}_O1JVy0kX&#xZYYus59L%qM?Ie|A-O{k*pNC)VG7mNOjY{v<>knc$bg zw4tbI#opETYH*67>aUMA)!}uN*zV*{j7-B(4Fm~{`)9|C-@za#Bf1X9U;f8s%;|z@ z^1wvDm5;_?$0+f>r;2I|$YToN<`~VK9ip79m|hl6-J*uoo&e zY5o1+gv!0L;|j#;q*T$*(O4a0#@0!*sYxD~2Zp_eP%<&FnK)yU5&B1#TCMo8-IkFa z`g-$USo*KAbq^N`aRpAGygvQ}rjcgj?%~_sT#q)r`$Y+`?hMLd6@B517PJWMF(#(8 zKJE(*rXG;QPy;y`%;_#&?^*AuI$Uo41$=YK2Io8Mxl0Va%kdvZ5{&lKV2pP)6I}{c zwg%jV%2Vn&E6RUeGp;lm5l}ByRWWf#_RDMf$dYKa{6t?wbfBfub>ePU)w0C80+)Lv zV>urJH{EGPMpM|$aEP0%ph|xdUwAxnd`2Y&?E14a)!f68oHj~Q8l z%U|ocs5Dl%4WN;Bf6GV7vParmw$JAfit^hb+PY4r>Gb{KX`QFge)FXAeJ!{#)oyTi zVX`dz6*s&C;`0l^q)O6^TKgg6m6#M*p#x~Qq5}QBE#A=Ej3!-mo8Vh*2uZFioS8aF z9g1TPV(9h@jNCPH!XK!wF(4ZCn7gW}smbEFypp&$sdA2ZtNp%~z5A%>X!{K-r z38G5tyH9#GdEfE~mI>}nEbZui$9(zO;qOPb zOLO2A3djgGpwAWW<38M9BGR^8r|Em|eAv{69{ARC-pN@K4x5<-l0(XI0ULIg4N{dot(_d0IYUOu z={If>Yv}&hA?9`Re=VW>CkC3mf@=SZ!@Itb_-sqMV_dF!=O3v?r=|JM*4ckD{2q3v z&U?@;n;SR|eb#M{A7w1jDGic ziPfBrMm#(?q_Tx;y}3becl^fx@+v)>hi^oRZR=(aZl^{?6@i}Q;Hry`qzKV{juOD& zJo|-H4HIoLnFZq4;xPiHcLQ-07yyaDr@)2 zDQ$WJqSV_6`k+n|jrmU{-T`!~(Hyl#>ykrp^q&}Q_LQ!1 zXqS_3nBmV3VBBYp_<&m+l>rkla0AuYThr<9U)Hst|(JPTcvy zsY@7|xUJS5T>_J>Dk-;vvC+m^H;8L8c(o?|HxgtN{tcHUwRM?xEzXQ*vYk?Ip`4K4 z=KirT1`vTfHwV2{7gOE!dr!2_8~iRs*O|M9Tq<)GO9%D+>5`FP81|7rrF>EbJ=AAf z@XFk9BBRl2wW5j719aBZivfX;C)hzvEm#3@_DMZEp_4HMOW}bq=GX3fE(Z|?MyQVA zn8;bm9Na5`H>A7KARnkiE0NB%K&(Prq)w z+f_MCv>{>mlGSj$_vPYkCGFY|RiJy3ITty((VD2i9M~5+nIMks{$9gmZ+QX|dv!xf zQiKrn`36(h_Hy1jYAF(kOucl)RcE>O?6g4fK%wA8Z1&zwNh5SQ_P8Q0FXn}$G~@{) z{Oa!cauJ#-Xh}~oPYRyzOow`9vK*C!60z76vM98e7wy}8$uvrK#1ibQ_ewSN02iUf=LZD<<)(A9mL-g?d28=k`hR1D|7#4jG=ygR^A!awqQ6+&gvbNNPJ4X=!Y-#46>(wFT`UGPYcK5eczqIV>Jw4YJlp)70sJ|RL=WI z)Om#^G~?)M*AL2dNS()eD%KaA1#6%Y6sE?;csUEAn@2{O-|Z9$Y>F$AE0Z*r#4HuR zjDL#C$P!w zaXdTZSoIeTlQQIQjv&W3%Q>8OTkmt2Zrn(A7aqIWrCDRteij>vpx_@Py(&&5<3C&R zibgroO}gKi2nHAzM(EffB-{JI!YG-}m6@DpLnp9I&v1!@wpTe5o?6!NM!0zwUc! zWK8Vi5QDiOKgw!RSzOfbrf zPnw;dEmsvDxOE`--qS9mCF0&K%O`bcEo6Y`U{MNHJS5P_$>ZkR4SevWf1X+5(tzeRmg-8iqJ*!(T)=ST1k> z@iE>@y#~uAKqO#C2#(hTNIT%#-yB1dIFZbjsQQhYP**c}e8Qm)(i^C-Kjp4MMge@# zI91qQkHW_@sC|~L=bfDHBWdSr?aG&>z=)Im<>tvTPbH!IW7%|Hi6=Hlg&nXj@8c@HI8y!s&@@zo6+Wp~3 z%;i5tyff8P`W*`YrKen3B+bCU@q8m9z-(XN;hAoA&4OJ0yG4L2z>_HFWUj>mK3Gya zK#jmlaQgjsld^q(1H#;u%uGyEr+ ztHU$@*Y7o8KI3 z{P>~g%ZmFJgi$orQx;9K?BBm zdlRj-+I!d5)G-I#)HLLRN9=YDEQC6{$ed3yEA4z%CZaLx4&UxR-h+zcI{!Yl zQtQ2*HD-&v+!vG^#kp5UANNi0zX4kA-~m6~k)H35en1HkrSaMfM@QCWAAj^~T+%jbphN`Ksk$nD~TIgJxB(X68325Yia6k*O?3s0r$l`{>Dl@ z7^R>wt0voBbGp#_d`fz^3>GgIu{u#m-VXGUsGD*agp>?MOy?f@aVe)oGk}y3`uk-| zio>3M7{ct{3Y3zAhv6^q{_v!eBcCC*-{!qUK}Q{l)SMzEedL&nVO{ug0F3v?naZ{b zr6Nf*V4*A#I7Sb_?QlA1mBqFHJle<8t+zT|WV5b+rlO|UTuX}t0`~D>sQ9U|JKx-i51VUfZCFEa2%IO( zrpk-=9LV@x*sc0uJ`@!F$-8K{QIc0|CsTLB!7kY^@(N!Vh7&hy&uB1o-SDrb&<~L;(L6qmQ?$TxyI>K zFK1z+NR!=cda-VfzCIxJt~o7J)IUNMJH*TDifEi@un)|ncE|-=Ns^aijUy)3${0%{ ztG@}!n(Itu7weUOZqlFqc~8GSGoF4Z1<(Ucg)V12w+X6%!<9WdQGBM3?yn)#=!5(v zPAL$^EfNxu#LWI1E;qRUh$NTht8j16_t~wAsGr0Yba0GiE;7B^Kgg5=zlszxtQF&V zexEDXz^`{j_p%=c+pg)BgQ9Qil72V+mT5DqbD3}iERG(LS4era;nR9hW9GF`apRnD z0J4}vqot>Ef89 z{JFUJpI%&J>SmG8Eg1rXn;gtq$WASQBiqhd{I6}P1cj{V*D|RitC7y!puOGQEz*q( zdCK!Cur2cL+ytTs3hH8+(x?WiVZpRWr?EnguCcggsVnd}ajP^J*++9%8WQ^3_6*5I z)1B471mpkc5uDG*q{Pic&1E0DDjt6d0sJZ@>3i=z3>L z6>s~diSZ>uzxl{`tpbx5Xo$xGey=?hX}7n0Yy4|dDhf4U8Py{kTdX{DMn%gCE8^Bxh61CA&?MM+$FirAy`1$FQ&Kb{&Da3lOPVjLvo(;j~4)4yfAquucvX4%pF zhftIy*5OeU4j?05mqF-Yn)6j&teVI9lBv>;tUrptjKl3|ZsDry?O_Jkz!1s20SKZS zyHF`p_3>%^0ex?z-~EQVRZN}9r2qS@j*Ajo$Ni2S+%`#J7Y-AKlMBk^rx|I!6N+q9 zl4u?qhVj^{K|2+2#CU71+j(ti4(W?r$KLnbWPldb2Wq#$Z|%@G0(~WJ+L)5Q3}i8gOP05dwk8x1qAC?cG`CGq+j=wRjyD&20l>IrYHfVPohcFHyb zGg6|X{olYjEhue|Q+@=eaORsPOlqZzutu!CTFOlT897(^8__>md zCLOFMzaM$G=y*A8#|anK2WU|{lE43kBDQ+|%I)GPt`X~Js#p^Fc>3EvPgIW{D0tM0 z@zX~%Cl>Ixh)}=-%Rq`dt63W2m7r1BDeAsRt(v=G*Rn5V7OzZFJF?k@b+X;|d;GVd z*F^`{>0*+fRB$Fn_uF&c1L%td0%>N8nq_tf*Jz!5@H~!|0~LHc*0;AdcG^K02AfM& zFuZH+lTDF`Ynj74lOYt6<4eAqiw5AqK0&JspSF9HON+_X-B8C#E|Z%EtlleiN21jL zgh*_;Qdd4UJIlZZ%Tbt^I{VE>GQe-Z_Cb{i+zM`(b_CGWf*t9MS3MbzsDM>o#+I!+ zj^dEpA!WcJ3r?QW-h3Jb@`t*Ri*&-HMF@Z&Mqf+{j(2#z?`-Yd-%4Lckx>Wc1?9YF zI8V}iwF4d&<*ctdPU2^WIm~S7Ig-)-Seh9Z!BpPi=w0v{anO!^2e(anFsQ)RoWxZ& zgR9U84fyjp3YvybAX)0&3=w3Ep838UtzqdNd*VSXaZlmDXAcj_P|{J z6$bC~<)<>KFKrK7FL>es@;+&MkATf7ZgC~%T}m$IyA-1MgV)<#@e`)qeU+hiRi$9283o>UUn#@jY(Mvihm%1L zEpV2&UyU(#O=&tmH}uC_bp&>Hc9QW^Qc-QcJqTpA9LYeV5QRt(w@r92)%ViXZ>iN9 zZYLya3$|17JKrr0Fh@i9JwxY!J=0>MqMH@4#1gW{;%pCB1G5($VrE_fX-$^k%-06+ z+ol$w^5x6f`>_|c(e}*pA)foqnA78ZY9-V8{gv}mK5oRzl)7)RuZZx~Q69I|)wG~A?MX}ItOdS%&Puv*RTVHW)9d;(r zE*+yG;>Xi@@SWI-^;g0aYZ4hWBDeG}D0nDIC?q1XL+@$8@!ap;(K%=>_tUf%_i0>7 zybjzfEVYx_7G}AcYf%t1pb5i!1+6;}&y|VEAsrNk_i$OGpcY4A%jZBvidZ1s5b9OP zkfaPyBGK_3k1Y%J0!UHYl?mKbHhxSQ!N`Qh;~w1!e!QI-eS!{85Th5cssjuO1L*k( z?3~U;3E>IJ36D0kGk$Cx%xrU`W$qHs`vWIf1_6V{BJNPal4Y2Z6H$WP=zd_dY%$2_ zhIasn1u6y+wch{Q&Em&f>_iR0$42h5m^-GC`EWQ_;^K!vK94F;yu@LWMBxV0A3e*Q zE#Om#5^{8g*A2#6USwJ5I%3tX!F)_mspQYY;e5=UnckopRM%Mk&b;Az*fJpcF>Y`v zev=0M44P(et$D=zR5?aaJ_2D_3l1y3R@tNFrl=g}peD{Cv31$DM16wNMp{6APaj{adBg@dsV{9FyqjVUnu*^&A!=WJ!^v1o?t~n%oRP22%c)L zo`}+o-ptkYfdMda!sgDh+FX-_%V)T5xB6WJPvE=&@`b-#F^dCh7m;Yi>u{I6e-b=i@z zX7tQ7%OMB8bT#DoSV!il1^WZP?bf1p`O41u%0Ld$nm#_esbr3dgJJCMqQ{dSHNVNa z$Ay+tQbeZfvl{QyY@9V!j0o7~vpc>>x4>?HDOfuu*^<@?&atPtv9o{3=J;K~lDxwz zbi6IUx}gBoKPA;-TuIppLtfn+zUI33p37H)F`;<@K)KSZo7Kx*!#7=SRxUy zBt5~BC>Cx8Kx4%_J(h;;BV(XXwF!13UqNTV=Y6{z_B}m8ESKJY*EQ20| zEv$C>p0Jy~v(5N_FGZh9*pOpQF;aG|oZr#C{ zXJy+x)p@H`4%rKQG^Oy=g#AGVk4PS|2CY&#q-))ch~MY&BDwa@*N*$T_~|3WuDi_P zgj~aDnX}4Djc;lCKpM%Lndk(7T;EUcf}bw;Pl=cnugm9BD{cGbPCwEqYO3eXeIi@lE8?TDVxSGzHnW0X*rAXgTS>rLUd{R zKuXWU^lQ#Exy|h?dTefF4564@&WW?i-Ku~H##Hu9(BxD(wfc9HFq8<5o`mxNI&uOc zURO9bRNSifr+q#$+`^Ouvn<;uDFAW;>k8#Tp5Fd*faG8(g%3N)UdenP+=UO`bV=vZ z`PWS3r?z*ZmupEwKI05rWblUEo2k8;Jq;|EjK%+H@2jJt-r9cwX{D40EmT4BjT`eLDa?;=aJiqAaYudYj%Bbi;rZ>%a|*L$mgPDAzpSDoiq0?NI1Pn+_ouw3#?yfvcE z-SZgqK)*5|fA&GUrXy1`RxbV4=QVwdmzv%0Q1v2Z)KX&P$Mg+dviZd5ua+CvU&+ee zsmeFGOg^uF7hLgIg=nw=0PB0g`5QOC_ltD|{YtL!9S}Pvs~mQ?)Pa-t8Z~piy+ABZ zbAu-8N#^MQ3!pG59k2MIh-+w2Qi&G3irJ$!Od|YeHj`C_n2cOz45JZ-DY-lK9(J6) zSQg7`JDp*HUb4h$cbD(a8&r|QfO$*l&rG~(c9WIb(ish0c|R? zal@KidqKj2N6B>u=_+aQ_to->T;6bK7v+}Wi#s)7Cf&}|th7|Ya-K=Cqrm9NAg^B+ zi`%V9!-1}Bp-a?8NyY*?^0j2>#NXV{@Ifjqfc3l7E#$Y9UtH|bG+jah&DkS;h^8zF z6Cxegn(s+l9mZRn@ATh1aPFQ+hcE6ot11>mDirEo_I_vQORY?MsoO?9A344^|N$_t&N@$^9`SxIE=imQlc1(roiWKAw|R!;F^#EVM0_zc%(W-5$W`1A!Tmoll-s+JPgEG{t|Jml!a z%UO3+UyAIHv>zP@Da{L!Y&+w>8~`N#D_R_z-0GwFm>qHEEF)N-WhG3l&W zY412k%4rHt(p6kFEjU9Ok1s5un$r(za;@64>>pH}Ao%yhOG|meKg6qM>S>*b7PCmp z&GK&sWT;4Z)64mZM(kq0THl>>$jDmIGNl~R3{?}^BtNUqoADWprS;o$l0j#(n{F^M zqpiGT-(;ey13yk}Z-FIWlCnfZGU#D z^`!TE7XXCGN6;gv91{;9lDT%qUES_YdS}yC(S}^m*LRUHx5!?D7bb{PN6VgY-{gLy z$3XNk)rywxi#=Z5L9&>6!{JshF91mV1qJ#dy*2|*%&*k&cR{sYi*&?*1zjt2m@(#25vvIj8q9Z`(>K*>su+{{U0B3`VoF>< zH7T<69A$H`K2i&p!HY#cOrkQ(daO4kGg)WT|vHS8xfrl>-vms z+Y%V+CiL+#iR*4kk)H_OhTpTM&2#n6d;UsN(jMx>%BzZvE0DBC8aI5R9}i{B?Tn&2 zA0=uwXmNb=Dci_%{giY+E*5;@nI`C<7W3vwu)RC+yj#7dO)+mWht)FhNvKH9Z;$tq+r509eYc#-B=!SPY9K+}3< zGxOxlYJdyuI2Kz?Jp|78T%Pax)Pf98LoQwqC{662 zMmHD+Hc$C;3IZ>=6pjy`GhrW%tb&vErkQ&13ma%8&0S$N7*Z91gKMb{M#Mfd7zQxHhYG$yi&596f4+a}U``fjHBj!NHUTe+5xY(c}qnfhDp{H+bGLJit+ z$oAVd%I1-99&L}J@kc~MI<5DZ6=@l^pXD|dQ50p`M~;4_W_$UiEwXaIsdnVP=cGJ#aY?<+tGlWr zS=>=-%kBh##kgZyO{5?5jzAqwz|o|BXTHG_KtK7fgB1U%j=%R(eXsO;cL=9Y3C35Q z1OL%&i<{=>>57UF+L~NP7JP|Mx9jwUUK&mo=-U*7cXpvL5F=ek#S4z4G9INYF(rrKDUwnCE?bO)e6V_`h!xG0ILS- zBrn_7M%`HQG-c2V28rU(sv3B}vo#&7KANtH9hnw%4}Doh>$Pr}ybEV+C)-D#TmX0W zw;v{(W<6z6w_e;mXG-j(SYmET`wd6>Tlj;eUK0ulG7u$?esmn*0t=qq0fAMya;6Ep zbl|LLa)QYE3r8D6l?S7!2Kl;uLGK%CV`$CiGD_W@3%A}M+*4GWSnFLh8^M}=`ZeI@ zR`?ydAIDlPql`S4_2|+}GQzm`VO&b0q8UM~8g7FOPZdomF~7&sN=9y|%w34vSv)kb z)o{^oqfM$hxl=?6kr~HX8JoJD8!4F~o*a}MlNNu0Mm1~XoSzBPH=Zp))n(}%WGe>M zvCKY&hvr}^iP0+Y936k;N<=qX+U`t>W@*pDzD)f7rB`!$b=la;u) zaGU+RRau7SqXB#j-6+SGm?fy_v7|whdX4YLml@2sFJuDRrMs#h(0%q6`V!w@vgHQ#EkT^cBpx#9lyu36GQ9)|Ci8y5YFWa6 zEyA_#VX(abrr*na-_+(nbdizFG({g36i>57ShyOhktfD#J8_{hPE2AnbrmDD_#13e zWs6WJBC|G|azb~1c^-Q#?4wrIXMctLK|=SUB3Yrlwibyykz2yFpKB^qx;ncUz1OL4 z<=%5qvps$!Ea>Saumml6*llgNv@wct3wd&`Nl&R{OEr`vn>}7?#5{F4oeOuAj@R&r zPnqmas8XmcM?JjlVGDP92r3%&dBGyaMn&_CT-6jbTcQ2N1_6AF8s9u2PByOU(Rjom zIwtZwl#`2IWBik;gVn#EvYPvW&(5okZl={L|4qwDDs@A0+5)`-c( z6LUtAyDX?fjO-tNHRlM-L080OyQFU@_BFD%uC^J*ZSc)NJs$%1wrY`v+d^Nyed;b> z2ku-vnoz+epiN8rZ1`cNbnYW8)1{=Voy8|$Lf*C&F*lx9y7}5;BsyN#rc~v0xYhk( z+N<7uB}K%2YZ|hFsu(h9Q`FjwOZcfqw00s~Bcsgu=~?(@nG=&nq@lMv;JXI%V}f|= zmVCqc?|VwitMfgJ9+FN1D+v`luQX1KVx_h*RtQjD=|5~`FEhUc7j>gt7C4C1+M@{DZq zlFn~3a+tV}Sh~SURmuB@J@I)~Lm9^+o7T`FpMW8gA+poUqD3`-bawzpckW^%yTj9( zNrlULgc}ZnKaLqq_TsI>Q^+EX-L88x%#e`J<5D2)tc3wx2|tN|n~M#daw!SGfHSoS z0)RZHs4A)rSjM`az{+6?^S_{D(CD$T5orLCo{fLs%q_Z~*T{F>I1tE&?0sr-YML40 z)*%38-|>J)X3XxZp4V*C_2kq_nvu*OYI^R+c+IGM6EfsGIBsQ&n?X0`m@yW+NY&i~ z>_h#?mo#v|Bf%(R%zets6fyc*)y2JbMH0~x6LN9UfaP1jQxtS}B8PV-?j^tql_G62 z^xAr6)2vwRY~I1d=U{U;IOI%!=9}5!qeTsiLCX!RlAZSak1b~KW0;EKOZwWtGY8+x zZ$dlcVYMYyS{0y$o6iz{=l2lks@k35Elfxk#VNE4KDsGF;?fM8sJp(Lx{Vl&6xy9X zWSUG1FHMm-$;^5VPIna+t*Y8=37;QIO#^u1J*hJRK_3-EPRGC z&f)0xeCx^Cb+y8!&Iq>Mf!f$9uAAd<3jc!^+$Yv*hau?cpDno6(uzAr?NU!~3uTUR z34Pb~axiEau8Cmy7&ti~IS-o5j1k7qn>C_-MK*sB>*z1U@Z(poD?7JST4d;G36 zLFGdM8)TR3CRg!8WmnF^UOItwy(ZR6iIzDM9!FZjY#s~U`vV@Ou+SLC1BgRU1t{Ve zz;zmI;8@G8k;0d=6qh07kCCx4 z&GwapOWutDTM6CEdKsA_HTT|I0)z}U46&uW+OHekT}C-u2B_`xrsKSPrcI|4?QKqD)6NmgDSD-%B1463U$8(Dmk#$?$fn8j~+sKI}kQqoG2pT#8 zx67uI38(djE4$~=t-J#Z*sxmSw4VT%1R>}fNkbPE1)$YGwAMGqxA_3@17e!_>i$}P z_MMO#j?c)TRss^Q!lJooJW>7+&)_2gy{7K&$wQ<8A*WDmef}xM*8S6wea52s1qD_d z5`_t#83;*}YXX9Mf0nhBC4n#!)@u9VTBAxed+dk7Yg-rEg{7?! zp@$?AIuLH8gs`9>9YUr1*=7+PM85Jjt~$XrK5qEM>$HP!tk=&kDL~z#f~nQ0YN$!A zlRtbGA!Kq1E?W;oRYQCxT0_1nI|p7+1=6*gMFgI7BhIbpD=+t2hrazL#BWdH;r9|* z9fGuMaU1rRTrZIOsIs**wejk>l!~(+x6a_|9UgykRT6if$ktq6Y&4 zfyF~s$CJ?u`a=K^t?_0Nu7~k{w%)dC(M+-lpD5K@%Awunr!=RdrG*%?S@IvBz?MY1 zq(1FmJcw+{zzd+Qr}89zu(QtrBy($Vv)h$PTyt7SX9CD#s1;78fLkl>{&sEV3wI*x zo7S5-lASbF$$O<)ijo&)64z5q#?lPb=Q(iWBoGfWdYN$FW;kOqOFEM<5l_`SyxQE!dyz)lU7X3VN56&=2@I=%+HNDwcG z`6P^yeHIRi1g z*yUd{IHYCp&BU@ZeAM3_BScAG^EoKue?0dkXCGb7KG15ai1SXauLx-FR>{k*xkd;# zIZd=E>|f+~$U9_TvsUZDhcrwQJ2U|0Lw#f1MUwqDB$;PJE+ntW8AjG5_h7q}U^>Uc zv$>BJ{8=Bct4LsR2P(%b0ZlCn4f3<&0qyx1)Uipi$)zOR>SYi_lir2&$?8O_2T!P* zDGR#a5t~aJN6Vi3+{$YH<~tefk&BW*xU56=YVqc2;MTXm%-#2c+Xah)qLK|AHxF_w z=@4Tgtrd|0@53YQ$g%FwW{sGDXPXdVki|gC5(5-?gz&`M0bIkf5N=l;d8T+ty|0M> z`l6cJ=*E}wW>qqpb@Y9PB0LUag}Tulf|yXj@ZJ|^?;6Z5AkLLP?Na)Ul1J9L12=6trxerF13 zZY%-o?Ds^BDnZITy1s6(**o1}ij{4?Z1h?*@`MkjISkK+FEY}djKY^IOlFfUS$Dhh z7b`YZTkO|Y>OgVw{a*#PqXRxp&~b58wXftqY|j@Ij@`jR`;k8+_@_rf|5AA*b-=M4 z{LV3#+5QFJA3kX2Rpx^b)sbCM#j`ZU?n~iC9~%CL1F^`lHfrY!u_@Dp&WL>EGh023%0> zjwsTXi|yAjh2C}_OSXVx^OrpjsU(*hS)v)}0Jj^&7*;I^hmu8g7r3d+g56|5)h|(lhOLgM7iNmP$yfp4TY{%D z<&Gl_T4YPb5j@%x8X@tHXKJe%q=+L-Nv_s}YNva20ats067Zy%jAKE(9Zit;lvcCK zrFWjZS&2N!=WRo1cT&x%a@;EL7iXj@3AQ9O-EcvvD(`n~v@x4?om!VP!E{75joLWw zwACgDg#vL3es&7dVqs*J7Xh;)t^J6dDR?uTWqz0Hl-ywx8v&J!uu^+wKk!AiKMDLO zfD)zTlayEW_W8CU{8S6gOy={1qy-Wm&?=KS)VSy#dy<9)6)fpg}>V=A60ABaLWX(H~L9S~1K zyl#x^W5J_HELwx=&aB`VfJyu*vrXm5?o>@TT-SKl=-kf!9q#Qe#`kvotBSg0_z<4! z{^~E+HwDm9H@Z5X9 zC`H7=+|8=Q&Su0j&vVAvQ&`Jd-~aGVNz+V{s$YJbhR0+VRo4Jq-+)#7pikFWX@pC* zup#l{_)cDUv82ROQkm;D>NKfLYuA2+m5SBD&!q#LQ%IP@I&%oMEm;Jc=Os6f8t8T@ z_gkbL?#?GHILM|j2GW7#6etRsJUr@cDVz*WHk-7X-#j;#2Y+~QK&Z8_zs5US*>cTu zb5VLy;Pkxp%*jWagG93$0k#w-)xGIA!v`3Bi2(hl6+^2|+bIF5pYqnk%UjU9d%q3* z0jBG+rTFkbRqYLC;OV0Vv_Vm#*Y_)xq~|Y&sSZ5BXP#lb-jfU7y0YI}(qyBfLOj64 z2Iw!1Z;v5hV9A=C?pPoB?=B?dB-64a5~iT5PBwef%$potsi+2=71L1>5&{3s6sz6s z8)SV#OO4@yuJGM`wm4ciDCs{quSPFv{%GHHxXW-}rE(z7jfHRjN=kc)l`X&6 zkSEO6xln5ciA2f>eAgRjW1B{5<1_#`p2alshwYF)l-2UfN-stD1vpD>j zUiN++vCYT#E)T|SNV1bkRwgnu3LW9Q+tnjROr8gA12stK#2hpdhWdrC**IZy6oH(G@QOHfqBsQXqex$!`U0(7Jjx_(|NCet${);2%CpD6t zJ4>vDq<%AUhB`55_PGZIu|76_Rq)D&<)CUunq9m4B>p9xE3C#{)ZxN#(6!#a0CxhD zdFRnD*G`Hirpu$MM)Y8wk{vsXI%sj4A+*T26-NTDdy`CxHR1!jxX2F);dk~RyA4tyeec# zQ}&G>!GDe=#fF|BY%OQ;!6h9Ih|Qi*=3Zb zzKp_jRFEmV^uUXYG zlJkH>;XNAugynLuy%U8vGx6;UNLtb~ptJNO{JUE$K`U9JTI#=3Jm{_JCU3MJYjX8+ z7UT0gjkzJa%bY=CLH*2Ek7vdcb^WN1mc|a$a&(7~|CTEF-DhmEW8#2#&ZQ6!_G_u> z=xQ=Duu$5x9=KIEgD}8)N5@;EChw7CD}B$i6lB)&6Z;MFeiLgQFwBP*IOWJSKLpB6@MNz{_W2{ia6pJWjIQhigVfqOn7u z(?biw8fPbjIU#9)IJ2s}eT?|FUAsfya$bv==x((SGt8RzOhQTjWqbb2=mc~BWHf2& z%f5djfU6JB58RoFd57laW&q!7RxN+qOIj;DvZ>6VE`4qA^P0Lk>vdO-xi^c;A>}9S ze>sc4)a~^4V{Y!*P~DCc?xf}!%{bkAJqCSvm0n&z3YwTE3+YUG9P;@w4s`u(_|n*q zAH{i1CZ2EJOu0_m&jSUF(#xMGvvRM(w{~|45)AS*<_&p0qK?`uDc_amSnMa4guhos z*Lwt@-q^p{bpE_lvfyyDU^g@i@`pP)WV?6aii;OunBmV)Hp=`I1%fSOy*kQo(AlyRb%BUvwH7%M#rZlQyd@zJwYhc+w#+5>06|FoK5pk#l zj67pas5a!G0o+?FSWHwDjF6h!)YmI`WdVR`YJ{a`(T03FT~cW7-?8syZH8&qMijU% zbf;<4Lmu;x90wvt%j78FNb2g z{fztt4?J$;SPC~8M(_Wf7#|F!{52}`;**+IG%d`YVhf|)b_c@=3*@)9w^Crjt?RX; zqxdtnftjnhbX}lwSW9k;S{{ednWK#>mv(askKrtS zsM1oC#&U1(*-o%g+*C*{s>&Z>4yw5%3HVU~`1t7d-wg&ngIe5A$7uW0{r}~(-9ywS zY=7E?F1!TxlkvsH{mKyAYjuCL9JKicvy<07#5JXel5ed~M%b#NJ`HVlFchEeUI_hT zbY`mIn?@?XiVTf<`>`=T#-69b!uL5PRA z6;8dhF>9_ySld>Mg12%?k8emkZP2#=oi5>%Y7cS#Li$Y0Q^GTeYi->v>RwRUIO?(yr?U;DX>5 zJm%K+R~UJV2g**#7y9kldJ#<<$={`Q>j|c|=jcsi{?{nu?_FHJxnp$1y#|b++Qh)- zhJx$?nB+ND@W$O&a7}##Aa`ADy>Q20If`y(3(?09Q-yJ#ghHT5Ge{u)CzP+=!GWfW zcVJaIWNE>~~xC zX@06`;Gv2t6?xrDTJr5B{~;mvAwR`$i)Q=e#X0$}fHe&J zQ^^kB+d<#+LPG@2egKoK(D&PP8_)7Iz?Ctj^94>>M&_DiQ)O*4L8L^F3Xu`G#!1R_ zoBoveJH<1_B+E%8Q;fBYcul4SAp+226~NkFJYET8*3HpqIWB_&bMc+6&*_ z5{7mroH{r2ho&Xje+)vJV@oMHlapXU+&hhS zCNN*Z_dEe{D0>FXs}A0najwDr8_L1N)_;k{ZXL1;|FZU?3R1U}I00kUXbcdlr$_}} zwybk(g3DqSoQFV1Vnw*8)af5(>&by9Y|n>@PDSX2v*CG-jr~Uf4(tcHL#aNgb|IR7 ze^GE3fpuHSHA!g;=c(R+E@cNZ^8@;w(kBtuycq~v`jJkF!Y+xYb~2_RScHs)s!E#> zWD5gx4Ds|CUBHkf!?aXs$p^rW>1)*)!$Q7m_HC7=v#i*I$*rsVQ$ zai0+qbYc>7tOiM(=v~fziJPJoqOG9yH^v!&h@k=W-?odSOqqU0ORy3TIaWW6KV#o5 z49xlA&tp<|K|WfQAw1^;a`S#9Lc|0BkG2PGJjSd`LP)LULIiH3CFSi%BC><%eduNG#EH|HzF?XJS8nBRHF8H8b z8%XL`bh-lHpeP^$6b9;`Dv;@C$9f6s6yj0^(6}C zlgu4GofQz*SS<1(|A*!?l%b_{O!Na7<;Eu}1wk14(f>|?U>&kysk`&SZ?)$-*H{-L-b}Ax&xsy>J_X~14MZnYk)lykfSx1zn1iA>~p%{##ul zvPz=+Rajc%LW&?{Xp-K_|sEH=nq?t$q;@0lI=Gb*J*!3HR%Ry%8wa}-8Lv$JRh4ELG^kcjWnJuDB-2)OZK z0)6-gTZ5$X(cz`CH|`TDfnUg0RD&TjjXa3(mg1)lm7{YYEkVairp&aRESRP)zS#EH z27tF}Z(;CXzWfg%X`3XFoA~mH2VObTz`c}0S_i;9rIq(rHomaQvpxSBA)q7plvt7j zBacMIvwDYORQ%N4UrgE#yGDJR*UY?7rLhPU})!juZSCw`CyGUpt zt>h-M`#ZeAfga+7+MKC56f|*YJ~X$ZzZa+qvZJT39XVUw9fsCxS#Uec*I!NQporF<&a8;fca0;&g&M|_pOe}5V2mfY_dC*L`d z)H0Dj4Y5=kPMyf0&2S-Blh@8T(@?;ldx*c-UiB8kU#G-5QPhbhty(e?o_9R>U1wp{ zvN1M$$05=82w#h9tYR16P+ba|eqH?OOT%lfmVc&j@a=z3lYFy;Gpp21|A|}v9*zFP zp#MX?|H#j?pc7gw;`aZ7;Qx;UVFcr%lTXU;p8d=J|IcsyKaX!6^b?l7`|p(gx1{%Ua`FO~kkwo7d{n4g7zu(2m*ATiJ%CHa?fr81^({}+aDDLMcE literal 0 HcmV?d00001 diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/index.md new file mode 100644 index 0000000000..800d8882b5 --- /dev/null +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-forked-repo/index.md @@ -0,0 +1,46 @@ +# Your first commit: Creating a forked repo + +In order to limit the branches on the main repo, Radius enforces code contributions via forked repos. + +## Creating a forked repo + +In order to fork a repo, go to the main radius repo page in GitHub and select the "fork" option: + +Creating a fork of the main repo + +## Clone the forked repo + +Now clone the forked repo and navigate there in your command shell. + +``` +git clone +``` + +## Configuring remote repositories + +Configure the remote repositories, referring to the forked repo as `origin` and the main repo as `upstream` (you may choose your own custom names if desired). + +### Adding remote repositories + +``` +git remote add origin +git remote add upstream +``` + +### Verify new remote + +``` +git remote -v +``` + +## Workflow to follow +1. Push your local code changes to the forked repo + ``` + git push origin + ``` + +2. Go to the main radius repo and create a pull request using the _compare against forks_ option: + + Creating a pull request across forks + + Make sure you select the fields (shown in red) "head repository" as your fork (/radius) and "compare" as your branch with the code changes. \ No newline at end of file diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-pr/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md similarity index 93% rename from docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-pr/index.md rename to docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md index a638bbf02a..11afa8b04e 100644 --- a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-pr/index.md +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md @@ -42,7 +42,9 @@ Include a level of detail that makese sense based on the complexity of problem a ## Creating the pull request -Push your changes and then [open a pull request](https://github.com/project-radius/radius/compare). +At this point, you have reviewed the forked repo workflow. + +Push your changes to your forked repo and then [open a pull request](https://github.com/project-radius/radius/compare). If you formatted your commit message correctly then everything should be good to go. diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-pr/pr-checks.png b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/pr-checks.png similarity index 100% rename from docs/contributing/contributing-code/contributing-code-first-commit/first-commit-06-creating-a-pr/pr-checks.png rename to docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/pr-checks.png diff --git a/docs/contributing/contributing-pull-requests/README.md b/docs/contributing/contributing-pull-requests/README.md index c0ec30e241..34262f8f80 100644 --- a/docs/contributing/contributing-pull-requests/README.md +++ b/docs/contributing/contributing-pull-requests/README.md @@ -15,7 +15,7 @@ We the maintainers have discretion over what features and pull requests we accep > 💡 If you're new to Go or new to open source, our [first commit guide](./../contributing-code/contributing-code-first-commit/) can walk you through the process of making code changes and submitting a pull request. -Please open pull requests against the `main` branch (the default) unless otherwise instructed. +Please submit pull requests using a forked repo and open pull requests against the `main` branch (the default) unless otherwise instructed. When opening a pull request, the form will be pre-populated with our template. Please fill out the template to provide structure to your PR message. If you've already written a good commit message (see below) it will be easy to use with our template. From d9a2e11c3fb0cf21facf6ba60405c9c4cc29a854 Mon Sep 17 00:00:00 2001 From: Vishwanath Hiremath <100623239+vishwahiremat@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:30:12 -0700 Subject: [PATCH 26/57] Enable support for recipe type specific garbage collection of resources. (#6162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Moving the logic of garbage collection of resources inside driver. Updating the unit tests ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at cece1e3 ### Summary 🧪🗑️🔄 This pull request adds garbage collection functionality to the recipe engine and the bicep driver. It modifies the `Execute` function signatures of the engine and the driver interfaces to accept the previous state of the output resources, and implements the logic to find and delete the obsolete resources. It also updates the test cases and the error codes to reflect the new functionality. > _We are the masters of the bicep driver_ > _We execute with options and garbage collector_ > _We pass the previous state of the output resources_ > _We delete the obsolete ones with no remorse_ ### Walkthrough * Pass previous state of output resources to recipe engine and drivers for garbage collection ([link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-b93ba441d82b7bf92f0027d1e366830b87ca7d768ce1d9d21c54bc4f3c2ede07L75-R75), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-b93ba441d82b7bf92f0027d1e366830b87ca7d768ce1d9d21c54bc4f3c2ede07L96-R100), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-b93ba441d82b7bf92f0027d1e366830b87ca7d768ce1d9d21c54bc4f3c2ede07L116-R124), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-b93ba441d82b7bf92f0027d1e366830b87ca7d768ce1d9d21c54bc4f3c2ede07L141-R143), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L141-R145), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0R283-R315), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-a95d80e21fb522c60702dad150fe92099ac96749fd90a452abd92867b40d069dR50-R51), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L51-R55), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L69-R69), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59R92), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528R62-R64), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L107-R115), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528R130-R132), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L161-R173), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528R189-R191), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L227-R243), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L255-R274), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L277-R298), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528R314-R316), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L310-R330), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-2dee9fa8b594b7a0e0783bd6587b452223eb5f7ba7c28a1dc0178c121a2509f0L54-R56), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-2dee9fa8b594b7a0e0783bd6587b452223eb5f7ba7c28a1dc0178c121a2509f0L63-R65), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-11be7ca47327363d5edeaff3c6ac6389a462ff9111e1fc03ccb3a98123cd939fL30-R30)) * Remove redundant test case and resource client calls from `CreateOrUpdateResource` controller ([link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-9bdc7e92b6a746c8b205c08b733880545415d6f58933b3d36b44b37181f1ce1dL229-L242), [link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-9bdc7e92b6a746c8b205c08b733880545415d6f58933b3d36b44b37181f1ce1dL392-L404)) * Simplify data structure for output resources in `CreateOrUpdateResource` controller ([link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-b93ba441d82b7bf92f0027d1e366830b87ca7d768ce1d9d21c54bc4f3c2ede07L116-R124)) * Add new error code for recipe garbage collection failure ([link](https://github.com/project-radius/radius/pull/6162/files?diff=unified&w=0#diff-4811c2c3581e1effba7ad029717fa82713a8e3a58b848b3845cfaf7d6a44fbacR31-R33)) --- .../controller/createorupdateresource.go | 37 +++--------- .../controller/createorupdateresource_test.go | 34 ++--------- pkg/recipes/driver/bicep.go | 49 +++++++++++++++ pkg/recipes/driver/bicep_test.go | 59 +++++++++++++++++++ pkg/recipes/driver/types.go | 2 + pkg/recipes/engine/engine.go | 7 ++- pkg/recipes/engine/engine_test.go | 34 ++++++++--- pkg/recipes/engine/mock_engine.go | 8 +-- pkg/recipes/engine/types.go | 5 +- pkg/recipes/errorcodes.go | 3 + 10 files changed, 164 insertions(+), 74 deletions(-) diff --git a/pkg/linkrp/backend/controller/createorupdateresource.go b/pkg/linkrp/backend/controller/createorupdateresource.go index b96b008a4e..56da670549 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource.go +++ b/pkg/linkrp/backend/controller/createorupdateresource.go @@ -19,7 +19,6 @@ package controller import ( "context" "errors" - "fmt" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" "github.com/project-radius/radius/pkg/linkrp/datamodel" @@ -29,7 +28,6 @@ import ( "github.com/project-radius/radius/pkg/recipes/engine" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" ) // CreateOrUpdateResource is the async operation controller to create or update Applications.Link resources. @@ -72,7 +70,7 @@ func (c *CreateOrUpdateResource[P, T]) Run(ctx context.Context, req *ctrl.Reques previousOutputResources := c.copyOutputResources(data) // Now we're ready to process recipes (if needed). - recipeOutput, err := c.executeRecipeIfNeeded(ctx, data) + recipeOutput, err := c.executeRecipeIfNeeded(ctx, data, previousOutputResources) if err != nil { if recipeError, ok := err.(*recipes.RecipeError); ok { return ctrl.NewFailedResult(recipeError.ErrorDetails), nil @@ -92,13 +90,6 @@ func (c *CreateOrUpdateResource[P, T]) Run(ctx context.Context, req *ctrl.Reques return ctrl.Result{}, err } - // Now we need to clean up any obsolete output resources. - diff := rpv1.GetGCOutputResources(data.OutputResources(), previousOutputResources) - err = c.garbageCollectResources(ctx, diff) - if err != nil { - return ctrl.Result{}, err - } - update := &store.Object{ Metadata: store.Metadata{ ID: req.ResourceID, @@ -113,13 +104,15 @@ func (c *CreateOrUpdateResource[P, T]) Run(ctx context.Context, req *ctrl.Reques return ctrl.Result{}, err } -func (c *CreateOrUpdateResource[P, T]) copyOutputResources(data P) []rpv1.OutputResource { - previousOutputResources := make([]rpv1.OutputResource, len(data.OutputResources())) - copy(previousOutputResources, data.OutputResources()) +func (c *CreateOrUpdateResource[P, T]) copyOutputResources(data P) []string { + previousOutputResources := []string{} + for _, outputResource := range data.OutputResources() { + previousOutputResources = append(previousOutputResources, outputResource.ID.String()) + } return previousOutputResources } -func (c *CreateOrUpdateResource[P, T]) executeRecipeIfNeeded(ctx context.Context, data P) (*recipes.RecipeOutput, error) { +func (c *CreateOrUpdateResource[P, T]) executeRecipeIfNeeded(ctx context.Context, data P, prevState []string) (*recipes.RecipeOutput, error) { // 'any' is required here to convert to an interface type, only then can we use a type assertion. recipeDataModel, supportsRecipes := any(data).(datamodel.RecipeDataModel) if !supportsRecipes { @@ -138,7 +131,7 @@ func (c *CreateOrUpdateResource[P, T]) executeRecipeIfNeeded(ctx context.Context ResourceID: data.GetBaseResource().ID, } - return c.engine.Execute(ctx, request) + return c.engine.Execute(ctx, request, prevState) } func (c *CreateOrUpdateResource[P, T]) loadRuntimeConfiguration(ctx context.Context, environmentID string, applicationID string, resourceID string) (*recipes.RuntimeConfiguration, error) { @@ -150,17 +143,3 @@ func (c *CreateOrUpdateResource[P, T]) loadRuntimeConfiguration(ctx context.Cont return &config.Runtime, nil } - -func (c *CreateOrUpdateResource[P, T]) garbageCollectResources(ctx context.Context, diff []rpv1.OutputResource) error { - logger := ucplog.FromContextOrDiscard(ctx) - for _, resource := range diff { - logger.Info(fmt.Sprintf("Deleting output resource: %q", resource.ID), ucplog.LogFieldTargetResourceID, resource.ID) - err := c.client.Delete(ctx, resource.ID.String()) - if err != nil { - return err - } - logger.Info(fmt.Sprintf("Deleted output resource: %q", resource.ID), ucplog.LogFieldTargetResourceID, resource.ID) - } - - return nil -} diff --git a/pkg/linkrp/backend/controller/createorupdateresource_test.go b/pkg/linkrp/backend/controller/createorupdateresource_test.go index e456abc04d..587e2210f5 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource_test.go +++ b/pkg/linkrp/backend/controller/createorupdateresource_test.go @@ -225,20 +225,6 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { nil, processorErr, }, - { - "resourceclient-err", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(successProcessorReference, eng, client, cfg, options) - }, - nil, - false, - nil, - nil, - nil, - errors.New("resource client failed"), - nil, - errors.New("resource client failed"), - }, { "save-err", func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { @@ -341,16 +327,19 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { "p1": "v1", }, } + prevState := []string{ + oldOutputResourceResourceID, + } if stillPassing && tt.recipeErr != nil { stillPassing = false eng.EXPECT(). - Execute(gomock.Any(), recipeMetadata). + Execute(gomock.Any(), recipeMetadata, prevState). Return(&recipes.RecipeOutput{}, tt.recipeErr). Times(1) } else if stillPassing { eng.EXPECT(). - Execute(gomock.Any(), recipeMetadata). + Execute(gomock.Any(), recipeMetadata, prevState). Return(&recipes.RecipeOutput{}, nil). Times(1) } @@ -389,19 +378,6 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { stillPassing = false } - if stillPassing && tt.resourceClientErr != nil { - stillPassing = false - client.EXPECT(). - Delete(gomock.Any(), oldOutputResourceResourceID). - Return(tt.resourceClientErr). - Times(1) - } else if stillPassing { - client.EXPECT(). - Delete(gomock.Any(), oldOutputResourceResourceID). - Return(nil). - Times(1) - } - if stillPassing && tt.saveErr != nil { stillPassing = false msc.EXPECT(). diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index f7c4807175..313d07e51d 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -139,6 +139,18 @@ func (d *bicepDriver) Execute(ctx context.Context, opts ExecuteOptions) (*recipe return nil, recipes.NewRecipeError(recipes.InvalidRecipeOutputs, fmt.Sprintf("failed to read the recipe output %q: %s", recipes.ResultPropertyName, err.Error()), recipes.GetRecipeErrorDetails(err)) } + // When a Radius portable resource consuming a recipe is redeployed, Garbage collection of the recipe resources that aren't included + // in the currently deployed resources compared to the list of resources from the previous deployment needs to be deleted + // as bicep does not take care of automatically deleting the unused resources. + // Identify the output resources that are no longer relevant to the recipe. + diff := d.getGCOutputResources(recipeResponse.Resources, opts.PrevState) + + // Deleting obsolete output resources. + err = d.deleteGCOutputResources(ctx, diff) + if err != nil { + return nil, recipes.NewRecipeError(recipes.RecipeGarbageCollectionFailed, err.Error(), nil) + } + return recipeResponse, nil } @@ -276,3 +288,40 @@ func (d *bicepDriver) prepareRecipeResponse(outputs any, resources []*deployment return recipeResponse, nil } + +// getGCOutputResources [GC stands for Garbage Collection] compares two slices of resource ids and +// returns a slice of resource ids that contains the elements that are in the "previous" slice but not in the "current". +func (d *bicepDriver) getGCOutputResources(current []string, previous []string) []string { + // We can easily determine which resources have changed via a brute-force search comparing IDs. + // The lists of resources we work with are small, so this is fine. + diff := []string{} + for _, prevResource := range previous { + found := false + for _, currentResource := range current { + if prevResource == currentResource { + found = true + break + } + } + + if !found { + diff = append(diff, prevResource) + } + } + + return diff +} + +func (d *bicepDriver) deleteGCOutputResources(ctx context.Context, diff []string) error { + logger := ucplog.FromContextOrDiscard(ctx) + for _, resource := range diff { + logger.Info(fmt.Sprintf("Deleting output resource: %s", resource), ucplog.LogFieldTargetResourceID, resource) + err := d.ResourceClient.Delete(ctx, resource) + if err != nil { + return err + } + logger.Info(fmt.Sprintf("Deleted output resource: %s", resource), ucplog.LogFieldTargetResourceID, resource) + } + + return nil +} diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index 77d13373d5..d87e2db2de 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -17,6 +17,7 @@ limitations under the License. package driver import ( + "errors" "fmt" "testing" @@ -428,3 +429,61 @@ func Test_Bicep_Delete_Error(t *testing.T) { require.Error(t, err) require.Equal(t, err, &recipeError) } + +func Test_GetGCOutputResources(t *testing.T) { + d := &bicepDriver{} + before := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource1", + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource2", + } + after := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource1", + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource3", + } + exp := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource2", + } + res := d.getGCOutputResources(after, before) + require.Equal(t, exp, res) +} + +func Test_DeleteGCOutputResources(t *testing.T) { + ctx := testcontext.New(t) + driver, client := setupDeleteInputs(t) + tests := []struct { + desc string + err error + gcOutputResources []string + }{ + { + desc: "success", + err: nil, + gcOutputResources: []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource1", + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource2", + }, + }, + { + desc: "deletion failed", + err: errors.New("test-error"), + gcOutputResources: []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/resource1", + }, + }, + } + for _, tt := range tests { + for _, resource := range tt.gcOutputResources { + client.EXPECT(). + Delete(ctx, resource). + Return(tt.err). + Times(1) + } + err := driver.deleteGCOutputResources(ctx, tt.gcOutputResources) + if tt.err != nil { + require.Equal(t, err, tt.err) + } else { + require.NoError(t, err) + } + } + +} diff --git a/pkg/recipes/driver/types.go b/pkg/recipes/driver/types.go index e646c363bc..a8886fdfc1 100644 --- a/pkg/recipes/driver/types.go +++ b/pkg/recipes/driver/types.go @@ -47,6 +47,8 @@ type BaseOptions struct { // ExecuteOptions is the options for the Execute method. type ExecuteOptions struct { BaseOptions + // Previously deployed state of output resource IDs. + PrevState []string } // DeleteOptions is the options for the Delete method. diff --git a/pkg/recipes/engine/engine.go b/pkg/recipes/engine/engine.go index b0e36f7bbc..dc2e455f80 100644 --- a/pkg/recipes/engine/engine.go +++ b/pkg/recipes/engine/engine.go @@ -48,11 +48,11 @@ type engine struct { // Execute loads the recipe definition from the environment, finds the driver associated with the recipe, loads the // configuration associated with the recipe, and then executes the recipe using the driver. It returns a RecipeOutput and // an error if one occurs. -func (e *engine) Execute(ctx context.Context, recipe recipes.ResourceMetadata) (*recipes.RecipeOutput, error) { +func (e *engine) Execute(ctx context.Context, recipe recipes.ResourceMetadata, prevState []string) (*recipes.RecipeOutput, error) { executionStart := time.Now() result := metrics.SuccessfulOperationState - recipeOutput, definition, err := e.executeCore(ctx, recipe) + recipeOutput, definition, err := e.executeCore(ctx, recipe, prevState) if err != nil { result = metrics.FailedOperationState } @@ -66,7 +66,7 @@ func (e *engine) Execute(ctx context.Context, recipe recipes.ResourceMetadata) ( // executeCore function is the core logic of the Execute function. // Any changes to the core logic of the Execute function should be made here. -func (e *engine) executeCore(ctx context.Context, recipe recipes.ResourceMetadata) (*recipes.RecipeOutput, *recipes.EnvironmentDefinition, error) { +func (e *engine) executeCore(ctx context.Context, recipe recipes.ResourceMetadata, prevState []string) (*recipes.RecipeOutput, *recipes.EnvironmentDefinition, error) { // Load Recipe Definition from the environment. definition, err := e.options.ConfigurationLoader.LoadRecipe(ctx, &recipe) if err != nil { @@ -89,6 +89,7 @@ func (e *engine) executeCore(ctx context.Context, recipe recipes.ResourceMetadat Recipe: recipe, Definition: *definition, }, + PrevState: prevState, }) if err != nil { return nil, definition, err diff --git a/pkg/recipes/engine/engine_test.go b/pkg/recipes/engine/engine_test.go index 262767282d..24b293ac32 100644 --- a/pkg/recipes/engine/engine_test.go +++ b/pkg/recipes/engine/engine_test.go @@ -59,6 +59,9 @@ func Test_Engine_Execute_Success(t *testing.T) { "resourceName": "resource1", }, } + prevState := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1", + } envConfig := &recipes.Configuration{ Runtime: recipes.RuntimeConfiguration{ Kubernetes: &recipes.KubernetesRuntime{ @@ -104,11 +107,12 @@ func Test_Engine_Execute_Success(t *testing.T) { Recipe: recipeMetadata, Definition: *recipeDefinition, }, + PrevState: prevState, }). Times(1). Return(recipeResult, nil) - result, err := engine.Execute(ctx, recipeMetadata) + result, err := engine.Execute(ctx, recipeMetadata, prevState) require.NoError(t, err) require.Equal(t, result, recipeResult) } @@ -123,6 +127,9 @@ func Test_Engine_Execute_Failure(t *testing.T) { "resourceName": "resource1", }, } + prevState := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1", + } envConfig := &recipes.Configuration{ Runtime: recipes.RuntimeConfiguration{ Kubernetes: &recipes.KubernetesRuntime{ @@ -158,11 +165,12 @@ func Test_Engine_Execute_Failure(t *testing.T) { Recipe: recipeMetadata, Definition: *recipeDefinition, }, + PrevState: prevState, }). Times(1). Return(nil, errors.New("failed to execute recipe")) - result, err := engine.Execute(ctx, recipeMetadata) + result, err := engine.Execute(ctx, recipeMetadata, prevState) require.Nil(t, result) require.Error(t, err) require.Equal(t, err.Error(), "failed to execute recipe") @@ -178,6 +186,9 @@ func Test_Engine_Terraform_Success(t *testing.T) { "resourceName": "resource1", }, } + prevState := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1", + } envConfig := &recipes.Configuration{ Runtime: recipes.RuntimeConfiguration{ Kubernetes: &recipes.KubernetesRuntime{ @@ -224,11 +235,12 @@ func Test_Engine_Terraform_Success(t *testing.T) { Recipe: recipeMetadata, Definition: *recipeDefinition, }, + PrevState: prevState, }). Times(1). Return(recipeResult, nil) - result, err := engine.Execute(ctx, recipeMetadata) + result, err := engine.Execute(ctx, recipeMetadata, prevState) require.NoError(t, err) require.Equal(t, result, recipeResult) } @@ -252,12 +264,14 @@ func Test_Engine_InvalidDriver(t *testing.T) { "resourceName": "resource1", }, } - + prevState := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1", + } configLoader.EXPECT(). LoadRecipe(ctx, &recipeMetadata). Times(1). Return(recipeDefinition, nil) - _, err := engine.Execute(ctx, recipeMetadata) + _, err := engine.Execute(ctx, recipeMetadata, prevState) require.Error(t, err) require.Equal(t, err.Error(), "could not find driver invalid") } @@ -274,11 +288,14 @@ func Test_Engine_Lookup_Error(t *testing.T) { "resourceName": "resource1", }, } + prevState := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1", + } configLoader.EXPECT(). LoadRecipe(ctx, &recipeMetadata). Times(1). Return(nil, errors.New("could not find recipe mongo-azure in environment env1")) - _, err := engine.Execute(ctx, recipeMetadata) + _, err := engine.Execute(ctx, recipeMetadata, prevState) require.Error(t, err) } @@ -294,6 +311,9 @@ func Test_Engine_Load_Error(t *testing.T) { "resourceName": "resource1", }, } + prevState := []string{ + "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1", + } recipeDefinition := &recipes.EnvironmentDefinition{ Driver: recipes.TemplateKindBicep, TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", @@ -307,7 +327,7 @@ func Test_Engine_Load_Error(t *testing.T) { LoadConfiguration(ctx, recipeMetadata). Times(1). Return(nil, errors.New("unable to fetch namespace information")) - _, err := engine.Execute(ctx, recipeMetadata) + _, err := engine.Execute(ctx, recipeMetadata, prevState) require.Error(t, err) } diff --git a/pkg/recipes/engine/mock_engine.go b/pkg/recipes/engine/mock_engine.go index 65456bd714..62aac203af 100644 --- a/pkg/recipes/engine/mock_engine.go +++ b/pkg/recipes/engine/mock_engine.go @@ -51,16 +51,16 @@ func (mr *MockEngineMockRecorder) Delete(arg0, arg1, arg2 interface{}) *gomock.C } // Execute mocks base method. -func (m *MockEngine) Execute(arg0 context.Context, arg1 recipes.ResourceMetadata) (*recipes.RecipeOutput, error) { +func (m *MockEngine) Execute(arg0 context.Context, arg1 recipes.ResourceMetadata, arg2 []string) (*recipes.RecipeOutput, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Execute", arg0, arg1) + ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2) ret0, _ := ret[0].(*recipes.RecipeOutput) ret1, _ := ret[1].(error) return ret0, ret1 } // Execute indicates an expected call of Execute. -func (mr *MockEngineMockRecorder) Execute(arg0, arg1 interface{}) *gomock.Call { +func (mr *MockEngineMockRecorder) Execute(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockEngine)(nil).Execute), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockEngine)(nil).Execute), arg0, arg1, arg2) } diff --git a/pkg/recipes/engine/types.go b/pkg/recipes/engine/types.go index 386e7bb02b..b7309c97ed 100644 --- a/pkg/recipes/engine/types.go +++ b/pkg/recipes/engine/types.go @@ -26,8 +26,9 @@ import ( //go:generate mockgen -destination=./mock_engine.go -package=engine -self_package github.com/project-radius/radius/pkg/recipes/engine github.com/project-radius/radius/pkg/recipes/engine Engine type Engine interface { - // Execute gathers environment configuration and recipe definition and calls the driver to deploy the recipe. - Execute(ctx context.Context, recipe recipes.ResourceMetadata) (*recipes.RecipeOutput, error) + // Execute gathers environment configuration, recipe definition and calls the driver to deploy the recipe. + // prevState is added to the driver execute options, which is used to get the obsolete resources for cleanup. It consists list of recipe output resource IDs that were created in the previous deployment. + Execute(ctx context.Context, recipe recipes.ResourceMetadata, prevState []string) (*recipes.RecipeOutput, error) // Delete handles deletion of output resources for the recipe deployment. Delete(ctx context.Context, recipe recipes.ResourceMetadata, outputResources []rpv1.OutputResource) error } diff --git a/pkg/recipes/errorcodes.go b/pkg/recipes/errorcodes.go index 6075953570..04f7ea5505 100644 --- a/pkg/recipes/errorcodes.go +++ b/pkg/recipes/errorcodes.go @@ -28,4 +28,7 @@ const ( // Used for errors encountered while reading a recipe from registry. RecipeLanguageFailure = "RecipeLanguageFailure" + + // Used for errors encountered while cleaning up of obsolete resources during patch operation. + RecipeGarbageCollectionFailed = "RecipeGarbageCollectionFailed" ) From 7ec4aa81d8386d086af3d813a605704acfd15921 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:11:31 -0700 Subject: [PATCH 27/57] SplitNamespace: Remove Applications.Link, rename linkrp package to portableresources (#6130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description All new namespaces and associated resources are merged into main branch. In this PR we are removing Applications.Link namespace, renaming linkrp package to portableresources and updating references in code where applicable. Notes: Prerequisite for pipeline run: Samples [PR](https://github.com/project-radius/samples/pull/520) needs to be merged so cross-repo test can run. *** Temporarily skipped cross-repo test [Test_FirstApplicationSample](https://github.com/project-radius/radius/blob/26b4d7d01487c2b80d5f9676dca2bb4007c78bcc/test/functional/samples/tutorial_test.go#L56) to ensure all other tests run.*** We will need to coordinate merge of Samples repo PR with this PR. There will be a subsequent PR to further cleanup/update portableresources pkg. [ADOLink](https://dev.azure.com/azure-octo/Incubations/_workitems/edit/9100) ## Type of change - This pull request adds or changes features of Radius and has an approved issue #3499 Fixes: Part of #3499 ## Auto-generated summary ### 🤖 Generated by Copilot at fc8917a ### Summary 🚮🔄📦 This pull request removes the LinkRP from the project and replaces it with the PortableResources package. This involves deleting the `cadl/Applications.Link/` folder and all its files, updating the `generate` makefile target, refactoring the `applications-rp` service, and modifying various config files and documentation files. This change simplifies the build process and the control plane schema, and enables more flexible and portable resource management. > _`LinkRP` is gone_ > _PortableResources take its place_ > _Winter of refactor_ ### Walkthrough * Removed the LinkRP and replaced it with the PortableResources ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L26-R31), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L43), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L86-L90), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL35-R37), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL56-R58), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL75-R77), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL116-R119), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-ceba0600c7e49ffd65b0a2fd7bf1798d9f6f6f531db64e051bb00ff29c7dcd93L41), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-58d6d96c3a9a74e33fc72e9a458a3e9f4c463287d906985725fddb0398081126L95-R95), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-be9c0b61a26165c87503e667cec005520aea94da66f0dd1eedfff863efd266acL34), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL5-R5), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL11-R11), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL32-R32), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL111-R111), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL188-R188), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL232), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-9e2fd80b379a42830faf06edccddb5228ec9ade05d089345244394619fb9e805L11-R11), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-5d21ae7061cfc67f297efd6dff13a428d728e4773925f3510f60c8e6d9e37783L24-R48), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-75c80cc14be37fb7c211406cad8842938ecf06f13f8e96cce2ffc1fd0773a4abL24-R24), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-265d86c33d8aaadab1095bdb645c2a9ac332e8fe668c53177416253167a60155), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-956ed27870b031f49618a9b6a8042d476f99d7e3138e4657581ffaeeba648ee6), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-78185fadaac5ff42fb057be4c16d8fd8ab1fdb42b4970917555ff6e9f757d6a0), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-89f91f33bafb5faa7b074dd268635b954293c5fe2f53c09009f9e6abfc795095), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-0bfbdac013e7b2b48647109f16b6dff0303d1e22c9cba36ac3a368ab1a3bf64e), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-88966ddffd3fac707c94f18453b9450a7d360f820fc6ac41ca5fedc2c53b0011), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-07a129bf3e41583f906498de6a694439bd12dce38d89e98bc3c42fa810e80c4f), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-d71e3c7100ad9aefdc37bbeba197163fd2eae9ef5647b8f84a5cf696b7b0825c), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-a7fc4c1c91cdd5fea8251213ddba04b704e9c11e1dee140aeb613753ef5e8141), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-30f91ef9fd4bea5a339df8ccc84c014b2b5b849703066601b747171614f54855), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-d79f3addb8760363b564d5a26305d1cba9df8b75e8f41204a3c11b7d7f22fb28)) * Updated the `generate` and `generate-cadl` targets in the `build/generate.mk` file to remove the dependency and command for the LinkRP ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L26-R31), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L43)) * Removed the `generate-rad-linkrp-client` target in the `build/generate.mk` file ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L86-L90)) * Updated the imports, functions, flags, and logger messages in the `main.go` file for the applications-rp to use the `pr_backend` and `pr_frontend` packages instead of the `link_backend` and `link_frontend` packages ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL35-R37), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL56-R58), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL75-R77), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL116-R119)) * Removed the `Applications.Link` entry from the `ucp` section in the `ucp-self-hosted-dev.yaml` file in the `cmd/ucpd` folder ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-ceba0600c7e49ffd65b0a2fd7bf1798d9f6f6f531db64e051bb00ff29c7dcd93L41)) * Changed the `serviceName` value for the `tracerProvider` section from "applications.link" to "applications.datastores" in the `configmaps.yaml` file in the `deploy/Chart/templates/rp` folder ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-58d6d96c3a9a74e33fc72e9a458a3e9f4c463287d906985725fddb0398081126L95-R95)) * Removed the `Applications.Link` entry from the `ucp` section in the `configmaps.yaml` file in the `deploy/Chart/templates/ucp` folder ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-be9c0b61a26165c87503e667cec005520aea94da66f0dd1eedfff863efd266acL34)) * Updated the summary, examples, schema, and configuration files sections in the `configSettings.md` file in the `docs/contributing/contributing-code/contributing-code-control-plane` folder to mention the PortableResources instead of the Applications.Link RP ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL5-R5), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL11-R11), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL32-R32), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL111-R111), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL188-R188), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-c5a6e900bac29ec26476b731e62862ee9afb8f9f67225da0aa8fd1d052f8183fL232)) * Updated the running Radius control plane provider locally section in the `running-controlplane-locally.md` file in the `docs/contributing/contributing-code/contributing-code-control-plane` folder to mention the PortableResources instead of the Applications.Link RP ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-9e2fd80b379a42830faf06edccddb5228ec9ade05d089345244394619fb9e805L11-R11)) * Updated the pkg folders section in the `README.md` file in the `docs/contributing/contributing-code/contributing-code-organization` folder to replace the `linkrp/` folder with the `portableresources/` folder ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-5d21ae7061cfc67f297efd6dff13a428d728e4773925f3510f60c8e6d9e37783L24-R48)) * Updated the step 1 section in the `README.md` file in the `docs/contributing/contributing-code/contributing-code-schema-changes` folder to mention the portable resources instead of the LinkRP ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-75c80cc14be37fb7c211406cad8842938ecf06f13f8e96cce2ffc1fd0773a4abL24-R24)) * Deleted the `cadl/Applications.Link/` folder and the `cadl/cadl-project.yaml` file, as they are no longer needed ([link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-265d86c33d8aaadab1095bdb645c2a9ac332e8fe668c53177416253167a60155), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-956ed27870b031f49618a9b6a8042d476f99d7e3138e4657581ffaeeba648ee6), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-78185fadaac5ff42fb057be4c16d8fd8ab1fdb42b4970917555ff6e9f757d6a0), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-89f91f33bafb5faa7b074dd268635b954293c5fe2f53c09009f9e6abfc795095), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-0bfbdac013e7b2b48647109f16b6dff0303d1e22c9cba36ac3a368ab1a3bf64e), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-88966ddffd3fac707c94f18453b9450a7d360f820fc6ac41ca5fedc2c53b0011), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-07a129bf3e41583f906498de6a694439bd12dce38d89e98bc3c42fa810e80c4f), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-d71e3c7100ad9aefdc37bbeba197163fd2eae9ef5647b8f84a5cf696b7b0825c), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-a7fc4c1c91cdd5fea8251213ddba04b704e9c11e1dee140aeb613753ef5e8141), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-30f91ef9fd4bea5a339df8ccc84c014b2b5b849703066601b747171614f54855), [link](https://github.com/project-radius/radius/pull/6130/files?diff=unified&w=0#diff-d79f3addb8760363b564d5a26305d1cba9df8b75e8f41204a3c11b7d7f22fb28)) --- .github/workflows/functional-test.yaml | 1 + .vscode/launch.json | 4 +- build/generate.mk | 10 +- cadl/Applications.Link/daprPubSubBrokers.cadl | 88 - cadl/Applications.Link/daprSecretStores.cadl | 84 - cadl/Applications.Link/daprStateStores.cadl | 88 - cadl/Applications.Link/extenders.cadl | 98 - cadl/Applications.Link/global.cadl | 86 - cadl/Applications.Link/main.cadl | 31 - cadl/Applications.Link/mongoDatabases.cadl | 120 - .../rabbitMQMessageQueues.cadl | 133 - cadl/Applications.Link/redisCaches.cadl | 122 - cadl/Applications.Link/sqlDatabases.cadl | 122 - cadl/cadl-project.yaml | 5 - cmd/applications-rp/main.go | 40 +- ...ink-dev.yaml => portableresource-dev.yaml} | 0 ...yaml => portableresource-self-hosted.yaml} | 2 +- cmd/rad/cmd/recipe.go | 6 +- cmd/ucpd/ucp-self-hosted-dev.yaml | 3 +- deploy/Chart/templates/rp/configmaps.yaml | 4 +- deploy/Chart/templates/rp/deployment.yaml | 6 +- deploy/Chart/templates/rp/service.yaml | 2 +- deploy/Chart/templates/ucp/configmaps.yaml | 1 - .../configSettings.md | 11 +- .../running-controlplane-locally.md | 4 +- .../contributing-code-organization/README.md | 52 +- .../README.md | 2 +- docs/release-notes/v0.22.0.md | 4 +- docs/ucp/configuration.md | 2 +- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 2 +- .../2022-03-15-privatepreview/types.json | 1 - .../2022-03-15-privatepreview/types.md | 352 --- hack/bicep-types-radius/generated/index.json | 2 +- hack/bicep-types-radius/generated/index.md | 25 - pkg/armrpc/api/v1/types.go | 2 +- .../defaultoperation/resource_test.go | 2 +- pkg/cli/clients/management.go | 24 +- pkg/cli/clients_new/README.md | 2 +- pkg/cli/clivalidation.go | 2 +- .../cmd/credential/register/azure/azure.go | 2 +- pkg/cli/cmd/radinit/init_test.go | 2 +- pkg/cli/cmd/radinit/recipe.go | 39 +- pkg/cli/cmd/radinit/recipe_test.go | 54 +- pkg/cli/cmd/recipe/list/list.go | 6 +- pkg/cli/cmd/recipe/list/list_test.go | 8 +- pkg/cli/cmd/recipe/register/register.go | 8 +- pkg/cli/cmd/recipe/register/register_test.go | 36 +- pkg/cli/cmd/recipe/show/show.go | 2 +- pkg/cli/cmd/recipe/show/show_test.go | 10 +- pkg/cli/cmd/recipe/unregister/unregister.go | 2 +- .../cmd/recipe/unregister/unregister_test.go | 30 +- .../environment_conversion.go | 3 +- .../environment_conversion_test.go | 32 +- ...ronmentrecipeproperties_conversion_test.go | 4 +- .../extender_conversion.go | 28 +- .../extender_conversion_test.go | 14 +- .../environmentresource-invalid-linktype.json | 2 +- ...ironmentresource-invalid-templatekind.json | 2 +- ...ironmentresource-missing-templatekind.json | 2 +- ...entresource-terraformrecipe-localpath.json | 2 +- ...onmentresource-with-workload-identity.json | 2 +- .../testdata/environmentresource.json | 6 +- ...ourcedatamodel-with-workload-identity.json | 2 +- .../environmentresourcedatamodel.json | 2 +- .../environmentresourcedatamodelemptyext.json | 2 +- ...entresourcedatamodelemptytemplatekind.json | 2 +- .../testdata/environmentresourceemptyext.json | 2 +- .../environmentresourceemptyext2.json | 2 +- .../testdata/reciperesource.json | 2 +- .../api/v20220315privatepreview/util.go | 24 - .../api/v20220315privatepreview/util_test.go | 10 - .../zz_generated_extenders_client.go | 10 +- .../zz_generated_models.go | 10 +- .../zz_generated_response_types.go | 6 +- .../controller/createorupdateresource_test.go | 14 +- .../backend/deployment/deploymentprocessor.go | 102 +- .../deployment/deploymentprocessor_test.go | 46 +- pkg/corerp/backend/service.go | 14 +- pkg/corerp/datamodel/environment.go | 2 +- pkg/corerp/datamodel/extender.go | 16 +- pkg/corerp/datamodel/linkmetadata.go | 2 +- .../environments/getrecipemetadata.go | 6 +- .../environments/getrecipemetadata_test.go | 2 +- ...nment20220315privatepreview_datamodel.json | 2 +- ...vironment20220315privatepreview_input.json | 2 +- ...ironment20220315privatepreview_output.json | 2 +- ...ingrecipe20220315privatepreview_input.json | 2 +- ...adata20220315privatepreview_datamodel.json | 4 +- ...emetadata20220315privatepreview_input.json | 2 +- pkg/corerp/frontend/handler/getoperations.go | 4 +- pkg/corerp/frontend/service.go | 2 +- pkg/corerp/processors/extenders/processor.go | 2 +- .../processors/extenders/processor_test.go | 2 +- .../v20220315privatepreview/datamodel_util.go | 32 +- .../datamodel_util_test.go | 36 +- .../pubsubbroker_conversion.go | 6 +- .../pubsubbroker_conversion_test.go | 18 +- .../secretstore_conversion.go | 6 +- .../secretstore_conversion_test.go | 16 +- .../statestore_conversion.go | 6 +- .../statestore_conversion_test.go | 12 +- pkg/daprrp/datamodel/daprpubsubbroker.go | 18 +- pkg/daprrp/datamodel/daprsecretstore.go | 22 +- pkg/daprrp/datamodel/daprstatestore.go | 26 +- pkg/daprrp/datamodel/daprstatestore_test.go | 2 +- pkg/daprrp/frontend/controller/types.go | 38 + .../processors/pubsubbrokers/processor.go | 14 +- .../pubsubbrokers/processor_test.go | 18 +- .../processors/secretstores/processor.go | 14 +- .../processors/secretstores/processor_test.go | 14 +- .../processors/statestores/processor.go | 14 +- .../processors/statestores/processor_test.go | 18 +- .../v20220315privatepreview/datamodel_util.go | 32 +- .../datamodel_util_test.go | 40 +- .../mongodatabase_conversion.go | 4 +- .../mongodatabase_conversion_test.go | 32 +- .../rediscache_conversion.go | 4 +- .../rediscache_conversion_test.go | 30 +- .../sqldatabase_conversion.go | 6 +- .../sqldatabase_conversion_test.go | 18 +- pkg/datastoresrp/datamodel/mongodatabase.go | 24 +- pkg/datastoresrp/datamodel/rediscache.go | 24 +- pkg/datastoresrp/datamodel/sqldatabase.go | 22 +- .../listsecretsmongodatabase.go | 2 +- .../listsecretsmongodatabase_test.go | 2 +- .../controller/mongodatabases/types.go | 22 - .../rediscaches/listsecretsrediscache.go | 8 +- .../rediscaches/listsecretsrediscache_test.go | 2 +- .../sqldatabases/listsecretssqldatabase.go | 2 +- .../frontend/controller/sqldatabases/types.go | 22 - pkg/datastoresrp/frontend/controller/types.go | 10 +- .../processors/mongodatabases/processor.go | 4 +- .../mongodatabases/processor_test.go | 12 +- .../processors/rediscaches/processor.go | 4 +- .../processors/rediscaches/processor_test.go | 12 +- .../processors/sqldatabases/processor.go | 4 +- .../processors/sqldatabases/processor_test.go | 12 +- pkg/linkrp/api/README.md | 63 - .../daprpubsubbroker_conversion.go | 151 - .../daprpubsubbroker_conversion_test.go | 264 -- .../daprsecretstore_conversion.go | 141 - .../daprsecretstore_conversion_test.go | 262 -- .../daprstatestore_conversion.go | 134 - .../daprstatestore_conversion_test.go | 199 -- .../v20220315privatepreview/datamodel_util.go | 163 -- .../datamodel_util_test.go | 272 -- .../extender_conversion.go | 88 - .../extender_conversion_test.go | 252 -- .../mongodatabase_conversion.go | 135 - .../mongodatabase_conversion_test.go | 387 --- .../rabbitmq_conversion.go | 137 - .../rabbitmq_conversion_test.go | 317 --- .../rediscache_conversion.go | 136 - .../rediscache_conversion_test.go | 396 --- .../sqldatabase_conversion.go | 136 - .../sqldatabase_conversion_test.go | 305 -- ...prpubsubbroker_invalidmanual_resource.json | 17 - ...prpubsubbroker_invalidrecipe_resource.json | 18 - .../daprpubsubbroker_manual_datamodel.json | 40 - ...pubsubbroker_manual_generic_datamodel.json | 36 - .../daprpubsubbroker_manual_resource.json | 24 - .../daprpubsubbroker_recipe_datamodel.json | 33 - .../daprpubsubbroker_recipe_resource.json | 17 - ...aprsecretstore_invalidrecipe_resource.json | 18 - ...aprsecretstore_invalidvalues_resource.json | 17 - .../daprsecretstore_manual_resource.json | 20 - ...rsecretstore_manual_resourcedatamodel.json | 36 - .../daprsecretstore_recipe_resource.json | 26 - ...rsecretstore_recipe_resourcedatamodel.json | 40 - .../daprsecretstoreresource-invalid.json | 10 - ...daprstatestore_invalidrecipe_resource.json | 18 - ...daprstatestore_invalidvalues_resource.json | 17 - .../daprstatestore_recipe_resource.json | 17 - ...prstatestore_recipe_resourcedatamodel.json | 32 - .../daprstatestore_values_resource.json | 24 - ...prstatestore_values_resourcedatamodel.json | 40 - .../testdata/extender_manual.json | 22 - .../testdata/extender_manual_nosecrets.json | 11 - .../testdata/extender_recipe.json | 19 - .../testdata/extenderdatamodel_manual.json | 35 - .../extenderdatamodel_manual_nosecrets.json | 31 - .../testdata/extenderdatamodel_recipe.json | 30 - .../testdata/extenderresource-invalid.json | 8 - .../extenderresponseresourcedatamodel.json | 31 - .../mongodatabaseresource-invalid.json | 9 - ...tabaseresource-invalidresprovisioning.json | 8 - .../mongodatabaseresource-missinginputs.json | 8 - .../testdata/mongodatabaseresource.json | 25 - .../testdata/mongodatabaseresource2.json | 14 - .../mongodatabaseresource_recipe.json | 18 - .../mongodatabaseresource_recipe2.json | 11 - .../mongodatabaseresourcedatamodel.json | 36 - .../mongodatabaseresourcedatamodel2.json | 36 - ...mongodatabaseresourcedatamodel_recipe.json | 35 - .../testdata/mongodatabasesecrets.json | 4 - .../mongodatabasesecretsdatamodel.json | 4 - .../rabbitmq_invalid_properties_resource.json | 8 - ...invalid_resourceprovisioning_resource.json | 8 - .../testdata/rabbitmq_manual_datamodel.json | 39 - .../testdata/rabbitmq_manual_resource.json | 24 - .../testdata/rabbitmq_recipe_datamodel.json | 41 - .../testdata/rabbitmq_recipe_resource.json | 27 - .../testdata/rabbitmqresource-invalid.json | 8 - .../testdata/rabbitmqsecrets.json | 4 - .../testdata/rabbitmqsecretsdatamodel.json | 4 - .../testdata/rediscacheresource-invalid.json | 8 - .../testdata/rediscacheresource-invalid2.json | 11 - .../rediscacheresource-invalidinput.json | 8 - .../rediscacheresource_defaultrecipe.json | 9 - .../testdata/rediscacheresource_manual.json | 31 - ...rediscacheresource_manual_noresources.json | 12 - .../rediscacheresource_recipe_named.json | 12 - ...iscacheresource_recipe_overridevalues.json | 17 - .../rediscacheresourcedatamodel_manual.json | 30 - ...cheresourcedatamodel_manual_resources.json | 39 - ...cacheresourcedatamodel_recipe_default.json | 27 - ...scacheresourcedatamodel_recipe_params.json | 33 - .../testdata/rediscachesecrets.json | 5 - .../testdata/rediscachesecretsdatamodel.json | 5 - ...ldatabase_invalid_properties_resource.json | 8 - ...invalid_resourceprovisioning_resource.json | 8 - .../testdata/sqldatabase_manual_resource.json | 34 - .../sqldatabase_manual_resourcedatamodel.json | 38 - .../testdata/sqldatabase_recipe_resource.json | 19 - .../sqldatabase_recipe_resourcedatamodel.json | 39 - .../sqldatabase_secrets_datamodel.json | 4 - .../testdata/sqldatabaseresource-invalid.json | 9 - .../zz_generated_client_factory.go | 83 - .../zz_generated_constants.go | 111 - .../zz_generated_daprpubsubbroker_client.go | 281 -- .../zz_generated_daprsecretstore_client.go | 276 -- .../zz_generated_daprstatestore_client.go | 281 -- .../zz_generated_extenders_client.go | 304 -- .../zz_generated_models.go | 842 ------ .../zz_generated_models_serde.go | 2009 -------------- .../zz_generated_mongodatabases_client.go | 334 --- .../zz_generated_operations_client.go | 93 - .../zz_generated_options.go | 216 -- ..._generated_rabbitmqmessagequeues_client.go | 331 --- .../zz_generated_rediscaches_client.go | 328 --- .../zz_generated_response_types.go | 254 -- .../zz_generated_sqldatabases_client.go | 329 --- .../converter/daprpubsubbroker_converter.go | 60 - .../daprpubsubbroker_converter_test.go | 205 -- .../converter/daprsecretstore_converter.go | 59 - .../daprsecretstore_converter_test.go | 108 - .../converter/daprstatestore_converter.go | 60 - .../daprstatestore_converter_test.go | 124 - .../datamodel/converter/extender_converter.go | 63 - .../converter/extender_converter_test.go | 103 - .../converter/mongodatabase_converter.go | 75 - .../converter/mongodatabase_converter_test.go | 144 - .../datamodel/converter/rabbitmq_converter.go | 73 - .../converter/rabbitmq_converter_test.go | 145 - .../converter/rediscache_converter.go | 77 - .../converter/rediscache_converter_test.go | 145 - .../converter/sqldatabase_converter.go | 73 - .../converter/sqldatabase_converter_test.go | 156 -- pkg/linkrp/datamodel/daprdetector.go | 50 - pkg/linkrp/datamodel/daprpubsubbroker.go | 88 - pkg/linkrp/datamodel/daprsecretstore.go | 76 - pkg/linkrp/datamodel/daprstatestore.go | 82 - pkg/linkrp/datamodel/daprstatestore_test.go | 85 - pkg/linkrp/datamodel/extender.go | 77 - pkg/linkrp/datamodel/mongodatabase.go | 142 - pkg/linkrp/datamodel/rabbitmq.go | 126 - pkg/linkrp/datamodel/rediscache.go | 169 -- pkg/linkrp/datamodel/sqldatabase.go | 139 - .../extenders/listsecretsextender.go | 70 - .../extenders/listsecretsextender_test.go | 148 - .../20220315privatepreview_datamodel.json | 43 - .../20220315privatepreview_input.json | 13 - ...20220315privatepreview_input_diff_env.json | 13 - .../20220315privatepreview_output.json | 33 - ...20220315privatepreview_requestheaders.json | 63 - ...220315privatepreviewgetandlist_output.json | 29 - .../frontend/controller/extenders/types.go | 22 - .../extenders/v20220315privatepreview_test.go | 43 - .../listsecretsmongodatabase.go | 73 - .../listsecretsmongodatabase_test.go | 177 -- .../20220315privatepreview_datamodel.json | 60 - ...20220315privatepreview_requestheaders.json | 63 - .../controller/mongodatabases/types.go | 22 - .../v20220315privatepreview_test.go | 35 - .../listsecretsrabbitmq.go | 75 - .../listsecretsrabbitmq_test.go | 135 - .../20220315privatepreview_datamodel.json | 48 - ...20220315privatepreview_requestheaders.json | 63 - .../controller/rabbitmqmessagequeues/types.go | 22 - .../v20220315privatepreview_test.go | 35 - .../rediscaches/listsecretsrediscache.go | 80 - .../rediscaches/listsecretsrediscache_test.go | 174 -- .../20220315privatepreview_datamodel.json | 57 - ...20220315privatepreview_requestheaders.json | 63 - .../frontend/controller/rediscaches/types.go | 22 - .../v20220315privatepreview_test.go | 35 - .../sqldatabases/listsecretssqldatabase.go | 73 - .../listsecretssqldatabase_test.go | 176 -- .../20220315privatepreview_datamodel.json | 59 - .../20220315privatepreview_input.json | 21 - .../20220315privatepreview_output.json | 37 - ...20220315privatepreview_requestheaders.json | 63 - .../frontend/controller/sqldatabases/types.go | 22 - .../v20220315privatepreview_test.go | 43 - pkg/linkrp/frontend/controller/types.go | 66 - pkg/linkrp/frontend/handler/routes.go | 1744 ------------ pkg/linkrp/frontend/handler/routes_test.go | 522 ---- .../processors/daprpubsubbrokers/doc.go | 18 - .../processors/daprpubsubbrokers/processor.go | 103 - .../daprpubsubbrokers/processor_test.go | 333 --- pkg/linkrp/processors/daprsecretstores/doc.go | 18 - .../processors/daprsecretstores/processor.go | 100 - .../daprsecretstores/processor_test.go | 306 -- pkg/linkrp/processors/daprstatestores/doc.go | 18 - .../processors/daprstatestores/processor.go | 103 - .../daprstatestores/processor_test.go | 330 --- pkg/linkrp/processors/extenders/doc.go | 18 - pkg/linkrp/processors/extenders/processor.go | 71 - .../processors/extenders/processor_test.go | 228 -- pkg/linkrp/processors/mongodatabases/doc.go | 18 - .../processors/mongodatabases/processor.go | 67 - .../mongodatabases/processor_test.go | 237 -- .../processors/rabbitmqmessagequeues/doc.go | 18 - .../rabbitmqmessagequeues/processor.go | 79 - .../rabbitmqmessagequeues/processor_test.go | 190 -- pkg/linkrp/processors/rediscaches/doc.go | 18 - .../processors/rediscaches/processor.go | 104 - .../processors/rediscaches/processor_test.go | 249 -- pkg/linkrp/processors/sqldatabases/doc.go | 7 - .../processors/sqldatabases/processor.go | 55 - .../processors/sqldatabases/processor_test.go | 224 -- pkg/logging/logfields.go | 4 +- .../v20220315privatepreview/datamodel_util.go | 32 +- .../datamodel_util_test.go | 24 +- .../rabbitmq_conversion.go | 6 +- .../rabbitmq_conversion_test.go | 16 +- pkg/messagingrp/datamodel/rabbitmq.go | 42 +- .../rabbitmqqueues/listsecretsrabbitmq.go | 2 +- .../listsecretsrabbitmq_test.go | 2 +- .../processors/rabbitmqqueues/processor.go | 4 +- .../rabbitmqqueues/processor_test.go | 2 +- .../api/v20220315privatepreview/util.go | 4 + .../api/v20220315privatepreview/util_test.go} | 24 +- .../api/v20220315privatepreview/version.go | 0 .../zz_generated_time_rfc3339.go | 2 +- .../controller/createorupdateresource.go | 6 +- .../controller/createorupdateresource_test.go | 14 +- .../backend/controller/deleteresource.go | 42 +- .../backend/controller/deleteresource_test.go | 10 +- .../backend/service.go | 71 +- .../datamodel/doc.go | 2 +- .../datamodel/linkmetadata.go | 14 +- .../datamodel/recipes.go | 6 +- .../frontend/handler/getoperations.go | 367 +-- .../frontend/handler/getoperations_test.go | 4 +- .../frontend/handler/routes.go | 909 ++++++ .../frontend/handler/routes_test.go | 292 ++ .../frontend/service.go | 11 +- .../handlers/util.go | 0 .../handlers/util_test.go | 18 +- .../processors/doc.go | 2 +- .../processors/mock_resourceclient.go | 2 +- .../processors/resourceclient.go | 0 .../processors/resourceclient_test.go | 0 .../processors/types.go | 4 +- .../processors/util.go | 4 +- .../processors/util_test.go | 6 +- .../processors/validator.go | 6 +- .../processors/validator_test.go | 10 +- .../renderers/dapr/generic.go | 0 .../renderers/types.go | 0 pkg/{linkrp => portableresources}/types.go | 85 +- .../types_test.go} | 20 +- pkg/recipes/configloader/environment_test.go | 10 +- pkg/recipes/driver/bicep.go | 4 +- pkg/recipes/driver/bicep_test.go | 16 +- pkg/recipes/driver/terraform_test.go | 4 +- pkg/recipes/engine/engine_test.go | 14 +- pkg/recipes/recipecontext/context_test.go | 22 +- pkg/recipes/recipecontext/types.go | 6 +- pkg/recipes/terraform/config/config_test.go | 4 +- .../config/testdata/main-all.tf.json | 4 +- .../config/testdata/main-noparams.tf.json | 4 +- .../testdata/main-noresourceparam.tf.json | 4 +- pkg/recipes/types.go | 10 +- pkg/rp/frontend/validator.go | 2 +- pkg/rp/frontend/validator_test.go | 2 +- pkg/ucp/resources/id_test.go | 88 +- pkg/ucp/resources/radius/radius.go | 5 +- pkg/ucp/resources/radius/radius_test.go | 2 +- pkg/ucp/util/normalize_test.go | 2 +- pkg/validator/loader.go | 6 +- swagger/doc.go | 4 +- .../examples/Environments_CreateOrUpdate.json | 4 +- .../examples/Environments_GetEnv0.json | 2 +- .../Environments_GetRecipeMetadata.json | 2 +- .../examples/Environments_List.json | 6 +- .../examples/Environments_PatchEnv0.json | 4 +- .../2022-03-15-privatepreview/openapi.json | 20 +- .../examples/DaprPubSubBrokersDelete.json | 13 - .../examples/DaprPubSubBrokersGet.json | 33 - .../examples/DaprPubSubBrokersList.json | 71 - .../DaprPubSubBrokersListByRootScope.json | 54 - .../examples/DaprPubSubBrokersPut.json | 75 - .../DaprPubSubBrokersPutWithRecipe.json | 64 - .../examples/DaprSecretStoresDelete.json | 12 - .../examples/DaprSecretStoresGet.json | 29 - .../examples/DaprSecretStoresList.json | 50 - .../DaprSecretStoresListByRootScope.json | 50 - .../examples/DaprSecretStoresPut.json | 62 - .../examples/DaprStateStoresDelete.json | 13 - .../examples/DaprStateStoresGet.json | 26 - .../examples/DaprStateStoresList.json | 87 - .../DaprStateStoresListByRootScope.json | 73 - .../examples/DaprStateStoresPut.json | 63 - .../DaprStateStoresPutWithRecipe.json | 53 - .../examples/ExtendersDelete.json | 13 - .../examples/ExtendersGet.json | 30 - .../examples/ExtendersList.json | 33 - .../examples/ExtendersListByRootScope.json | 33 - .../examples/ExtendersListSecrets.json | 17 - .../examples/ExtendersPut.json | 60 - .../examples/ExtendersPutWithRecipe.json | 52 - .../examples/MongoDatabasesDelete.json | 12 - .../examples/MongoDatabasesGet.json | 29 - .../examples/MongoDatabasesList.json | 69 - .../MongoDatabasesListByRootScope.json | 68 - .../examples/MongoDatabasesListSecrets.json | 16 - .../examples/MongoDatabasesPutRecipe.json | 60 - .../examples/MongoDatabasesPutValues.json | 59 - .../examples/OperationsList.json | 73 - .../examples/RabbitMQMessageQueuesDelete.json | 13 - .../examples/RabbitMQMessageQueuesGet.json | 28 - .../examples/RabbitMQMessageQueuesList.json | 46 - .../RabbitMQMessageQueuesListByRootScope.json | 49 - .../RabbitMQMessageQueuesListSecrets.json | 16 - .../examples/RabbitMQMessageQueuesPut.json | 58 - .../examples/RedisCachesDelete.json | 13 - .../examples/RedisCachesGet.json | 28 - .../examples/RedisCachesList.json | 64 - .../examples/RedisCachesListByRootScope.json | 63 - .../examples/RedisCachesListSecrets.json | 17 - .../examples/RedisCachesPutRecipe.json | 61 - .../examples/RedisCachesPutResource.json | 55 - .../examples/RedisCachesPutValues.json | 58 - .../examples/SQLDatabasesDelete.json | 13 - .../examples/SQLDatabasesGet.json | 31 - .../examples/SQLDatabasesList.json | 66 - .../examples/SQLDatabasesListByRootScope.json | 66 - .../examples/SQLDatabasesPut.json | 49 - .../2022-03-15-privatepreview/extenders.json | 385 --- .../2022-03-15-privatepreview/openapi.json | 2462 ----------------- .../TestAsyncResource_CreateOrUpdate.json | 30 + .../examples/TestAsyncResource_Delete.json | 14 + .../examples/TestAsyncResource_Get.json | 22 + .../examples/TestAsyncResource_List.json | 35 + .../TestAsyncResource_ListByScope.json | 35 + .../examples/TestAsyncResource_Update.json | 30 + .../preview/2022-08-19-preview/openapi.json | 744 +++++ .../TestAsyncResource_CreateOrUpdate.json | 30 + .../examples/TestAsyncResource_Delete.json | 14 + .../examples/TestAsyncResource_Get.json | 22 + .../examples/TestAsyncResource_List.json | 35 + .../TestAsyncResource_ListByScope.json | 35 + .../examples/TestAsyncResource_Update.json | 30 + .../TestSyncResource_CreateOrUpdate.json | 30 + .../examples/TestSyncResource_Get.json | 22 + .../examples/TestSyncResource_List.json | 35 + .../TestSyncResource_ListByScope.json | 35 + .../examples/TestSyncResource_Update.json | 30 + .../stable/2023-08-19/openapi.json | 1038 +++++++ .../resource-manager/readme.csharp.md | 8 - .../applications/resource-manager/readme.md | 10 - .../resource-manager/readme.python.md | 13 - .../examples/PlanesGetPlaneLocal.json | 2 +- .../examples/PlanesList.json | 2 +- .../examples/PlanesTypeList.json | 2 +- swagger/specs.go | 1 - .../datastoresrp/resources/mongodb_test.go | 8 +- .../datastoresrp/resources/sql_test.go | 2 +- .../testdata/tutorial-environment.bicep | 2 +- test/functional/samples/tutorial_test.go | 6 +- test/functional/shared/cli/cli_test.go | 4 +- .../corerp-resources-recipe-env.bicep | 2 +- .../dapr_component_name_conflict_test.go | 60 - .../shared/resources/dapr_pubsub_test.go | 112 - .../shared/resources/dapr_secretstore_test.go | 106 - .../resources/dapr_serviceinvocation_test.go | 67 - .../shared/resources/dapr_statestore_test.go | 114 - .../shared/resources/linkrp_extender_test.go | 165 -- .../shared/resources/microsoftsql_test.go | 121 - .../shared/resources/mongodb_test.go | 236 -- .../shared/resources/rabbitmq_test.go | 116 - .../functional/shared/resources/redis_test.go | 139 - .../shared/resources/secretstore_test.go | 115 - test/functional/shared/resources/sql_test.go | 82 - ...sources-friendly-container-version-1.bicep | 2 +- ...sources-dapr-component-name-conflict.bicep | 43 - ...-resources-dapr-pubsub-broker-manual.bicep | 64 - ...-resources-dapr-pubsub-broker-recipe.bicep | 72 - ...rp-resources-dapr-secretstore-manual.bicep | 57 - ...rp-resources-dapr-secretstore-recipe.bicep | 76 - ...erp-resources-dapr-serviceinvocation.bicep | 68 - ...erp-resources-dapr-statestore-manual.bicep | 65 - ...erp-resources-dapr-statestore-recipe.bicep | 72 - .../corerp-resources-microsoft-sql.bicep | 80 - ...esources-mongodb-manual-provisioning.bicep | 88 - ...erp-resources-mongodb-recipe-context.bicep | 83 - ...-resources-mongodb-recipe-parameters.bicep | 93 - .../corerp-resources-mongodb-recipe.bicep | 86 - .../corerp-resources-rabbitmq-recipe.bicep | 85 - .../testdata/corerp-resources-rabbitmq.bicep | 98 - ...orerp-resources-redis-default-recipe.bicep | 55 - ...p-resources-redis-manualprovisioning.bicep | 78 - .../corerp-resources-redis-recipe.bicep | 58 - .../corerp-resources-secretstore-new.bicep | 64 - .../corerp-resources-secretstore-ref.bicep | 35 - .../testdata/corerp-resources-sql.bicep | 106 - .../corerp-resources-sqldb-recipe.bicep | 91 - ...krp-resources-extender-aws-s3-recipe.bicep | 63 - .../linkrp-resources-extender-recipe.bicep | 50 - .../testdata/linkrp-resources-extender.bicep | 42 - test/validation/shared.go | 10 - typespec/Applications.Core/environments.tsp | 2 +- .../Environments_CreateOrUpdate.json | 4 +- .../Environments_GetEnv0.json | 2 +- .../Environments_GetRecipeMetadata.json | 2 +- .../Environments_List.json | 6 +- .../Environments_PatchEnv0.json | 4 +- typespec/Applications.Core/extenders.tsp | 8 +- 531 files changed, 4573 insertions(+), 32874 deletions(-) delete mode 100644 cadl/Applications.Link/daprPubSubBrokers.cadl delete mode 100644 cadl/Applications.Link/daprSecretStores.cadl delete mode 100644 cadl/Applications.Link/daprStateStores.cadl delete mode 100644 cadl/Applications.Link/extenders.cadl delete mode 100644 cadl/Applications.Link/global.cadl delete mode 100644 cadl/Applications.Link/main.cadl delete mode 100644 cadl/Applications.Link/mongoDatabases.cadl delete mode 100644 cadl/Applications.Link/rabbitMQMessageQueues.cadl delete mode 100644 cadl/Applications.Link/redisCaches.cadl delete mode 100644 cadl/Applications.Link/sqlDatabases.cadl delete mode 100644 cadl/cadl-project.yaml rename cmd/applications-rp/{link-dev.yaml => portableresource-dev.yaml} (100%) rename cmd/applications-rp/{link-self-hosted.yaml => portableresource-self-hosted.yaml} (94%) delete mode 100644 hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.json delete mode 100644 hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.md create mode 100644 pkg/daprrp/frontend/controller/types.go delete mode 100644 pkg/datastoresrp/frontend/controller/mongodatabases/types.go delete mode 100644 pkg/datastoresrp/frontend/controller/sqldatabases/types.go delete mode 100644 pkg/linkrp/api/README.md delete mode 100644 pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/datamodel_util.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/datamodel_util_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/extender_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/rediscache_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidmanual_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidrecipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidrecipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidvalues_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstoreresource-invalid.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidrecipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidvalues_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual_nosecrets.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extenderresource-invalid.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalid.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalidresprovisioning.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-missinginputs.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource2.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe2.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecrets.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecretsdatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_properties_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_resourceprovisioning_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqresource-invalid.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecrets.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecretsdatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid2.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalidinput.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_defaultrecipe.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual_noresources.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_named.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_overridevalues.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecrets.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecretsdatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_properties_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_resourceprovisioning_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resource.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_secrets_datamodel.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabaseresource-invalid.json delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go delete mode 100644 pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go delete mode 100644 pkg/linkrp/datamodel/converter/daprpubsubbroker_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/daprsecretstore_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/daprsecretstore_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/daprstatestore_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/daprstatestore_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/extender_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/extender_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/mongodatabase_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/mongodatabase_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/rabbitmq_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/rabbitmq_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/rediscache_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/rediscache_converter_test.go delete mode 100644 pkg/linkrp/datamodel/converter/sqldatabase_converter.go delete mode 100644 pkg/linkrp/datamodel/converter/sqldatabase_converter_test.go delete mode 100644 pkg/linkrp/datamodel/daprdetector.go delete mode 100644 pkg/linkrp/datamodel/daprpubsubbroker.go delete mode 100644 pkg/linkrp/datamodel/daprsecretstore.go delete mode 100644 pkg/linkrp/datamodel/daprstatestore.go delete mode 100644 pkg/linkrp/datamodel/daprstatestore_test.go delete mode 100644 pkg/linkrp/datamodel/extender.go delete mode 100644 pkg/linkrp/datamodel/mongodatabase.go delete mode 100644 pkg/linkrp/datamodel/rabbitmq.go delete mode 100644 pkg/linkrp/datamodel/rediscache.go delete mode 100644 pkg/linkrp/datamodel/sqldatabase.go delete mode 100644 pkg/linkrp/frontend/controller/extenders/listsecretsextender.go delete mode 100644 pkg/linkrp/frontend/controller/extenders/listsecretsextender_test.go delete mode 100644 pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_datamodel.json delete mode 100644 pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input.json delete mode 100644 pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input_diff_env.json delete mode 100644 pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json delete mode 100644 pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_requestheaders.json delete mode 100644 pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json delete mode 100644 pkg/linkrp/frontend/controller/extenders/types.go delete mode 100644 pkg/linkrp/frontend/controller/extenders/v20220315privatepreview_test.go delete mode 100644 pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go delete mode 100644 pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go delete mode 100644 pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json delete mode 100644 pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_requestheaders.json delete mode 100644 pkg/linkrp/frontend/controller/mongodatabases/types.go delete mode 100644 pkg/linkrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go delete mode 100644 pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq.go delete mode 100644 pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq_test.go delete mode 100644 pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json delete mode 100644 pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_requestheaders.json delete mode 100644 pkg/linkrp/frontend/controller/rabbitmqmessagequeues/types.go delete mode 100644 pkg/linkrp/frontend/controller/rabbitmqmessagequeues/v20220315privatepreview_test.go delete mode 100644 pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache.go delete mode 100644 pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache_test.go delete mode 100644 pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json delete mode 100644 pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_requestheaders.json delete mode 100644 pkg/linkrp/frontend/controller/rediscaches/types.go delete mode 100644 pkg/linkrp/frontend/controller/rediscaches/v20220315privatepreview_test.go delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase.go delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_input.json delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_requestheaders.json delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/types.go delete mode 100644 pkg/linkrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go delete mode 100644 pkg/linkrp/frontend/controller/types.go delete mode 100644 pkg/linkrp/frontend/handler/routes.go delete mode 100644 pkg/linkrp/frontend/handler/routes_test.go delete mode 100644 pkg/linkrp/processors/daprpubsubbrokers/doc.go delete mode 100644 pkg/linkrp/processors/daprpubsubbrokers/processor.go delete mode 100644 pkg/linkrp/processors/daprpubsubbrokers/processor_test.go delete mode 100644 pkg/linkrp/processors/daprsecretstores/doc.go delete mode 100644 pkg/linkrp/processors/daprsecretstores/processor.go delete mode 100644 pkg/linkrp/processors/daprsecretstores/processor_test.go delete mode 100644 pkg/linkrp/processors/daprstatestores/doc.go delete mode 100644 pkg/linkrp/processors/daprstatestores/processor.go delete mode 100644 pkg/linkrp/processors/daprstatestores/processor_test.go delete mode 100644 pkg/linkrp/processors/extenders/doc.go delete mode 100644 pkg/linkrp/processors/extenders/processor.go delete mode 100644 pkg/linkrp/processors/extenders/processor_test.go delete mode 100644 pkg/linkrp/processors/mongodatabases/doc.go delete mode 100644 pkg/linkrp/processors/mongodatabases/processor.go delete mode 100644 pkg/linkrp/processors/mongodatabases/processor_test.go delete mode 100644 pkg/linkrp/processors/rabbitmqmessagequeues/doc.go delete mode 100644 pkg/linkrp/processors/rabbitmqmessagequeues/processor.go delete mode 100644 pkg/linkrp/processors/rabbitmqmessagequeues/processor_test.go delete mode 100644 pkg/linkrp/processors/rediscaches/doc.go delete mode 100644 pkg/linkrp/processors/rediscaches/processor.go delete mode 100644 pkg/linkrp/processors/rediscaches/processor_test.go delete mode 100644 pkg/linkrp/processors/sqldatabases/doc.go delete mode 100644 pkg/linkrp/processors/sqldatabases/processor.go delete mode 100644 pkg/linkrp/processors/sqldatabases/processor_test.go rename pkg/{linkrp => portableresources}/api/v20220315privatepreview/util.go (85%) rename pkg/{datastoresrp/frontend/controller/rediscaches/types.go => portableresources/api/v20220315privatepreview/util_test.go} (51%) rename pkg/{linkrp => portableresources}/api/v20220315privatepreview/version.go (100%) rename pkg/{linkrp => portableresources}/api/v20220315privatepreview/zz_generated_time_rfc3339.go (97%) rename pkg/{linkrp => portableresources}/backend/controller/createorupdateresource.go (96%) rename pkg/{linkrp => portableresources}/backend/controller/createorupdateresource_test.go (96%) rename pkg/{linkrp => portableresources}/backend/controller/deleteresource.go (71%) rename pkg/{linkrp => portableresources}/backend/controller/deleteresource_test.go (92%) rename pkg/{linkrp => portableresources}/backend/service.go (59%) rename pkg/{linkrp => portableresources}/datamodel/doc.go (86%) rename pkg/{linkrp => portableresources}/datamodel/linkmetadata.go (70%) rename pkg/{linkrp => portableresources}/datamodel/recipes.go (81%) rename pkg/{linkrp => portableresources}/frontend/handler/getoperations.go (50%) rename pkg/{linkrp => portableresources}/frontend/handler/getoperations_test.go (92%) create mode 100644 pkg/portableresources/frontend/handler/routes.go create mode 100644 pkg/portableresources/frontend/handler/routes_test.go rename pkg/{linkrp => portableresources}/frontend/service.go (90%) rename pkg/{linkrp => portableresources}/handlers/util.go (100%) rename pkg/{linkrp => portableresources}/handlers/util_test.go (81%) rename pkg/{linkrp => portableresources}/processors/doc.go (94%) rename pkg/{linkrp => portableresources}/processors/mock_resourceclient.go (93%) rename pkg/{linkrp => portableresources}/processors/resourceclient.go (100%) rename pkg/{linkrp => portableresources}/processors/resourceclient_test.go (100%) rename pkg/{linkrp => portableresources}/processors/types.go (92%) rename pkg/{linkrp => portableresources}/processors/util.go (92%) rename pkg/{linkrp => portableresources}/processors/util_test.go (94%) rename pkg/{linkrp => portableresources}/processors/validator.go (98%) rename pkg/{linkrp => portableresources}/processors/validator_test.go (98%) rename pkg/{linkrp => portableresources}/renderers/dapr/generic.go (100%) rename pkg/{linkrp => portableresources}/renderers/types.go (100%) rename pkg/{linkrp => portableresources}/types.go (66%) rename pkg/{linkrp/datamodel/converter/test_util.go => portableresources/types_test.go} (58%) delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPut.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPutWithRecipe.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresPut.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPut.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPutWithRecipe.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPut.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/OperationsList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListSecrets.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesPut.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/extenders.json delete mode 100644 swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/openapi.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json create mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json delete mode 100644 test/functional/shared/resources/dapr_component_name_conflict_test.go delete mode 100644 test/functional/shared/resources/dapr_pubsub_test.go delete mode 100644 test/functional/shared/resources/dapr_secretstore_test.go delete mode 100644 test/functional/shared/resources/dapr_serviceinvocation_test.go delete mode 100644 test/functional/shared/resources/dapr_statestore_test.go delete mode 100644 test/functional/shared/resources/linkrp_extender_test.go delete mode 100644 test/functional/shared/resources/microsoftsql_test.go delete mode 100644 test/functional/shared/resources/mongodb_test.go delete mode 100644 test/functional/shared/resources/rabbitmq_test.go delete mode 100644 test/functional/shared/resources/redis_test.go delete mode 100644 test/functional/shared/resources/secretstore_test.go delete mode 100644 test/functional/shared/resources/sql_test.go delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-component-name-conflict.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-manual.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-manual.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-serviceinvocation.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-manual.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-microsoft-sql.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-mongodb-manual-provisioning.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-context.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-parameters.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-rabbitmq-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-rabbitmq.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-redis-default-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-redis-manualprovisioning.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-redis-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-secretstore-new.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-secretstore-ref.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-sql.bicep delete mode 100644 test/functional/shared/resources/testdata/corerp-resources-sqldb-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep delete mode 100644 test/functional/shared/resources/testdata/linkrp-resources-extender.bicep diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index d5cd64d449..f7e6987275 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -526,6 +526,7 @@ jobs: if: always() run: | POD_STATE_LOG_FILENAME='${{ env.RADIUS_CONTAINER_LOG_BASE }}/${{ matrix.name }}-tests-pod-states.log' + mkdir -p $(dirname $POD_STATE_LOG_FILENAME) echo "kubectl get pods -A" >> $POD_STATE_LOG_FILENAME kubectl get pods -A >> $POD_STATE_LOG_FILENAME echo "kubectl describe pods -A" >> $POD_STATE_LOG_FILENAME diff --git a/.vscode/launch.json b/.vscode/launch.json index 1d07be7d45..001c31578f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,8 +15,8 @@ "args": [ "--config-file", "${workspaceFolder}/cmd/applications-rp/radius-self-hosted.yaml", - "--link-config", - "${workspaceFolder}/cmd/applications-rp/link-self-hosted.yaml", + "--portableresource-config", + "${workspaceFolder}/cmd/applications-rp/portableresource-self-hosted.yaml", ], "env": { "RADIUS_ENV": "self-hosted" diff --git a/build/generate.mk b/build/generate.mk index 5ab7eeaafb..1d26d7959c 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -23,12 +23,12 @@ ifeq ($(GOOS),windows) endif .PHONY: generate -generate: generate-genericcliclient generate-rad-corerp-client generate-rad-linkrp-client generate-rad-datastoresrp-client generate-rad-messagingrp-client generate-rad-daprrp-client generate-rad-ucp-client generate-go generate-bicep-types generate-ucp-crd ## Generates all targets. +generate: generate-genericcliclient generate-rad-corerp-client generate-rad-datastoresrp-client generate-rad-messagingrp-client generate-rad-daprrp-client generate-rad-ucp-client generate-go generate-bicep-types generate-ucp-crd ## Generates all targets. .PHONY: generate-cadl-installed generate-cadl-installed: @echo "$(ARROW) Detecting cadl..." - cd cadl/Applications.Link && npx$(CMD_EXT) -q cadl --help > /dev/null || { echo "cadl is a required dependency"; exit 1; } + cd cadl/Applications.UCP && npx$(CMD_EXT) -q cadl --help > /dev/null || { echo "cadl is a required dependency"; exit 1; } @echo "$(ARROW) OK" .PHONY: generate-tsp-installed @@ -40,7 +40,6 @@ generate-tsp-installed: .PHONY: generate-openapi-spec generate-openapi-spec: @echo "Generating openapi specs from cadl models." - cd cadl/Applications.Link && npx$(CMD_EXT) cadl compile . cd cadl/UCP && npx$(CMD_EXT) cadl compile . @echo "Generating openapi specs from typespec models." @@ -83,11 +82,6 @@ generate-rad-corerp-client: generate-node-installed generate-autorest-installed @echo "$(AUTOREST_MODULE_VERSION) is module version" autorest pkg/corerp/api/README.md --tag=core-2022-03-15-privatepreview -.PHONY: generate-rad-linkrp-client -generate-rad-linkrp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the linkrp client SDK (Autorest). - @echo "$(AUTOREST_MODULE_VERSION) is module version" - autorest pkg/linkrp/api/README.md --tag=link-2022-03-15-privatepreview - .PHONY: generate-rad-datastoresrp-client generate-rad-datastoresrp-client: generate-node-installed generate-autorest-installed generate-tsp-installed generate-openapi-spec ## Generates the datastoresrp client SDK (Autorest). @echo "$(AUTOREST_MODULE_VERSION) is module version" diff --git a/cadl/Applications.Link/daprPubSubBrokers.cadl b/cadl/Applications.Link/daprPubSubBrokers.cadl deleted file mode 100644 index b0ffdd482c..0000000000 --- a/cadl/Applications.Link/daprPubSubBrokers.cadl +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Link DaprPubSubBroker Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; - -@doc("DaprPubSubBroker link properties") -model DaprPubSubBrokerProperties extends BasicDaprResourceProperties { - @doc("Provisioning state of the daprPubSubBroker resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Metadata for the daprPubSubBroker resource. This should match the values specified in Dapr component spec") - metadata?: object; - - @doc("The recipe used to automatically deploy underlying infrastructure for the daprPubSubBroker link") - recipe?: Recipe; - - @doc("A collection of references to resources associated with the daprPubSubBroker") - resources?: ResourceReference[]; - - @doc("DaprPubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format.") - type?: string; - - @doc("Dapr component version") - version?: string; -} - -@doc("DaprPubSubBroker link") -model DaprPubSubBrokerResource is TrackedResource { - @doc("DaprPubSubBroker name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$") - @key("daprPubSubBrokerName") - @path - @extension("x-ms-parameter-location", "method") - @segment("daprPubSubBrokers") - name: string; -} - -@armResourceOperations -interface DaprPubSubBroker - extends Radius.ResourceOperationWithAsyncDelete< - DaprPubSubBrokerResource, - DaprPubSubBrokerProperties, - RootScopeParam - > {} diff --git a/cadl/Applications.Link/daprSecretStores.cadl b/cadl/Applications.Link/daprSecretStores.cadl deleted file mode 100644 index 68df941a93..0000000000 --- a/cadl/Applications.Link/daprSecretStores.cadl +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Link/daprSecretStores") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; -@doc("DaprSecretStore link properties") -model DaprSecretStoreProperties extends BasicDaprResourceProperties { - @doc("Provisioning state of the dapr secret store link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Dapr Secret Store type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/") - type?: string; - - @doc("Dapr component version") - version?: string; - - @doc("Metadata for the Secret Store resource. This should match the values specified in Dapr component spec") - metadata?: object; - - @doc("The recipe used to automatically deploy underlying infrastructure for the daprSecretStore link") - recipe?: Recipe; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; -} - -@doc("DaprSecretStore link") -model DaprSecretStoreResource is TrackedResource { - @doc("DaprSecretStore name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$") - @key("daprSecretStoreName") - @path - @segment("daprSecretStores") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@armResourceOperations -interface DaprSecretStore - extends Radius.ResourceOperationWithSyncDelete< - DaprSecretStoreResource, - DaprSecretStoreProperties, - RootScopeParam - > {} diff --git a/cadl/Applications.Link/daprStateStores.cadl b/cadl/Applications.Link/daprStateStores.cadl deleted file mode 100644 index e1326a52a8..0000000000 --- a/cadl/Applications.Link/daprStateStores.cadl +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST API for Applications.Link DaprStateStore Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; - -@doc("DaprStateStore link properties") -model DaprStateStoreProperties extends BasicDaprResourceProperties { - @doc("Provisioning state of the DaprStateStore link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Metadata for the state store resource. This should match the values specified in Dapr component spec") - metadata?: object; - - @doc("The recipe used to automatically deploy underlying infrastructure for the daprStateStore link") - recipe?: Recipe; - - @doc("A collection of references to resources associated with the state store") - resources?: ResourceReference[]; - - @doc("Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format.") - type?: string; - - @doc("Dapr component version") - version?: string; -} - -@doc("DaprStateStore link") -model DaprStateStoreResource is TrackedResource { - @doc("DaprStateStore name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$") - @key("daprStateStoreName") - @path - @segment("daprStateStores") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@armResourceOperations -interface DaprStateStore - extends Radius.ResourceOperationWithAsyncDelete< - DaprStateStoreResource, - DaprStateStoreProperties, - RootScopeParam - > {} diff --git a/cadl/Applications.Link/extenders.cadl b/cadl/Applications.Link/extenders.cadl deleted file mode 100644 index 689e60a9b4..0000000000 --- a/cadl/Applications.Link/extenders.cadl +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-providerhub"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST API for Applications.Link Extender Resource") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; - -@doc("Extender link") -model ExtenderResource is TrackedResource { - @doc("Extender name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("extenderName") - @path - @segment("extenders") - @extension("x-ms-parameter-location", "method") - name: string; -} -@doc("The secret values for the given Extender resource") -model ExtenderListSecretsResult is ExtenderSecrets; - -@doc("The secret values for the given Extender resource") -model ExtenderSecrets {} - -@doc("Extender link properties") -model ExtenderProperties extends BasicResourceProperties { - @doc("Provisioning state of the extender link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("The secrets value for the resource") - secrets?: ExtenderSecrets; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Extender") - recipe?: Recipe; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; -} - -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified Extender resource") -@post -@route("/{rootScope}/providers/Applications.Link/extenders/{extenderName}/listSecrets") -op Extenders_listSecrets( - ...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the Extender link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - extenderName: string): ArmResponse | ErrorResponse; - -@armResourceOperations -interface Extenders - extends Radius.RootScopeResourceOperations< - ExtenderResource, - ExtenderProperties, - RootScopeParam - > {} diff --git a/cadl/Applications.Link/global.cadl b/cadl/Applications.Link/global.cadl deleted file mode 100644 index e11a38fa19..0000000000 --- a/cadl/Applications.Link/global.cadl +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/openapi"; - -using OpenAPI; - - -@doc("Basic properties of a Radius resource.") -model BasicResourceProperties { - @doc("Status of a resource.") - @visibility("read") - status?: ResourceStatus; - - @doc("Fully qualified resource ID for the environment that the link is linked to") - environment: string; - - @doc("Fully qualified resource ID for the application that the link is consumed by") - application?: Application -} - -@doc("Basic properties of a Dapr component object.") -model BasicDaprResourceProperties extends BasicResourceProperties{ - @doc("The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.") - @visibility("read") - componentName?: string; -} - -@doc("Status of a resource.") -model ResourceStatus { - @doc("Properties of an output resource") - @extension("x-ms-identifiers", []) - outputResources?: OutputResource[]; -} - -@doc("Describes a reference to an existing resource") -model ResourceReference { - @doc("Resource id of an existing resource") - id: string -} - -@doc("Properties of an output resource.") -model OutputResource {} - -@doc("Fully qualified resource ID for the application that the link is consumed by") -scalar Application extends string; - -@doc("Provisioning state of the link at the time the operation was called") -enum ProvisioningState { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, -} - -@doc("Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.") -enum ResourceProvisioning { - recipe, - manual, -} - -@doc("The recipe used to automatically deploy underlying infrastructure for a link") -model Recipe{ - @doc("The name of the recipe within the environment to use") - name: string; - @doc("Key/value parameters to pass into the recipe at deployment") - parameters?: Parameters; -} -@doc("Key/value parameters to pass into the recipe at deployment") -model Parameters{} \ No newline at end of file diff --git a/cadl/Applications.Link/main.cadl b/cadl/Applications.Link/main.cadl deleted file mode 100644 index 14f25140fe..0000000000 --- a/cadl/Applications.Link/main.cadl +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/openapi"; -import "@azure-tools/cadl-autorest"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; - -import "./mongoDatabases.cadl"; -import "./sqlDatabases.cadl"; -import "./redisCaches.cadl"; -import "./rabbitMQMessageQueues.cadl"; -import "./daprSecretStores.cadl"; -import "./daprStateStores.cadl"; -import "./daprPubSubBrokers.cadl"; -// Extender app model spec is not generated using cadl as "additionalPropertis" property is not supported by cadl. -//import "./extenders.cadl"; \ No newline at end of file diff --git a/cadl/Applications.Link/mongoDatabases.cadl b/cadl/Applications.Link/mongoDatabases.cadl deleted file mode 100644 index dd48c4bef4..0000000000 --- a/cadl/Applications.Link/mongoDatabases.cadl +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Link/mongoDatabases") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; -@doc("MongoDatabase link") -model MongoDatabaseResource is TrackedResource { - @doc("The name of the MongoDatabase link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @segment("mongoDatabases") - @key("mongoDatabaseName") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@doc("The secret values for the given MongoDatabase resource") -model MongoDatabaseListSecretsResult is MongoDatabaseSecrets; - -@doc("The secret values for the given MongoDatabase resource") -model MongoDatabaseSecrets { - @doc("Password to use when connecting to the target Mongo database") - password?: string; - - @doc("Connection string used to connect to the target Mongo database") - connectionString?: string; -} - -@doc("MongoDatabase link properties") -model MongoDatabaseProperties extends BasicResourceProperties{ - @doc("Provisioning state of the mongo database link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Secret values provided for the resource") - secrets?: MongoDatabaseSecrets; - - @doc("Host name of the target Mongo database") - host?: string; - - @doc("Port value of the target Mongo database") - port?: int32; - - @doc("Database name of the target Mongo database") - database?: string; - - @doc("The recipe used to automatically deploy underlying infrastructure for the MongoDB link") - recipe?: Recipe; - - @doc("List of the resource IDs that support the MongoDB resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Username to use when connecting to the target Mongo database") - username?: string; -} - -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified MongoDatabase resource") -@post -@route("/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}/listSecrets") -op MongoDatabases_listSecrets(...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the MongoDatabase link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - mongoDatabaseName: string): ArmResponse - | ErrorResponse; - -@armResourceOperations -interface MongoDatabases - extends Radius.ResourceOperationWithAsyncDelete< - MongoDatabaseResource, - MongoDatabaseProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Link/rabbitMQMessageQueues.cadl b/cadl/Applications.Link/rabbitMQMessageQueues.cadl deleted file mode 100644 index d1d07a390e..0000000000 --- a/cadl/Applications.Link/rabbitMQMessageQueues.cadl +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Link/rabbitMQMessageQueues") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("RabbitMQMessageQueue link") -model RabbitMQMessageQueueResource - is TrackedResource { - @doc("The name of the RabbitMQMessageQueue link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("rabbitMQMessageQueueName") - @path - @segment("rabbitMQMessageQueues") - name: string; -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("The secret values for the given RabbitMQMessageQueue resource") -model RabbitMQListSecretsResult is RabbitMQSecrets; - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("The secret values for the given RabbitMQMessageQueue resource") -model RabbitMQSecrets { - @doc("The password used to connect to the RabbitMQ instance") - password?: string; - - @doc("The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value") - uri?: string; -} -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("RabbitMQMessageQueue link properties") -model RabbitMQMessageQueueProperties extends BasicResourceProperties { - @doc("Provisioning state of the rabbitMQ message queue link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Secrets provided by resources,") - secrets?: RabbitMQSecrets; - - @doc("The name of the queue") - queue?: string; - - @doc("The hostname of the RabbitMQ instance") - host?: string; - - @doc("The port of the RabbitMQ instance. Defaults to 5672") - port?: int32; - - @doc("The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost.") - vHost?: string; - - @doc("The username to use when connecting to the RabbitMQ instance") - username?: string; - - @doc("List of the resource IDs that support the rabbitMQ resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("The recipe used to automatically deploy underlying infrastructure for the rabbitMQ link") - recipe?: Recipe; - - @doc("Specifies whether to use SSL when connecting to the RabbitMQ instance") - tls?: boolean; - -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use camelCase" -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified RabbitMQMessageQueue resource") -@post -@route("/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}/listSecrets") -op RabbitMQMessageQueues_listSecrets( - ...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the RabbitMQMessageQueue link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - rabbitMQMessageQueueName: string -): ArmResponse | ErrorResponse; - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCase" -@armResourceOperations -interface RabbitMQMessageQueues - extends Radius.ResourceOperationWithSyncDelete< - RabbitMQMessageQueueResource, - RabbitMQMessageQueueProperties, - RootScopeParam - > {} diff --git a/cadl/Applications.Link/redisCaches.cadl b/cadl/Applications.Link/redisCaches.cadl deleted file mode 100644 index 66001ff5c4..0000000000 --- a/cadl/Applications.Link/redisCaches.cadl +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Link/redisCaches") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; - -@doc("RedisCache link") -model RedisCacheResource - is TrackedResource { - @doc("The name of the RedisCache link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("redisCacheName") - @path - @segment("redisCaches") - name: string; -} - -@doc("The secret values for the given RedisCache resource") -model RedisCacheListSecretsResult is RedisCacheSecrets; - -@doc("The secret values for the given RedisCache resource") -model RedisCacheSecrets { - @doc("The connection string used to connect to the Redis cache") - connectionString?: string; - - @doc("The password for this Redis cache instance") - password?: string; - - @doc("The URL used to connect to the Redis cache") - url?: string -} - -@doc("RedisCache link properties") -model RedisCacheProperties extends BasicResourceProperties { - @doc("Provisioning state of the redis cache link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Secrets provided by resource") - secrets?: RedisCacheSecrets; - - @doc("The host name of the target Redis cache") - host?: string; - - @doc("The port value of the target Redis cache") - port?: int32; - - @doc("The username for Redis cache") - username?: string; - - @doc("Specifies whether to enable SSL connections to the Redis cache") - tls?: boolean; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Redis caches link") - recipe?: Recipe; - - @doc("List of the resource IDs that support the Redis resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; -} -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified RedisCache resource") -@route("/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}/listSecrets") -@post -op RedisCaches_listSecrets( - ...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the RedisCache link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - redisCacheName: string): ArmResponse | ErrorResponse; - -@armResourceOperations -interface RedisCaches - extends Radius.ResourceOperationWithSyncDelete< - RedisCacheResource, - RedisCacheProperties, - RootScopeParam - > {} diff --git a/cadl/Applications.Link/sqlDatabases.cadl b/cadl/Applications.Link/sqlDatabases.cadl deleted file mode 100644 index 92a7fbfdfe..0000000000 --- a/cadl/Applications.Link/sqlDatabases.cadl +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -import "./global.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -@armProviderNamespace -@service({ - title: "Applications.Link Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Link/sqlDatabases") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Link; - -interface Operations extends Azure.ResourceManager.Operations {} -@doc("SqlDatabase properties") -model SqlDatabaseProperties extends BasicResourceProperties { - @doc("Provisioning state of the Sql database link at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("The name of the Sql database.") - database?: string; - - @doc("The fully qualified domain name of the Sql database.") - server?: string; - - @doc("Port value of the target Sql database") - port?: int32; - - @doc("Username to use when connecting to the target Sql database") - username?: string; - - @doc("The recipe used to automatically deploy underlying infrastructure for the sqldatabases link") - recipe?: Recipe; - - @doc("List of the resource IDs that support the SqlDatabase resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Secret values provided for the resource") - secrets?: SqlDatabaseSecrets; -} - -@doc("The secret values for the given SqlDatabase resource") -model SqlDatabaseListSecretsResult is SqlDatabaseSecrets; - -@doc("The secret values for the given SqlDatabase resource") -model SqlDatabaseSecrets { - @doc("Password to use when connecting to the target Sql database") - password?: string; - - @doc("Connection string used to connect to the target Sql database") - connectionString?: string; -} - -@doc("SqlDatabase link") -model SqlDatabaseResource is TrackedResource { - @doc("The name of the SqlDatabase link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("sqlDatabaseName") - @path - @segment("sqlDatabases") - @extension("x-ms-parameter-location", "method") - name: string; -} - -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified SqlDatabase resource") -@post -@route("/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}/listSecrets") -op SqlDatabases_listSecrets(...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the SqlDatabase link resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - sqlDatabaseName: string): ArmResponse - | ErrorResponse; - -@armResourceOperations -interface SqlDatabases - extends Radius.ResourceOperationWithSyncDelete< - SqlDatabaseResource, - SqlDatabaseProperties, - RootScopeParam - > {} diff --git a/cadl/cadl-project.yaml b/cadl/cadl-project.yaml deleted file mode 100644 index 7797ff9b39..0000000000 --- a/cadl/cadl-project.yaml +++ /dev/null @@ -1,5 +0,0 @@ -emit: - - "@azure-tools/cadl-autorest" -options: - "@azure-tools/cadl-autorest": - emitter-output-dir: "{project-root}/../swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/" \ No newline at end of file diff --git a/cmd/applications-rp/main.go b/cmd/applications-rp/main.go index 4f7dde480f..85f951af88 100644 --- a/cmd/applications-rp/main.go +++ b/cmd/applications-rp/main.go @@ -32,9 +32,9 @@ import ( profilerservice "github.com/project-radius/radius/pkg/profiler/service" "github.com/project-radius/radius/pkg/trace" - link_backend "github.com/project-radius/radius/pkg/linkrp/backend" - link_frontend "github.com/project-radius/radius/pkg/linkrp/frontend" "github.com/project-radius/radius/pkg/logging" + pr_backend "github.com/project-radius/radius/pkg/portableresources/backend" + pr_frontend "github.com/project-radius/radius/pkg/portableresources/frontend" "github.com/project-radius/radius/pkg/ucp/data" "github.com/project-radius/radius/pkg/ucp/dataprovider" "github.com/project-radius/radius/pkg/ucp/hosting" @@ -47,15 +47,15 @@ import ( const serviceName = "applications.core" -func newLinkHosts(configFile string, enableAsyncWorker bool) ([]hosting.Service, *hostoptions.HostOptions, error) { +func newPortableResourceHosts(configFile string, enableAsyncWorker bool) ([]hosting.Service, *hostoptions.HostOptions, error) { hostings := []hosting.Service{} options, err := hostoptions.NewHostOptionsFromEnvironment(configFile) if err != nil { return nil, nil, err } - hostings = append(hostings, link_frontend.NewService(options)) + hostings = append(hostings, pr_frontend.NewService(options)) if enableAsyncWorker { - hostings = append(hostings, link_backend.NewService(options)) + hostings = append(hostings, pr_backend.NewService(options)) } return hostings, &options, nil @@ -65,16 +65,16 @@ func main() { var configFile string var enableAsyncWorker bool - var runLink bool - var linkConfigFile string + var runPortableResource bool + var portableResourceConfigFile string defaultConfig := fmt.Sprintf("radius-%s.yaml", hostoptions.Environment()) flag.StringVar(&configFile, "config-file", defaultConfig, "The service configuration file.") flag.BoolVar(&enableAsyncWorker, "enable-asyncworker", true, "Flag to run async request process worker (for private preview and dev/test purpose).") - flag.BoolVar(&runLink, "run-link", true, "Flag to run Applications.Link RP (for private preview and dev/test purpose).") - defaultLinkConfig := fmt.Sprintf("link-%s.yaml", hostoptions.Environment()) - flag.StringVar(&linkConfigFile, "link-config", defaultLinkConfig, "The service configuration file for Applications.Link.") + flag.BoolVar(&runPortableResource, "run-portableresource", true, "Flag to run portable resources RPs(for private preview and dev/test purpose).") + defaultPortableRsConfig := fmt.Sprintf("portableresource-%s.yaml", hostoptions.Environment()) + flag.StringVar(&portableResourceConfigFile, "portableresource-config", defaultPortableRsConfig, "The service configuration file for portable resource providers.") if configFile == "" { log.Fatal("config-file is empty.") //nolint:forbidigo // this is OK inside the main function. @@ -113,17 +113,17 @@ func main() { hostingSvc = append(hostingSvc, backend.NewService(options)) } - // Configure Applications.Link to run it with Applications.Core RP. - var linkOpts *hostoptions.HostOptions - if runLink && linkConfigFile != "" { - logger.Info("Run Applications.Link.") - var linkSvcs []hosting.Service + // Configure Portable Resources to run it with Applications.Core RP. + var portableResourceOpts *hostoptions.HostOptions + if runPortableResource && portableResourceConfigFile != "" { + logger.Info("Run Service for Portable Resource Providers.") + var portableResourceSvcs []hosting.Service var err error - linkSvcs, linkOpts, err = newLinkHosts(linkConfigFile, enableAsyncWorker) + portableResourceSvcs, portableResourceOpts, err = newPortableResourceHosts(portableResourceConfigFile, enableAsyncWorker) if err != nil { log.Fatal(err) //nolint:forbidigo // this is OK inside the main function. } - hostingSvc = append(hostingSvc, linkSvcs...) + hostingSvc = append(hostingSvc, portableResourceSvcs...) } if options.Config.StorageProvider.Provider == dataprovider.TypeETCD && @@ -135,9 +135,9 @@ func main() { client := hosting.NewAsyncValue[etcdclient.Client]() options.Config.StorageProvider.ETCD.Client = client options.Config.SecretProvider.ETCD.Client = client - if linkOpts != nil { - linkOpts.Config.StorageProvider.ETCD.Client = client - linkOpts.Config.SecretProvider.ETCD.Client = client + if portableResourceOpts != nil { + portableResourceOpts.Config.StorageProvider.ETCD.Client = client + portableResourceOpts.Config.SecretProvider.ETCD.Client = client } hostingSvc = append(hostingSvc, data.NewEmbeddedETCDService(data.EmbeddedETCDServiceOptions{ClientConfigSink: client})) } diff --git a/cmd/applications-rp/link-dev.yaml b/cmd/applications-rp/portableresource-dev.yaml similarity index 100% rename from cmd/applications-rp/link-dev.yaml rename to cmd/applications-rp/portableresource-dev.yaml diff --git a/cmd/applications-rp/link-self-hosted.yaml b/cmd/applications-rp/portableresource-self-hosted.yaml similarity index 94% rename from cmd/applications-rp/link-self-hosted.yaml rename to cmd/applications-rp/portableresource-self-hosted.yaml index 0c34a7492d..fdadd10dda 100644 --- a/cmd/applications-rp/link-self-hosted.yaml +++ b/cmd/applications-rp/portableresource-self-hosted.yaml @@ -1,6 +1,6 @@ # This configuration file is used in development when launching from VS Code. # -# This configures the link RP to... +# This configures the Portable Resources' Providers to... # # - Use Kubernetes (namespace: radius-testing) for storage and secrets # - Listen on port 8081 diff --git a/cmd/rad/cmd/recipe.go b/cmd/rad/cmd/recipe.go index 8bc7c3d506..b5b2f73060 100644 --- a/cmd/rad/cmd/recipe.go +++ b/cmd/rad/cmd/recipe.go @@ -23,9 +23,9 @@ import ( func NewRecipeCommand() *cobra.Command { return &cobra.Command{ Use: "recipe", - Short: "Manage link recipes", - Long: `Manage link recipes - Link recipes automate the deployment of infrastructure and configuration of links.`, + Short: "Manage recipes", + Long: `Manage recipes + Recipes automate the deployment of infrastructure and configuration of portable resources.`, } } diff --git a/cmd/ucpd/ucp-self-hosted-dev.yaml b/cmd/ucpd/ucp-self-hosted-dev.yaml index 294a083103..5f14d8a49b 100644 --- a/cmd/ucpd/ucp-self-hosted-dev.yaml +++ b/cmd/ucpd/ucp-self-hosted-dev.yaml @@ -6,7 +6,7 @@ # - Listen on port 9000 # - Talk to Deployment Engine on port 5017 # - Talk to Core RP on port 8080 -# - Talk to Link RP on port 8081 +# - Talk to Portable Resources' Providers on port 8081 # - Disables metrics and profiler # storageProvider: @@ -38,7 +38,6 @@ planes: properties: resourceProviders: Applications.Core: "http://localhost:8080" - Applications.Link: "http://localhost:8081" Applications.Messaging: "http://localhost:8081" Applications.Dapr: "http://localhost:8081" Applications.Datastores: "http://localhost:8081" diff --git a/deploy/Chart/templates/rp/configmaps.yaml b/deploy/Chart/templates/rp/configmaps.yaml index 7b0719c905..16527b5c49 100644 --- a/deploy/Chart/templates/rp/configmaps.yaml +++ b/deploy/Chart/templates/rp/configmaps.yaml @@ -53,7 +53,7 @@ data: terraform: path: "/terraform" - link-self-host.yaml: |- + portableresource-self-host.yaml: |- # Radius configuration file. # See https://github.com/project-radius/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. environment: @@ -92,7 +92,7 @@ data: json: true {{- if and .Values.global.zipkin .Values.global.zipkin.url }} tracerProvider: - serviceName: "applications.link" + serviceName: "applications.datastores" zipkin: url: {{ .Values.global.zipkin.url }} {{- end }} diff --git a/deploy/Chart/templates/rp/deployment.yaml b/deploy/Chart/templates/rp/deployment.yaml index f934e0b517..3da0d8dbe4 100644 --- a/deploy/Chart/templates/rp/deployment.yaml +++ b/deploy/Chart/templates/rp/deployment.yaml @@ -32,8 +32,8 @@ spec: image: "{{ .Values.rp.image }}:{{ .Values.rp.tag | default $appversion }}" args: - --config-file=/etc/config/radius-self-host.yaml - - --run-link - - --link-config=/etc/config/link-self-host.yaml + - --run-portableresource + - --portableresource-config=/etc/config/portableresource-self-host.yaml env: - name: SKIP_ARM value: 'false' @@ -52,7 +52,7 @@ spec: name: applications-rp protocol: TCP - containerPort: 5444 - name: applink-rp + name: app-pr-rp protocol: TCP {{- if eq .Values.global.prometheus.enabled true }} - containerPort: {{ .Values.global.prometheus.port }} diff --git a/deploy/Chart/templates/rp/service.yaml b/deploy/Chart/templates/rp/service.yaml index 3451fed1ce..252347b942 100644 --- a/deploy/Chart/templates/rp/service.yaml +++ b/deploy/Chart/templates/rp/service.yaml @@ -13,7 +13,7 @@ spec: protocol: TCP targetPort: 5443 - port: 5444 - name: link-http + name: portablers-http protocol: TCP targetPort: 5444 selector: diff --git a/deploy/Chart/templates/ucp/configmaps.yaml b/deploy/Chart/templates/ucp/configmaps.yaml index 608c710894..e18e9070f1 100644 --- a/deploy/Chart/templates/ucp/configmaps.yaml +++ b/deploy/Chart/templates/ucp/configmaps.yaml @@ -31,7 +31,6 @@ data: properties: resourceProviders: Applications.Core: "http://applications-rp.radius-system:5443" - Applications.Link: "http://applications-rp.radius-system:5444" Applications.Dapr: "http://applications-rp.radius-system:5444" Applications.Datastores: "http://applications-rp.radius-system:5444" Applications.Messaging: "http://applications-rp.radius-system:5444" diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md b/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md index b782ff2021..3d8723dafe 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md @@ -2,13 +2,13 @@ ## Summary -Configuration schemas are used to define the service configuration for the resource provider's execution. The default configurations use the `Applications.Core RP` but configurations can also be set to run the `Applications.Link RP` for private preview and dev/test purposes. +Configuration schemas are used to define the service configuration for the resource provider's execution. The default configurations use the `Applications.Core RP` but configurations can also be set to run `Portable Resources' Providers` for private preview and dev/test purposes. If you wanted to locally run Radius with specific configurations, `yaml` files can be created and stored in the `cmd` folder for the corresponding UCP or resource provider. ![Local Config](./configExamples/localConfig.png) -If you wanted to run Radius on Kubernetes with specific configurations, `yaml` files can be created and stored in the `deploy/Chart/charts` folder for `Applications.Core RP`, `Applications.Link RP`, or `UCP`. +If you wanted to run Radius on Kubernetes with specific configurations, `yaml` files can be created and stored in the `deploy/Chart/charts` folder for `Applications.Core RP`, `Portable Resources' Providers`, or `UCP`. ![Kubernetes Config](./configExamples/kubeConfig.png) @@ -29,7 +29,7 @@ The following properties can be specified in configuration for all services: ----- -The following are properties that can be specified for the `Applications.Core RP` and the `Applications.Link RP`: +The following are properties that can be specified for the `Applications.Core RP` and `Portable Resources`: | Key | Description | Example | |-----|-------------|---------| | ucp | Configuration options for connecting to UCP's API | [**See below**](#ucp) @@ -108,7 +108,7 @@ The following are properties that can be specified for UCP: ### ucp -This section configures the connection from either the `Applications.Core RP` or the `Applications.Link RP` to UCP's API. As the UCP service does not need to connect to itself, these settings do not apply in UCP's configuration files. +This section configures the connection from either the `Applications.Core RP` or the `Portable Resources' Providers` to UCP's API. As the UCP service does not need to connect to itself, these settings do not apply in UCP's configuration files. | Key | Description | Example | |-----|-------------|---------| @@ -185,7 +185,7 @@ ucp: Below are completed examples of possible configurations: -### Applications.Core and Applications.Link +### Applications.Core and Portable Resources' Providers ```yaml environment: name: self-hosted @@ -229,7 +229,6 @@ planes: properties: resourceProviders: Applications.Core: "http://applications-rp.radius-system:5443" - Applications.Link: "http://applications-rp.radius-system:5444" Applications.Dapr: "http://applications-rp.radius-system:5444" Applications.Datastores: "http://applications-rp.radius-system:5444" Applications.Messaging: "http://applications-rp.radius-system:5444" diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md index 440dc98b4e..00f18f91b4 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md @@ -8,7 +8,7 @@ Radius consists of a few processes that get deployed inside a Kubernetes cluster This includes: -- Applications.Core RP / Applications.Link RP (applications-rp) - The resource provider that handles processing of core resources as well as recipes. +- Applications.Core RP / Portable Resources' Providers (applications-rp) - The resource provider that handles processing of core resources as well as recipes. - Universal Control Plane (ucp) - Acts as a proxy between the other services, also manages deployments of AWS resources. - Deployment Engine (bicep-de) - Handles deployment orchestration for bicep files. @@ -22,7 +22,7 @@ If you need to manually test APIs you can reach them at the following endpoints - UCP: port 9000 - AppCore Namespace: port 8080 -- AppLink Namespace: port 8081 +- AppPortableResource Namespace: port 8081 (Applications.Datastores, Applications.Dapr and Applications.Messaging are hosted) - Deployment Engine: port 5017 ## Prerequisites diff --git a/docs/contributing/contributing-code/contributing-code-organization/README.md b/docs/contributing/contributing-code/contributing-code-organization/README.md index de9c255507..3b58d39164 100644 --- a/docs/contributing/contributing-code/contributing-code-organization/README.md +++ b/docs/contributing/contributing-code/contributing-code-organization/README.md @@ -21,29 +21,29 @@ In general you should ask for guidance before creating a new top-level folder in ## Pkg folders -| Folder | Description | -| ----------------- | --------------------------------------------------------------------------------------- | -| `algorithm/` | General purpose algorithms and data structures | -| `armrpc/` | Implementation containing shared functionality and utility for all Radius RP | -| `aws/` | Utility code and library integrations for working with AWS | -| `azure/` | Utility code and library integrations for working with Azure | -| `cli/` | Implementation code for the `rad` CLI | -| `corerp/` | Resource Provider implementation for `Applications.Core` resources | -| `daprrp/` | Resource Provider implementation for `Applications.Dapr` resources | -| `datastoresrp/` | Resource Provider implementation for `Applications.Datastores` resources | -| `kubernetes/` | Utility code and library integrations for working with Kubernetes | -| `kubeutil/` | Utility code and working with Kubernetes on client side | -| `linkrp/` | Resource Provider implementation for `Applications.Link` resources | -| `logging/` | Utility code for Radius logging | -| `messagingrp/` | Resource Provider implementation for `Applications.Messaging` resources | -| `middleware/` | Implementation for all Radius middleware | -| `metrics/` | Code generating Radius metrics | -| `profiler/` | Code and configs for Radius profiler | -| `recipes/` | Implementation for Radius Recipes | -| `rp/` | Code shared by multiple rps | -| `sdk/` | Code for interfacing with Radius as a client | -| `to/` | Code for pointer to value conversions | -| `trace/` | Utility code for generating Radius traces | -| `ucp/` | Implementation of Universal Control Plane | -| `validator/` | OpenAPI spec loader and validator | -| `version/` | Infrastructure for how to version the Radius implementations | \ No newline at end of file +| Folder | Description | +| ---------------------- | --------------------------------------------------------------------------------------- | +| `algorithm/` | General purpose algorithms and data structures | +| `armrpc/` | Implementation containing shared functionality and utility for all Radius RP | +| `aws/` | Utility code and library integrations for working with AWS | +| `azure/` | Utility code and library integrations for working with Azure | +| `cli/` | Implementation code for the `rad` CLI | +| `corerp/` | Resource Provider implementation for `Applications.Core` resources | +| `daprrp/` | Resource Provider implementation for `Applications.Dapr` resources | +| `datastoresrp/` | Resource Provider implementation for `Applications.Datastores` resources | +| `kubernetes/` | Utility code and library integrations for working with Kubernetes | +| `kubeutil/` | Utility code and working with Kubernetes on client side | +| `portableresources/` | Shared Resource Provider implementation for portable resources | +| `logging/` | Utility code for Radius logging | +| `messagingrp/` | Resource Provider implementation for `Applications.Messaging` resources | +| `middleware/` | Implementation for all Radius middleware | +| `metrics/` | Code generating Radius metrics | +| `profiler/` | Code and configs for Radius profiler | +| `recipes/` | Implementation for Radius Recipes | +| `rp/` | Code shared by multiple rps | +| `sdk/` | Code for interfacing with Radius as a client | +| `to/` | Code for pointer to value conversions | +| `trace/` | Utility code for generating Radius traces | +| `ucp/` | Implementation of Universal Control Plane | +| `validator/` | OpenAPI spec loader and validator | +| `version/` | Infrastructure for how to version the Radius implementations | \ No newline at end of file diff --git a/docs/contributing/contributing-code/contributing-code-schema-changes/README.md b/docs/contributing/contributing-code/contributing-code-schema-changes/README.md index 1d2cc864ab..595ee1c1eb 100644 --- a/docs/contributing/contributing-code/contributing-code-schema-changes/README.md +++ b/docs/contributing/contributing-code/contributing-code-schema-changes/README.md @@ -21,7 +21,7 @@ In order to update or create a new schema follow these steps: ``` 2. Generate the client code by running autorest - For example, to generate the LinkRP resources run: + For example, to generate the portable resources run: ```bash autorest pkg/linkrp/api/README.md --tag=link-2022-03-15-privatepreview ``` diff --git a/docs/release-notes/v0.22.0.md b/docs/release-notes/v0.22.0.md index 3dc696f981..e2fc36c317 100644 --- a/docs/release-notes/v0.22.0.md +++ b/docs/release-notes/v0.22.0.md @@ -12,7 +12,7 @@ If you're new to Radius, check out our website, [radapp.dev](https://radapp.dev) ### Recipe support for all Application.Link resources -All Applications.Link resources now support Recipes. This allows operators to add their approved Bicep templates to a Radius environment and developers to deploy any Radius Link without needing to define or configure any infrastructure. Learn more in the [docs](https://docs.radapp.dev/author-apps/recipes/). +All portable resources now support Recipes. This allows operators to add their approved Bicep templates to a Radius environment and developers to deploy any Radius Link without needing to define or configure any infrastructure. Learn more in the [docs](https://docs.radapp.dev/author-apps/recipes/). ### Updated contribution guides @@ -33,7 +33,7 @@ Thank you to the attendees of our latest community call! You can check out the r ## Breaking changes - The Radius Helm chart has been updated, requiring a full uninstall and install of the Radius control-plane. `rad install kubernetes --reinstall` will not work. See [Upgrading to Radius v0.22.0](#upgrading-to-radius-v0220) for more details. -- The schema of all Applications.Link resources have been updated to the new format which defaults to Recipes. Applications with Links need to: +- The schema of all portable resources have been updated to the new format which defaults to Recipes. Applications with Links need to: - Update from `mode: 'values'` to `resourceProvisioning: 'manual'` - Update from `mode: 'resource'` to either Recipes or `resourceProvisioning: 'manual'` - The schema of Radius Gateways has been updated to remove a duplicate 'hostname' field within the `tls` property. `tls.hostname` needs to be removed. diff --git a/docs/ucp/configuration.md b/docs/ucp/configuration.md index 0ff8ee7715..71965c1f2b 100644 --- a/docs/ucp/configuration.md +++ b/docs/ucp/configuration.md @@ -4,4 +4,4 @@ UCP is configured to communicate with the different planes that it supports, cur The configuration can be found in: deploy/Chart/charts/ucp/ucp-config.yaml. -Within each plane, the configuration specifies a URL to communicate with every supported resource provider. For example, separate URLs are specified for Applications.Core and Applications.Link providers within the Radius plane. +Within each plane, the configuration specifies a URL to communicate with every supported resource provider. For example, separate URLs are specified for Applications.Core and portable resource providers within the Radius plane. diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index 014d0f0ed0..9d8569805c 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":111,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":107,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":108,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":109,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":74,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":75,"Flags":0,"Description":"environment"},"ports":{"Type":80,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":100,"Flags":0,"Description":"container volumes"},"command":{"Type":101,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":102,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[71,72,73]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":79,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[77,78]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":76}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":82,"httpGet":84,"tcp":87}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":83,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":85,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":86,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":88,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":90,"persistent":95}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":93,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":94,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[91,92]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":98,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":99,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[96,97]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":89}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":104,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":105,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":106,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":103}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":110,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":113,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":114,"Flags":10,"Description":"The resource api version"},"properties":{"Type":116,"Flags":0,"Description":"Environment properties"},"tags":{"Type":136,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":124,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":125,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":134,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":135,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[117,118,119,120,121,122,123]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":126,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":127,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":129,"terraform":131}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":130,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":132,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":128}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":133}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":115}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":138,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":139,"Flags":10,"Description":"The resource api version"},"properties":{"Type":141,"Flags":0,"Description":"ExtenderResource link properties"},"tags":{"Type":154,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":149,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":150,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":153,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[142,143,144,145,146,147,148]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[151,152]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":140}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":156,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":157,"Flags":10,"Description":"The resource api version"},"properties":{"Type":159,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":175,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":167,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":168,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":170,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":171,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[160,161,162,163,164,165,166]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":169}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":174,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[172,173]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":158}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":177,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":178,"Flags":10,"Description":"The resource api version"},"properties":{"Type":180,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":189,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":188,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[181,182,183,184,185,186,187]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":179}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":191,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":192,"Flags":10,"Description":"The resource api version"},"properties":{"Type":194,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":212,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":202,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":205,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":211,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[195,196,197,198,199,200,201]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[203,204]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":209,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":210,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[207,208]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":206}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":193}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":214,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":215,"Flags":10,"Description":"The resource api version"},"properties":{"Type":217,"Flags":0,"Description":"Volume properties"},"tags":{"Type":249,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":225,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":226}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[218,219,220,221,222,223,224]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":239,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":241,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":247,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":248,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":231,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":234,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":238,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[228,229,230]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[232,233]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[235,236,237]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":227}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":240}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":246,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[243,244,245]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":242}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":216}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":255,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":256,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[253,254]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":206}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":252,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":111,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":107,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":108,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":109,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":74,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":75,"Flags":0,"Description":"environment"},"ports":{"Type":80,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":100,"Flags":0,"Description":"container volumes"},"command":{"Type":101,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":102,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[71,72,73]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":79,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[77,78]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":76}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":82,"httpGet":84,"tcp":87}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":83,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":85,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":86,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":88,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":90,"persistent":95}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":93,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":94,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[91,92]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":98,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":99,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[96,97]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":89}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":104,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":105,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":106,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":103}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":110,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":113,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":114,"Flags":10,"Description":"The resource api version"},"properties":{"Type":116,"Flags":0,"Description":"Environment properties"},"tags":{"Type":136,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":124,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":125,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":134,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":135,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[117,118,119,120,121,122,123]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":126,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":127,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":129,"terraform":131}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":130,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":132,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":128}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":133}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":115}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":138,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":139,"Flags":10,"Description":"The resource api version"},"properties":{"Type":141,"Flags":0,"Description":"ExtenderResource portable resource properties"},"tags":{"Type":154,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":149,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":150,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":153,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[142,143,144,145,146,147,148]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[151,152]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":140}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":156,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":157,"Flags":10,"Description":"The resource api version"},"properties":{"Type":159,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":175,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":167,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":168,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":170,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":171,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[160,161,162,163,164,165,166]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":169}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":174,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[172,173]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":158}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":177,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":178,"Flags":10,"Description":"The resource api version"},"properties":{"Type":180,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":189,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":188,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[181,182,183,184,185,186,187]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":179}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":191,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":192,"Flags":10,"Description":"The resource api version"},"properties":{"Type":194,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":212,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":202,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":205,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":211,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[195,196,197,198,199,200,201]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[203,204]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":209,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":210,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[207,208]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":206}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":193}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":214,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":215,"Flags":10,"Description":"The resource api version"},"properties":{"Type":217,"Flags":0,"Description":"Volume properties"},"tags":{"Type":249,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":225,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":226}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[218,219,220,221,222,223,224]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":239,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":241,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":247,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":248,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":231,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":234,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":238,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[228,229,230]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[232,233]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[235,236,237]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":227}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":240}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":246,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[243,244,245]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":242}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":216}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":255,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":256,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[253,254]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":206}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":252,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index d5fd5f851b..ece5c35303 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -43,7 +43,7 @@ * **id**: string (ReadOnly, DeployTimeConstant): The resource id * **location**: string (Required): The geo-location where the resource lives * **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [ExtenderProperties](#extenderproperties): ExtenderResource link properties +* **properties**: [ExtenderProperties](#extenderproperties): ExtenderResource portable resource properties * **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. * **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. * **type**: 'Applications.Core/extenders' (ReadOnly, DeployTimeConstant): The resource type diff --git a/hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.json deleted file mode 100644 index 955d5a7757..0000000000 --- a/hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.json +++ /dev/null @@ -1 +0,0 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Link/daprPubSubBrokers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/daprPubSubBrokers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"DaprPubSubBroker link properties"},"tags":{"Type":28,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprPubSubBrokerProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"resourceProvisioning":{"Type":22,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resources":{"Type":25,"Flags":0,"Description":"A collection of references to resources associated with the daprPubSubBroker"},"type":{"Type":4,"Flags":0,"Description":"DaprPubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format."},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[20,21]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"2":{"Name":"ResourceReference","Properties":{"id":{"Type":4,"Flags":1,"Description":"Resource id of an existing resource"}}}},{"3":{"ItemType":24}},{"2":{"Name":"ResourceStatus","Properties":{"outputResources":{"Type":27,"Flags":0,"Description":"Properties of an output resource"}}}},{"3":{"ItemType":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":34,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":39,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[30,31,32,33]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[35,36,37,38]}},{"4":{"Name":"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Link/daprSecretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/daprSecretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":41,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":42,"Flags":10,"Description":"The resource api version"},"properties":{"Type":44,"Flags":0,"Description":"DaprSecretStore link properties"},"tags":{"Type":56,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprSecretStoreProperties","Properties":{"provisioningState":{"Type":52,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"type":{"Type":4,"Flags":0,"Description":"Dapr Secret Store type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/"},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resourceProvisioning":{"Type":55,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[45,46,47,48,49,50,51]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[53,54]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/daprSecretStores@2022-03-15-privatepreview","ScopeType":0,"Body":43}},{"6":{"Value":"Applications.Link/daprStateStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/daprStateStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"DaprStateStore link properties"},"tags":{"Type":74,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"DaprStateStoreProperties","Properties":{"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"resourceProvisioning":{"Type":72,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"metadata":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resources":{"Type":73,"Flags":0,"Description":"A collection of references to resources associated with the state store"},"type":{"Type":4,"Flags":0,"Description":"Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format."},"version":{"Type":4,"Flags":0,"Description":"Dapr component version"},"componentName":{"Type":4,"Flags":2,"Description":"The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[70,71]}},{"3":{"ItemType":24}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/daprStateStores@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Link/mongoDatabases"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/mongoDatabases","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":76,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":77,"Flags":10,"Description":"The resource api version"},"properties":{"Type":79,"Flags":0,"Description":"MongoDatabase link properties"},"tags":{"Type":93,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"MongoDatabaseProperties","Properties":{"provisioningState":{"Type":87,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"secrets":{"Type":88,"Flags":0,"Description":"The secret values for the given MongoDatabase resource"},"host":{"Type":4,"Flags":0,"Description":"Host name of the target Mongo database"},"port":{"Type":3,"Flags":0,"Description":"Port value of the target Mongo database"},"database":{"Type":4,"Flags":0,"Description":"Database name of the target Mongo database"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resources":{"Type":89,"Flags":0,"Description":"List of the resource IDs that support the MongoDB resource"},"resourceProvisioning":{"Type":92,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"username":{"Type":4,"Flags":0,"Description":"Username to use when connecting to the target Mongo database"},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[80,81,82,83,84,85,86]}},{"2":{"Name":"MongoDatabaseSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"Password to use when connecting to the target Mongo database"},"connectionString":{"Type":4,"Flags":0,"Description":"Connection string used to connect to the target Mongo database"}}}},{"3":{"ItemType":24}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[90,91]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/mongoDatabases@2022-03-15-privatepreview","ScopeType":0,"Body":78}},{"6":{"Value":"Applications.Link/rabbitMQMessageQueues"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/rabbitMQMessageQueues","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":95,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":96,"Flags":10,"Description":"The resource api version"},"properties":{"Type":98,"Flags":0,"Description":"RabbitMQMessageQueue link properties"},"tags":{"Type":112,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"RabbitMQMessageQueueProperties","Properties":{"provisioningState":{"Type":106,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"secrets":{"Type":107,"Flags":0,"Description":"The secret values for the given RabbitMQMessageQueue resource"},"queue":{"Type":4,"Flags":0,"Description":"The name of the queue"},"host":{"Type":4,"Flags":0,"Description":"The hostname of the RabbitMQ instance"},"port":{"Type":3,"Flags":0,"Description":"The port of the RabbitMQ instance. Defaults to 5672"},"vHost":{"Type":4,"Flags":0,"Description":"The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost."},"username":{"Type":4,"Flags":0,"Description":"The username to use when connecting to the RabbitMQ instance"},"resources":{"Type":108,"Flags":0,"Description":"List of the resource IDs that support the rabbitMQ resource"},"resourceProvisioning":{"Type":111,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"tls":{"Type":2,"Flags":0,"Description":"Specifies whether to use SSL when connecting to the RabbitMQ instance"},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[99,100,101,102,103,104,105]}},{"2":{"Name":"RabbitMQSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"The password used to connect to the RabbitMQ instance"},"uri":{"Type":4,"Flags":0,"Description":"The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value"}}}},{"3":{"ItemType":24}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[109,110]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview","ScopeType":0,"Body":97}},{"6":{"Value":"Applications.Link/redisCaches"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/redisCaches","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":114,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":115,"Flags":10,"Description":"The resource api version"},"properties":{"Type":117,"Flags":0,"Description":"RedisCache link properties"},"tags":{"Type":131,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"RedisCacheProperties","Properties":{"provisioningState":{"Type":125,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"secrets":{"Type":126,"Flags":0,"Description":"The secret values for the given RedisCache resource"},"host":{"Type":4,"Flags":0,"Description":"The host name of the target Redis cache"},"port":{"Type":3,"Flags":0,"Description":"The port value of the target Redis cache"},"username":{"Type":4,"Flags":0,"Description":"The username for Redis cache"},"tls":{"Type":2,"Flags":0,"Description":"Specifies whether to enable SSL connections to the Redis cache"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resources":{"Type":127,"Flags":0,"Description":"List of the resource IDs that support the Redis resource"},"resourceProvisioning":{"Type":130,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[118,119,120,121,122,123,124]}},{"2":{"Name":"RedisCacheSecrets","Properties":{"connectionString":{"Type":4,"Flags":0,"Description":"The connection string used to connect to the Redis cache"},"password":{"Type":4,"Flags":0,"Description":"The password for this Redis cache instance"},"url":{"Type":4,"Flags":0,"Description":"The URL used to connect to the Redis cache"}}}},{"3":{"ItemType":24}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[128,129]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/redisCaches@2022-03-15-privatepreview","ScopeType":0,"Body":116}},{"6":{"Value":"Applications.Link/sqlDatabases"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/sqlDatabases","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":133,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":134,"Flags":10,"Description":"The resource api version"},"properties":{"Type":136,"Flags":0,"Description":"SqlDatabase properties"},"tags":{"Type":150,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SqlDatabaseProperties","Properties":{"provisioningState":{"Type":144,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"database":{"Type":4,"Flags":0,"Description":"The name of the Sql database."},"server":{"Type":4,"Flags":0,"Description":"The fully qualified domain name of the Sql database."},"port":{"Type":3,"Flags":0,"Description":"Port value of the target Sql database"},"username":{"Type":4,"Flags":0,"Description":"Username to use when connecting to the target Sql database"},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"resources":{"Type":145,"Flags":0,"Description":"List of the resource IDs that support the SqlDatabase resource"},"resourceProvisioning":{"Type":148,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"secrets":{"Type":149,"Flags":0,"Description":"The secret values for the given SqlDatabase resource"},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[137,138,139,140,141,142,143]}},{"3":{"ItemType":24}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[146,147]}},{"2":{"Name":"SqlDatabaseSecrets","Properties":{"password":{"Type":4,"Flags":0,"Description":"Password to use when connecting to the target Sql database"},"connectionString":{"Type":4,"Flags":0,"Description":"Connection string used to connect to the target Sql database"}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/sqlDatabases@2022-03-15-privatepreview","ScopeType":0,"Body":135}},{"6":{"Value":"Applications.Link/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Link/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":152,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":153,"Flags":10,"Description":"The resource api version"},"properties":{"Type":155,"Flags":1,"Description":"Extender link properties"},"tags":{"Type":168,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":29,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"provisioningState":{"Type":163,"Flags":2,"Description":"Provisioning state of the link at the time the operation was called"},"secrets":{"Type":164,"Flags":0,"Description":"The secret values for the given Extender resource"},"resourceProvisioning":{"Type":167,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."},"recipe":{"Type":23,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a link"},"status":{"Type":26,"Flags":2,"Description":"Status of a resource."},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the link is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the link is consumed by"}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[156,157,158,159,160,161,162]}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[165,166]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Link/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":154}},{"2":{"Name":"MongoDatabaseListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"Password to use when connecting to the target Mongo database"},"connectionString":{"Type":4,"Flags":2,"Description":"Connection string used to connect to the target Mongo database"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Link/mongoDatabases","ApiVersion":"2022-03-15-privatepreview","Output":170}},{"2":{"Name":"RabbitMQListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"The password used to connect to the RabbitMQ instance"},"uri":{"Type":4,"Flags":2,"Description":"The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Link/rabbitMQMessageQueues","ApiVersion":"2022-03-15-privatepreview","Output":172}},{"2":{"Name":"RedisCacheListSecretsResult","Properties":{"connectionString":{"Type":4,"Flags":2,"Description":"The connection string used to connect to the Redis cache"},"password":{"Type":4,"Flags":2,"Description":"The password for this Redis cache instance"},"url":{"Type":4,"Flags":2,"Description":"The URL used to connect to the Redis cache"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Link/redisCaches","ApiVersion":"2022-03-15-privatepreview","Output":174}},{"2":{"Name":"SqlDatabaseListSecretsResult","Properties":{"password":{"Type":4,"Flags":2,"Description":"Password to use when connecting to the target Sql database"},"connectionString":{"Type":4,"Flags":2,"Description":"Connection string used to connect to the target Sql database"}}}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Link/sqlDatabases","ApiVersion":"2022-03-15-privatepreview","Output":176}},{"2":{"Name":"ExtenderSecrets","Properties":{},"AdditionalProperties":0}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Link/extenders","ApiVersion":"2022-03-15-privatepreview","Output":178}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.md deleted file mode 100644 index 1ae31cefde..0000000000 --- a/hack/bicep-types-radius/generated/applications/applications.link/2022-03-15-privatepreview/types.md +++ /dev/null @@ -1,352 +0,0 @@ -# Applications.Link @ 2022-03-15-privatepreview - -## Resource Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprPubSubBrokerProperties](#daprpubsubbrokerproperties): DaprPubSubBroker link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/daprPubSubBrokers' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/daprSecretStores@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprSecretStoreProperties](#daprsecretstoreproperties): DaprSecretStore link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/daprSecretStores' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/daprStateStores@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [DaprStateStoreProperties](#daprstatestoreproperties): DaprStateStore link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/daprStateStores' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/extenders@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [ExtenderProperties](#extenderproperties) (Required): Extender link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/extenders' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/mongoDatabases@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [MongoDatabaseProperties](#mongodatabaseproperties): MongoDatabase link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/mongoDatabases' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [RabbitMQMessageQueueProperties](#rabbitmqmessagequeueproperties): RabbitMQMessageQueue link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/rabbitMQMessageQueues' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/redisCaches@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [RedisCacheProperties](#rediscacheproperties): RedisCache link properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/redisCaches' (ReadOnly, DeployTimeConstant): The resource type - -## Resource Applications.Link/sqlDatabases@2022-03-15-privatepreview -* **Valid Scope(s)**: Unknown -### Properties -* **apiVersion**: '2022-03-15-privatepreview' (ReadOnly, DeployTimeConstant): The resource api version -* **id**: string (ReadOnly, DeployTimeConstant): The resource id -* **location**: string (Required): The geo-location where the resource lives -* **name**: string (Required, DeployTimeConstant): The resource name -* **properties**: [SqlDatabaseProperties](#sqldatabaseproperties): SqlDatabase properties -* **systemData**: [SystemData](#systemdata) (ReadOnly): Metadata pertaining to creation and last modification of the resource. -* **tags**: [TrackedResourceTags](#trackedresourcetags): Resource tags. -* **type**: 'Applications.Link/sqlDatabases' (ReadOnly, DeployTimeConstant): The resource type - -## Function listSecrets (Applications.Link/mongoDatabases@2022-03-15-privatepreview) -* **Resource**: Applications.Link/mongoDatabases -* **ApiVersion**: 2022-03-15-privatepreview -* **Output**: [MongoDatabaseListSecretsResult](#mongodatabaselistsecretsresult) - -## Function listSecrets (Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview) -* **Resource**: Applications.Link/rabbitMQMessageQueues -* **ApiVersion**: 2022-03-15-privatepreview -* **Output**: [RabbitMQListSecretsResult](#rabbitmqlistsecretsresult) - -## Function listSecrets (Applications.Link/redisCaches@2022-03-15-privatepreview) -* **Resource**: Applications.Link/redisCaches -* **ApiVersion**: 2022-03-15-privatepreview -* **Output**: [RedisCacheListSecretsResult](#rediscachelistsecretsresult) - -## Function listSecrets (Applications.Link/sqlDatabases@2022-03-15-privatepreview) -* **Resource**: Applications.Link/sqlDatabases -* **ApiVersion**: 2022-03-15-privatepreview -* **Output**: [SqlDatabaseListSecretsResult](#sqldatabaselistsecretsresult) - -## Function listSecrets (Applications.Link/extenders@2022-03-15-privatepreview) -* **Resource**: Applications.Link/extenders -* **ApiVersion**: 2022-03-15-privatepreview -* **Output**: [ExtenderSecrets](#extendersecrets) - -## DaprPubSubBrokerProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **componentName**: string (ReadOnly): The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component. -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **metadata**: any: Any object -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the daprPubSubBroker -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: string: DaprPubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format. -* **version**: string: Dapr component version - -## Recipe -### Properties -* **name**: string (Required): The name of the recipe within the environment to use -* **parameters**: any: Any object - -## ResourceReference -### Properties -* **id**: string (Required): Resource id of an existing resource - -## ResourceStatus -### Properties -* **outputResources**: any[]: Properties of an output resource - -## SystemData -### Properties -* **createdAt**: string: The timestamp of resource creation (UTC). -* **createdBy**: string: The identity that created the resource. -* **createdByType**: 'Application' | 'Key' | 'ManagedIdentity' | 'User': The type of identity that created the resource. -* **lastModifiedAt**: string: The timestamp of resource last modification (UTC) -* **lastModifiedBy**: string: The identity that last modified the resource. -* **lastModifiedByType**: 'Application' | 'Key' | 'ManagedIdentity' | 'User': The type of identity that created the resource. - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## DaprSecretStoreProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **componentName**: string (ReadOnly): The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component. -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **metadata**: any: Any object -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: string: Dapr Secret Store type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/ -* **version**: string: Dapr component version - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## DaprStateStoreProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **componentName**: string (ReadOnly): The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component. -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **metadata**: any: Any object -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: A collection of references to resources associated with the state store -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **type**: string: Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format. -* **version**: string: Dapr component version - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## ExtenderProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **secrets**: [ExtenderSecrets](#extendersecrets): The secret values for the given Extender resource -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -### Additional Properties -* **Additional Properties Type**: any - -## ExtenderSecrets -### Properties -### Additional Properties -* **Additional Properties Type**: any - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## MongoDatabaseProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **database**: string: Database name of the target Mongo database -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **host**: string: Host name of the target Mongo database -* **port**: int: Port value of the target Mongo database -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the MongoDB resource -* **secrets**: [MongoDatabaseSecrets](#mongodatabasesecrets): The secret values for the given MongoDatabase resource -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **username**: string: Username to use when connecting to the target Mongo database - -## MongoDatabaseSecrets -### Properties -* **connectionString**: string: Connection string used to connect to the target Mongo database -* **password**: string: Password to use when connecting to the target Mongo database - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## RabbitMQMessageQueueProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **host**: string: The hostname of the RabbitMQ instance -* **port**: int: The port of the RabbitMQ instance. Defaults to 5672 -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **queue**: string: The name of the queue -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the rabbitMQ resource -* **secrets**: [RabbitMQSecrets](#rabbitmqsecrets): The secret values for the given RabbitMQMessageQueue resource -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **tls**: bool: Specifies whether to use SSL when connecting to the RabbitMQ instance -* **username**: string: The username to use when connecting to the RabbitMQ instance -* **vHost**: string: The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. - -## RabbitMQSecrets -### Properties -* **password**: string: The password used to connect to the RabbitMQ instance -* **uri**: string: The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## RedisCacheProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **host**: string: The host name of the target Redis cache -* **port**: int: The port value of the target Redis cache -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the Redis resource -* **secrets**: [RedisCacheSecrets](#rediscachesecrets): The secret values for the given RedisCache resource -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **tls**: bool: Specifies whether to enable SSL connections to the Redis cache -* **username**: string: The username for Redis cache - -## RedisCacheSecrets -### Properties -* **connectionString**: string: The connection string used to connect to the Redis cache -* **password**: string: The password for this Redis cache instance -* **url**: string: The URL used to connect to the Redis cache - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## SqlDatabaseProperties -### Properties -* **application**: string: Fully qualified resource ID for the application that the link is consumed by -* **database**: string: The name of the Sql database. -* **environment**: string (Required): Fully qualified resource ID for the environment that the link is linked to -* **port**: int: Port value of the target Sql database -* **provisioningState**: 'Accepted' | 'Canceled' | 'Deleting' | 'Failed' | 'Provisioning' | 'Succeeded' | 'Updating' (ReadOnly): Provisioning state of the link at the time the operation was called -* **recipe**: [Recipe](#recipe): The recipe used to automatically deploy underlying infrastructure for a link -* **resourceProvisioning**: 'manual' | 'recipe': Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values. -* **resources**: [ResourceReference](#resourcereference)[]: List of the resource IDs that support the SqlDatabase resource -* **secrets**: [SqlDatabaseSecrets](#sqldatabasesecrets): The secret values for the given SqlDatabase resource -* **server**: string: The fully qualified domain name of the Sql database. -* **status**: [ResourceStatus](#resourcestatus) (ReadOnly): Status of a resource. -* **username**: string: Username to use when connecting to the target Sql database - -## SqlDatabaseSecrets -### Properties -* **connectionString**: string: Connection string used to connect to the target Sql database -* **password**: string: Password to use when connecting to the target Sql database - -## TrackedResourceTags -### Properties -### Additional Properties -* **Additional Properties Type**: string - -## MongoDatabaseListSecretsResult -### Properties -* **connectionString**: string (ReadOnly): Connection string used to connect to the target Mongo database -* **password**: string (ReadOnly): Password to use when connecting to the target Mongo database - -## RabbitMQListSecretsResult -### Properties -* **password**: string (ReadOnly): The password used to connect to the RabbitMQ instance -* **uri**: string (ReadOnly): The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value - -## RedisCacheListSecretsResult -### Properties -* **connectionString**: string (ReadOnly): The connection string used to connect to the Redis cache -* **password**: string (ReadOnly): The password for this Redis cache instance -* **url**: string (ReadOnly): The URL used to connect to the Redis cache - -## SqlDatabaseListSecretsResult -### Properties -* **connectionString**: string (ReadOnly): Connection string used to connect to the target Sql database -* **password**: string (ReadOnly): Password to use when connecting to the target Sql database - -## ExtenderSecrets -### Properties -### Additional Properties -* **Additional Properties Type**: any - diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 6afc79a0de..5c0e7ef2ec 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":112},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":137},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":155},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":176},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":190},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":213},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":250},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":40},"Applications.Link/daprSecretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":57},"Applications.Link/daprStateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":75},"Applications.Link/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":94},"Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":113},"Applications.Link/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":132},"Applications.Link/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":151},"Applications.Link/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":169},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":257}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.link/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":171}]},"applications.link/rabbitmqmessagequeues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":173}]},"applications.link/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":175}]},"applications.link/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":177}]},"applications.link/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.link/2022-03-15-privatepreview/types.json","Index":179}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":112},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":137},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":155},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":176},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":190},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":213},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":250},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":257}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/index.md b/hack/bicep-types-radius/generated/index.md index a78a4699fa..abbb71ecff 100644 --- a/hack/bicep-types-radius/generated/index.md +++ b/hack/bicep-types-radius/generated/index.md @@ -44,31 +44,6 @@ ### applications.datastores/sqldatabases * [2022-03-15-privatepreview](applications/applications.datastores/2022-03-15-privatepreview/types.md#resource-applicationsdatastoressqldatabases2022-03-15-privatepreview) -## applications.link -### applications.link/daprpubsubbrokers -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkdaprpubsubbrokers2022-03-15-privatepreview) - -### applications.link/daprsecretstores -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkdaprsecretstores2022-03-15-privatepreview) - -### applications.link/daprstatestores -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkdaprstatestores2022-03-15-privatepreview) - -### applications.link/extenders -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkextenders2022-03-15-privatepreview) - -### applications.link/mongodatabases -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkmongodatabases2022-03-15-privatepreview) - -### applications.link/rabbitmqmessagequeues -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkrabbitmqmessagequeues2022-03-15-privatepreview) - -### applications.link/rediscaches -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinkrediscaches2022-03-15-privatepreview) - -### applications.link/sqldatabases -* [2022-03-15-privatepreview](applications/applications.link/2022-03-15-privatepreview/types.md#resource-applicationslinksqldatabases2022-03-15-privatepreview) - ## applications.messaging ### applications.messaging/rabbitmqqueues * [2022-03-15-privatepreview](applications/applications.messaging/2022-03-15-privatepreview/types.md#resource-applicationsmessagingrabbitmqqueues2022-03-15-privatepreview) diff --git a/pkg/armrpc/api/v1/types.go b/pkg/armrpc/api/v1/types.go index 893c7d711d..5e4ed75020 100644 --- a/pkg/armrpc/api/v1/types.go +++ b/pkg/armrpc/api/v1/types.go @@ -72,7 +72,7 @@ func (o OperationMethod) HTTPMethod() string { if !ok { // ARM RPC defines CRUD_L operations of one resource type and the custom action should be defined as POST method. // For example, if we want to support `listSecret` API for mongodatabase, this API must be defined as POST method. - // POST /subscriptions/{subId}/resourcegroups/{rg}/applications.link/mongodatabases/{mongo}/listSecret + // POST /subscriptions/{subId}/resourcegroups/{rg}/applications.datastores/mongodatabases/{mongo}/listSecret return http.MethodPost } return m diff --git a/pkg/armrpc/frontend/defaultoperation/resource_test.go b/pkg/armrpc/frontend/defaultoperation/resource_test.go index 96ae277461..3b7df1dc3d 100644 --- a/pkg/armrpc/frontend/defaultoperation/resource_test.go +++ b/pkg/armrpc/frontend/defaultoperation/resource_test.go @@ -178,7 +178,7 @@ func testResourceDataModelFromVersioned(content []byte, version string) (*TestRe // testValidateRequest is an example resource filter. // // In this case we're validating that the application of an existing resource can't change. This is one of our scenarios -// for the corerp and linkrp. However we're avoiding calling into that code directly from here to avoid coupling. +// for the corerp and portable resource providers. However we're avoiding calling into that code directly from here to avoid coupling. func testValidateRequest(ctx context.Context, newResource *TestResourceDataModel, oldResource *TestResourceDataModel, options *controller.Options) (rest.Response, error) { if oldResource == nil { return nil, nil diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index ec134ab001..75ff8dc366 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -29,7 +29,7 @@ import ( aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" "github.com/project-radius/radius/pkg/cli/clients_new/generated" corerpv20220315 "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" ucpv20220901 "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" "github.com/project-radius/radius/pkg/ucp/resources" resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" @@ -44,24 +44,18 @@ var _ ApplicationsManagementClient = (*UCPApplicationsManagementClient)(nil) var ( ResourceTypesList = []string{ - linkrp.MongoDatabasesResourceType, - linkrp.RabbitMQMessageQueuesResourceType, - linkrp.RedisCachesResourceType, - linkrp.SqlDatabasesResourceType, - linkrp.DaprStateStoresResourceType, - linkrp.DaprSecretStoresResourceType, - linkrp.DaprPubSubBrokersResourceType, - linkrp.ExtendersResourceType, + portableresources.MongoDatabasesResourceType, + portableresources.RabbitMQQueuesResourceType, + portableresources.RedisCachesResourceType, + portableresources.SqlDatabasesResourceType, + portableresources.DaprStateStoresResourceType, + portableresources.DaprSecretStoresResourceType, + portableresources.DaprPubSubBrokersResourceType, + portableresources.ExtendersResourceType, "Applications.Core/gateways", "Applications.Core/httpRoutes", "Applications.Core/containers", "Applications.Core/secretStores", - "Applications.Core/extenders", - // Resource Types after Splitting Linkrp Namespace - linkrp.N_RabbitMQQueuesResourceType, - linkrp.N_DaprStateStoresResourceType, - linkrp.N_DaprSecretStoresResourceType, - linkrp.N_DaprPubSubBrokersResourceType, } ) diff --git a/pkg/cli/clients_new/README.md b/pkg/cli/clients_new/README.md index 5b7bea9575..57fd28d3d7 100644 --- a/pkg/cli/clients_new/README.md +++ b/pkg/cli/clients_new/README.md @@ -47,4 +47,4 @@ output-folder: ./generated ``` ### Adding ResourceTypes: -All resource types are tracked in resourceTypesList in ucp package. Whenever a new core-rp or link type is added this list has to be updated. +All resource types are tracked in resourceTypesList in ucp package. Whenever a new core-rp or portable resource type is added this list has to be updated. diff --git a/pkg/cli/clivalidation.go b/pkg/cli/clivalidation.go index aeedee42cb..21490a6470 100644 --- a/pkg/cli/clivalidation.go +++ b/pkg/cli/clivalidation.go @@ -261,7 +261,7 @@ func RequireResourceTypeAndName(args []string) (string, string, error) { return resourceType, resourceName, nil } -// example of resource Type: Applications.Core/httpRoutes, Applications.Link/redisCaches +// example of resource Type: Applications.Core/httpRoutes, Applications.Datastores/redisCaches // // RequireResourceType checks if the first argument provided is a valid resource type and returns it if it is. If the diff --git a/pkg/cli/cmd/credential/register/azure/azure.go b/pkg/cli/cmd/credential/register/azure/azure.go index bedea63d96..27ede125db 100644 --- a/pkg/cli/cmd/credential/register/azure/azure.go +++ b/pkg/cli/cmd/credential/register/azure/azure.go @@ -53,7 +53,7 @@ This command is intended for scripting or advanced use-cases. See 'rad init' for to configure these settings. Radius will use the provided service principal for all interactions with Azure, including Bicep deployment, -Radius environments, and Radius links. +Radius environments, and Radius portable resources. Radius will use the provided subscription and resource group as the default target scope for Bicep deployment. The provided service principal must have the Contributor or Owner role assigned for the provided resource group diff --git a/pkg/cli/cmd/radinit/init_test.go b/pkg/cli/cmd/radinit/init_test.go index efee1541ac..06d8aa4766 100644 --- a/pkg/cli/cmd/radinit/init_test.go +++ b/pkg/cli/cmd/radinit/init_test.go @@ -592,7 +592,7 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { azureProvider: nil, awsProvider: nil, recipes: map[string]map[string]corerp.RecipePropertiesClassification{ - "Applications.Link/redisCaches": { + "Applications.Datastores/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("radiusdev.azurecr.io/redis:latest"), diff --git a/pkg/cli/cmd/radinit/recipe.go b/pkg/cli/cmd/radinit/recipe.go index 6131a216f2..114cc0efbb 100644 --- a/pkg/cli/cmd/radinit/recipe.go +++ b/pkg/cli/cmd/radinit/recipe.go @@ -22,11 +22,10 @@ import ( "strings" corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" recipe_types "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/version" - "oras.land/oras-go/v2/registry/remote" ) @@ -117,15 +116,15 @@ func processRepositories(repos []string, tag string) map[string]map[string]corer continue } - linkType := getLinkType(resourceType) - // If the link type is empty, it means we don't support the resource type. - if linkType == "" { + portableResourceType := getPortableResourceType(resourceType) + // If the PortableResource type is empty, it means we don't support the resource type. + if portableResourceType == "" { continue } repoPath := DevRecipesRegistry + "/" + repo - recipes[linkType] = map[string]corerp.RecipePropertiesClassification{ + recipes[portableResourceType] = map[string]corerp.RecipePropertiesClassification{ name: &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipe_types.TemplateKindBicep), TemplatePath: to.Ptr(repoPath + ":" + tag), @@ -152,31 +151,25 @@ func getResourceTypeFromPath(repo string) (resourceType string) { return resourceType } -// getLinkType returns the link type for the given resource type. -func getLinkType(resourceType string) string { +// getPortableResourceType returns the resource type for the given resource. +func getPortableResourceType(resourceType string) string { switch resourceType { - case "daprpubsubbrokers": - return linkrp.DaprPubSubBrokersResourceType - case "daprsecretstores": - return linkrp.DaprSecretStoresResourceType - case "daprstatestores": - return linkrp.DaprStateStoresResourceType case "mongodatabases": - return linkrp.MongoDatabasesResourceType - case "rabbitmqmessagequeues": - return linkrp.RabbitMQMessageQueuesResourceType + return portableresources.MongoDatabasesResourceType case "rediscaches": - return linkrp.RedisCachesResourceType + return portableresources.RedisCachesResourceType case "sqldatabases": - return linkrp.SqlDatabasesResourceType + return portableresources.SqlDatabasesResourceType case "rabbitmqqueues": - return linkrp.N_RabbitMQQueuesResourceType + return portableresources.RabbitMQQueuesResourceType case "pubsubbrokers": - return linkrp.N_DaprPubSubBrokersResourceType + return portableresources.DaprPubSubBrokersResourceType case "secretstores": - return linkrp.N_DaprSecretStoresResourceType + return portableresources.DaprSecretStoresResourceType case "statestores": - return linkrp.N_DaprStateStoresResourceType + return portableresources.DaprStateStoresResourceType + case "extenders": + return portableresources.ExtendersResourceType default: return "" } diff --git a/pkg/cli/cmd/radinit/recipe_test.go b/pkg/cli/cmd/radinit/recipe_test.go index f477709224..85e576635d 100644 --- a/pkg/cli/cmd/radinit/recipe_test.go +++ b/pkg/cli/cmd/radinit/recipe_test.go @@ -73,57 +73,57 @@ func Test_getResourceTypeFromPath(t *testing.T) { } } -func Test_getLinkType(t *testing.T) { +func Test_getPortableResourceType(t *testing.T) { tests := []struct { name string resourceType string want string }{ { - "Dapr PubSub Link Type", - "daprpubsubbrokers", - "Applications.Link/daprPubSubBrokers", + "Dapr PubSub Portable Resource", + "pubsubbrokers", + "Applications.Dapr/pubSubBrokers", }, { - "Dapr Secret Store Link Type", - "daprsecretstores", - "Applications.Link/daprSecretStores", + "Dapr Secret Store Portable Resource", + "secretstores", + "Applications.Dapr/secretStores", }, { - "Dapr State Store Link Type", - "daprstatestores", - "Applications.Link/daprStateStores", + "Dapr State Store Portable Resource", + "statestores", + "Applications.Dapr/stateStores", }, { - "Rabbit MQ Link Type", - "rabbitmqmessagequeues", - "Applications.Link/rabbitMQMessageQueues", + "Rabbit MQ Portable Resource", + "rabbitmqqueues", + "Applications.Messaging/rabbitMQQueues", }, { - "Redis Cache Link Type", + "Redis Cache Portable Resource", "rediscaches", - "Applications.Link/redisCaches", + "Applications.Datastores/redisCaches", }, { - "Mongo Database Link Type", + "Mongo Database Portable Resource", "mongodatabases", - "Applications.Link/mongoDatabases", + "Applications.Datastores/mongoDatabases", }, { - "SQL Database Link Type", + "SQL Database Portable Resource", "sqldatabases", - "Applications.Link/sqlDatabases", + "Applications.Datastores/sqlDatabases", }, { - "Invalid Link Type", + "Invalid Portable Resource", "unsupported", "", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := getLinkType(tt.resourceType); got != tt.want { - t.Errorf("getLinkType() = %v, want %v", got, tt.want) + if got := getPortableResourceType(tt.resourceType); got != tt.want { + t.Errorf("getPortableResourceType() = %v, want %v", got, tt.want) } }) } @@ -143,7 +143,7 @@ func Test_processRepositories(t *testing.T) { }, "0.20", map[string]map[string]corerp.RecipePropertiesClassification{ - "Applications.Link/redisCaches": { + "Applications.Datastores/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr(fmt.Sprintf("%s/recipes/local-dev/rediscaches:0.20", DevRecipesRegistry)), @@ -159,13 +159,13 @@ func Test_processRepositories(t *testing.T) { }, "0.20", map[string]map[string]corerp.RecipePropertiesClassification{ - "Applications.Link/redisCaches": { + "Applications.Datastores/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr(fmt.Sprintf("%s/recipes/local-dev/rediscaches:0.20", DevRecipesRegistry)), }, }, - "Applications.Link/mongoDatabases": { + "Applications.Datastores/mongoDatabases": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr(fmt.Sprintf("%s/recipes/local-dev/mongodatabases:0.20", DevRecipesRegistry)), @@ -184,13 +184,13 @@ func Test_processRepositories(t *testing.T) { }, "latest", map[string]map[string]corerp.RecipePropertiesClassification{ - "Applications.Link/redisCaches": { + "Applications.Datastores/redisCaches": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr(fmt.Sprintf("%s/recipes/local-dev/rediscaches:latest", DevRecipesRegistry)), }, }, - "Applications.Link/mongoDatabases": { + "Applications.Datastores/mongoDatabases": { "default": &corerp.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr(fmt.Sprintf("%s/recipes/local-dev/mongodatabases:latest", DevRecipesRegistry)), diff --git a/pkg/cli/cmd/recipe/list/list.go b/pkg/cli/cmd/recipe/list/list.go index fa0dddfed9..76b66c548b 100644 --- a/pkg/cli/cmd/recipe/list/list.go +++ b/pkg/cli/cmd/recipe/list/list.go @@ -118,14 +118,14 @@ func (r *Runner) Run(ctx context.Context) error { return err } var envRecipes []types.EnvironmentRecipe - for link, recipes := range envResource.Properties.Recipes { + for resourceType, recipes := range envResource.Properties.Recipes { for recipeName, recipeDetails := range recipes { recipe := types.EnvironmentRecipe{} switch c := recipeDetails.(type) { case *corerp.TerraformRecipeProperties: recipe = types.EnvironmentRecipe{ Name: recipeName, - LinkType: link, + LinkType: resourceType, TemplatePath: *c.TemplatePath, TemplateKind: *c.TemplateKind, TemplateVersion: *c.TemplateVersion, @@ -133,7 +133,7 @@ func (r *Runner) Run(ctx context.Context) error { case *corerp.BicepRecipeProperties: recipe = types.EnvironmentRecipe{ Name: recipeName, - LinkType: link, + LinkType: resourceType, TemplatePath: *c.TemplatePath, TemplateKind: *c.TemplateKind, } diff --git a/pkg/cli/cmd/recipe/list/list_test.go b/pkg/cli/cmd/recipe/list/list_test.go index e4f6ef86c4..ee7494c051 100644 --- a/pkg/cli/cmd/recipe/list/list_test.go +++ b/pkg/cli/cmd/recipe/list/list_test.go @@ -30,7 +30,7 @@ import ( "github.com/project-radius/radius/pkg/cli/output" "github.com/project-radius/radius/pkg/cli/workspaces" "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/radcli" @@ -86,7 +86,7 @@ func Test_Run(t *testing.T) { Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -103,13 +103,13 @@ func Test_Run(t *testing.T) { recipes := []types.EnvironmentRecipe{ { Name: "cosmosDB", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", }, { Name: "cosmosDB-terraform", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", diff --git a/pkg/cli/cmd/recipe/register/register.go b/pkg/cli/cmd/recipe/register/register.go index ba890fa717..5449aa3098 100644 --- a/pkg/cli/cmd/recipe/register/register.go +++ b/pkg/cli/cmd/recipe/register/register.go @@ -52,13 +52,13 @@ You can specify parameters using the '--parameter' flag ('-p' for short). Parame `, Example: ` # Add a recipe to an environment -rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Link/mongoDatabases +rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Datastores/mongoDatabases # Specify a parameter -rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Link/mongoDatabases --parameters throughput=400 +rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Datastores/mongoDatabases --parameters throughput=400 # specify multiple parameters using a JSON parameter file -rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Link/mongoDatabases --parameters @myfile.json +rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Datastores/mongoDatabases --parameters @myfile.json `, Args: cobra.ExactArgs(1), RunE: framework.RunCommand(runner), @@ -73,7 +73,7 @@ rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --te cmd.Flags().String("template-version", "", "specify the version for the terraform module.") cmd.Flags().String("template-path", "", "specify the path to the template provided by the recipe.") _ = cmd.MarkFlagRequired("template-path") - cmd.Flags().String("link-type", "", "specify the type of the link this recipe can be consumed by") + cmd.Flags().String("link-type", "", "specify the type of the portable resource this recipe can be consumed by") _ = cmd.MarkFlagRequired("link-type") commonflags.AddParameterFlag(cmd) diff --git a/pkg/cli/cmd/recipe/register/register_test.go b/pkg/cli/cmd/recipe/register/register_test.go index 9c45c0161a..f63c35d4d4 100644 --- a/pkg/cli/cmd/recipe/register/register_test.go +++ b/pkg/cli/cmd/recipe/register/register_test.go @@ -32,7 +32,7 @@ import ( "github.com/project-radius/radius/pkg/cli/output" "github.com/project-radius/radius/pkg/cli/workspaces" "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/radcli" @@ -47,7 +47,7 @@ func Test_Validate(t *testing.T) { testcases := []radcli.ValidateInput{ { Name: "Valid Register Command with parameters", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", linkrp.MongoDatabasesResourceType, "--parameters", "a=b"}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType, "--parameters", "a=b"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -56,7 +56,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Valid Register Command for terraform recipe", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindTerraform, "--template-path", "test_template", "--link-type", linkrp.MongoDatabasesResourceType, "--template-version", "1.1.0"}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindTerraform, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType, "--template-version", "1.1.0"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -65,7 +65,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Valid Register Command with parameters passed as file", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", linkrp.MongoDatabasesResourceType, "--parameters", "@testdata/recipeparam.json"}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType, "--parameters", "@testdata/recipeparam.json"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -74,7 +74,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command with fallback workspace", - Input: []string{"-e", "myenvironment", "test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", linkrp.MongoDatabasesResourceType}, + Input: []string{"-e", "myenvironment", "test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -83,7 +83,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command without name", - Input: []string{"--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", linkrp.MongoDatabasesResourceType}, + Input: []string{"--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -92,7 +92,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command without template kind", - Input: []string{"test_recipe", "--template-path", "test_template", "--link-type", linkrp.MongoDatabasesResourceType}, + Input: []string{"test_recipe", "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -101,7 +101,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command without template path", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--link-type", linkrp.MongoDatabasesResourceType}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--link-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -135,7 +135,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testRecipes := map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -175,7 +175,7 @@ func Test_Run(t *testing.T) { TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_new", } @@ -198,7 +198,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testRecipes := map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), }, @@ -244,7 +244,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_new", } @@ -271,7 +271,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_new", } @@ -285,7 +285,7 @@ func Test_Run(t *testing.T) { testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -324,7 +324,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/rediscaches:v1", - LinkType: linkrp.RedisCachesResourceType, + LinkType: portableresources.RedisCachesResourceType, RecipeName: "redis", Parameters: map[string]map[string]any{}, } @@ -348,7 +348,7 @@ func Test_Run(t *testing.T) { ctrl := gomock.NewController(t) testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -380,7 +380,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_no_namespace", } @@ -432,7 +432,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/rediscaches:v1", - LinkType: linkrp.RedisCachesResourceType, + LinkType: portableresources.RedisCachesResourceType, RecipeName: "redis", } diff --git a/pkg/cli/cmd/recipe/show/show.go b/pkg/cli/cmd/recipe/show/show.go index 4db49063af..6da820a74f 100644 --- a/pkg/cli/cmd/recipe/show/show.go +++ b/pkg/cli/cmd/recipe/show/show.go @@ -98,7 +98,7 @@ func NewRunner(factory framework.Factory) *Runner { // // Validate takes in a command and a slice of strings and validates the command line arguments, setting the workspace, environment, -// recipe name, link type and output format in the Runner struct. It returns an error if any of the arguments are invalid. +// recipe name, portable resource type and output format in the Runner struct. It returns an error if any of the arguments are invalid. func (r *Runner) Validate(cmd *cobra.Command, args []string) error { // Validate command line args workspace, err := cli.RequireWorkspace(cmd, r.ConfigHolder.Config, r.ConfigHolder.DirectoryConfig) diff --git a/pkg/cli/cmd/recipe/show/show_test.go b/pkg/cli/cmd/recipe/show/show_test.go index fe444dae58..ad025c278a 100644 --- a/pkg/cli/cmd/recipe/show/show_test.go +++ b/pkg/cli/cmd/recipe/show/show_test.go @@ -30,7 +30,7 @@ import ( "github.com/project-radius/radius/pkg/cli/output" "github.com/project-radius/radius/pkg/cli/workspaces" "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/radcli" @@ -111,7 +111,7 @@ func Test_Run(t *testing.T) { } recipe := types.EnvironmentRecipe{ Name: "cosmosDB", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", } @@ -145,7 +145,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{}, Format: "table", RecipeName: "cosmosDB", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, } err := runner.Run(context.Background()) @@ -187,7 +187,7 @@ func Test_Run(t *testing.T) { } recipe := types.EnvironmentRecipe{ Name: "cosmosDB", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", @@ -222,7 +222,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{}, Format: "table", RecipeName: "cosmosDB", - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, } err := runner.Run(context.Background()) diff --git a/pkg/cli/cmd/recipe/unregister/unregister.go b/pkg/cli/cmd/recipe/unregister/unregister.go index 327bec3c95..587a532268 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister.go +++ b/pkg/cli/cmd/recipe/unregister/unregister.go @@ -35,7 +35,7 @@ import ( // // NewCommand creates a new cobra command for unregistering a recipe from an environment, which takes in a factory and returns a cobra command -// and a runner. It also sets up flags for output, workspace, resource group, environment name and link type, with link type being a required flag. +// and a runner. It also sets up flags for output, workspace, resource group, environment name and portable resource type, with link-type being a required flag. func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) { runner := NewRunner(factory) diff --git a/pkg/cli/cmd/recipe/unregister/unregister_test.go b/pkg/cli/cmd/recipe/unregister/unregister_test.go index cf5cafa55a..a24687d73e 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister_test.go +++ b/pkg/cli/cmd/recipe/unregister/unregister_test.go @@ -32,7 +32,7 @@ import ( "github.com/project-radius/radius/pkg/cli/output" "github.com/project-radius/radius/pkg/cli/workspaces" "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/radcli" @@ -101,7 +101,7 @@ func Test_Run(t *testing.T) { testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -136,7 +136,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Link/mongoDatabases", + LinkType: "Applications.Datastores/mongoDatabases", } expectedOutput := []any{ @@ -159,7 +159,7 @@ func Test_Run(t *testing.T) { testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), }, @@ -202,7 +202,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Link/mongoDatabases", + LinkType: "Applications.Datastores/mongoDatabases", } err := runner.Run(context.Background()) @@ -215,7 +215,7 @@ func Test_Run(t *testing.T) { testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -247,7 +247,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Link/mongoDatabases", + LinkType: "Applications.Datastores/mongoDatabases", } expectedOutput := []any{ @@ -275,7 +275,7 @@ func Test_Run(t *testing.T) { Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmosDB": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -297,7 +297,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB1", - LinkType: "Applications.Link/mongoDatabases", + LinkType: "Applications.Datastores/mongoDatabases", } err := runner.Run(context.Background()) @@ -313,7 +313,7 @@ func Test_Run(t *testing.T) { Location: to.Ptr(v1.LocationGlobal), Properties: &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "testResource": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), @@ -335,7 +335,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "testResource", - LinkType: "Applications.Link/redisCaches", + LinkType: "Applications.Datastores/redisCaches", } err := runner.Run(context.Background()) @@ -365,7 +365,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Link/mongoDatabases", + LinkType: "Applications.Datastores/mongoDatabases", } err := runner.Run(context.Background()) @@ -377,13 +377,13 @@ func Test_Run(t *testing.T) { testEnvProperties := &v20220315privatepreview.EnvironmentProperties{ Recipes: map[string]map[string]v20220315privatepreview.RecipePropertiesClassification{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "testResource": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1"), }, }, - linkrp.RedisCachesResourceType: { + portableresources.RedisCachesResourceType: { "testResource": &v20220315privatepreview.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("testpublicrecipe.azurecr.io/bicep/modules/rediscaches:v1"), @@ -418,7 +418,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "testResource", - LinkType: "Applications.Link/mongoDatabases", + LinkType: "Applications.Datastores/mongoDatabases", } expectedOutput := []any{ diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go index 73129c89e7..099219beef 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go @@ -23,6 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" + "github.com/project-radius/radius/pkg/portableresources" types "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -64,7 +65,7 @@ func (src *EnvironmentResource) ConvertTo() (v1.DataModelInterface, error) { if src.Properties.Recipes != nil { envRecipes := make(map[string]map[string]datamodel.EnvironmentRecipeProperties) for resourceType, recipes := range src.Properties.Recipes { - if !isValidLinkType(resourceType) { + if !portableresources.IsValidPortableResourceType(resourceType) { return &datamodel.Environment{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid link type: %q", resourceType)) } envRecipes[resourceType] = map[string]datamodel.EnvironmentRecipeProperties{} diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go index 10d0f0fabd..b65b76d64a 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go @@ -23,7 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -74,7 +74,7 @@ func TestConvertVersionedToDataModel(t *testing.T) { }, }, Recipes: map[string]map[string]datamodel.EnvironmentRecipeProperties{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmos-recipe": datamodel.EnvironmentRecipeProperties{ TemplateKind: recipes.TemplateKindBicep, TemplatePath: "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", @@ -118,7 +118,7 @@ func TestConvertVersionedToDataModel(t *testing.T) { }, }, Recipes: map[string]map[string]datamodel.EnvironmentRecipeProperties{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmos-recipe": datamodel.EnvironmentRecipeProperties{ TemplateKind: recipes.TemplateKindBicep, TemplatePath: "br:sampleregistry.azureacr.io/radius/recipes/mongodatabases", @@ -136,13 +136,13 @@ func TestConvertVersionedToDataModel(t *testing.T) { TemplatePath: "http://example.com/myrecipe.zip", }, }, - linkrp.RedisCachesResourceType: { + portableresources.RedisCachesResourceType: { "redis-recipe": datamodel.EnvironmentRecipeProperties{ TemplateKind: recipes.TemplateKindBicep, TemplatePath: "br:sampleregistry.azureacr.io/radius/recipes/rediscaches", }, }, - linkrp.DaprStateStoresResourceType: { + portableresources.DaprStateStoresResourceType: { "statestore-recipe": datamodel.EnvironmentRecipeProperties{ TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/storage/azurerm", @@ -185,7 +185,7 @@ func TestConvertVersionedToDataModel(t *testing.T) { }, }, Recipes: map[string]map[string]datamodel.EnvironmentRecipeProperties{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmos-recipe": datamodel.EnvironmentRecipeProperties{ TemplateKind: recipes.TemplateKindBicep, TemplatePath: "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", @@ -227,7 +227,7 @@ func TestConvertVersionedToDataModel(t *testing.T) { }, }, Recipes: map[string]map[string]datamodel.EnvironmentRecipeProperties{ - linkrp.MongoDatabasesResourceType: { + portableresources.MongoDatabasesResourceType: { "cosmos-recipe": datamodel.EnvironmentRecipeProperties{ TemplateKind: recipes.TemplateKindBicep, TemplatePath: "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", @@ -249,7 +249,7 @@ func TestConvertVersionedToDataModel(t *testing.T) { }, { filename: "environmentresource-invalid-linktype.json", - err: &v1.ErrClientRP{Code: v1.CodeInvalid, Message: "invalid link type: \"Applications.Link/pubsub\""}, + err: &v1.ErrClientRP{Code: v1.CodeInvalid, Message: "invalid link type: \"Applications.Dapr/pubsub\""}, }, { filename: "environmentresource-invalid-templatekind.json", @@ -327,17 +327,17 @@ func TestConvertDataModelToVersioned(t *testing.T) { require.Equal(t, "kubernetes", string(*versioned.Properties.Compute.GetEnvironmentCompute().Kind)) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", string(*versioned.Properties.Compute.GetEnvironmentCompute().ResourceID)) require.Equal(t, 1, len(versioned.Properties.Recipes)) - require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplatePath)) - require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplateKind)) - require.Equal(t, map[string]any{"throughput": float64(400)}, versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().Parameters) + require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplatePath)) + require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplateKind)) + require.Equal(t, map[string]any{"throughput": float64(400)}, versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().Parameters) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", string(*versioned.Properties.Providers.Azure.Scope)) require.Equal(t, "/planes/aws/aws/accounts/140313373712/regions/us-west-2", string(*versioned.Properties.Providers.Aws.Scope)) require.Equal(t, "kubernetesMetadata", *versioned.Properties.Extensions[0].GetExtension().Kind) require.Equal(t, 1, len(versioned.Properties.Extensions)) - recipeDetails := versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"] + recipeDetails := versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["terraform-recipe"] if tt.filename == "environmentresourcedatamodel.json" { - require.Equal(t, "Azure/cosmosdb/azurerm", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"].GetRecipeProperties().TemplatePath)) - require.Equal(t, recipes.TemplateKindTerraform, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["terraform-recipe"].GetRecipeProperties().TemplateKind)) + require.Equal(t, "Azure/cosmosdb/azurerm", string(*versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["terraform-recipe"].GetRecipeProperties().TemplatePath)) + require.Equal(t, recipes.TemplateKindTerraform, string(*versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["terraform-recipe"].GetRecipeProperties().TemplateKind)) switch c := recipeDetails.(type) { case *TerraformRecipeProperties: @@ -396,8 +396,8 @@ func TestConvertDataModelWithIdentityToVersioned(t *testing.T) { require.Equal(t, "kubernetes", string(*versioned.Properties.Compute.GetEnvironmentCompute().Kind)) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ContainerService/managedClusters/radiusTestCluster", string(*versioned.Properties.Compute.GetEnvironmentCompute().ResourceID)) require.Equal(t, 1, len(versioned.Properties.Recipes)) - require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplatePath)) - require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[linkrp.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplateKind)) + require.Equal(t, "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", string(*versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplatePath)) + require.Equal(t, recipes.TemplateKindBicep, string(*versioned.Properties.Recipes[portableresources.MongoDatabasesResourceType]["cosmos-recipe"].GetRecipeProperties().TemplateKind)) require.Equal(t, "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", string(*versioned.Properties.Providers.Azure.Scope)) require.Equal(t, &IdentitySettings{ diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go index 41102417d2..d48330251c 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" types "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/test/testutil" @@ -89,7 +89,7 @@ func TestRecipeConvertVersionedToDataModel(t *testing.T) { t.Run("Convert to Data Model", func(t *testing.T) { filename := "reciperesource.json" expected := &datamodel.Recipe{ - LinkType: linkrp.MongoDatabasesResourceType, + LinkType: portableresources.MongoDatabasesResourceType, Name: "mongo-azure", } rawPayload := testutil.ReadFixture(filename) diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go index ee4fcdc4c2..890e53b733 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go @@ -21,8 +21,8 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_apiver "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + pr_apiver "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -91,24 +91,24 @@ func (dst *ExtenderResource) ConvertFrom(src v1.DataModelInterface) error { return nil } -func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (linkrp.ResourceProvisioning, error) { +func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (portableresources.ResourceProvisioning, error) { if provisioning == nil { - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil } switch *provisioning { case ResourceProvisioningManual: - return linkrp.ResourceProvisioningManual, nil + return portableresources.ResourceProvisioningManual, nil case ResourceProvisioningRecipe: - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil default: return "", &v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} } } -func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) *ResourceProvisioning { +func fromResourceProvisioningDataModel(provisioning portableresources.ResourceProvisioning) *ResourceProvisioning { var converted ResourceProvisioning switch provisioning { - case linkrp.ResourceProvisioningManual: + case portableresources.ResourceProvisioningManual: converted = ResourceProvisioningManual default: converted = ResourceProvisioningRecipe @@ -117,22 +117,22 @@ func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) return &converted } -func fromRecipeDataModel(r linkrp.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, } } -func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { - return linkrp.LinkRecipe{ - Name: linkrp_apiver.DefaultRecipeName, + return portableresources.LinkRecipe{ + Name: pr_apiver.DefaultRecipeName, } } - recipe := linkrp.LinkRecipe{} + recipe := portableresources.LinkRecipe{} if r.Name == nil { - recipe.Name = linkrp_apiver.DefaultRecipeName + recipe.Name = pr_apiver.DefaultRecipeName } else { recipe.Name = to.String(r.Name) } diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go index 886225435a..f7833e618f 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -60,9 +60,9 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Secrets: map[string]any{"accountSid": "sid", "authToken": "token"}, - ResourceRecipe: linkrp.LinkRecipe{Name: "default"}, + ResourceRecipe: portableresources.LinkRecipe{Name: "default"}, }, }, }, @@ -90,8 +90,8 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - ResourceRecipe: linkrp.LinkRecipe{Name: "default"}, + ResourceProvisioning: portableresources.ResourceProvisioningManual, + ResourceRecipe: portableresources.LinkRecipe{Name: "default"}, }, }, }, @@ -118,8 +118,8 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - ResourceRecipe: linkrp.LinkRecipe{Name: "test-recipe"}, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, + ResourceRecipe: portableresources.LinkRecipe{Name: "test-recipe"}, }, }, }, diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-linktype.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-linktype.json index e00cb9da1f..217e39f54f 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-linktype.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-linktype.json @@ -17,7 +17,7 @@ } }, "recipes": { - "Applications.Link/pubsub":{ + "Applications.Dapr/pubsub":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/pubsub" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-templatekind.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-templatekind.json index 6a4d4f9a52..d59b36a83a 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-templatekind.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-templatekind.json @@ -14,7 +14,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "helm", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/mongo" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-missing-templatekind.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-missing-templatekind.json index b4729202b2..6288126867 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-missing-templatekind.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-missing-templatekind.json @@ -14,7 +14,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/mongo" } diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-terraformrecipe-localpath.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-terraformrecipe-localpath.json index 095ec7bf86..145cf4a3c5 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-terraformrecipe-localpath.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-terraformrecipe-localpath.json @@ -14,7 +14,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "terraform", "templatePath": "../not-allowed/" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-with-workload-identity.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-with-workload-identity.json index 76dedf0711..45ddb6e7c3 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-with-workload-identity.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-with-workload-identity.json @@ -19,7 +19,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource.json index e0f691271d..f8673b1d36 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource.json @@ -17,7 +17,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/mongodatabases", @@ -35,13 +35,13 @@ "templatePath": "http://example.com/myrecipe.zip" } }, - "Applications.Link/redisCaches":{ + "Applications.Datastores/redisCaches":{ "redis-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/rediscaches" } }, - "Applications.Link/daprStateStores":{ + "Applications.Dapr/stateStores":{ "statestore-recipe": { "templateKind": "terraform", "templatePath": "Azure/storage/azurerm", diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel-with-workload-identity.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel-with-workload-identity.json index 94fa8c1d91..71dd115a5a 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel-with-workload-identity.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel-with-workload-identity.json @@ -32,7 +32,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel.json index c7ba9c3197..b361ca6d9e 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodel.json @@ -30,7 +30,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptyext.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptyext.json index 3cfeef0c81..e32d7dc027 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptyext.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptyext.json @@ -30,7 +30,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptytemplatekind.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptytemplatekind.json index 4e50f8ac6e..bfab0d1d29 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptytemplatekind.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourcedatamodelemptytemplatekind.json @@ -27,7 +27,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" } diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext.json index d26670c5d5..4a0a4dbdda 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext.json @@ -14,7 +14,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext2.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext2.json index 4bdc949084..d9f13ccdf8 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext2.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresourceemptyext2.json @@ -14,7 +14,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json b/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json index c55f66c896..31eff8b802 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json @@ -1,4 +1,4 @@ { - "linkType":"Applications.Link/mongoDatabases", + "linkType":"Applications.Datastores/mongoDatabases", "name":"mongo-azure" } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/util.go b/pkg/corerp/api/v20220315privatepreview/util.go index 2daa31303b..72fa11d87a 100644 --- a/pkg/corerp/api/v20220315privatepreview/util.go +++ b/pkg/corerp/api/v20220315privatepreview/util.go @@ -20,7 +20,6 @@ import ( "time" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -122,29 +121,6 @@ func stringSlice(s []*string) []string { return r } -func isValidLinkType(link string) bool { - linkTypes := []string{ - linkrp.DaprPubSubBrokersResourceType, - linkrp.DaprSecretStoresResourceType, - linkrp.DaprStateStoresResourceType, - linkrp.ExtendersResourceType, - linkrp.MongoDatabasesResourceType, - linkrp.RabbitMQMessageQueuesResourceType, - linkrp.RedisCachesResourceType, - linkrp.SqlDatabasesResourceType, - // Resources After Split of LinkRP Namespace - linkrp.N_RabbitMQQueuesResourceType, - linkrp.N_DaprPubSubBrokersResourceType, - linkrp.N_DaprSecretStoresResourceType, - linkrp.N_DaprStateStoresResourceType, - linkrp.N_MongoDatabasesResourceType, - linkrp.N_RedisCachesResourceType, - linkrp.N_SqlDatabasesResourceType, - linkrp.N_ExtendersResourceType, - } - return slices.Contains(linkTypes, link) -} - func isValidTemplateKind(templateKind string) bool { return slices.Contains(recipes.SupportedTemplateKind, templateKind) } diff --git a/pkg/corerp/api/v20220315privatepreview/util_test.go b/pkg/corerp/api/v20220315privatepreview/util_test.go index 1a487956b9..159befe14e 100644 --- a/pkg/corerp/api/v20220315privatepreview/util_test.go +++ b/pkg/corerp/api/v20220315privatepreview/util_test.go @@ -124,13 +124,3 @@ func TestFromSystemDataModel(t *testing.T) { require.Equal(t, tt.LastModifiedAt, string(c)) } } - -func TestValidLinkType(t *testing.T) { - isValid := isValidLinkType("Applications.Link/mongoDatabases") - require.Equal(t, true, isValid) -} - -func TestInvalidLinkType(t *testing.T) { - isValid := isValidLinkType("Applications.Link/pubSubBroker") - require.Equal(t, false, isValid) -} diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go index d0fadd17a1..35d2424f58 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_extenders_client.go @@ -48,7 +48,7 @@ func NewExtendersClient(rootScope string, credential azcore.TokenCredential, opt // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the ExtenderResource link resource +// - extenderName - The name of the ExtenderResource portable resource // - resource - Resource create parameters. // - options - ExtendersClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.BeginCreateOrUpdate // method. @@ -114,7 +114,7 @@ func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the ExtenderResource link resource +// - extenderName - The name of the ExtenderResource portable resource // - options - ExtendersClientBeginDeleteOptions contains the optional parameters for the ExtendersClient.BeginDelete method. func (client *ExtendersClient) BeginDelete(ctx context.Context, extenderName string, options *ExtendersClientBeginDeleteOptions) (*runtime.Poller[ExtendersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { @@ -175,7 +175,7 @@ func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extender // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the ExtenderResource link resource +// - extenderName - The name of the ExtenderResource portable resource // - options - ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. func (client *ExtendersClient) Get(ctx context.Context, extenderName string, options *ExtendersClientGetOptions) (ExtendersClientGetResponse, error) { var err error @@ -284,7 +284,7 @@ func (client *ExtendersClient) listByScopeHandleResponse(resp *http.Response) (E // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the ExtenderResource link resource +// - extenderName - The name of the ExtenderResource portable resource // - body - The content of the action request // - options - ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName string, body map[string]any, options *ExtendersClientListSecretsOptions) (ExtendersClientListSecretsResponse, error) { @@ -340,7 +340,7 @@ func (client *ExtendersClient) listSecretsHandleResponse(resp *http.Response) (E // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the ExtenderResource link resource +// - extenderName - The name of the ExtenderResource portable resource // - properties - The resource properties to be updated. // - options - ExtendersClientBeginUpdateOptions contains the optional parameters for the ExtendersClient.BeginUpdate method. func (client *ExtendersClient) BeginUpdate(ctx context.Context, extenderName string, properties ExtenderResourceUpdate, options *ExtendersClientBeginUpdateOptions) (*runtime.Poller[ExtendersClientUpdateResponse], error) { diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index a906f1275c..2984e63c92 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -625,7 +625,7 @@ func (e *ExecHealthProbeProperties) GetHealthProbeProperties() *HealthProbePrope } } -// ExtenderProperties - ExtenderResource link properties +// ExtenderProperties - ExtenderResource portable resource properties type ExtenderProperties struct { // REQUIRED; Fully qualified resource ID for the environment that the portable resource is linked to Environment *string @@ -636,7 +636,7 @@ type ExtenderProperties struct { // Fully qualified resource ID for the application that the portable resource is consumed by (if applicable) Application *string - // The recipe used to automatically deploy underlying infrastructure for the extender link + // The recipe used to automatically deploy underlying infrastructure for the extender portable resource Recipe *Recipe // Specifies how the underlying service/resource is provisioned and managed. @@ -652,7 +652,7 @@ type ExtenderProperties struct { Status *ResourceStatus } -// ExtenderResource link +// ExtenderResource portable resource type ExtenderResource struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -702,7 +702,7 @@ type ExtenderResourceUpdateProperties struct { // Fully qualified resource ID for the environment that the portable resource is linked to Environment *string - // The recipe used to automatically deploy underlying infrastructure for the extender link + // The recipe used to automatically deploy underlying infrastructure for the extender portable resource Recipe *RecipeUpdate // Specifies how the underlying service/resource is provisioned and managed. @@ -1292,7 +1292,7 @@ type Recipe struct { // RecipeGetMetadata - Represents the request body of the getmetadata action. type RecipeGetMetadata struct { - // REQUIRED; Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases' + // REQUIRED; Type of the link this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases' LinkType *string // REQUIRED; The name of the recipe registered to the environment diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go index 83534c474f..ed14cb1dc7 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_response_types.go @@ -102,7 +102,7 @@ type EnvironmentsClientUpdateResponse struct { // ExtendersClientCreateOrUpdateResponse contains the response from method ExtendersClient.BeginCreateOrUpdate. type ExtendersClientCreateOrUpdateResponse struct { - // ExtenderResource link + // ExtenderResource portable resource ExtenderResource } @@ -113,7 +113,7 @@ type ExtendersClientDeleteResponse struct { // ExtendersClientGetResponse contains the response from method ExtendersClient.Get. type ExtendersClientGetResponse struct { - // ExtenderResource link + // ExtenderResource portable resource ExtenderResource } @@ -131,7 +131,7 @@ type ExtendersClientListSecretsResponse struct { // ExtendersClientUpdateResponse contains the response from method ExtendersClient.BeginUpdate. type ExtendersClientUpdateResponse struct { - // ExtenderResource link + // ExtenderResource portable resource ExtenderResource } diff --git a/pkg/corerp/backend/controller/createorupdateresource_test.go b/pkg/corerp/backend/controller/createorupdateresource_test.go index 7096da50b6..feaf381322 100644 --- a/pkg/corerp/backend/controller/createorupdateresource_test.go +++ b/pkg/corerp/backend/controller/createorupdateresource_test.go @@ -33,7 +33,7 @@ import ( "github.com/project-radius/radius/pkg/corerp/renderers/container" "github.com/project-radius/radius/pkg/corerp/renderers/gateway" "github.com/project-radius/radius/pkg/corerp/renderers/httproute" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" "github.com/project-radius/radius/pkg/ucp/store" @@ -150,9 +150,9 @@ func TestCreateOrUpdateResourceRun_20220315PrivatePreview(t *testing.T) { }, { "unsupported-type-put", - linkrp.RedisCachesResourceType, - "APPLICATIONS.LINK/REDISCACHES|PUT", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/rc0", + portableresources.RedisCachesResourceType, + "APPLICATIONS.DATASTORES/REDISCACHES|PUT", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/rc0", nil, true, nil, @@ -347,9 +347,9 @@ func TestCreateOrUpdateResourceRun_20220315PrivatePreview(t *testing.T) { }, { "unsupported-type-patch", - linkrp.RedisCachesResourceType, - "APPLICATIONS.LINK/REDISCACHES|PATCH", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/rc0", + portableresources.RedisCachesResourceType, + "APPLICATIONS.DATASTORES/REDISCACHES|PATCH", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/redisCaches/rc0", nil, true, nil, diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index 0d5e0188f5..294ae3d71a 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -35,12 +35,10 @@ import ( dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" datastores_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - link_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/ucp/dataprovider" "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" "github.com/project-radius/radius/pkg/ucp/store" "github.com/project-radius/radius/pkg/ucp/ucplog" @@ -80,8 +78,8 @@ type ResourceData struct { OutputResources []rpv1.OutputResource ComputedValues map[string]any SecretValues map[string]rpv1.SecretValueReference - AppID *resources.ID // Application ID for which the resource is created - RecipeData linkrp.RecipeData // Relevant only for links created with recipes to find relevant connections created by that recipe + AppID *resources.ID // Application ID for which the resource is created + RecipeData portableresources.RecipeData // Relevant only for portable resources created with recipes to find relevant connections created by that recipe } // Render fetches the resource renderer, the application, environment and application options, and the dependencies of the @@ -466,133 +464,85 @@ func (dp *deploymentProcessor) getResourceDataByID(ctx context.Context, resource if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) case strings.ToLower(corerp_dm.GatewayResourceType): obj := &corerp_dm.Gateway{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) case strings.ToLower(corerp_dm.VolumeResourceType): obj := &corerp_dm.VolumeResource{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) case strings.ToLower(corerp_dm.HTTPRouteResourceType): obj := &corerp_dm.HTTPRoute{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) case strings.ToLower(corerp_dm.SecretStoreResourceType): obj := &corerp_dm.SecretStore{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) - case strings.ToLower(linkrp.MongoDatabasesResourceType): - obj := &link_dm.MongoDatabase{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.SqlDatabasesResourceType): - obj := &link_dm.SqlDatabase{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.RedisCachesResourceType): - obj := &link_dm.RedisCache{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.RabbitMQMessageQueuesResourceType): - obj := &link_dm.RabbitMQMessageQueue{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.ExtendersResourceType): - obj := &link_dm.Extender{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) - case strings.ToLower(linkrp.DaprStateStoresResourceType): - obj := &link_dm.DaprStateStore{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.DaprSecretStoresResourceType): - obj := &link_dm.DaprSecretStore{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.DaprPubSubBrokersResourceType): - obj := &link_dm.DaprPubSubBroker{} - if err = resource.As(obj); err != nil { - return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) - } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.N_MongoDatabasesResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.MongoDatabasesResourceType): obj := &datastores_dm.MongoDatabase{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.N_SqlDatabasesResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.SqlDatabasesResourceType): obj := &datastores_dm.SqlDatabase{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.N_RedisCachesResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.RedisCachesResourceType): obj := &datastores_dm.RedisCache{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.N_RabbitMQQueuesResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.RabbitMQQueuesResourceType): obj := &msg_dm.RabbitMQQueue{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) case strings.ToLower(corerp_dm.ExtenderResourceType): obj := &corerp_dm.Extender{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, linkrp.RecipeData{}) - case strings.ToLower(linkrp.N_DaprStateStoresResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.DaprStateStoresResourceType): obj := &dapr_dm.DaprStateStore{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.N_DaprSecretStoresResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.DaprSecretStoresResourceType): obj := &dapr_dm.DaprSecretStore{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) - case strings.ToLower(linkrp.N_DaprPubSubBrokersResourceType): + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) + case strings.ToLower(portableresources.DaprPubSubBrokersResourceType): obj := &dapr_dm.DaprPubSubBroker{} if err = resource.As(obj); err != nil { return ResourceData{}, fmt.Errorf(errMsg, resourceID.String(), err) } - return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, obj.RecipeData) + return dp.buildResourceDependency(resourceID, obj.Properties.Application, obj, obj.Properties.Status.OutputResources, obj.ComputedValues, obj.SecretValues, portableresources.RecipeData{}) default: return ResourceData{}, fmt.Errorf("unsupported resource type: %q for resource ID: %q", resourceType, resourceID.String()) } } -func (dp *deploymentProcessor) buildResourceDependency(resourceID resources.ID, applicationID string, resource v1.DataModelInterface, outputResources []rpv1.OutputResource, computedValues map[string]any, secretValues map[string]rpv1.SecretValueReference, recipeData linkrp.RecipeData) (ResourceData, error) { +func (dp *deploymentProcessor) buildResourceDependency(resourceID resources.ID, applicationID string, resource v1.DataModelInterface, outputResources []rpv1.OutputResource, computedValues map[string]any, secretValues map[string]rpv1.SecretValueReference, recipeData portableresources.RecipeData) (ResourceData, error) { var appID *resources.ID if applicationID != "" { parsedID, err := resources.ParseResource(applicationID) @@ -600,8 +550,8 @@ func (dp *deploymentProcessor) buildResourceDependency(resourceID resources.ID, return ResourceData{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("application ID %q for the resource %q is not a valid id. Error: %s", applicationID, resourceID.String(), err.Error())) } appID = &parsedID - } else if strings.EqualFold(resourceID.ProviderNamespace(), resources_radius.NamespaceApplicationsLink) { - // Application id is optional for link resource types + } else if portableresources.IsValidPortableResourceType(resourceID.TypeSegments()[0].Type) { + // Application id is optional for portable resource types appID = nil } else { return ResourceData{}, fmt.Errorf("missing required application id for the resource %q", resourceID.String()) diff --git a/pkg/corerp/backend/deployment/deploymentprocessor_test.go b/pkg/corerp/backend/deployment/deploymentprocessor_test.go index 95516ca087..e9deb9107d 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor_test.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor_test.go @@ -30,9 +30,10 @@ import ( "github.com/project-radius/radius/pkg/corerp/model" "github.com/project-radius/radius/pkg/corerp/renderers" "github.com/project-radius/radius/pkg/corerp/renderers/container" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" - linkrp_renderers "github.com/project-radius/radius/pkg/linkrp/renderers" + dsrp_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" + pr_renderers "github.com/project-radius/radius/pkg/portableresources/renderers" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -161,23 +162,23 @@ func getTestResourceID(id string) resources.ID { return resourceID } -func buildMongoDBLinkWithRecipe() linkrp_dm.MongoDatabase { - return linkrp_dm.MongoDatabase{ +func buildMongoDBWithRecipe() dsrp_dm.MongoDatabase { + return dsrp_dm.MongoDatabase{ BaseResource: v1.BaseResource{ TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Link/mongoDatabases/test-mongo", + ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo", }, }, - Properties: linkrp_dm.MongoDatabaseProperties{ + Properties: dsrp_dm.MongoDatabaseProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ Application: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", Environment: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/environments/env0", }, }, - LinkMetadata: linkrp_dm.LinkMetadata{ - RecipeData: linkrp.RecipeData{ - RecipeProperties: linkrp.RecipeProperties{ - LinkRecipe: linkrp.LinkRecipe{ + LinkMetadata: pr_dm.LinkMetadata{ + RecipeData: portableresources.RecipeData{ + RecipeProperties: portableresources.RecipeProperties{ + LinkRecipe: portableresources.LinkRecipe{ Name: "mongoDB", Parameters: map[string]any{ "ResourceGroup": "testRG", @@ -195,15 +196,15 @@ func buildMongoDBLinkWithRecipe() linkrp_dm.MongoDatabase { } func buildMongoDBResourceDataWithRecipeAndSecrets() ResourceData { - testResource := buildMongoDBLinkWithRecipe() + testResource := buildMongoDBWithRecipe() secretValues := map[string]rpv1.SecretValueReference{} - secretValues[linkrp_renderers.ConnectionStringValue] = rpv1.SecretValueReference{ + secretValues[pr_renderers.ConnectionStringValue] = rpv1.SecretValueReference{ Value: "test-connection-string", } computedValues := map[string]any{ - linkrp_renderers.DatabaseNameValue: "db", + pr_renderers.DatabaseNameValue: "db", } testResource.ComputedValues = computedValues @@ -274,7 +275,7 @@ func Test_Render(t *testing.T) { resourceID := getTestResourceID(testResource.ID) depId1, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/httpRoutes/A") - depId2, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Link/mongoDatabases/test-mongo") + depId2, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo") requiredResources := []resources.ID{depId1, depId2} mocks.renderer.EXPECT().Render(gomock.Any(), gomock.Any(), gomock.Any()).Times(1).Return(testRendererOutput, nil) @@ -335,13 +336,13 @@ func Test_Render(t *testing.T) { mocks.db.EXPECT().Get(gomock.Any(), gomock.Any()).Times(1).Return(&nr, nil) - mongoResource := linkrp_dm.MongoDatabase{ + mongoResource := dsrp_dm.MongoDatabase{ BaseResource: v1.BaseResource{ TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Link/mongoDatabases/test-mongo", + ID: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo", }, }, - Properties: linkrp_dm.MongoDatabaseProperties{ + Properties: dsrp_dm.MongoDatabaseProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ Environment: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/environments/env0", }, @@ -1040,8 +1041,9 @@ func Test_getResourceDataByID(t *testing.T) { t.Run("Get recipe data from connected mongoDB resources", func(t *testing.T) { mocks.dbProvider.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Times(1).Return(mocks.db, nil) - depId, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Link/mongoDatabases/test-mongo") - mongoResource := buildMongoDBLinkWithRecipe() + depId, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo") + mongoResource := buildMongoDBWithRecipe() + mongoResource.LinkMetadata.RecipeData = portableresources.RecipeData{} mr := store.Object{ Metadata: store.Metadata{ ID: mongoResource.ID, @@ -1067,10 +1069,10 @@ func Test_fetchSecrets(t *testing.T) { mongoResource := buildMongoDBResourceDataWithRecipeAndSecrets() secret := "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255/db?ssl=true" - mongoResource.SecretValues[linkrp_renderers.ConnectionStringValue] = rpv1.SecretValueReference{Value: secret} + mongoResource.SecretValues[pr_renderers.ConnectionStringValue] = rpv1.SecretValueReference{Value: secret} secretValues, err := dp.FetchSecrets(ctx, mongoResource) require.NoError(t, err) require.Equal(t, 1, len(secretValues)) - require.Equal(t, secret, secretValues[linkrp_renderers.ConnectionStringValue]) + require.Equal(t, secret, secretValues[pr_renderers.ConnectionStringValue]) }) } diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go index 4c03a83f5f..827e08742a 100644 --- a/pkg/corerp/backend/service.go +++ b/pkg/corerp/backend/service.go @@ -30,9 +30,9 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/model" "github.com/project-radius/radius/pkg/corerp/processors/extenders" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_backend_ctrl "github.com/project-radius/radius/pkg/linkrp/backend/controller" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources" + pr_backend_ctrl "github.com/project-radius/radius/pkg/portableresources/backend/controller" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" "github.com/project-radius/radius/pkg/recipes/driver" @@ -140,20 +140,20 @@ func (w *Service) Run(ctx context.Context) error { opts.GetDeploymentProcessor = nil extenderCreateOrUpdateController := func(options ctrl.Options) (ctrl.Controller, error) { processor := &extenders.Processor{} - return linkrp_backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](processor, engine, client, configLoader, options) + return pr_backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](processor, engine, client, configLoader, options) } // Register controllers to run backend processing for extenders. - err = w.Controllers.Register(ctx, linkrp.N_ExtendersResourceType, v1.OperationPut, extenderCreateOrUpdateController, opts) + err = w.Controllers.Register(ctx, portableresources.ExtendersResourceType, v1.OperationPut, extenderCreateOrUpdateController, opts) if err != nil { return err } err = w.Controllers.Register( ctx, - linkrp.N_ExtendersResourceType, + portableresources.ExtendersResourceType, v1.OperationDelete, func(options ctrl.Options) (ctrl.Controller, error) { - return linkrp_backend_ctrl.NewDeleteResource(options, engine) + return pr_backend_ctrl.NewDeleteResource(options, engine) }, opts) if err != nil { diff --git a/pkg/corerp/datamodel/environment.go b/pkg/corerp/datamodel/environment.go index f05962f774..62423dae4c 100644 --- a/pkg/corerp/datamodel/environment.go +++ b/pkg/corerp/datamodel/environment.go @@ -54,7 +54,7 @@ type EnvironmentRecipeProperties struct { // Recipe represents input properties for recipe getMetadata api. type Recipe struct { - // Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases' + // Type of the portable resource this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases' LinkType string `json:"linkType,omitempty"` // Name of the recipe registered to the environment. diff --git a/pkg/corerp/datamodel/extender.go b/pkg/corerp/datamodel/extender.go index bd443df4bf..ab25f6ee76 100644 --- a/pkg/corerp/datamodel/extender.go +++ b/pkg/corerp/datamodel/extender.go @@ -18,21 +18,21 @@ package datamodel import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) -// ExtenderResourceType is the resource type for Extender link resources. +// ExtenderResourceType is the resource type for Extender portable resources. const ExtenderResourceType = "Applications.Core/extenders" -// Extender represents Extender link resource. +// Extender represents Extender portable resource. type Extender struct { v1.BaseResource // Properties is the properties of the resource. Properties ExtenderProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all link types. + // LinkMetadata represents internal DataModel properties common to all portable resource types. LinkMetadata } @@ -59,8 +59,8 @@ func (extender *Extender) ResourceTypeName() string { // Recipe returns the LinkRecipe associated with the Extender if the ResourceProvisioning is not set to Manual, // otherwise it returns nil. -func (extender *Extender) Recipe() *linkrp.LinkRecipe { - if extender.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (extender *Extender) Recipe() *portableresources.LinkRecipe { + if extender.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &extender.Properties.ResourceRecipe @@ -74,7 +74,7 @@ type ExtenderProperties struct { // Secrets values provided for the resource Secrets map[string]any `json:"secrets,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Extender - ResourceRecipe linkrp.LinkRecipe `json:"recipe,omitempty"` + ResourceRecipe portableresources.LinkRecipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` } diff --git a/pkg/corerp/datamodel/linkmetadata.go b/pkg/corerp/datamodel/linkmetadata.go index 0c032eb281..065242e366 100644 --- a/pkg/corerp/datamodel/linkmetadata.go +++ b/pkg/corerp/datamodel/linkmetadata.go @@ -20,7 +20,7 @@ import ( rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) -// LinkMetadata represents internal DataModel properties common to all link types. +// LinkMetadata represents internal DataModel properties common to all portable resource types. type LinkMetadata struct { // TODO: stop using this type in CoreRP models. diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go index 11412b93ff..44a78d3487 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go @@ -27,7 +27,7 @@ import ( "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/datamodel/converter" - linkrp "github.com/project-radius/radius/pkg/linkrp/datamodel" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" "github.com/project-radius/radius/pkg/rp/util" "golang.org/x/exp/maps" ) @@ -142,8 +142,8 @@ func parseAndFormatRecipeParams(recipeData map[string]any, recipeParameters map[ } for paramName, paramValue := range recipeParam { - if paramName == linkrp.RecipeContextParameter { - // context parameter is only revelant to operator and is generated and passed by linkrp instead of the developer/operators. + if paramName == pr_dm.RecipeContextParameter { + // context parameter is only revelant to operator and is generated and passed by resource provider instead of the developer/operators. continue } diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go index 7a2e16a7fb..cdb0d2de7b 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go @@ -145,7 +145,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { err = json.Unmarshal(payload, &armerr) require.NoError(t, err) require.Equal(t, v1.CodeNotFound, armerr.Error.Code) - require.Contains(t, armerr.Error.Message, "Either recipe with name \"mongodb\" or resource type \"Applications.Link/mongoDatabases\" not found on environment with id") + require.Contains(t, armerr.Error.Message, "Either recipe with name \"mongodb\" or resource type \"Applications.Datastores/mongoDatabases\" not found on environment with id") }) } diff --git a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json index 01b02372ea..06af66d527 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_datamodel.json @@ -21,7 +21,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "mongo-azure": { "templateKind": "bicep", "templatePath": "radiusdev.azurecr.io/recipes/mongodatabases/azure:1.0", diff --git a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json index ce5e238e83..eee49c2497 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_input.json @@ -7,7 +7,7 @@ "namespace": "default" }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "mongo-azure": { "templateKind": "bicep", "templatePath": "radiusdev.azurecr.io/recipes/mongodatabases/azure:1.0", diff --git a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json index 7fda8a0eea..39139c8cfb 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environment20220315privatepreview_output.json @@ -14,7 +14,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "mongo-azure": { "templateKind": "bicep", "templatePath": "radiusdev.azurecr.io/recipes/mongodatabases/azure:1.0", diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json index b7c1b73f45..5eb30a4ebe 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json @@ -1,4 +1,4 @@ { "name":"mongodb", - "linkType":"Applications.Link/mongoDatabases" + "linkType":"Applications.Datastores/mongoDatabases" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json index 582b6604b6..e34bf9d96a 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json @@ -21,7 +21,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "mongo-parameters": { "templateKind": "bicep", "templatePath": "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0" @@ -32,7 +32,7 @@ "templateVersion": "1.1.0" } }, - "Applications.Link/redisCache":{ + "Applications.Datastores/redisCaches":{ "redis": { "templateKind": "bicep", "templatePath": "radiusdev.azurecr.io/redis:1.0" diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json index 911329ca7b..ab09f45543 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json @@ -1,4 +1,4 @@ { "name":"mongo-parameters", - "linkType":"Applications.Link/mongoDatabases" + "linkType":"Applications.Datastores/mongoDatabases" } \ No newline at end of file diff --git a/pkg/corerp/frontend/handler/getoperations.go b/pkg/corerp/frontend/handler/getoperations.go index b742bb67eb..35d1add06e 100644 --- a/pkg/corerp/frontend/handler/getoperations.go +++ b/pkg/corerp/frontend/handler/getoperations.go @@ -270,7 +270,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: ProviderNamespaceName, Resource: "extenders", Operation: "Create/Update extenders", - Description: "Creates or updates a extender link.", + Description: "Creates or updates a extender resource.", }, IsDataAction: false, }, @@ -280,7 +280,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: ProviderNamespaceName, Resource: "extenders", Operation: "Delete extender", - Description: "Deletes a extender link.", + Description: "Deletes a extender resource.", }, IsDataAction: false, }, diff --git a/pkg/corerp/frontend/service.go b/pkg/corerp/frontend/service.go index 0dea840574..253b1e080d 100644 --- a/pkg/corerp/frontend/service.go +++ b/pkg/corerp/frontend/service.go @@ -41,7 +41,7 @@ func NewService(options hostoptions.HostOptions) *Service { } } -// Name returns the namespace name of the provider. +// Name returns the namespace of the resource provider. func (s *Service) Name() string { return handler.ProviderNamespaceName } diff --git a/pkg/corerp/processors/extenders/processor.go b/pkg/corerp/processors/extenders/processor.go index 73a90fa626..5b66c712a9 100644 --- a/pkg/corerp/processors/extenders/processor.go +++ b/pkg/corerp/processors/extenders/processor.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" ) diff --git a/pkg/corerp/processors/extenders/processor_test.go b/pkg/corerp/processors/extenders/processor_test.go index 2ea4b280eb..8f77eba079 100644 --- a/pkg/corerp/processors/extenders/processor_test.go +++ b/pkg/corerp/processors/extenders/processor_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/stretchr/testify/require" diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go index 251a4aef3e..00d6eeb5c6 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go @@ -20,8 +20,8 @@ import ( "fmt" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -73,24 +73,24 @@ func fromProvisioningStateDataModel(state v1.ProvisioningState) *ProvisioningSta return &converted } -func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (linkrp.ResourceProvisioning, error) { +func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (portableresources.ResourceProvisioning, error) { if provisioning == nil { - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil } switch *provisioning { case ResourceProvisioningManual: - return linkrp.ResourceProvisioningManual, nil + return portableresources.ResourceProvisioningManual, nil case ResourceProvisioningRecipe: - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil default: return "", &v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} } } -func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) *ResourceProvisioning { +func fromResourceProvisioningDataModel(provisioning portableresources.ResourceProvisioning) *ResourceProvisioning { var converted ResourceProvisioning switch provisioning { - case linkrp.ResourceProvisioningManual: + case portableresources.ResourceProvisioningManual: converted = ResourceProvisioningManual default: converted = ResourceProvisioningRecipe @@ -110,13 +110,13 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { } } -func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { - return linkrp.LinkRecipe{ + return portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, } } - recipe := linkrp.LinkRecipe{} + recipe := portableresources.LinkRecipe{} if r.Name == nil { recipe.Name = v20220315privatepreview.DefaultRecipeName } else { @@ -128,27 +128,27 @@ func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { return recipe } -func fromRecipeDataModel(r linkrp.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, } } -func toResourcesDataModel(r []*ResourceReference) []*linkrp.ResourceReference { +func toResourcesDataModel(r []*ResourceReference) []*portableresources.ResourceReference { if r == nil { return nil } - resources := make([]*linkrp.ResourceReference, len(r)) + resources := make([]*portableresources.ResourceReference, len(r)) for i, resource := range r { - resources[i] = &linkrp.ResourceReference{ + resources[i] = &portableresources.ResourceReference{ ID: to.String(resource.ID), } } return resources } -func fromResourcesDataModel(r []*linkrp.ResourceReference) []*ResourceReference { +func fromResourcesDataModel(r []*portableresources.ResourceReference) []*ResourceReference { if r == nil { return nil } diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go index 93ee50b243..ac7ed861a5 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go @@ -21,8 +21,8 @@ import ( "testing" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -117,15 +117,15 @@ func TestFromSystemDataModel(t *testing.T) { func TestToResourcesDataModel(t *testing.T) { testset := []struct { - DMResources []*linkrp.ResourceReference + DMResources []*portableresources.ResourceReference VersionedResources []*ResourceReference }{ { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, + DMResources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, }, { - DMResources: []*linkrp.ResourceReference{}, + DMResources: []*portableresources.ResourceReference{}, VersionedResources: []*ResourceReference{}, }, } @@ -139,15 +139,15 @@ func TestToResourcesDataModel(t *testing.T) { func TestFromResourcesDataModel(t *testing.T) { testset := []struct { - DMResources []*linkrp.ResourceReference + DMResources []*portableresources.ResourceReference VersionedResources []*ResourceReference }{ { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, + DMResources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, }, { - DMResources: []*linkrp.ResourceReference{}, + DMResources: []*portableresources.ResourceReference{}, VersionedResources: []*ResourceReference{}, }, } @@ -162,17 +162,17 @@ func TestFromResourcesDataModel(t *testing.T) { func TestToResourceProvisiongDataModel(t *testing.T) { testset := []struct { versioned ResourceProvisioning - datamodel linkrp.ResourceProvisioning + datamodel portableresources.ResourceProvisioning err error }{ { ResourceProvisioningManual, - linkrp.ResourceProvisioningManual, + portableresources.ResourceProvisioningManual, nil, }, { ResourceProvisioningRecipe, - linkrp.ResourceProvisioningRecipe, + portableresources.ResourceProvisioningRecipe, nil, }, { @@ -199,11 +199,11 @@ func TestToResourceProvisiongDataModel(t *testing.T) { func TestFromResourceProvisiongDataModel(t *testing.T) { testCases := []struct { - datamodel linkrp.ResourceProvisioning + datamodel portableresources.ResourceProvisioning versioned ResourceProvisioning }{ - {linkrp.ResourceProvisioningManual, ResourceProvisioningManual}, - {linkrp.ResourceProvisioningRecipe, ResourceProvisioningRecipe}, + {portableresources.ResourceProvisioningManual, ResourceProvisioningManual}, + {portableresources.ResourceProvisioningRecipe, ResourceProvisioningRecipe}, {"", ResourceProvisioningRecipe}, } @@ -216,11 +216,11 @@ func TestFromResourceProvisiongDataModel(t *testing.T) { func TestToRecipeDataModel(t *testing.T) { testset := []struct { versioned *Recipe - datamodel linkrp.LinkRecipe + datamodel portableresources.LinkRecipe }{ { nil, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, }, }, @@ -231,7 +231,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: "test", Parameters: map[string]any{ "foo": "bar", @@ -244,7 +244,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go index 97350f6f1f..23de68750e 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go @@ -23,7 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -66,7 +66,7 @@ func (src *DaprPubSubBrokerResource) ConvertTo() (v1.DataModelInterface, error) // the recipe is expected to create the Dapr Component manifest. However, they are required // when resourceProvisioning is set to manual. msgs := []string{} - if converted.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if src.Properties.Recipe != nil && (!reflect.ValueOf(*src.Properties.Recipe).IsZero()) { msgs = append(msgs, "recipe details cannot be specified when resourceProvisioning is set to manual") } @@ -133,7 +133,7 @@ func (dst *DaprPubSubBrokerResource) ConvertFrom(src v1.DataModelInterface) erro }, } - if daprPubSub.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if daprPubSub.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { dst.Properties.Metadata = daprPubSub.Properties.Metadata dst.Properties.Type = to.Ptr(daprPubSub.Properties.Type) dst.Properties.Version = to.Ptr(daprPubSub.Properties.Version) diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go index 73c4baced5..9e6842e2a9 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -44,7 +44,7 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", Name: "test-dpsb", - Type: linkrp.N_DaprPubSubBrokersResourceType, + Type: portableresources.DaprPubSubBrokersResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -62,11 +62,11 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{ "foo": "bar", }, - Resources: []*linkrp.ResourceReference{ + Resources: []*portableresources.ResourceReference{ { ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async", }, @@ -84,7 +84,7 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb", Name: "test-dpsb", - Type: linkrp.N_DaprPubSubBrokersResourceType, + Type: portableresources.DaprPubSubBrokersResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -102,8 +102,8 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{ + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, + Recipe: portableresources.LinkRecipe{ Name: "dpsb-recipe", }, }, @@ -199,7 +199,7 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb"), Name: to.Ptr("test-dpsb"), - Type: to.Ptr(linkrp.N_DaprPubSubBrokersResourceType), + Type: to.Ptr(portableresources.DaprPubSubBrokersResourceType), }, }, { @@ -223,7 +223,7 @@ func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/pubSubBrokers/test-dpsb"), Name: to.Ptr("test-dpsb"), - Type: to.Ptr(linkrp.N_DaprPubSubBrokersResourceType), + Type: to.Ptr(portableresources.DaprPubSubBrokersResourceType), }, }, } diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go index 5582acce52..d2b1e7df58 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go @@ -23,7 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -59,7 +59,7 @@ func (src *DaprSecretStoreResource) ConvertTo() (v1.DataModelInterface, error) { } msgs := []string{} - if converted.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if src.Properties.Recipe != nil && (!reflect.ValueOf(*src.Properties.Recipe).IsZero()) { msgs = append(msgs, "recipe details cannot be specified when resourceProvisioning is set to manual") } @@ -126,7 +126,7 @@ func (dst *DaprSecretStoreResource) ConvertFrom(src v1.DataModelInterface) error OutputResources: toOutputResources(daprSecretStore.Properties.Status.OutputResources), }, } - if daprSecretStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if daprSecretStore.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { dst.Properties.Metadata = daprSecretStore.Properties.Metadata dst.Properties.Type = to.Ptr(daprSecretStore.Properties.Type) dst.Properties.Version = to.Ptr(daprSecretStore.Properties.Version) diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go index 80b258ee10..1ae07ed03a 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -44,7 +44,7 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", Name: "test-dss", - Type: linkrp.N_DaprSecretStoresResourceType, + Type: portableresources.DaprSecretStoresResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -62,7 +62,7 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{ "foo": "bar", }, @@ -79,7 +79,7 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss", Name: "test-dss", - Type: linkrp.N_DaprSecretStoresResourceType, + Type: portableresources.DaprSecretStoresResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -97,8 +97,8 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{ + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, + Recipe: portableresources.LinkRecipe{ Name: "daprSecretStore", Parameters: map[string]any{ "foo": "bar", @@ -157,7 +157,7 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss"), Name: to.Ptr("test-dss"), - Type: to.Ptr(linkrp.N_DaprSecretStoresResourceType), + Type: to.Ptr(portableresources.DaprSecretStoresResourceType), }, }, { @@ -187,7 +187,7 @@ func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/secretStores/test-dss"), Name: to.Ptr("test-dss"), - Type: to.Ptr(linkrp.N_DaprSecretStoresResourceType), + Type: to.Ptr(portableresources.DaprSecretStoresResourceType), }, }, } diff --git a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go index 6cc73b37db..064190e1b8 100644 --- a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go @@ -7,7 +7,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -50,7 +50,7 @@ func (src *DaprStateStoreResource) ConvertTo() (v1.DataModelInterface, error) { // the recipe is expected to create the Dapr Component manifest. However, they are required // when resourceProvisioning is set to manual. msgs := []string{} - if converted.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if src.Properties.Recipe != nil && (!reflect.ValueOf(*src.Properties.Recipe).IsZero()) { msgs = append(msgs, "recipe details cannot be specified when resourceProvisioning is set to manual") } @@ -116,7 +116,7 @@ func (dst *DaprStateStoreResource) ConvertFrom(src v1.DataModelInterface) error Resources: fromResourcesDataModel(daprStateStore.Properties.Resources), } - if daprStateStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if daprStateStore.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { dst.Properties.Type = to.Ptr(daprStateStore.Properties.Type) dst.Properties.Version = to.Ptr(daprStateStore.Properties.Version) dst.Properties.Metadata = daprStateStore.Properties.Metadata diff --git a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go index 5a061aa5c8..60784cdc22 100644 --- a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -53,7 +53,7 @@ func TestDaprStateStore_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/stateStores/stateStore0", Name: "stateStore0", - Type: linkrp.N_DaprStateStoresResourceType, + Type: portableresources.DaprStateStoresResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -74,19 +74,19 @@ func TestDaprStateStore_ConvertVersionedToDataModel(t *testing.T) { }, } if payload == "statestore_values_resource.json" { - expected.Properties.ResourceProvisioning = linkrp.ResourceProvisioningManual + expected.Properties.ResourceProvisioning = portableresources.ResourceProvisioningManual expected.Properties.Type = "state.zookeeper" expected.Properties.Version = "v1" expected.Properties.Metadata = map[string]any{ "foo": "bar", } - expected.Properties.Resources = []*linkrp.ResourceReference{ + expected.Properties.Resources = []*portableresources.ResourceReference{ { ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", }, } } else if payload == "statestore_recipe_resource.json" { - expected.Properties.ResourceProvisioning = linkrp.ResourceProvisioningRecipe + expected.Properties.ResourceProvisioning = portableresources.ResourceProvisioningRecipe expected.Properties.Recipe.Name = "recipe-test" } @@ -144,7 +144,7 @@ func TestDaprStateStore_ConvertDataModelToVersioned(t *testing.T) { expected := &DaprStateStoreResource{ ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/stateStores/stateStore0"), Name: to.Ptr("stateStore0"), - Type: to.Ptr(linkrp.N_DaprStateStoresResourceType), + Type: to.Ptr(portableresources.DaprStateStoresResourceType), Location: to.Ptr(v1.LocationGlobal), Tags: map[string]*string{ "env": to.Ptr("dev"), diff --git a/pkg/daprrp/datamodel/daprpubsubbroker.go b/pkg/daprrp/datamodel/daprpubsubbroker.go index 1b505605b1..f11924ff0e 100644 --- a/pkg/daprrp/datamodel/daprpubsubbroker.go +++ b/pkg/daprrp/datamodel/daprpubsubbroker.go @@ -18,8 +18,8 @@ package datamodel import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -31,7 +31,7 @@ type DaprPubSubBroker struct { Properties DaprPubSubBrokerProperties `json:"properties"` // LinkMetadata represents internal DataModel properties common to all portable resource types. - linkrp_dm.LinkMetadata + pr_dm.LinkMetadata } // ApplyDeploymentOutput applies the properties changes based on the deployment output. It updates the @@ -53,12 +53,12 @@ func (r *DaprPubSubBroker) ResourceMetadata() *rpv1.BasicResourceProperties { // ResourceTypeName returns a string representing the resource type. func (daprPubSub *DaprPubSubBroker) ResourceTypeName() string { - return linkrp.N_DaprPubSubBrokersResourceType + return portableresources.DaprPubSubBrokersResourceType } // Recipe returns the recipe information of the resource. Returns nil if recipe execution is disabled. -func (r *DaprPubSubBroker) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (r *DaprPubSubBroker) Recipe() *portableresources.LinkRecipe { + if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &r.Properties.Recipe @@ -70,16 +70,16 @@ type DaprPubSubBrokerProperties struct { rpv1.BasicDaprResourceProperties // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` // Metadata of the Dapr Pub/Sub Broker resource. Metadata map[string]any `json:"metadata,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Dapr Pub/Sub Broker resource. - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` // List of the resource IDs that support the Dapr Pub/Sub Broker resource. - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` + Resources []*portableresources.ResourceReference `json:"resources,omitempty"` // Type of the Dapr Pub/Sub Broker resource. Type string `json:"type,omitempty"` diff --git a/pkg/daprrp/datamodel/daprsecretstore.go b/pkg/daprrp/datamodel/daprsecretstore.go index 7cdb09569e..0bd174916b 100644 --- a/pkg/daprrp/datamodel/daprsecretstore.go +++ b/pkg/daprrp/datamodel/daprsecretstore.go @@ -18,8 +18,8 @@ package datamodel import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -31,7 +31,7 @@ type DaprSecretStore struct { Properties DaprSecretStoreProperties `json:"properties"` // LinkMetadata represents internal DataModel properties common to all portable resource types. - linkrp_dm.LinkMetadata + pr_dm.LinkMetadata } // ApplyDeploymentOutput updates the status of the secret store with the output resources from a deployment. @@ -52,24 +52,24 @@ func (r *DaprSecretStore) ResourceMetadata() *rpv1.BasicResourceProperties { // ResourceTypeName returns the resource type of the DaprSecretStore resource. func (daprSecretStore *DaprSecretStore) ResourceTypeName() string { - return linkrp.N_DaprSecretStoresResourceType + return portableresources.DaprSecretStoresResourceType } // DaprSecretStoreProperties represents the properties of DaprSecretStore resource. type DaprSecretStoreProperties struct { rpv1.BasicResourceProperties rpv1.BasicDaprResourceProperties - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + Type string `json:"type,omitempty"` + Version string `json:"version,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` } // Recipe returns the Recipe from the DaprSecretStore Properties if ResourceProvisioning is not set to Manual, // otherwise it returns nil. -func (daprSecretStore *DaprSecretStore) Recipe() *linkrp.LinkRecipe { - if daprSecretStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (daprSecretStore *DaprSecretStore) Recipe() *portableresources.LinkRecipe { + if daprSecretStore.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &daprSecretStore.Properties.Recipe diff --git a/pkg/daprrp/datamodel/daprstatestore.go b/pkg/daprrp/datamodel/daprstatestore.go index b143dd092e..faeeb98abd 100644 --- a/pkg/daprrp/datamodel/daprstatestore.go +++ b/pkg/daprrp/datamodel/daprstatestore.go @@ -18,9 +18,9 @@ package datamodel import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" + "github.com/project-radius/radius/pkg/portableresources/renderers" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -32,7 +32,7 @@ type DaprStateStore struct { Properties DaprStateStoreProperties `json:"properties"` // LinkMetadata represents internal DataModel properties common to all portable types. - linkrp_dm.LinkMetadata + pr_dm.LinkMetadata } // ApplyDeploymentOutput updates the DaprStateStore resource with the DeploymentOutput values. @@ -58,12 +58,12 @@ func (r *DaprStateStore) ResourceMetadata() *rpv1.BasicResourceProperties { // ResourceTypeName returns the resource type of the DaprStateStore resource. func (daprStateStore *DaprStateStore) ResourceTypeName() string { - return linkrp.N_DaprStateStoresResourceType + return portableresources.DaprStateStoresResourceType } // Recipe returns the recipe information of the resource. It returns nil if the ResourceProvisioning is set to manual. -func (r *DaprStateStore) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (r *DaprStateStore) Recipe() *portableresources.LinkRecipe { + if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &r.Properties.Recipe @@ -74,10 +74,10 @@ type DaprStateStoreProperties struct { rpv1.BasicResourceProperties rpv1.BasicDaprResourceProperties // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Resources []*portableresources.ResourceReference `json:"resources,omitempty"` + Type string `json:"type,omitempty"` + Version string `json:"version,omitempty"` } diff --git a/pkg/daprrp/datamodel/daprstatestore_test.go b/pkg/daprrp/datamodel/daprstatestore_test.go index fb32529d22..c10a6c7de0 100644 --- a/pkg/daprrp/datamodel/daprstatestore_test.go +++ b/pkg/daprrp/datamodel/daprstatestore_test.go @@ -19,7 +19,7 @@ package datamodel import ( "testing" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/renderers" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" diff --git a/pkg/daprrp/frontend/controller/types.go b/pkg/daprrp/frontend/controller/types.go new file mode 100644 index 0000000000..838d6b66b9 --- /dev/null +++ b/pkg/daprrp/frontend/controller/types.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package controller + +import ( + "time" +) + +var ( + // AsyncCreateOrUpdateDaprStateStoreTimeout is the timeout for async create or update dapr state store + AsyncCreateOrUpdateDaprStateStoreTimeout = time.Duration(60) * time.Minute + // AsyncDeleteDaprStateStoreTimeout is the timeout for async delete dapr state store + AsyncDeleteDaprStateStoreTimeout = time.Duration(30) * time.Minute + + // AsyncCreateOrUpdateDaprSecretStoreTimeout is the timeout for async create or update dapr secret store + AsyncCreateOrUpdateDaprSecretStoreTimeout = time.Duration(60) * time.Minute + // AsyncDeleteDaprSecretStoreTimeout is the timeout for async delete dapr secret store + AsyncDeleteDaprSecretStoreTimeout = time.Duration(30) * time.Minute + + // AsyncCreateOrUpdateDaprPubSubBrokerTimeout is the timeout for async create or update dapr pub sub broker + AsyncCreateOrUpdateDaprPubSubBrokerTimeout = time.Duration(60) * time.Minute + // AsyncDeleteDaprPubSubBrokerTimeout is the timeout for async delete dapr pub sub broker + AsyncDeleteDaprPubSubBrokerTimeout = time.Duration(30) * time.Minute +) diff --git a/pkg/daprrp/processors/pubsubbrokers/processor.go b/pkg/daprrp/processors/pubsubbrokers/processor.go index c341619723..df68295629 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor.go @@ -22,10 +22,10 @@ import ( "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/handlers" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/handlers" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -51,7 +51,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubB return err } - if resource.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if resource.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { // If the resource is being provisioned by recipe then we expect the recipe to create the Dapr Component // in Kubernetes. At this point we're done so we can just return. return nil @@ -75,7 +75,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubB resource.Properties.ComponentName, applicationID.Name(), resource.Name, - linkrp.N_DaprPubSubBrokersResourceType) + portableresources.DaprPubSubBrokersResourceType) if err != nil { return err } @@ -85,7 +85,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubB return &processors.ResourceError{Inner: err} } - err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, linkrp.N_DaprPubSubBrokersResourceType) + err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, portableresources.DaprPubSubBrokersResourceType) if err != nil { return &processors.ValidationError{Message: err.Error()} } diff --git a/pkg/daprrp/processors/pubsubbrokers/processor_test.go b/pkg/daprrp/processors/pubsubbrokers/processor_test.go index 022598e9a0..528d59c18a 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor_test.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor_test.go @@ -23,9 +23,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -134,11 +134,11 @@ func Test_Process(t *testing.T) { BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ ComponentName: componentName, }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{ "config": "extrasecure", }, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: externalResourceID1}}, Type: "pubsub.redis", Version: "v1", }, @@ -171,7 +171,7 @@ func Test_Process(t *testing.T) { "metadata": map[string]any{ "namespace": "test-namespace", "name": "test-dapr-pubsub-broker", - "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", linkrp.N_DaprPubSubBrokersResourceType), + "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", portableresources.DaprPubSubBrokersResourceType), "resourceVersion": "1", }, "spec": map[string]any{ @@ -290,7 +290,7 @@ func Test_Process(t *testing.T) { "test-dapr-pubsub-broker", "test-app", "some-other-other-name", - linkrp.N_DaprPubSubBrokersResourceType) + portableresources.DaprPubSubBrokersResourceType) require.NoError(t, err) processor := Processor{ @@ -309,9 +309,9 @@ func Test_Process(t *testing.T) { BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ ComponentName: componentName, }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{"config": "extrasecure"}, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: externalResourceID1}}, Type: "pubsub.redis", Version: "v1", }, diff --git a/pkg/daprrp/processors/secretstores/processor.go b/pkg/daprrp/processors/secretstores/processor.go index c9c9937ec3..e2ecce65e9 100644 --- a/pkg/daprrp/processors/secretstores/processor.go +++ b/pkg/daprrp/processors/secretstores/processor.go @@ -22,10 +22,10 @@ import ( "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/handlers" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/handlers" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -49,7 +49,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretS return err } - if resource.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if resource.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { // If the resource is being provisioned by recipe then we expect the recipe to create the Dapr Component // in Kubernetes. At this point we're done so we can just return. return nil @@ -72,7 +72,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretS resource.Properties.ComponentName, applicationID.Name(), resource.Name, - linkrp.N_DaprSecretStoresResourceType) + portableresources.DaprSecretStoresResourceType) if err != nil { return err } @@ -82,7 +82,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretS return &processors.ResourceError{Inner: err} } - err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, linkrp.N_DaprSecretStoresResourceType) + err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, portableresources.DaprSecretStoresResourceType) if err != nil { return &processors.ValidationError{Message: err.Error()} } diff --git a/pkg/daprrp/processors/secretstores/processor_test.go b/pkg/daprrp/processors/secretstores/processor_test.go index fe5770e2e2..bca405bb95 100644 --- a/pkg/daprrp/processors/secretstores/processor_test.go +++ b/pkg/daprrp/processors/secretstores/processor_test.go @@ -23,9 +23,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -124,7 +124,7 @@ func Test_Process(t *testing.T) { BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ ComponentName: componentName, }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{"config": "extrasecure"}, Type: "secretstores.kubernetes", Version: "v1", @@ -155,7 +155,7 @@ func Test_Process(t *testing.T) { "metadata": map[string]any{ "namespace": "test-namespace", "name": "test-component", - "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", linkrp.N_DaprSecretStoresResourceType), + "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", portableresources.DaprSecretStoresResourceType), "resourceVersion": "1", }, "spec": map[string]any{ @@ -264,7 +264,7 @@ func Test_Process(t *testing.T) { "test-component", "test-app", "some-other-other-name", - linkrp.N_DaprSecretStoresResourceType) + portableresources.DaprSecretStoresResourceType) require.NoError(t, err) processor := Processor{ @@ -283,7 +283,7 @@ func Test_Process(t *testing.T) { BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ ComponentName: componentName, }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{"config": "extrasecure"}, Type: "secretstores.kubernetes", Version: "v1", diff --git a/pkg/daprrp/processors/statestores/processor.go b/pkg/daprrp/processors/statestores/processor.go index 826daa9000..0fa3800557 100644 --- a/pkg/daprrp/processors/statestores/processor.go +++ b/pkg/daprrp/processors/statestores/processor.go @@ -22,10 +22,10 @@ import ( "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/handlers" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/handlers" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/pkg/ucp/resources" @@ -51,7 +51,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateSt return err } - if resource.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if resource.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { // If the resource is being provisioned by recipe then we expect the recipe to create the Dapr Component // in Kubernetes. At this point we're done so we can just return. return nil @@ -75,7 +75,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateSt resource.Properties.ComponentName, applicationID.Name(), resource.Name, - linkrp.DaprStateStoresResourceType) + portableresources.DaprStateStoresResourceType) if err != nil { return err } @@ -85,7 +85,7 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateSt return &processors.ResourceError{Inner: err} } - err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, linkrp.DaprStateStoresResourceType) + err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, portableresources.DaprStateStoresResourceType) if err != nil { return &processors.ValidationError{Message: err.Error()} } diff --git a/pkg/daprrp/processors/statestores/processor_test.go b/pkg/daprrp/processors/statestores/processor_test.go index 966529ab28..70c11f9874 100644 --- a/pkg/daprrp/processors/statestores/processor_test.go +++ b/pkg/daprrp/processors/statestores/processor_test.go @@ -23,9 +23,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/daprrp/datamodel" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -128,9 +128,9 @@ func Test_Process(t *testing.T) { BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ ComponentName: componentName, }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{"config": "extrasecure"}, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: externalResourceID1}}, Type: "state.redis", Version: "v1", }, @@ -163,7 +163,7 @@ func Test_Process(t *testing.T) { "metadata": map[string]any{ "namespace": "test-namespace", "name": "test-component", - "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", linkrp.DaprStateStoresResourceType), + "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", portableresources.DaprStateStoresResourceType), "resourceVersion": "1", }, "spec": map[string]any{ @@ -278,7 +278,7 @@ func Test_Process(t *testing.T) { "test-component", "test-app", "some-other-other-name", - linkrp.DaprStateStoresResourceType) + portableresources.DaprStateStoresResourceType) require.NoError(t, err) processor := Processor{ @@ -297,9 +297,9 @@ func Test_Process(t *testing.T) { BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ ComponentName: componentName, }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Metadata: map[string]any{"config": "extrasecure"}, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: externalResourceID1}}, Type: "state.redis", Version: "v1", }, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go index ae80aac404..19084a23c6 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go @@ -20,8 +20,8 @@ import ( "fmt" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -73,24 +73,24 @@ func fromProvisioningStateDataModel(state v1.ProvisioningState) *ProvisioningSta return &converted } -func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (linkrp.ResourceProvisioning, error) { +func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (portableresources.ResourceProvisioning, error) { if provisioning == nil { - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil } switch *provisioning { case ResourceProvisioningManual: - return linkrp.ResourceProvisioningManual, nil + return portableresources.ResourceProvisioningManual, nil case ResourceProvisioningRecipe: - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil default: return "", &v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} } } -func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) *ResourceProvisioning { +func fromResourceProvisioningDataModel(provisioning portableresources.ResourceProvisioning) *ResourceProvisioning { var converted ResourceProvisioning switch provisioning { - case linkrp.ResourceProvisioningManual: + case portableresources.ResourceProvisioningManual: converted = ResourceProvisioningManual default: converted = ResourceProvisioningRecipe @@ -99,13 +99,13 @@ func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) return &converted } -func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { - return linkrp.LinkRecipe{ + return portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, } } - recipe := linkrp.LinkRecipe{} + recipe := portableresources.LinkRecipe{} if r.Name == nil { recipe.Name = v20220315privatepreview.DefaultRecipeName } else { @@ -117,27 +117,27 @@ func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { return recipe } -func fromRecipeDataModel(r linkrp.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, } } -func toResourcesDataModel(r []*ResourceReference) []*linkrp.ResourceReference { +func toResourcesDataModel(r []*ResourceReference) []*portableresources.ResourceReference { if r == nil { return nil } - resources := make([]*linkrp.ResourceReference, len(r)) + resources := make([]*portableresources.ResourceReference, len(r)) for i, resource := range r { - resources[i] = &linkrp.ResourceReference{ + resources[i] = &portableresources.ResourceReference{ ID: to.String(resource.ID), } } return resources } -func fromResourcesDataModel(r []*linkrp.ResourceReference) []*ResourceReference { +func fromResourcesDataModel(r []*portableresources.ResourceReference) []*ResourceReference { if r == nil { return nil } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go index 955b94b808..7c3f011a51 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go @@ -21,8 +21,8 @@ import ( "testing" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -117,15 +117,15 @@ func TestFromSystemDataModel(t *testing.T) { func TestToResourcesDataModel(t *testing.T) { testset := []struct { - DMResources []*linkrp.ResourceReference + DMResources []*portableresources.ResourceReference VersionedResources []*ResourceReference }{ { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, + DMResources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, }, { - DMResources: []*linkrp.ResourceReference{}, + DMResources: []*portableresources.ResourceReference{}, VersionedResources: []*ResourceReference{}, }, } @@ -139,15 +139,15 @@ func TestToResourcesDataModel(t *testing.T) { func TestFromResourcesDataModel(t *testing.T) { testset := []struct { - DMResources []*linkrp.ResourceReference + DMResources []*portableresources.ResourceReference VersionedResources []*ResourceReference }{ { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, + DMResources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, }, { - DMResources: []*linkrp.ResourceReference{}, + DMResources: []*portableresources.ResourceReference{}, VersionedResources: []*ResourceReference{}, }, } @@ -162,17 +162,17 @@ func TestFromResourcesDataModel(t *testing.T) { func TestToResourceProvisiongDataModel(t *testing.T) { testset := []struct { versioned ResourceProvisioning - datamodel linkrp.ResourceProvisioning + datamodel portableresources.ResourceProvisioning err error }{ { ResourceProvisioningManual, - linkrp.ResourceProvisioningManual, + portableresources.ResourceProvisioningManual, nil, }, { ResourceProvisioningRecipe, - linkrp.ResourceProvisioningRecipe, + portableresources.ResourceProvisioningRecipe, nil, }, { @@ -199,11 +199,11 @@ func TestToResourceProvisiongDataModel(t *testing.T) { func TestFromResourceProvisiongDataModel(t *testing.T) { testCases := []struct { - datamodel linkrp.ResourceProvisioning + datamodel portableresources.ResourceProvisioning versioned ResourceProvisioning }{ - {linkrp.ResourceProvisioningManual, ResourceProvisioningManual}, - {linkrp.ResourceProvisioningRecipe, ResourceProvisioningRecipe}, + {portableresources.ResourceProvisioningManual, ResourceProvisioningManual}, + {portableresources.ResourceProvisioningRecipe, ResourceProvisioningRecipe}, {"", ResourceProvisioningRecipe}, } @@ -215,11 +215,11 @@ func TestFromResourceProvisiongDataModel(t *testing.T) { func TestToRecipeDataModel(t *testing.T) { testset := []struct { versioned *Recipe - datamodel linkrp.LinkRecipe + datamodel portableresources.LinkRecipe }{ { nil, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, }, }, @@ -230,7 +230,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: "test", Parameters: map[string]any{ "foo": "bar", @@ -243,7 +243,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", @@ -259,11 +259,11 @@ func TestToRecipeDataModel(t *testing.T) { func TestFromRecipeDataModel(t *testing.T) { testset := []struct { - DMResources []linkrp.LinkRecipe + DMResources []portableresources.LinkRecipe VersionedResources []*Recipe }{ { - DMResources: []linkrp.LinkRecipe{{ + DMResources: []portableresources.LinkRecipe{{ Name: v20220315privatepreview.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go index 15d3ffe8e7..dc6b04890b 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go @@ -19,7 +19,7 @@ package v20220315privatepreview import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -67,7 +67,7 @@ func (src *MongoDatabaseResource) ConvertTo() (v1.DataModelInterface, error) { Password: to.String(v.Secrets.Password), } } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { converted.Properties.Recipe = toRecipeDataModel(v.Recipe) } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go index effc19ab08..60c149f91a 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go @@ -22,8 +22,8 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -46,7 +46,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", Name: "mongo0", - Type: linkrp.N_MongoDatabasesResourceType, + Type: portableresources.MongoDatabasesResourceType, Tags: map[string]string{}, }, InternalMetadata: v1.InternalMetadata{ @@ -61,11 +61,11 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Host: "testAccount.mongo.cosmos.azure.com", Port: 10255, Database: "test-database", - Resources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}}, + Resources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}}, }, }, }, @@ -77,7 +77,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", Name: "mongo0", - Type: linkrp.N_MongoDatabasesResourceType, + Type: portableresources.MongoDatabasesResourceType, Tags: map[string]string{}, }, InternalMetadata: v1.InternalMetadata{ @@ -92,10 +92,10 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "testAccount.mongo.cosmos.azure.com", Port: 10255, - Recipe: linkrp.LinkRecipe{Name: "cosmosdb", Parameters: map[string]interface{}{"foo": "bar"}}, + Recipe: portableresources.LinkRecipe{Name: "cosmosdb", Parameters: map[string]interface{}{"foo": "bar"}}, }, }, }, @@ -108,7 +108,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", Name: "mongo0", - Type: linkrp.N_MongoDatabasesResourceType, + Type: portableresources.MongoDatabasesResourceType, Tags: map[string]string{}, }, InternalMetadata: v1.InternalMetadata{ @@ -123,10 +123,10 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "mynewhost.com", Port: 10256, - Recipe: linkrp.LinkRecipe{Name: v20220315privatepreview.DefaultRecipeName, Parameters: nil}, + Recipe: portableresources.LinkRecipe{Name: v20220315privatepreview.DefaultRecipeName, Parameters: nil}, }, }, }, @@ -138,7 +138,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0", Name: "mongo0", - Type: linkrp.N_MongoDatabasesResourceType, + Type: portableresources.MongoDatabasesResourceType, Tags: map[string]string{}, }, InternalMetadata: v1.InternalMetadata{ @@ -153,7 +153,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Host: "testAccount.mongo.cosmos.azure.com", Port: 10255, Database: "test-database", @@ -247,7 +247,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0"), Name: to.Ptr("mongo0"), - Type: to.Ptr(linkrp.N_MongoDatabasesResourceType), + Type: to.Ptr(portableresources.MongoDatabasesResourceType), }, }, { @@ -275,7 +275,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0"), Name: to.Ptr("mongo0"), - Type: to.Ptr(linkrp.N_MongoDatabasesResourceType), + Type: to.Ptr(portableresources.MongoDatabasesResourceType), }, }, { @@ -303,7 +303,7 @@ func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0"), Name: to.Ptr("mongo0"), - Type: to.Ptr(linkrp.N_MongoDatabasesResourceType), + Type: to.Ptr(portableresources.MongoDatabasesResourceType), }, }, } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go index 84d6c7391c..9089a5acd1 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go @@ -19,7 +19,7 @@ package v20220315privatepreview import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -55,7 +55,7 @@ func (src *RedisCacheResource) ConvertTo() (v1.DataModelInterface, error) { if err != nil { return nil, err } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { converted.Properties.Recipe = toRecipeDataModel(v.Recipe) } converted.Properties.Resources = toResourcesDataModel(v.Resources) diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go index b6e4454d15..ac16b71fc1 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go @@ -27,7 +27,7 @@ import ( "github.com/project-radius/radius/test/testutil/resourcetypeutil" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -51,12 +51,12 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { BaseResource: createBaseResource(), Properties: datamodel.RedisCacheProperties{ BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "", Port: 0, TLS: false, Username: "", - Recipe: linkrp.LinkRecipe{Name: "default"}, + Recipe: portableresources.LinkRecipe{Name: "default"}, }, }, }, @@ -67,12 +67,12 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { BaseResource: createBaseResource(), Properties: datamodel.RedisCacheProperties{ BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "", Port: 0, TLS: false, Username: "", - Recipe: linkrp.LinkRecipe{Name: "redis-test"}, + Recipe: portableresources.LinkRecipe{Name: "redis-test"}, }, }, }, @@ -83,12 +83,12 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { BaseResource: createBaseResource(), Properties: datamodel.RedisCacheProperties{ BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "myrediscache.redis.cache.windows.net", Port: 10255, TLS: false, Username: "", - Recipe: linkrp.LinkRecipe{Name: "redis-test", Parameters: map[string]any{"port": float64(6081)}}, + Recipe: portableresources.LinkRecipe{Name: "redis-test", Parameters: map[string]any{"port": float64(6081)}}, }, }, }, @@ -99,12 +99,12 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { BaseResource: createBaseResource(), Properties: datamodel.RedisCacheProperties{ BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Host: "myrediscache.redis.cache.windows.net", Port: 10255, TLS: true, Username: "admin", - Resources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}}, + Resources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}}, Secrets: datamodel.RedisCacheSecrets{ Password: "testPassword", ConnectionString: "test-connection-string", @@ -120,7 +120,7 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { BaseResource: createBaseResource(), Properties: datamodel.RedisCacheProperties{ BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Host: "myrediscache.redis.cache.windows.net", Port: 10255, TLS: false, @@ -178,7 +178,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr(RedisID), Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.N_RedisCachesResourceType), + Type: to.Ptr(portableresources.RedisCachesResourceType), }, }, { @@ -203,7 +203,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr(RedisID), Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.N_RedisCachesResourceType), + Type: to.Ptr(portableresources.RedisCachesResourceType), }, }, { @@ -228,7 +228,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr(RedisID), Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.N_RedisCachesResourceType), + Type: to.Ptr(portableresources.RedisCachesResourceType), }, }, { @@ -259,7 +259,7 @@ func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr(RedisID), Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.N_RedisCachesResourceType), + Type: to.Ptr(portableresources.RedisCachesResourceType), }, }, } @@ -377,7 +377,7 @@ func createBaseResource() v1.BaseResource { TrackedResource: v1.TrackedResource{ ID: RedisID, Name: "redis0", - Type: linkrp.N_RedisCachesResourceType, + Type: portableresources.RedisCachesResourceType, Tags: map[string]string{}, }, InternalMetadata: v1.InternalMetadata{ diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go index 88b7d59073..1175736ee3 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go @@ -19,7 +19,7 @@ package v20220315privatepreview import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -56,7 +56,7 @@ func (src *SQLDatabaseResource) ConvertTo() (v1.DataModelInterface, error) { if err != nil { return nil, err } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { converted.Properties.Recipe = toRecipeDataModel(properties.Recipe) } converted.Properties.Resources = toResourcesDataModel(properties.Resources) @@ -105,7 +105,7 @@ func (dst *SQLDatabaseResource) ConvertFrom(src v1.DataModelInterface) error { Application: to.Ptr(sql.Properties.Application), Username: to.Ptr(sql.Properties.Username), } - if sql.Properties.ResourceProvisioning == linkrp.ResourceProvisioningRecipe { + if sql.Properties.ResourceProvisioning == portableresources.ResourceProvisioningRecipe { dst.Properties.Recipe = fromRecipeDataModel(sql.Properties.Recipe) } return nil diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go index aa6fbcad36..c41261f4cf 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go @@ -22,7 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -44,7 +44,7 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", Name: "sql0", - Type: linkrp.N_SqlDatabasesResourceType, + Type: portableresources.SqlDatabasesResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -62,8 +62,8 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Resources: []*linkrp.ResourceReference{ + ResourceProvisioning: portableresources.ResourceProvisioningManual, + Resources: []*portableresources.ResourceReference{ { ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", }, @@ -87,7 +87,7 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0", Name: "sql0", - Type: linkrp.N_SqlDatabasesResourceType, + Type: portableresources.SqlDatabasesResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -105,8 +105,8 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{ + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, + Recipe: portableresources.LinkRecipe{ Name: "sql-test", Parameters: map[string]any{ "foo": "bar", @@ -168,7 +168,7 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0"), Name: to.Ptr("sql0"), - Type: to.Ptr(linkrp.N_SqlDatabasesResourceType), + Type: to.Ptr(portableresources.SqlDatabasesResourceType), }, }, { @@ -198,7 +198,7 @@ func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/sqlDatabases/sql0"), Name: to.Ptr("sql0"), - Type: to.Ptr(linkrp.N_SqlDatabasesResourceType), + Type: to.Ptr(portableresources.SqlDatabasesResourceType), }, }, } diff --git a/pkg/datastoresrp/datamodel/mongodatabase.go b/pkg/datastoresrp/datamodel/mongodatabase.go index 26bfc39252..fbb2d55f34 100644 --- a/pkg/datastoresrp/datamodel/mongodatabase.go +++ b/pkg/datastoresrp/datamodel/mongodatabase.go @@ -21,9 +21,9 @@ import ( "strings" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" + "github.com/project-radius/radius/pkg/portableresources/renderers" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -32,7 +32,7 @@ type MongoDatabase struct { v1.BaseResource // LinkMetadata represents internal DataModel properties common to all portable resources. - linkrp_dm.LinkMetadata + pr_dm.LinkMetadata // Properties is the properties of the resource. Properties MongoDatabaseProperties `json:"properties"` @@ -50,11 +50,11 @@ type MongoDatabaseProperties struct { // Database name of the target Mongo database Database string `json:"database,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Mongo database link - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` // List of the resource IDs that support the Mongo database resource - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` + Resources []*portableresources.ResourceReference `json:"resources,omitempty"` // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` // Username of the Mongo database Username string `json:"username,omitempty"` } @@ -73,7 +73,7 @@ func (mongoSecrets MongoDatabaseSecrets) IsEmpty() bool { // VerifyInputs checks if the manual resource provisioning fields are set and returns an error if any of them are missing. func (mongodb *MongoDatabase) VerifyInputs() error { msgs := []string{} - if mongodb.Properties.ResourceProvisioning != "" && mongodb.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if mongodb.Properties.ResourceProvisioning != "" && mongodb.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if mongodb.Properties.Host == "" { msgs = append(msgs, "host must be specified when resourceProvisioning is set to manual") } @@ -125,8 +125,8 @@ func (r *MongoDatabase) ResourceMetadata() *rpv1.BasicResourceProperties { // Recipe returns the LinkRecipe associated with the Mongo database instance, or nil if the // ResourceProvisioning is set to Manual. -func (r *MongoDatabase) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (r *MongoDatabase) Recipe() *portableresources.LinkRecipe { + if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &r.Properties.Recipe @@ -134,10 +134,10 @@ func (r *MongoDatabase) Recipe() *linkrp.LinkRecipe { // ResourceTypeName returns the resource type for Mongo database resource. func (mongoSecrets *MongoDatabaseSecrets) ResourceTypeName() string { - return linkrp.N_MongoDatabasesResourceType + return portableresources.MongoDatabasesResourceType } // ResourceTypeName returns the resource type for Mongo database resource. func (mongo *MongoDatabase) ResourceTypeName() string { - return linkrp.N_MongoDatabasesResourceType + return portableresources.MongoDatabasesResourceType } diff --git a/pkg/datastoresrp/datamodel/rediscache.go b/pkg/datastoresrp/datamodel/rediscache.go index b1bd9e87b4..f747a09144 100644 --- a/pkg/datastoresrp/datamodel/rediscache.go +++ b/pkg/datastoresrp/datamodel/rediscache.go @@ -23,9 +23,9 @@ import ( "strings" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" + "github.com/project-radius/radius/pkg/portableresources/renderers" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -37,7 +37,7 @@ type RedisCache struct { Properties RedisCacheProperties `json:"properties"` // LinkMetadata represents internal DataModel properties common to all link types. - linkrp_dm.LinkMetadata + pr_dm.LinkMetadata } // ApplyDeploymentOutput sets the Status, ComputedValues, SecretValues, Host, Port and Username properties of the @@ -85,13 +85,13 @@ func (r *RedisCache) ResourceMetadata() *rpv1.BasicResourceProperties { // ResourceTypeName returns the resource type of Redis cache resource. func (redis *RedisCache) ResourceTypeName() string { - return linkrp.N_RedisCachesResourceType + return portableresources.RedisCachesResourceType } // Recipe returns the LinkRecipe from the Redis cache Properties if ResourceProvisioning is not set to Manual, // otherwise it returns nil. -func (redis *RedisCache) Recipe() *linkrp.LinkRecipe { - if redis.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (redis *RedisCache) Recipe() *portableresources.LinkRecipe { + if redis.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &redis.Properties.Recipe @@ -106,7 +106,7 @@ func (redisSecrets *RedisCacheSecrets) IsEmpty() bool { // and returns an error if not. func (redisCache *RedisCache) VerifyInputs() error { msgs := []string{} - if redisCache.Properties.ResourceProvisioning != "" && redisCache.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if redisCache.Properties.ResourceProvisioning != "" && redisCache.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if redisCache.Properties.Host == "" { msgs = append(msgs, "host must be specified when resourceProvisioning is set to manual") } @@ -145,16 +145,16 @@ type RedisCacheProperties struct { TLS bool `json:"tls,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Redis caches link - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` // Secrets provided by resource Secrets RedisCacheSecrets `json:"secrets,omitempty"` // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` // List of the resource IDs that support the Redis resource - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` + Resources []*portableresources.ResourceReference `json:"resources,omitempty"` } // Secrets values consisting of secrets provided for the resource @@ -166,5 +166,5 @@ type RedisCacheSecrets struct { // ResourceTypeName returns the resource type of RedisCache resource. func (redis RedisCacheSecrets) ResourceTypeName() string { - return linkrp.N_RedisCachesResourceType + return portableresources.RedisCachesResourceType } diff --git a/pkg/datastoresrp/datamodel/sqldatabase.go b/pkg/datastoresrp/datamodel/sqldatabase.go index 273053020a..326b15e9e0 100644 --- a/pkg/datastoresrp/datamodel/sqldatabase.go +++ b/pkg/datastoresrp/datamodel/sqldatabase.go @@ -21,15 +21,15 @@ import ( "strings" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) // Recipe returns the LinkRecipe associated with the SQL database instance if the ResourceProvisioning is not // set to Manual, otherwise it returns nil. -func (sql *SqlDatabase) Recipe() *linkrp.LinkRecipe { - if sql.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (sql *SqlDatabase) Recipe() *portableresources.LinkRecipe { + if sql.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &sql.Properties.Recipe @@ -43,7 +43,7 @@ type SqlDatabase struct { Properties SqlDatabaseProperties `json:"properties"` // LinkMetadata represents internal DataModel properties common to all portable resources. - linkrp_dm.LinkMetadata + pr_dm.LinkMetadata } // ApplyDeploymentOutput updates the output resources of a SQL database resource with the output resources of a DeploymentOutput @@ -65,14 +65,14 @@ func (r *SqlDatabase) ResourceMetadata() *rpv1.BasicResourceProperties { // ResourceTypeName returns the resource type of the SQL database resource. func (sql *SqlDatabase) ResourceTypeName() string { - return linkrp.N_SqlDatabasesResourceType + return portableresources.SqlDatabasesResourceType } // SqlDatabaseProperties represents the properties of SQL database resource. type SqlDatabaseProperties struct { rpv1.BasicResourceProperties // The recipe used to automatically deploy underlying infrastructure for the SQL database resource - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` // Database name of the target SQL database resource Database string `json:"database,omitempty"` // The fully qualified domain name of the SQL database resource @@ -80,9 +80,9 @@ type SqlDatabaseProperties struct { // Port value of the target SQL database resource Port int32 `json:"port,omitempty"` // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` // List of the resource IDs that support the SQL database resource - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` + Resources []*portableresources.ResourceReference `json:"resources,omitempty"` // Username of the SQL database resource Username string `json:"username,omitempty"` // Secrets values provided for the resource @@ -102,7 +102,7 @@ type SqlDatabaseSecrets struct { // if any of the required fields are not set. func (sql *SqlDatabase) VerifyInputs() error { msgs := []string{} - if sql.Properties.ResourceProvisioning != "" && sql.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if sql.Properties.ResourceProvisioning != "" && sql.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if sql.Properties.Server == "" { msgs = append(msgs, "server must be specified when resourceProvisioning is set to manual") } @@ -136,5 +136,5 @@ func (sqlSecrets SqlDatabaseSecrets) IsEmpty() bool { // ResourceTypeName returns the resource type of the SQL database resource. func (sqlSecrets *SqlDatabaseSecrets) ResourceTypeName() string { - return linkrp.N_SqlDatabasesResourceType + return portableresources.SqlDatabasesResourceType } diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go index 7a178721e6..7f93670ee5 100644 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go +++ b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go @@ -25,7 +25,7 @@ import ( "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) var _ ctrl.Controller = (*ListSecretsMongoDatabase)(nil) diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go index 8ef273e6f5..8d45f34ab9 100644 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go +++ b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go @@ -28,7 +28,7 @@ import ( ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rpctest" "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/renderers" "github.com/project-radius/radius/pkg/ucp/store" "github.com/golang/mock/gomock" diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/types.go b/pkg/datastoresrp/frontend/controller/mongodatabases/types.go deleted file mode 100644 index c9833d3940..0000000000 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go index 945eb1c88f..dfcb94389e 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go +++ b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go @@ -24,9 +24,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/datastoresrp/datamodel" + "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" + "github.com/project-radius/radius/pkg/portableresources/renderers" "github.com/project-radius/radius/pkg/ucp/store" ) @@ -53,7 +53,7 @@ func (ctrl *ListSecretsRedisCache) Run(ctx context.Context, w http.ResponseWrite sCtx := v1.ARMRequestContextFromContext(ctx) // Request route for listsecrets has name of the operation as suffix which should be removed to get the resource id. - // route id format: subscriptions//resourceGroups//providers/Applications.Link/redisCaches//listsecrets + // route id format: subscriptions//resourceGroups//providers/Applications.Datastores/redisCaches//listsecrets parsedResourceID := sCtx.ResourceID.Truncate() resource, _, err := ctrl.GetResource(ctx, parsedResourceID) if err != nil { diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go index 059846c048..38ef5ce8c1 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go +++ b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go @@ -28,7 +28,7 @@ import ( ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rpctest" "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/renderers" "github.com/project-radius/radius/pkg/ucp/store" "github.com/golang/mock/gomock" diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go b/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go index 30c058c139..e392df64b5 100644 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go +++ b/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go @@ -25,7 +25,7 @@ import ( "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) var _ ctrl.Controller = (*ListSecretsSqlDatabase)(nil) diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/types.go b/pkg/datastoresrp/frontend/controller/sqldatabases/types.go deleted file mode 100644 index 1e801ba341..0000000000 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sqldatabases - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/datastoresrp/frontend/controller/types.go b/pkg/datastoresrp/frontend/controller/types.go index 9219bb1530..224063485a 100644 --- a/pkg/datastoresrp/frontend/controller/types.go +++ b/pkg/datastoresrp/frontend/controller/types.go @@ -20,7 +20,10 @@ import ( "time" ) -var ( +const ( + // User defined operation names + OperationListSecret = "LISTSECRETS" + // AsyncCreateOrUpdateMongoDatabaseTimeout is the timeout for async create or update Mongo database AsyncCreateOrUpdateMongoDatabaseTimeout = time.Duration(10) * time.Minute // AsyncDeleteMongoDatabaseTimeout is the timeout for async delete Mongo database @@ -35,4 +38,9 @@ var ( AsyncCreateOrUpdateDaprStateStoreTimeout = time.Duration(60) * time.Minute // AsyncDeleteDaprStateStoreTimeout is the timeout for async delete Dapr state store AsyncDeleteDaprStateStoreTimeout = time.Duration(30) * time.Minute + + // AsyncCreateOrUpdateSqlTimeout is the timeout for async create or update sql database + AsyncCreateOrUpdateSqlDatabaseTimeout = time.Duration(10) * time.Minute + // AsyncDeleteSqlDatabaseTimeout is the timeout for async delete sql database + AsyncDeleteSqlDatabaseTimeout = time.Duration(15) * time.Minute ) diff --git a/pkg/datastoresrp/processors/mongodatabases/processor.go b/pkg/datastoresrp/processors/mongodatabases/processor.go index 8f80c2ae22..9aacf88955 100644 --- a/pkg/datastoresrp/processors/mongodatabases/processor.go +++ b/pkg/datastoresrp/processors/mongodatabases/processor.go @@ -21,8 +21,8 @@ import ( "fmt" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) // Processor is a processor for MongoDB resources. diff --git a/pkg/datastoresrp/processors/mongodatabases/processor_test.go b/pkg/datastoresrp/processors/mongodatabases/processor_test.go index 3f0aad542b..2d5a8c81b0 100644 --- a/pkg/datastoresrp/processors/mongodatabases/processor_test.go +++ b/pkg/datastoresrp/processors/mongodatabases/processor_test.go @@ -21,8 +21,8 @@ import ( "testing" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/stretchr/testify/require" @@ -96,7 +96,7 @@ func Test_Process(t *testing.T) { t.Run("success - manual", func(t *testing.T) { resource := &datamodel.MongoDatabase{ Properties: datamodel.MongoDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureMongoResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: azureMongoResourceID1}}, Host: host, Port: port, Database: database, @@ -132,7 +132,7 @@ func Test_Process(t *testing.T) { }, } - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ + expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*portableresources.ResourceReference{ { ID: azureMongoResourceID1, }, @@ -147,7 +147,7 @@ func Test_Process(t *testing.T) { t.Run("success - recipe with value overrides", func(t *testing.T) { resource := &datamodel.MongoDatabase{ Properties: datamodel.MongoDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureMongoResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: azureMongoResourceID1}}, Host: host, Port: port, Database: database, @@ -208,7 +208,7 @@ func Test_Process(t *testing.T) { require.NoError(t, err) expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ + resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*portableresources.ResourceReference{ { ID: azureMongoResourceID1, }, diff --git a/pkg/datastoresrp/processors/rediscaches/processor.go b/pkg/datastoresrp/processors/rediscaches/processor.go index d3ed1765a9..45c81a435f 100644 --- a/pkg/datastoresrp/processors/rediscaches/processor.go +++ b/pkg/datastoresrp/processors/rediscaches/processor.go @@ -21,8 +21,8 @@ import ( "fmt" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) const ( diff --git a/pkg/datastoresrp/processors/rediscaches/processor_test.go b/pkg/datastoresrp/processors/rediscaches/processor_test.go index 212011bb56..facc615e0c 100644 --- a/pkg/datastoresrp/processors/rediscaches/processor_test.go +++ b/pkg/datastoresrp/processors/rediscaches/processor_test.go @@ -21,8 +21,8 @@ import ( "testing" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/stretchr/testify/require" @@ -101,7 +101,7 @@ func Test_Process(t *testing.T) { t.Run("success - manual", func(t *testing.T) { resource := &datamodel.RedisCache{ Properties: datamodel.RedisCacheProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureRedisResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: azureRedisResourceID1}}, Host: host, Port: RedisSSLPort, Username: username, @@ -141,7 +141,7 @@ func Test_Process(t *testing.T) { }, } - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ + expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*portableresources.ResourceReference{ { ID: azureRedisResourceID1, }, @@ -156,7 +156,7 @@ func Test_Process(t *testing.T) { t.Run("success - recipe with value overrides", func(t *testing.T) { resource := &datamodel.RedisCache{ Properties: datamodel.RedisCacheProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureRedisResourceID1}}, + Resources: []*portableresources.ResourceReference{{ID: azureRedisResourceID1}}, Host: host, Port: RedisNonSSLPort, Username: username, @@ -221,7 +221,7 @@ func Test_Process(t *testing.T) { require.NoError(t, err) expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ + resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*portableresources.ResourceReference{ { ID: azureRedisResourceID1, }, diff --git a/pkg/datastoresrp/processors/sqldatabases/processor.go b/pkg/datastoresrp/processors/sqldatabases/processor.go index 5bfb1f587b..a514296467 100644 --- a/pkg/datastoresrp/processors/sqldatabases/processor.go +++ b/pkg/datastoresrp/processors/sqldatabases/processor.go @@ -10,8 +10,8 @@ import ( "fmt" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) // Processor is a processor for SQL database resources. diff --git a/pkg/datastoresrp/processors/sqldatabases/processor_test.go b/pkg/datastoresrp/processors/sqldatabases/processor_test.go index 33e47d3c0b..6273d14191 100644 --- a/pkg/datastoresrp/processors/sqldatabases/processor_test.go +++ b/pkg/datastoresrp/processors/sqldatabases/processor_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/stretchr/testify/require" @@ -83,7 +83,7 @@ func Test_Process(t *testing.T) { t.Run("success - manual", func(t *testing.T) { resource := &datamodel.SqlDatabase{ Properties: datamodel.SqlDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureSqlResourceID}}, + Resources: []*portableresources.ResourceReference{{ID: azureSqlResourceID}}, Database: database, Server: server, Port: port, @@ -119,7 +119,7 @@ func Test_Process(t *testing.T) { }, } - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ + expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*portableresources.ResourceReference{ { ID: azureSqlResourceID, }, @@ -134,7 +134,7 @@ func Test_Process(t *testing.T) { t.Run("success - recipe with value overrides", func(t *testing.T) { resource := &datamodel.SqlDatabase{ Properties: datamodel.SqlDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureSqlResourceID}}, + Resources: []*portableresources.ResourceReference{{ID: azureSqlResourceID}}, Database: database, Server: server, Port: port, @@ -194,7 +194,7 @@ func Test_Process(t *testing.T) { require.NoError(t, err) expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ + resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*portableresources.ResourceReference{ { ID: azureSqlResourceID, }, diff --git a/pkg/linkrp/api/README.md b/pkg/linkrp/api/README.md deleted file mode 100644 index 4f28dfb8ed..0000000000 --- a/pkg/linkrp/api/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# API models - -This directory includes API version specific models from open api specs. The models in this directory is used for serializing/deserializing request and response. [datamodels](../datamodel/) has the converters to convert between version specific models and datamodels. datamodels will be used for internal controller and datastorage. - -## Generate new models -### Prerequisites -1. Install [NodeJS](https://nodejs.org/) -2. Install [AutoRest](http://aka.ms/autorest) -``` -npm install -g autorest -``` - -### Add new api-version - -1. Add api version tags and openapi file below in this README.md -2. Run autorest. -```bash -autorest README.md --tag=link-2022-03-15-privatepreview -``` -3. Create or modify the corresponding datamodels in [datamodel](../datamodel/) -4. Add the converter between versioned model and datamodel in [converter](../datamodel/converter/) - ---- - -## Configuration - -The following are the settings for this using this API with AutoRest. - -### Input OpenAPI specificiations - -#### Tag: link-2022-03-15-privatepreview - -These settings apply only when `--tag=link-2022-03-15-privatepreview` is specified on the command line. - -```yaml $(tag) == 'link-2022-03-15-privatepreview' -input-file: - - ../../../swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/openapi.json - - ../../../swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/extenders.json -modelerfour: - treat-type-object-as-anything: false -``` -### Common - -The following configuration generates track2 go models and client. - -```yaml $(tag) != '' -version: 3.*.* -use: "@autorest/go@4.0.0-preview.55" -module-version: 0.0.1 -file-prefix: zz_generated_ -license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated." -azure-arm: true -``` - -### Output - -#### Tag: link-2022-03-15-privatepreview - -These settings apply only when `--tag=link-2022-03-15-privatepreview` is specified on the command line. - -```yaml $(tag) == 'link-2022-03-15-privatepreview' -output-folder: ./v20220315privatepreview -``` \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion.go b/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion.go deleted file mode 100644 index 78541bdadd..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "fmt" - "reflect" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned DaprPubSubBroker resource to version-agnostic datamodel, validating the input -// and returning an error if any of the validation checks fail. -func (src *DaprPubSubBrokerResource) ConvertTo() (v1.DataModelInterface, error) { - daprPubSubproperties := datamodel.DaprPubSubBrokerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - } - - trackedResource := v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - } - internalMetadata := v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - } - converted := &datamodel.DaprPubSubBroker{} - converted.TrackedResource = trackedResource - converted.InternalMetadata = internalMetadata - converted.Properties = daprPubSubproperties - - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(src.Properties.ResourceProvisioning) - if err != nil { - return nil, err - } - - converted.Properties.Resources = toResourcesDataModel(src.Properties.Resources) - - // Note: The metadata, type, and version fields cannot be specified when using recipes since - // the recipe is expected to create the Dapr Component manifest. However, they are required - // when resourceProvisioning is set to manual. - msgs := []string{} - if converted.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if src.Properties.Recipe != nil && (!reflect.ValueOf(*src.Properties.Recipe).IsZero()) { - msgs = append(msgs, "recipe details cannot be specified when resourceProvisioning is set to manual") - } - if src.Properties.Metadata == nil || len(src.Properties.Metadata) == 0 { - msgs = append(msgs, "metadata must be specified when resourceProvisioning is set to manual") - } - if src.Properties.Type == nil || *src.Properties.Type == "" { - msgs = append(msgs, "type must be specified when resourceProvisioning is set to manual") - } - if src.Properties.Version == nil || *src.Properties.Version == "" { - msgs = append(msgs, "version must be specified when resourceProvisioning is set to manual") - } - - converted.Properties.Metadata = src.Properties.Metadata - converted.Properties.Type = to.String(src.Properties.Type) - converted.Properties.Version = to.String(src.Properties.Version) - } else { - if src.Properties.Metadata != nil && (!reflect.ValueOf(src.Properties.Metadata).IsZero()) { - msgs = append(msgs, "metadata cannot be specified when resourceProvisioning is set to recipe (default)") - } - if src.Properties.Type != nil && (!reflect.ValueOf(*src.Properties.Type).IsZero()) { - msgs = append(msgs, "type cannot be specified when resourceProvisioning is set to recipe (default)") - } - if src.Properties.Version != nil && (!reflect.ValueOf(*src.Properties.Version).IsZero()) { - msgs = append(msgs, "version cannot be specified when resourceProvisioning is set to recipe (default)") - } - - converted.Properties.Recipe = toRecipeDataModel(src.Properties.Recipe) - } - - if len(msgs) == 1 { - return nil, &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return nil, &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned DaprPubSubBroker resource. -// If the DataModelInterface is not of the correct type, an error is returned. -func (dst *DaprPubSubBrokerResource) ConvertFrom(src v1.DataModelInterface) error { - daprPubSub, ok := src.(*datamodel.DaprPubSubBroker) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(daprPubSub.ID) - dst.Name = to.Ptr(daprPubSub.Name) - dst.Type = to.Ptr(daprPubSub.Type) - dst.SystemData = fromSystemDataModel(daprPubSub.SystemData) - dst.Location = to.Ptr(daprPubSub.Location) - dst.Tags = *to.StringMapPtr(daprPubSub.Tags) - - dst.Properties = &DaprPubSubBrokerProperties{ - Environment: to.Ptr(daprPubSub.Properties.Environment), - Application: to.Ptr(daprPubSub.Properties.Application), - ResourceProvisioning: fromResourceProvisioningDataModel(daprPubSub.Properties.ResourceProvisioning), - Resources: fromResourcesDataModel(daprPubSub.Properties.Resources), - ComponentName: to.Ptr(daprPubSub.Properties.ComponentName), - ProvisioningState: fromProvisioningStateDataModel(daprPubSub.InternalMetadata.AsyncProvisioningState), - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(daprPubSub.Properties.Status.OutputResources), - }, - } - - if daprPubSub.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - dst.Properties.Metadata = daprPubSub.Properties.Metadata - dst.Properties.Type = to.Ptr(daprPubSub.Properties.Type) - dst.Properties.Version = to.Ptr(daprPubSub.Properties.Version) - } else { - dst.Properties.Recipe = fromRecipeDataModel(daprPubSub.Properties.Recipe) - } - - return nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go deleted file mode 100644 index 860e18c241..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/daprpubsubbroker_conversion_test.go +++ /dev/null @@ -1,264 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { - testCases := []struct { - desc string - file string - expected *datamodel.DaprPubSubBroker - }{ - { - desc: "Manual provisioning of a DaprPubSubBroker", - file: "daprpubsubbroker/daprpubsubbroker_manual_resource.json", - expected: &datamodel.DaprPubSubBroker{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - Name: "test-dpsb", - Type: linkrp.DaprPubSubBrokersResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.DaprPubSubBrokerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{ - "foo": "bar", - }, - Resources: []*linkrp.ResourceReference{ - { - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async", - }, - }, - Type: "pubsub.azure.servicebus", - Version: "v1", - }, - }, - }, - { - desc: "Provisioning by a Recipe of a DaprPubSubBroker", - file: "daprpubsubbroker/daprpubsubbroker_recipe_resource.json", - expected: &datamodel.DaprPubSubBroker{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - Name: "test-dpsb", - Type: linkrp.DaprPubSubBrokersResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.DaprPubSubBrokerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{ - Name: "dpsb-recipe", - }, - }, - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture(tc.file) - versionedResource := &DaprPubSubBrokerResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.DaprPubSubBroker) - - require.Equal(t, tc.expected, convertedResource) - }) - } -} - -func TestDaprPubSubBroker_ConvertVersionedToDataModel_Invalid(t *testing.T) { - testset := []struct { - payload string - errType error - message string - }{ - { - "daprpubsubbroker/daprpubsubbroker_invalidmanual_resource.json", - &v1.ErrClientRP{}, - "code BadRequest: err multiple errors were found:\n\trecipe details cannot be specified when resourceProvisioning is set to manual\n\tmetadata must be specified when resourceProvisioning is set to manual\n\ttype must be specified when resourceProvisioning is set to manual\n\tversion must be specified when resourceProvisioning is set to manual", - }, - { - "daprpubsubbroker/daprpubsubbroker_invalidrecipe_resource.json", - &v1.ErrClientRP{}, - "code BadRequest: err multiple errors were found:\n\tmetadata cannot be specified when resourceProvisioning is set to recipe (default)\n\ttype cannot be specified when resourceProvisioning is set to recipe (default)\n\tversion cannot be specified when resourceProvisioning is set to recipe (default)", - }, - } - - for _, test := range testset { - t.Run(test.payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(test.payload) - versionedResource := &DaprStateStoreResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - require.Error(t, err) - require.Nil(t, dm) - require.IsType(t, test.errType, err) - require.Equal(t, test.message, err.Error()) - }) - } -} - -func TestDaprPubSubBroker_ConvertDataModelToVersioned(t *testing.T) { - testCases := []struct { - desc string - file string - expected *DaprPubSubBrokerResource - }{ - { - desc: "Convert manually provisioned DaprPubSubBroker datamodel to versioned resource", - file: "daprpubsubbroker/daprpubsubbroker_manual_datamodel.json", - expected: &DaprPubSubBrokerResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &DaprPubSubBrokerProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - Metadata: map[string]any{ - "foo": "bar", - }, - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Resources: []*ResourceReference{ - { - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async"), - }, - }, - Type: to.Ptr("pubsub.azure.servicebus"), - Version: to.Ptr("v1"), - ComponentName: to.Ptr("test-dpsb"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb"), - Name: to.Ptr("test-dpsb"), - Type: to.Ptr(linkrp.DaprPubSubBrokersResourceType), - }, - }, - { - desc: "Convert DaprPubSubBroker datamodel provisioned by a recipe to versioned resource", - file: "daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json", - expected: &DaprPubSubBrokerResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &DaprPubSubBrokerProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - Recipe: &Recipe{ - Name: to.Ptr("dpsb-recipe"), - }, - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - ComponentName: to.Ptr("test-dpsb"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb"), - Name: to.Ptr("test-dpsb"), - Type: to.Ptr(linkrp.DaprPubSubBrokersResourceType), - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.DaprPubSubBroker{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &DaprPubSubBrokerResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } -} - -func TestDaprPubSubBroker_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &DaprPubSubBrokerResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion.go b/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion.go deleted file mode 100644 index 18d9b898e7..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "fmt" - "reflect" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned DaprSecretStore resource to version-agnostic datamodel and returns an error if the -// resourceProvisioning is set to manual and the required fields are not specified. -func (src *DaprSecretStoreResource) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - }, - } - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(src.Properties.ResourceProvisioning) - if err != nil { - return nil, err - } - - msgs := []string{} - if converted.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if src.Properties.Recipe != nil && (!reflect.ValueOf(*src.Properties.Recipe).IsZero()) { - msgs = append(msgs, "recipe details cannot be specified when resourceProvisioning is set to manual") - } - if src.Properties.Metadata == nil || len(src.Properties.Metadata) == 0 { - msgs = append(msgs, "metadata must be specified when resourceProvisioning is set to manual") - } - if src.Properties.Type == nil || *src.Properties.Type == "" { - msgs = append(msgs, "type must be specified when resourceProvisioning is set to manual") - } - if src.Properties.Version == nil || *src.Properties.Version == "" { - msgs = append(msgs, "version must be specified when resourceProvisioning is set to manual") - } - - converted.Properties.Metadata = src.Properties.Metadata - converted.Properties.Type = to.String(src.Properties.Type) - converted.Properties.Version = to.String(src.Properties.Version) - } else { - if src.Properties.Metadata != nil && (!reflect.ValueOf(src.Properties.Metadata).IsZero()) { - msgs = append(msgs, "metadata cannot be specified when resourceProvisioning is set to recipe (default)") - } - if src.Properties.Type != nil && (!reflect.ValueOf(*src.Properties.Type).IsZero()) { - msgs = append(msgs, "type cannot be specified when resourceProvisioning is set to recipe (default)") - } - if src.Properties.Version != nil && (!reflect.ValueOf(*src.Properties.Version).IsZero()) { - msgs = append(msgs, "version cannot be specified when resourceProvisioning is set to recipe (default)") - } - - converted.Properties.Recipe = toRecipeDataModel(src.Properties.Recipe) - } - if len(msgs) == 1 { - return nil, &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return nil, &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned DaprSecretStore resource. -func (dst *DaprSecretStoreResource) ConvertFrom(src v1.DataModelInterface) error { - daprSecretStore, ok := src.(*datamodel.DaprSecretStore) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(daprSecretStore.ID) - dst.Name = to.Ptr(daprSecretStore.Name) - dst.Type = to.Ptr(daprSecretStore.Type) - dst.SystemData = fromSystemDataModel(daprSecretStore.SystemData) - dst.Location = to.Ptr(daprSecretStore.Location) - dst.Tags = *to.StringMapPtr(daprSecretStore.Tags) - dst.Properties = &DaprSecretStoreProperties{ - ResourceProvisioning: fromResourceProvisioningDataModel(daprSecretStore.Properties.ResourceProvisioning), - ProvisioningState: fromProvisioningStateDataModel(daprSecretStore.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(daprSecretStore.Properties.Environment), - Application: to.Ptr(daprSecretStore.Properties.Application), - Type: to.Ptr(daprSecretStore.Properties.Type), - Version: to.Ptr(daprSecretStore.Properties.Version), - Metadata: daprSecretStore.Properties.Metadata, - ComponentName: to.Ptr(daprSecretStore.Properties.ComponentName), - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(daprSecretStore.Properties.Status.OutputResources), - }, - } - if daprSecretStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - dst.Properties.Metadata = daprSecretStore.Properties.Metadata - dst.Properties.Type = to.Ptr(daprSecretStore.Properties.Type) - dst.Properties.Version = to.Ptr(daprSecretStore.Properties.Version) - } else { - dst.Properties.Recipe = fromRecipeDataModel(daprSecretStore.Properties.Recipe) - } - return nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go deleted file mode 100644 index 5d35213ac2..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/daprsecretstore_conversion_test.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - - "github.com/stretchr/testify/require" -) - -func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { - testCases := []struct { - desc string - file string - expected *datamodel.DaprSecretStore - }{ - { - desc: "daprsecretstore manual resource", - file: "daprsecretstore_manual_resource.json", - expected: &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - Name: "test-dss", - Type: linkrp.DaprSecretStoresResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{ - "foo": "bar", - }, - Type: "secretstores.hashicorp.vault", - Version: "v1", - }, - }, - }, - { - desc: "daprsecretstore recipe resource", - file: "daprsecretstore_recipe_resource.json", - expected: &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - Name: "test-dss", - Type: linkrp.DaprSecretStoresResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{ - Name: "daprSecretStore", - Parameters: map[string]any{ - "foo": "bar", - }, - }, - }, - }, - }, - } - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture(tc.file) - versionedResource := &DaprSecretStoreResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.DaprSecretStore) - - require.Equal(t, tc.expected, convertedResource) - }) - } -} - -func TestDaprSecretStore_ConvertDataModelToVersioned(t *testing.T) { - testCases := []struct { - desc string - file string - expected *DaprSecretStoreResource - }{ - { - desc: "daprsecretstore manual resource data model", - file: "daprsecretstore_manual_resourcedatamodel.json", - expected: &DaprSecretStoreResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &DaprSecretStoreProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - Metadata: map[string]any{ - "foo": "bar", - }, - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Type: to.Ptr("secretstores.hashicorp.vault"), - Version: to.Ptr("v1"), - ComponentName: to.Ptr("test-dss"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss"), - Name: to.Ptr("test-dss"), - Type: to.Ptr(linkrp.DaprSecretStoresResourceType), - }, - }, - { - desc: "daprsecretstore recipe resource data model", - file: "daprsecretstore_recipe_resourcedatamodel.json", - expected: &DaprSecretStoreResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &DaprSecretStoreProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - Recipe: &Recipe{ - Name: to.Ptr("daprSecretStore"), - Parameters: map[string]any{ - "foo": "bar", - }, - }, - Type: to.Ptr("secretstores.hashicorp.vault"), - Version: to.Ptr("v1"), - Metadata: map[string]any{"foo": "bar"}, - ComponentName: to.Ptr("test-dss"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss"), - Name: to.Ptr("test-dss"), - Type: to.Ptr(linkrp.DaprSecretStoresResourceType), - }, - }, - } - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.DaprSecretStore{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &DaprSecretStoreResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } - -} - -func TestDaprSecretStore_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { - testset := []struct { - payload string - errType error - message string - }{ - { - "daprsecretstore_invalidvalues_resource.json", - &v1.ErrClientRP{}, - "code BadRequest: err multiple errors were found:\n\trecipe details cannot be specified when resourceProvisioning is set to manual\n\tmetadata must be specified when resourceProvisioning is set to manual\n\ttype must be specified when resourceProvisioning is set to manual\n\tversion must be specified when resourceProvisioning is set to manual", - }, - { - "daprsecretstore_invalidrecipe_resource.json", - &v1.ErrClientRP{}, - "code BadRequest: err multiple errors were found:\n\tmetadata cannot be specified when resourceProvisioning is set to recipe (default)\n\ttype cannot be specified when resourceProvisioning is set to recipe (default)\n\tversion cannot be specified when resourceProvisioning is set to recipe (default)", - }, - } - for _, test := range testset { - t.Run(test.payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(test.payload) - versionedResource := &DaprSecretStoreResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - require.Error(t, err) - require.Nil(t, dm) - require.IsType(t, test.errType, err) - require.Equal(t, test.message, err.Error()) - }) - } -} - -func TestDaprSecretStore_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &DaprSecretStoreResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion.go b/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion.go deleted file mode 100644 index c7ab73b3c6..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion.go +++ /dev/null @@ -1,134 +0,0 @@ -package v20220315privatepreview - -import ( - "fmt" - "reflect" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned DaprStateStore resource to version-agnostic datamodel and returns an error -// if the resourceProvisioning is set to manual and the required fields are not specified. -func (src *DaprStateStoreResource) ConvertTo() (v1.DataModelInterface, error) { - daprStateStoreProperties := datamodel.DaprStateStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - } - - trackedResource := v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - } - internalMetadata := v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - } - converted := &datamodel.DaprStateStore{} - converted.TrackedResource = trackedResource - converted.InternalMetadata = internalMetadata - converted.Properties = daprStateStoreProperties - - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(src.Properties.ResourceProvisioning) - if err != nil { - return nil, err - } - - converted.Properties.Resources = toResourcesDataModel(src.Properties.Resources) - - // Note: The metadata, type, and version fields cannot be specified when using recipes since - // the recipe is expected to create the Dapr Component manifest. However, they are required - // when resourceProvisioning is set to manual. - msgs := []string{} - if converted.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if src.Properties.Recipe != nil && (!reflect.ValueOf(*src.Properties.Recipe).IsZero()) { - msgs = append(msgs, "recipe details cannot be specified when resourceProvisioning is set to manual") - } - if src.Properties.Metadata == nil || len(src.Properties.Metadata) == 0 { - msgs = append(msgs, "metadata must be specified when resourceProvisioning is set to manual") - } - if src.Properties.Type == nil || *src.Properties.Type == "" { - msgs = append(msgs, "type must be specified when resourceProvisioning is set to manual") - } - if src.Properties.Version == nil || *src.Properties.Version == "" { - msgs = append(msgs, "version must be specified when resourceProvisioning is set to manual") - } - - converted.Properties.Metadata = src.Properties.Metadata - converted.Properties.Type = to.String(src.Properties.Type) - converted.Properties.Version = to.String(src.Properties.Version) - } else { - if src.Properties.Metadata != nil && (!reflect.ValueOf(src.Properties.Metadata).IsZero()) { - msgs = append(msgs, "metadata cannot be specified when resourceProvisioning is set to recipe (default)") - } - if src.Properties.Type != nil && (!reflect.ValueOf(*src.Properties.Type).IsZero()) { - msgs = append(msgs, "type cannot be specified when resourceProvisioning is set to recipe (default)") - } - if src.Properties.Version != nil && (!reflect.ValueOf(*src.Properties.Version).IsZero()) { - msgs = append(msgs, "version cannot be specified when resourceProvisioning is set to recipe (default)") - } - - converted.Properties.Recipe = toRecipeDataModel(src.Properties.Recipe) - } - - if len(msgs) == 1 { - return nil, &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return nil, &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned DaprStateStore resource and returns an error if the -// conversion fails. -func (dst *DaprStateStoreResource) ConvertFrom(src v1.DataModelInterface) error { - daprStateStore, ok := src.(*datamodel.DaprStateStore) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(daprStateStore.ID) - dst.Name = to.Ptr(daprStateStore.Name) - dst.Type = to.Ptr(daprStateStore.Type) - dst.SystemData = fromSystemDataModel(daprStateStore.SystemData) - dst.Location = to.Ptr(daprStateStore.Location) - dst.Tags = *to.StringMapPtr(daprStateStore.Tags) - dst.Properties = &DaprStateStoreProperties{ - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(daprStateStore.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(daprStateStore.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(daprStateStore.Properties.Environment), - Application: to.Ptr(daprStateStore.Properties.Application), - ComponentName: to.Ptr(daprStateStore.Properties.ComponentName), - ResourceProvisioning: fromResourceProvisioningDataModel(daprStateStore.Properties.ResourceProvisioning), - Resources: fromResourcesDataModel(daprStateStore.Properties.Resources), - } - - if daprStateStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - dst.Properties.Type = to.Ptr(daprStateStore.Properties.Type) - dst.Properties.Version = to.Ptr(daprStateStore.Properties.Version) - dst.Properties.Metadata = daprStateStore.Properties.Metadata - } else { - dst.Properties.Recipe = fromRecipeDataModel(daprStateStore.Properties.Recipe) - } - - return nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go deleted file mode 100644 index 50ee76f619..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/daprstatestore_conversion_test.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -func TestDaprStateStore_ConvertVersionedToDataModel(t *testing.T) { - testset := []string{ - "daprstatestore_values_resource.json", - "daprstatestore_recipe_resource.json", - } - - for _, payload := range testset { - t.Run(payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(payload) - versionedResource := &DaprStateStoreResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - - require.NoError(t, err) - convertedResource := dm.(*datamodel.DaprStateStore) - - expected := &datamodel.DaprStateStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - Name: "daprStateStore0", - Type: linkrp.DaprStateStoresResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.DaprStateStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - }, - } - if payload == "daprstatestore_values_resource.json" { - expected.Properties.ResourceProvisioning = linkrp.ResourceProvisioningManual - expected.Properties.Type = "state.zookeeper" - expected.Properties.Version = "v1" - expected.Properties.Metadata = map[string]any{ - "foo": "bar", - } - expected.Properties.Resources = []*linkrp.ResourceReference{ - { - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", - }, - } - } else if payload == "daprstatestore_recipe_resource.json" { - expected.Properties.ResourceProvisioning = linkrp.ResourceProvisioningRecipe - expected.Properties.Recipe.Name = "recipe-test" - } - - require.Equal(t, expected, convertedResource) - }) - } -} - -func TestDaprStateStore_ConvertVersionedToDataModel_Invalid(t *testing.T) { - testset := []struct { - payload string - errType error - message string - }{ - {"daprstatestore_invalidvalues_resource.json", &v1.ErrClientRP{}, "code BadRequest: err multiple errors were found:\n\trecipe details cannot be specified when resourceProvisioning is set to manual\n\tmetadata must be specified when resourceProvisioning is set to manual\n\ttype must be specified when resourceProvisioning is set to manual\n\tversion must be specified when resourceProvisioning is set to manual"}, - {"daprstatestore_invalidrecipe_resource.json", &v1.ErrClientRP{}, "code BadRequest: err multiple errors were found:\n\tmetadata cannot be specified when resourceProvisioning is set to recipe (default)\n\ttype cannot be specified when resourceProvisioning is set to recipe (default)\n\tversion cannot be specified when resourceProvisioning is set to recipe (default)"}, - } - - for _, test := range testset { - t.Run(test.payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(test.payload) - versionedResource := &DaprStateStoreResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - require.Error(t, err) - require.Nil(t, dm) - require.IsType(t, test.errType, err) - require.Equal(t, test.message, err.Error()) - }) - } -} - -func TestDaprStateStore_ConvertDataModelToVersioned(t *testing.T) { - testset := []string{ - "daprstatestore_values_resourcedatamodel.json", - "daprstatestore_recipe_resourcedatamodel.json", - } - - for _, payload := range testset { - t.Run(payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(payload) - resource := &datamodel.DaprStateStore{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &DaprStateStoreResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - expected := &DaprStateStoreResource{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0"), - Name: to.Ptr("daprStateStore0"), - Type: to.Ptr(linkrp.DaprStateStoresResourceType), - Location: to.Ptr(v1.LocationGlobal), - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - Properties: &DaprStateStoreProperties{ - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - ComponentName: to.Ptr("daprStateStore0"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - } - - if payload == "daprstatestore_values_resourcedatamodel.json" { - expected.Properties.ResourceProvisioning = to.Ptr(ResourceProvisioningManual) - expected.Properties.Type = to.Ptr("state.zookeeper") - expected.Properties.Version = to.Ptr("v1") - expected.Properties.Metadata = map[string]any{ - "foo": "bar", - } - expected.Properties.Resources = []*ResourceReference{ - { - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase"), - }, - } - } else if payload == "daprstatestore_recipe_resourcedatamodel.json" { - expected.Properties.ResourceProvisioning = to.Ptr(ResourceProvisioningRecipe) - expected.Properties.Recipe = &Recipe{ - Name: to.Ptr("recipe-test"), - } - } - - require.Equal(t, expected, versionedResource) - }) - } -} - -func TestDaprStateStore_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &DaprStateStoreResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/datamodel_util.go b/pkg/linkrp/api/v20220315privatepreview/datamodel_util.go deleted file mode 100644 index 6f77b73d4e..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/datamodel_util.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "fmt" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/to" -) - -// DefaultRecipeName represents the default recipe name. -const DefaultRecipeName = "default" - -func toProvisioningStateDataModel(state *ProvisioningState) v1.ProvisioningState { - if state == nil { - return v1.ProvisioningStateAccepted - } - - switch *state { - case ProvisioningStateUpdating: - return v1.ProvisioningStateUpdating - case ProvisioningStateDeleting: - return v1.ProvisioningStateDeleting - case ProvisioningStateAccepted: - return v1.ProvisioningStateAccepted - case ProvisioningStateSucceeded: - return v1.ProvisioningStateSucceeded - case ProvisioningStateFailed: - return v1.ProvisioningStateFailed - case ProvisioningStateCanceled: - return v1.ProvisioningStateCanceled - case ProvisioningStateProvisioning: - return v1.ProvisioningStateProvisioning - default: - return v1.ProvisioningStateAccepted - } -} - -func fromProvisioningStateDataModel(state v1.ProvisioningState) *ProvisioningState { - var converted ProvisioningState - switch state { - case v1.ProvisioningStateUpdating: - converted = ProvisioningStateUpdating - case v1.ProvisioningStateDeleting: - converted = ProvisioningStateDeleting - case v1.ProvisioningStateAccepted: - converted = ProvisioningStateAccepted - case v1.ProvisioningStateSucceeded: - converted = ProvisioningStateSucceeded - case v1.ProvisioningStateFailed: - converted = ProvisioningStateFailed - case v1.ProvisioningStateCanceled: - converted = ProvisioningStateCanceled - default: - converted = ProvisioningStateAccepted - } - - return &converted -} - -func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (linkrp.ResourceProvisioning, error) { - if provisioning == nil { - return linkrp.ResourceProvisioningRecipe, nil - } - switch *provisioning { - case ResourceProvisioningManual: - return linkrp.ResourceProvisioningManual, nil - case ResourceProvisioningRecipe: - return linkrp.ResourceProvisioningRecipe, nil - default: - return "", &v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} - } -} - -func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) *ResourceProvisioning { - var converted ResourceProvisioning - switch provisioning { - case linkrp.ResourceProvisioningManual: - converted = ResourceProvisioningManual - default: - converted = ResourceProvisioningRecipe - } - - return &converted -} - -func fromSystemDataModel(s v1.SystemData) *SystemData { - return &SystemData{ - CreatedBy: to.Ptr(s.CreatedBy), - CreatedByType: (*CreatedByType)(to.Ptr(s.CreatedByType)), - CreatedAt: UnmarshalTimeString(s.CreatedAt), - LastModifiedBy: to.Ptr(s.LastModifiedBy), - LastModifiedByType: (*CreatedByType)(to.Ptr(s.LastModifiedByType)), - LastModifiedAt: UnmarshalTimeString(s.LastModifiedAt), - } -} - -func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { - if r == nil { - return linkrp.LinkRecipe{ - Name: DefaultRecipeName, - } - } - recipe := linkrp.LinkRecipe{} - if r.Name == nil { - recipe.Name = DefaultRecipeName - } else { - recipe.Name = to.String(r.Name) - } - if r.Parameters != nil { - recipe.Parameters = r.Parameters - } - return recipe -} - -func fromRecipeDataModel(r linkrp.LinkRecipe) *Recipe { - return &Recipe{ - Name: to.Ptr(r.Name), - Parameters: r.Parameters, - } -} - -func toResourcesDataModel(r []*ResourceReference) []*linkrp.ResourceReference { - if r == nil { - return nil - } - resources := make([]*linkrp.ResourceReference, len(r)) - for i, resource := range r { - resources[i] = &linkrp.ResourceReference{ - ID: to.String(resource.ID), - } - } - return resources -} - -func fromResourcesDataModel(r []*linkrp.ResourceReference) []*ResourceReference { - if r == nil { - return nil - } - resources := make([]*ResourceReference, len(r)) - for i, resource := range r { - resources[i] = &ResourceReference{ - ID: to.Ptr(resource.ID), - } - } - return resources -} diff --git a/pkg/linkrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/linkrp/api/v20220315privatepreview/datamodel_util_test.go deleted file mode 100644 index 77e5188b50..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/datamodel_util_test.go +++ /dev/null @@ -1,272 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "fmt" - "testing" - "time" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/to" - - "github.com/stretchr/testify/require" -) - -func TestToProvisioningStateDataModel(t *testing.T) { - stateTests := []struct { - versioned ProvisioningState - datamodel v1.ProvisioningState - }{ - {ProvisioningStateUpdating, v1.ProvisioningStateUpdating}, - {ProvisioningStateDeleting, v1.ProvisioningStateDeleting}, - {ProvisioningStateAccepted, v1.ProvisioningStateAccepted}, - {ProvisioningStateSucceeded, v1.ProvisioningStateSucceeded}, - {ProvisioningStateFailed, v1.ProvisioningStateFailed}, - {ProvisioningStateCanceled, v1.ProvisioningStateCanceled}, - {"", v1.ProvisioningStateAccepted}, - } - - for _, tt := range stateTests { - sc := toProvisioningStateDataModel(&tt.versioned) - require.Equal(t, tt.datamodel, sc) - } -} - -func TestFromProvisioningStateDataModel(t *testing.T) { - testCases := []struct { - datamodel v1.ProvisioningState - versioned ProvisioningState - }{ - {v1.ProvisioningStateUpdating, ProvisioningStateUpdating}, - {v1.ProvisioningStateDeleting, ProvisioningStateDeleting}, - {v1.ProvisioningStateAccepted, ProvisioningStateAccepted}, - {v1.ProvisioningStateSucceeded, ProvisioningStateSucceeded}, - {v1.ProvisioningStateFailed, ProvisioningStateFailed}, - {v1.ProvisioningStateCanceled, ProvisioningStateCanceled}, - {"", ProvisioningStateAccepted}, - } - - for _, testCase := range testCases { - sc := fromProvisioningStateDataModel(testCase.datamodel) - require.Equal(t, testCase.versioned, *sc) - } -} - -func TestUnmarshalTimeString(t *testing.T) { - parsedTime := UnmarshalTimeString("2021-09-24T19:09:00.000000Z") - require.NotNil(t, parsedTime) - - require.Equal(t, 2021, parsedTime.Year()) - require.Equal(t, time.Month(9), parsedTime.Month()) - require.Equal(t, 24, parsedTime.Day()) - - parsedTime = UnmarshalTimeString("") - require.NotNil(t, parsedTime) - require.Equal(t, 1, parsedTime.Year()) -} - -func TestFromSystemDataModel(t *testing.T) { - systemDataTests := []v1.SystemData{ - { - CreatedBy: "", - CreatedByType: "", - CreatedAt: "", - LastModifiedBy: "", - LastModifiedByType: "", - LastModifiedAt: "", - }, { - CreatedBy: "fakeid@live.com", - CreatedByType: "", - CreatedAt: "2021-09-24T19:09:00Z", - LastModifiedBy: "fakeid@live.com", - LastModifiedByType: "", - LastModifiedAt: "2021-09-25T19:09:00Z", - }, { - CreatedBy: "fakeid@live.com", - CreatedByType: "User", - CreatedAt: "2021-09-24T19:09:00Z", - LastModifiedBy: "fakeid@live.com", - LastModifiedByType: "User", - LastModifiedAt: "2021-09-25T19:09:00Z", - }, - } - - for _, tt := range systemDataTests { - versioned := fromSystemDataModel(tt) - require.Equal(t, tt.CreatedBy, string(*versioned.CreatedBy)) - require.Equal(t, tt.CreatedByType, string(*versioned.CreatedByType)) - c, err := versioned.CreatedAt.MarshalText() - require.NoError(t, err) - if tt.CreatedAt == "" { - tt.CreatedAt = "0001-01-01T00:00:00Z" - } - require.Equal(t, tt.CreatedAt, string(c)) - - require.Equal(t, tt.LastModifiedBy, string(*versioned.LastModifiedBy)) - require.Equal(t, tt.LastModifiedByType, string(*versioned.LastModifiedByType)) - c, err = versioned.LastModifiedAt.MarshalText() - require.NoError(t, err) - if tt.LastModifiedAt == "" { - tt.LastModifiedAt = "0001-01-01T00:00:00Z" - } - require.Equal(t, tt.LastModifiedAt, string(c)) - } -} - -func TestToResourcesDataModel(t *testing.T) { - testset := []struct { - DMResources []*linkrp.ResourceReference - VersionedResources []*ResourceReference - }{ - { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, - VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, - }, - { - DMResources: []*linkrp.ResourceReference{}, - VersionedResources: []*ResourceReference{}, - }, - } - - for _, tt := range testset { - dm := toResourcesDataModel(tt.VersionedResources) - require.Equal(t, tt.DMResources, dm) - - } -} - -func TestFromResourcesDataModel(t *testing.T) { - testset := []struct { - DMResources []*linkrp.ResourceReference - VersionedResources []*ResourceReference - }{ - { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, - VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, - }, - { - DMResources: []*linkrp.ResourceReference{}, - VersionedResources: []*ResourceReference{}, - }, - } - - for _, tt := range testset { - versioned := fromResourcesDataModel(tt.DMResources) - require.Equal(t, tt.VersionedResources, versioned) - - } -} - -func TestToResourceProvisiongDataModel(t *testing.T) { - testset := []struct { - versioned ResourceProvisioning - datamodel linkrp.ResourceProvisioning - err error - }{ - { - ResourceProvisioningManual, - linkrp.ResourceProvisioningManual, - nil, - }, - { - ResourceProvisioningRecipe, - linkrp.ResourceProvisioningRecipe, - nil, - }, - { - "", - "", - &v1.ErrModelConversion{ - PropertyName: "$.properties.resourceProvisioning", - ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues()), - }, - }, - } - for _, tt := range testset { - sc, err := toResourceProvisiongDataModel(&tt.versioned) - - if tt.err != nil { - require.EqualError(t, err, tt.err.Error()) - continue - } - - require.NoError(t, err) - require.Equal(t, tt.datamodel, sc) - } -} - -func TestFromResourceProvisiongDataModel(t *testing.T) { - testCases := []struct { - datamodel linkrp.ResourceProvisioning - versioned ResourceProvisioning - }{ - {linkrp.ResourceProvisioningManual, ResourceProvisioningManual}, - {linkrp.ResourceProvisioningRecipe, ResourceProvisioningRecipe}, - {"", ResourceProvisioningRecipe}, - } - - for _, testCase := range testCases { - sc := fromResourceProvisioningDataModel(testCase.datamodel) - require.Equal(t, testCase.versioned, *sc) - } -} -func TestToRecipeDataModel(t *testing.T) { - testset := []struct { - versioned *Recipe - datamodel linkrp.LinkRecipe - }{ - { - nil, - linkrp.LinkRecipe{ - Name: DefaultRecipeName, - }, - }, - { - &Recipe{ - Name: to.Ptr("test"), - Parameters: map[string]any{ - "foo": "bar", - }, - }, - linkrp.LinkRecipe{ - Name: "test", - Parameters: map[string]any{ - "foo": "bar", - }, - }, - }, - { - &Recipe{ - Parameters: map[string]any{ - "foo": "bar", - }, - }, - linkrp.LinkRecipe{ - Name: DefaultRecipeName, - Parameters: map[string]any{ - "foo": "bar", - }, - }, - }, - } - for _, testCase := range testset { - sc := toRecipeDataModel(testCase.versioned) - require.Equal(t, testCase.datamodel, sc) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/extender_conversion.go b/pkg/linkrp/api/v20220315privatepreview/extender_conversion.go deleted file mode 100644 index 6538ae151a..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/extender_conversion.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned Extender resource to version-agnostic datamodel and returns it, or an error if the -// conversion fails. -func (src *ExtenderResource) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.Extender{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - }, - Properties: datamodel.ExtenderProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - AdditionalProperties: src.Properties.AdditionalProperties, - Secrets: src.Properties.Secrets, - Recipe: toRecipeDataModel(src.Properties.Recipe), - }, - } - - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(src.Properties.ResourceProvisioning) - if err != nil { - return nil, err - } - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned Extender resource and returns an error if the conversion fails. -func (dst *ExtenderResource) ConvertFrom(src v1.DataModelInterface) error { - extender, ok := src.(*datamodel.Extender) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(extender.ID) - dst.Name = to.Ptr(extender.Name) - dst.Type = to.Ptr(extender.Type) - dst.SystemData = fromSystemDataModel(extender.SystemData) - dst.Location = to.Ptr(extender.Location) - dst.Tags = *to.StringMapPtr(extender.Tags) - dst.Properties = &ExtenderProperties{ - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(extender.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(extender.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(extender.Properties.Environment), - Application: to.Ptr(extender.Properties.Application), - AdditionalProperties: extender.Properties.AdditionalProperties, - Recipe: fromRecipeDataModel(extender.Properties.Recipe), - ResourceProvisioning: fromResourceProvisioningDataModel(extender.Properties.ResourceProvisioning), - // Secrets are omitted. - } - return nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go deleted file mode 100644 index d0fa6c1fd1..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/extender_conversion_test.go +++ /dev/null @@ -1,252 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -func TestExtender_ConvertVersionedToDataModel(t *testing.T) { - testset := []struct { - desc string - file string - expected *datamodel.Extender - }{ - { - desc: "extender resource provisioning manual", - file: "extender_manual.json", - expected: &datamodel.Extender{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - Name: "extender0", - Type: linkrp.ExtendersResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.ExtenderProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Secrets: map[string]any{"accountSid": "sid", "authToken": "token"}, - Recipe: linkrp.LinkRecipe{Name: "default"}, - }, - }, - }, - { - desc: "extender resource provisioning manual (no secrets)", - file: "extender_manual_nosecrets.json", - expected: &datamodel.Extender{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - Name: "extender0", - Type: linkrp.ExtendersResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.ExtenderProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Recipe: linkrp.LinkRecipe{Name: "default"}, - }, - }, - }, - { - desc: "extender resource recipe", - file: "extender_recipe.json", - expected: &datamodel.Extender{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - Name: "extender0", - Type: linkrp.ExtendersResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.ExtenderProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{Name: "test-recipe"}, - }, - }, - }, - } - - for _, payload := range testset { - // arrange - rawPayload := testutil.ReadFixture(payload.file) - versionedResource := &ExtenderResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.Extender) - - require.Equal(t, payload.expected, convertedResource) - } -} - -func TestExtender_ConvertDataModelToVersioned(t *testing.T) { - testset := []struct { - desc string - file string - expected *ExtenderResource - }{ - { - desc: "extender resource provisioning manual datamodel", - file: "extenderdatamodel_manual.json", - expected: &ExtenderResource{ - Location: to.Ptr(""), - Properties: &ExtenderProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0"), - Name: to.Ptr("extender0"), - Type: to.Ptr(linkrp.ExtendersResourceType), - }, - }, - { - desc: "extender resource provisioning manual datamodel (no secrets)", - file: "extenderdatamodel_manual_nosecrets.json", - expected: &ExtenderResource{ - Location: to.Ptr(""), - Properties: &ExtenderProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0"), - Name: to.Ptr("extender0"), - Type: to.Ptr(linkrp.ExtendersResourceType), - }, - }, - { - desc: "extender resource recipe datamodel", - file: "extenderdatamodel_recipe.json", - expected: &ExtenderResource{ - Location: to.Ptr(""), - Properties: &ExtenderProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr("test-recipe"), Parameters: nil}, - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0"), - Name: to.Ptr("extender0"), - Type: to.Ptr(linkrp.ExtendersResourceType), - }, - }, - } - - for _, tc := range testset { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.Extender{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &ExtenderResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } -} - -func TestExtender_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &ExtenderResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion.go b/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion.go deleted file mode 100644 index 494ad3d7ad..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned MongoDatabase resource to version-agnostic datamodel and returns it, -// returning an error if any of the inputs are invalid. -func (src *MongoDatabaseResource) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.MongoDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - }, - Properties: datamodel.MongoDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - }, - } - v := src.Properties - - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(v.ResourceProvisioning) - if err != nil { - return nil, err - } - - converted.Properties.Resources = toResourcesDataModel(v.Resources) - converted.Properties.Host = to.String(v.Host) - converted.Properties.Port = to.Int32(v.Port) - converted.Properties.Database = to.String(v.Database) - converted.Properties.Username = to.String(v.Username) - if v.Secrets != nil { - converted.Properties.Secrets = datamodel.MongoDatabaseSecrets{ - ConnectionString: to.String(v.Secrets.ConnectionString), - Password: to.String(v.Secrets.Password), - } - } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - converted.Properties.Recipe = toRecipeDataModel(v.Recipe) - } - - if err = converted.VerifyInputs(); err != nil { - return nil, err - } - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned MongoDatabase resource. It returns an error if the -// DataModelInterface is not a MongoDatabase. -func (dst *MongoDatabaseResource) ConvertFrom(src v1.DataModelInterface) error { - mongo, ok := src.(*datamodel.MongoDatabase) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(mongo.ID) - dst.Name = to.Ptr(mongo.Name) - dst.Type = to.Ptr(mongo.Type) - dst.SystemData = fromSystemDataModel(mongo.SystemData) - dst.Location = to.Ptr(mongo.Location) - dst.Tags = *to.StringMapPtr(mongo.Tags) - - dst.Properties = &MongoDatabaseProperties{ - Resources: fromResourcesDataModel(mongo.Properties.Resources), - Host: to.Ptr(mongo.Properties.Host), - Port: to.Ptr(mongo.Properties.Port), - Database: to.Ptr(mongo.Properties.Database), - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(mongo.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(mongo.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(mongo.Properties.Environment), - Application: to.Ptr(mongo.Properties.Application), - Recipe: fromRecipeDataModel(mongo.Properties.Recipe), - ResourceProvisioning: fromResourceProvisioningDataModel(mongo.Properties.ResourceProvisioning), - Username: to.Ptr(mongo.Properties.Username), - } - - return nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned MongoDatabaseSecrets instance and returns an error if -// the conversion fails. -func (dst *MongoDatabaseSecrets) ConvertFrom(src v1.DataModelInterface) error { - mongoSecrets, ok := src.(*datamodel.MongoDatabaseSecrets) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ConnectionString = to.Ptr(mongoSecrets.ConnectionString) - dst.Password = to.Ptr(mongoSecrets.Password) - - return nil -} - -// ConvertTo converts from the versioned MongoDatabaseSecrets instance to version-agnostic datamodel. -func (src *MongoDatabaseSecrets) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.MongoDatabaseSecrets{ - ConnectionString: to.String(src.ConnectionString), - Password: to.String(src.Password), - } - return converted, nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go deleted file mode 100644 index 8ac4aa1c40..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ /dev/null @@ -1,387 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { - testset := []struct { - file string - desc string - expected *datamodel.MongoDatabase - }{ - { - // Opt-out with resources - file: "mongodatabaseresource2.json", - desc: "mongodb resource provisioning manual (with resources)", - expected: &datamodel.MongoDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - Name: "mongo0", - Type: linkrp.MongoDatabasesResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.MongoDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Host: "testAccount.mongo.cosmos.azure.com", - Port: 10255, - Database: "test-database", - Resources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}}, - }, - }, - }, - { - desc: "mongodb resource named recipe", - file: "mongodatabaseresource_recipe.json", - expected: &datamodel.MongoDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - Name: "mongo0", - Type: linkrp.MongoDatabasesResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.MongoDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Host: "testAccount.mongo.cosmos.azure.com", - Port: 10255, - Recipe: linkrp.LinkRecipe{Name: "cosmosdb", Parameters: map[string]interface{}{"foo": "bar"}}, - }, - }, - }, - { - desc: "mongodb resource default recipe with overriden values", - file: "mongodatabaseresource_recipe2.json", - expected: &datamodel.MongoDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - Name: "mongo0", - Type: linkrp.MongoDatabasesResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.MongoDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Host: "mynewhost.com", - Port: 10256, - Recipe: linkrp.LinkRecipe{Name: DefaultRecipeName, Parameters: nil}, - }, - }, - }, - { - desc: "mongodb resource provisioning manual (without resources)", - file: "mongodatabaseresource.json", - expected: &datamodel.MongoDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - Name: "mongo0", - Type: linkrp.MongoDatabasesResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.MongoDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Host: "testAccount.mongo.cosmos.azure.com", - Port: 10255, - Database: "test-database", - Username: "testUser", - Secrets: datamodel.MongoDatabaseSecrets{ - Password: "testPassword", - ConnectionString: "test-connection-string", - }, - }, - }, - }, - } - for _, tc := range testset { - // arrange - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - versionedResource := &MongoDatabaseResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.MongoDatabase) - - require.Equal(t, tc.expected, convertedResource) - }) - } -} - -func TestMongoDatabase_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { - testset := []struct { - payload string - errType error - message string - }{ - { - payload: "mongodatabaseresource-invalidresprovisioning.json", - errType: &v1.ErrModelConversion{}, - message: "$.properties.resourceProvisioning must be one of [manual recipe].", - }, - { - payload: "mongodatabaseresource-missinginputs.json", - errType: &v1.ErrClientRP{}, - message: "code BadRequest: err multiple errors were found:\n\thost must be specified when resourceProvisioning is set to manual\n\tport must be specified when resourceProvisioning is set to manual\n\tdatabase must be specified when resourceProvisioning is set to manual", - }, - } - for _, test := range testset { - t.Run(test.payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(test.payload) - versionedResource := &MongoDatabaseResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - require.Error(t, err) - require.Nil(t, dm) - require.IsType(t, test.errType, err) - require.Equal(t, test.message, err.Error()) - }) - } -} - -func TestMongoDatabase_ConvertDataModelToVersioned(t *testing.T) { - testset := []struct { - file string - desc string - expected *MongoDatabaseResource - }{ - { - desc: "mongodb resource provisioning manual datamodel (without resources)", - file: "mongodatabaseresourcedatamodel.json", - expected: &MongoDatabaseResource{ - Location: to.Ptr(""), - Properties: &MongoDatabaseProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Host: to.Ptr("testAccount1.mongo.cosmos.azure.com"), - Port: to.Ptr(int32(10255)), - Database: to.Ptr("test-database"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - Username: to.Ptr("testUser"), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0"), - Name: to.Ptr("mongo0"), - Type: to.Ptr(linkrp.MongoDatabasesResourceType), - }, - }, - { - desc: "mongodb resource provisioning manual datamodel (with resources)", - file: "mongodatabaseresourcedatamodel2.json", - expected: &MongoDatabaseResource{ - Location: to.Ptr(""), - Properties: &MongoDatabaseProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Host: to.Ptr("testAccount1.mongo.cosmos.azure.com"), - Port: to.Ptr(int32(10255)), - Database: to.Ptr("test-database"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - Resources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db")}}, - Username: to.Ptr(""), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0"), - Name: to.Ptr("mongo0"), - Type: to.Ptr(linkrp.MongoDatabasesResourceType), - }, - }, - { - // Named recipe - desc: "mongodb named recipe datamodel", - file: "mongodatabaseresourcedatamodel_recipe.json", - expected: &MongoDatabaseResource{ - Location: to.Ptr(""), - Properties: &MongoDatabaseProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication"), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - Host: to.Ptr("testAccount1.mongo.cosmos.azure.com"), - Port: to.Ptr(int32(10255)), - Database: to.Ptr(""), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr("cosmosdb"), Parameters: map[string]interface{}{"foo": "bar"}}, - Username: to.Ptr(""), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0"), - Name: to.Ptr("mongo0"), - Type: to.Ptr(linkrp.MongoDatabasesResourceType), - }, - }, - } - for _, tc := range testset { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.MongoDatabase{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &MongoDatabaseResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } -} - -func TestMongoDatabase_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &MongoDatabaseResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} - -func TestMongoDatabaseSecrets_ConvertVersionedToDataModel(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("mongodatabasesecrets.json") - versioned := &MongoDatabaseSecrets{} - err := json.Unmarshal(rawPayload, versioned) - require.NoError(t, err) - - // act - dm, err := versioned.ConvertTo() - - // assert - require.NoError(t, err) - converted := dm.(*datamodel.MongoDatabaseSecrets) - require.Equal(t, "test-connection-string", converted.ConnectionString) - require.Equal(t, "testPassword", converted.Password) -} - -func TestMongoDatabaseSecrets_ConvertDataModelToVersioned(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("mongodatabasesecretsdatamodel.json") - secrets := &datamodel.MongoDatabaseSecrets{} - err := json.Unmarshal(rawPayload, secrets) - require.NoError(t, err) - - // act - versionedResource := &MongoDatabaseSecrets{} - err = versionedResource.ConvertFrom(secrets) - - // assert - require.NoError(t, err) - require.Equal(t, "test-connection-string", secrets.ConnectionString) - require.Equal(t, "testPassword", secrets.Password) -} - -func TestMongoDatabaseSecrets_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &MongoDatabaseSecrets{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion.go b/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion.go deleted file mode 100644 index d3adec9a1d..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned RabbitMQMessageQueue resource to version-agnostic datamodel -// and returns an error if the inputs are invalid. -func (src *RabbitMQMessageQueueResource) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.RabbitMQMessageQueue{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - }, - Properties: datamodel.RabbitMQMessageQueueProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - }, - } - properties := src.Properties - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(properties.ResourceProvisioning) - if err != nil { - return nil, err - } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - converted.Properties.Recipe = toRecipeDataModel(properties.Recipe) - } - converted.Properties.Resources = toResourcesDataModel(properties.Resources) - converted.Properties.Host = to.String(properties.Host) - converted.Properties.Port = to.Int32(properties.Port) - converted.Properties.Username = to.String(properties.Username) - converted.Properties.Queue = to.String(properties.Queue) - converted.Properties.VHost = to.String(properties.VHost) - converted.Properties.TLS = to.Bool(properties.TLS) - err = converted.VerifyInputs() - if err != nil { - return nil, err - } - - if src.Properties.Secrets != nil { - converted.Properties.Secrets = datamodel.RabbitMQSecrets{ - URI: to.String(src.Properties.Secrets.URI), - Password: to.String(properties.Secrets.Password), - } - } - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned RabbitMQMessageQueue resource, -// and returns an error if the source is not a valid datamodel.RabbitMQMessageQueue. -func (dst *RabbitMQMessageQueueResource) ConvertFrom(src v1.DataModelInterface) error { - rabbitmq, ok := src.(*datamodel.RabbitMQMessageQueue) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(rabbitmq.ID) - dst.Name = to.Ptr(rabbitmq.Name) - dst.Type = to.Ptr(rabbitmq.Type) - dst.SystemData = fromSystemDataModel(rabbitmq.SystemData) - dst.Location = to.Ptr(rabbitmq.Location) - dst.Tags = *to.StringMapPtr(rabbitmq.Tags) - dst.Properties = &RabbitMQMessageQueueProperties{ - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(rabbitmq.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(rabbitmq.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(rabbitmq.Properties.Environment), - Application: to.Ptr(rabbitmq.Properties.Application), - ResourceProvisioning: fromResourceProvisioningDataModel(rabbitmq.Properties.ResourceProvisioning), - Queue: to.Ptr(rabbitmq.Properties.Queue), - Host: to.Ptr(rabbitmq.Properties.Host), - Port: to.Ptr(rabbitmq.Properties.Port), - VHost: to.Ptr(rabbitmq.Properties.VHost), - Username: to.Ptr(rabbitmq.Properties.Username), - Resources: fromResourcesDataModel(rabbitmq.Properties.Resources), - TLS: to.Ptr(rabbitmq.Properties.TLS), - } - if rabbitmq.Properties.ResourceProvisioning == linkrp.ResourceProvisioningRecipe { - dst.Properties.Recipe = fromRecipeDataModel(rabbitmq.Properties.Recipe) - } - return nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned RabbitmqSecrets instance -// and returns an error if the conversion fails. -func (dst *RabbitMQSecrets) ConvertFrom(src v1.DataModelInterface) error { - rabbitMQSecrets, ok := src.(*datamodel.RabbitMQSecrets) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.URI = to.Ptr(rabbitMQSecrets.URI) - dst.Password = to.Ptr(rabbitMQSecrets.Password) - return nil -} - -// ConvertTo converts from the versioned RabbitMQSecrets instance to version-agnostic datamodel. -func (src *RabbitMQSecrets) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.RabbitMQSecrets{ - URI: to.String(src.URI), - Password: to.String(src.Password), - } - return converted, nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go deleted file mode 100644 index 8f339628b4..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/rabbitmq_conversion_test.go +++ /dev/null @@ -1,317 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -func TestRabbitMQMessageQueue_ConvertVersionedToDataModel(t *testing.T) { - testCases := []struct { - desc string - file string - expected *datamodel.RabbitMQMessageQueue - }{ - { - desc: "rabbitmq manual resource", - file: "rabbitmq_manual_resource.json", - expected: &datamodel.RabbitMQMessageQueue{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - Name: "rabbitmq0", - Type: linkrp.RabbitMQMessageQueuesResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.RabbitMQMessageQueueProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Queue: "testQueue", - Host: "test-host", - VHost: "test-vhost", - Port: 5672, - Username: "test-user", - TLS: true, - Secrets: datamodel.RabbitMQSecrets{ - URI: "connection://string", - Password: "password", - }, - }, - }, - }, - { - desc: "rabbitmq recipe resource", - file: "rabbitmq_recipe_resource.json", - expected: &datamodel.RabbitMQMessageQueue{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - Name: "rabbitmq0", - Type: linkrp.RabbitMQMessageQueuesResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.RabbitMQMessageQueueProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - TLS: false, - Recipe: linkrp.LinkRecipe{ - Name: "rabbitmq", - Parameters: map[string]any{ - "foo": "bar", - }, - }, - }, - }, - }, - } - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture(tc.file) - versionedResource := &RabbitMQMessageQueueResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.RabbitMQMessageQueue) - - require.Equal(t, tc.expected, convertedResource) - }) - } -} - -func TestRabbitMQMessageQueue_ConvertDataModelToVersioned(t *testing.T) { - testCases := []struct { - desc string - file string - expected *RabbitMQMessageQueueResource - }{ - { - desc: "rabbitmq manual data model", - file: "rabbitmq_manual_datamodel.json", - expected: &RabbitMQMessageQueueResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &RabbitMQMessageQueueProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Queue: to.Ptr("testQueue"), - Host: to.Ptr("test-host"), - VHost: to.Ptr("test-vhost"), - Port: to.Ptr(int32(5672)), - Username: to.Ptr("test-user"), - TLS: to.Ptr(true), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0"), - Name: to.Ptr("rabbitmq0"), - Type: to.Ptr(linkrp.RabbitMQMessageQueuesResourceType), - }, - }, - { - desc: "rabbitmq recipe data model", - file: "rabbitmq_recipe_datamodel.json", - expected: &RabbitMQMessageQueueResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &RabbitMQMessageQueueProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Queue: to.Ptr("testQueue"), - Host: to.Ptr("test-host"), - VHost: to.Ptr("test-vhost"), - Port: to.Ptr(int32(5672)), - Username: to.Ptr("test-user"), - TLS: to.Ptr(false), - Recipe: &Recipe{ - Name: to.Ptr("rabbitmq"), - Parameters: map[string]any{ - "foo": "bar", - }, - }, - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0"), - Name: to.Ptr("rabbitmq0"), - Type: to.Ptr(linkrp.RabbitMQMessageQueuesResourceType), - }, - }, - } - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.RabbitMQMessageQueue{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &RabbitMQMessageQueueResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } -} - -func TestRabbitMQMessageQueue_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { - testset := []struct { - payload string - errType error - message string - }{ - { - "rabbitmq_invalid_properties_resource.json", - &v1.ErrClientRP{}, - "code Bad Request: err queue is required when resourceProvisioning is manual", - }, - { - "rabbitmq_invalid_resourceprovisioning_resource.json", - &v1.ErrModelConversion{}, - "$.properties.resourceProvisioning must be one of [manual recipe].", - }, - } - - for _, test := range testset { - t.Run(test.payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(test.payload) - versionedResource := &RabbitMQMessageQueueResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - require.Error(t, err) - require.Nil(t, dm) - require.IsType(t, test.errType, err) - require.Equal(t, test.message, err.Error()) - }) - } -} - -func TestRabbitMQMessageQueue_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &RabbitMQMessageQueueResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} - -func TestRabbitMQSecrets_ConvertVersionedToDataModel(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("rabbitmqsecrets.json") - versioned := &RabbitMQSecrets{} - err := json.Unmarshal(rawPayload, versioned) - require.NoError(t, err) - - // act - dm, err := versioned.ConvertTo() - - // assert - require.NoError(t, err) - converted := dm.(*datamodel.RabbitMQSecrets) - require.Equal(t, "test-connection-string", converted.URI) -} - -func TestRabbitMQSecrets_ConvertDataModelToVersioned(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("./rabbitmqsecretsdatamodel.json") - secrets := &datamodel.RabbitMQSecrets{} - err := json.Unmarshal(rawPayload, secrets) - require.NoError(t, err) - - // act - versionedResource := &RabbitMQSecrets{} - err = versionedResource.ConvertFrom(secrets) - - // assert - require.NoError(t, err) - require.Equal(t, "test-connection-string", secrets.URI) -} - -func TestRabbitMQSecrets_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &RabbitMQSecrets{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion.go b/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion.go deleted file mode 100644 index 77126ee4ac..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned RedisCache resource to version-agnostic datamodel -// and returns an error if the inputs are invalid. -func (src *RedisCacheResource) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.RedisCache{ - BaseResource: v1.BaseResource{ - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - }, - Properties: datamodel.RedisCacheProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - }, - } - v := src.Properties - - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(src.Properties.ResourceProvisioning) - if err != nil { - return nil, err - } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - converted.Properties.Recipe = toRecipeDataModel(v.Recipe) - } - converted.Properties.Resources = toResourcesDataModel(v.Resources) - converted.Properties.Host = to.String(v.Host) - converted.Properties.Port = to.Int32(v.Port) - converted.Properties.TLS = to.Bool(v.TLS) - converted.Properties.Username = to.String(v.Username) - if v.Secrets != nil { - converted.Properties.Secrets = datamodel.RedisCacheSecrets{ - ConnectionString: to.String(v.Secrets.ConnectionString), - Password: to.String(v.Secrets.Password), - URL: to.String(v.Secrets.URL), - } - } - - if err = converted.VerifyInputs(); err != nil { - return nil, err - } - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned RedisCache resource. -func (dst *RedisCacheResource) ConvertFrom(src v1.DataModelInterface) error { - redis, ok := src.(*datamodel.RedisCache) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(redis.ID) - dst.Name = to.Ptr(redis.Name) - dst.Type = to.Ptr(redis.Type) - dst.SystemData = fromSystemDataModel(redis.SystemData) - dst.Location = to.Ptr(redis.Location) - dst.Tags = *to.StringMapPtr(redis.Tags) - - dst.Properties = &RedisCacheProperties{ - Recipe: fromRecipeDataModel(redis.Properties.Recipe), - ResourceProvisioning: fromResourceProvisioningDataModel(redis.Properties.ResourceProvisioning), - Resources: fromResourcesDataModel(redis.Properties.Resources), - Host: to.Ptr(redis.Properties.Host), - Port: to.Ptr(redis.Properties.Port), - TLS: to.Ptr(redis.Properties.TLS), - Username: to.Ptr(redis.Properties.Username), - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(redis.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(redis.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(redis.Properties.Environment), - Application: to.Ptr(redis.Properties.Application), - } - - return nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned RedisCacheSecrets instance -// and returns an error if the conversion fails. -func (dst *RedisCacheSecrets) ConvertFrom(src v1.DataModelInterface) error { - redisSecrets, ok := src.(*datamodel.RedisCacheSecrets) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ConnectionString = to.Ptr(redisSecrets.ConnectionString) - dst.Password = to.Ptr(redisSecrets.Password) - dst.URL = to.Ptr(redisSecrets.URL) - - return nil -} - -// ConvertTo converts from the versioned RedisCacheSecrets instance to version-agnostic datamodel. -func (src *RedisCacheSecrets) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.RedisCacheSecrets{ - ConnectionString: to.String(src.ConnectionString), - Password: to.String(src.Password), - URL: to.String(src.URL), - } - return converted, nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go deleted file mode 100644 index 960ca52387..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/rediscache_conversion_test.go +++ /dev/null @@ -1,396 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "fmt" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/to" - - "github.com/stretchr/testify/require" -) - -const ( - ApplicationID = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication" - EnvironmentID = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0" - RedisID = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0" -) - -func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { - testset := []struct { - desc string - file string - expected *datamodel.RedisCache - }{ - { - desc: "redis cache with default recipe", - file: "rediscacheresource_defaultrecipe.json", - expected: &datamodel.RedisCache{ - BaseResource: createBaseResource(), - Properties: datamodel.RedisCacheProperties{ - BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Host: "", - Port: 0, - TLS: false, - Username: "", - Recipe: linkrp.LinkRecipe{Name: "default"}, - }, - }, - }, - { - desc: "redis cache with named recipe", - file: "rediscacheresource_recipe_named.json", - expected: &datamodel.RedisCache{ - BaseResource: createBaseResource(), - Properties: datamodel.RedisCacheProperties{ - BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Host: "", - Port: 0, - TLS: false, - Username: "", - Recipe: linkrp.LinkRecipe{Name: "redis-test"}, - }, - }, - }, - { - desc: "redis cache with recipe overridden values", - file: "rediscacheresource_recipe_overridevalues.json", - expected: &datamodel.RedisCache{ - BaseResource: createBaseResource(), - Properties: datamodel.RedisCacheProperties{ - BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Host: "myrediscache.redis.cache.windows.net", - Port: 10255, - TLS: false, - Username: "", - Recipe: linkrp.LinkRecipe{Name: "redis-test", Parameters: map[string]any{"port": float64(6081)}}, - }, - }, - }, - { - desc: "redis cache manual with resources", - file: "rediscacheresource_manual.json", - expected: &datamodel.RedisCache{ - BaseResource: createBaseResource(), - Properties: datamodel.RedisCacheProperties{ - BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Host: "myrediscache.redis.cache.windows.net", - Port: 10255, - TLS: true, - Username: "admin", - Resources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}}, - Secrets: datamodel.RedisCacheSecrets{ - Password: "testPassword", - ConnectionString: "test-connection-string", - URL: "test-url", - }, - }, - }, - }, - { - desc: "redis cache manual without resources", - file: "rediscacheresource_manual_noresources.json", - expected: &datamodel.RedisCache{ - BaseResource: createBaseResource(), - Properties: datamodel.RedisCacheProperties{ - BasicResourceProperties: createBasicResourceProperties(), - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Host: "myrediscache.redis.cache.windows.net", - Port: 10255, - TLS: false, - Username: "", - }, - }, - }, - } - - for _, tc := range testset { - // arrange - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - versionedResource := &RedisCacheResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.RedisCache) - - require.Equal(t, tc.expected, convertedResource) - }) - } -} - -func TestRedisCache_ConvertDataModelToVersioned(t *testing.T) { - testset1 := []struct { - desc string - file string - expected *RedisCacheResource - }{ - { - desc: "redis cache manual with resources", - file: "rediscacheresourcedatamodel_manual.json", - expected: &RedisCacheResource{ - Location: to.Ptr(""), - Properties: &RedisCacheProperties{ - Environment: to.Ptr(EnvironmentID), - Application: to.Ptr(ApplicationID), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Host: to.Ptr("myrediscache.redis.cache.windows.net"), - Port: to.Ptr(int32(10255)), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - Username: to.Ptr(""), - TLS: to.Ptr(false), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr(RedisID), - Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.RedisCachesResourceType), - }, - }, - { - desc: "redis cache default recipe", - file: "rediscacheresourcedatamodel_recipe_default.json", - expected: &RedisCacheResource{ - Location: to.Ptr(""), - Properties: &RedisCacheProperties{ - Environment: to.Ptr(EnvironmentID), - Application: to.Ptr(ApplicationID), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - Host: to.Ptr(""), - Port: to.Ptr(int32(0)), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - Username: to.Ptr(""), - TLS: to.Ptr(false), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr(RedisID), - Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.RedisCachesResourceType), - }, - }, - { - desc: "redis cache named recipe", - file: "rediscacheresourcedatamodel_recipe_params.json", - expected: &RedisCacheResource{ - Location: to.Ptr(""), - Properties: &RedisCacheProperties{ - Environment: to.Ptr(EnvironmentID), - Application: to.Ptr(ApplicationID), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - Host: to.Ptr(""), - Port: to.Ptr(int32(0)), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr("redis-test"), Parameters: map[string]any{"port": float64(6081)}}, - Username: to.Ptr(""), - TLS: to.Ptr(false), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr(RedisID), - Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.RedisCachesResourceType), - }, - }, - { - desc: "redis cache manual with resources", - file: "rediscacheresourcedatamodel_manual_resources.json", - expected: &RedisCacheResource{ - Location: to.Ptr(""), - Properties: &RedisCacheProperties{ - Environment: to.Ptr(EnvironmentID), - Application: to.Ptr(ApplicationID), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Host: to.Ptr("myrediscache.redis.cache.windows.net"), - Port: to.Ptr(int32(10255)), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Recipe: &Recipe{Name: to.Ptr(""), Parameters: nil}, - Username: to.Ptr(""), - TLS: to.Ptr(true), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - Resources: []*ResourceReference{ - {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, - {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}, - }, - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr(RedisID), - Name: to.Ptr("redis0"), - Type: to.Ptr(linkrp.RedisCachesResourceType), - }, - }, - } - - for _, tc := range testset1 { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.RedisCache{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &RedisCacheResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } -} - -func TestRedisCache_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { - testset := []string{"rediscacheresource-invalid.json", "rediscacheresource-invalid2.json"} - for _, payload := range testset { - // arrange - rawPayload := testutil.ReadFixture(payload) - versionedResource := &RedisCacheResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - if payload == "rediscacheresource-invalid.json" { - expectedErr := v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} - _, err = versionedResource.ConvertTo() - require.Equal(t, &expectedErr, err) - } - if payload == "rediscacheresource-invalid2.json" { - expectedErr := v1.ErrClientRP{Code: "BadRequest", Message: "multiple errors were found:\n\thost must be specified when resourceProvisioning is set to manual\n\tport must be specified when resourceProvisioning is set to manual"} - _, err = versionedResource.ConvertTo() - require.Equal(t, &expectedErr, err) - } - } -} - -func TestRedisCache_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &RedisCacheResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} - -func TestRedisCacheSecrets_ConvertVersionedToDataModel(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("rediscachesecrets.json") - versioned := &RedisCacheSecrets{} - err := json.Unmarshal(rawPayload, versioned) - require.NoError(t, err) - - // act - dm, err := versioned.ConvertTo() - - // assert - require.NoError(t, err) - converted := dm.(*datamodel.RedisCacheSecrets) - require.Equal(t, "test-connection-string", converted.ConnectionString) - require.Equal(t, "testPassword", converted.Password) - require.Equal(t, "test-url", converted.URL) -} - -func TestRedisCacheSecrets_ConvertDataModelToVersioned(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("rediscachesecretsdatamodel.json") - secrets := &datamodel.RedisCacheSecrets{} - err := json.Unmarshal(rawPayload, secrets) - require.NoError(t, err) - - // act - versionedResource := &RedisCacheSecrets{} - err = versionedResource.ConvertFrom(secrets) - - // assert - require.NoError(t, err) - require.Equal(t, "test-connection-string", secrets.ConnectionString) - require.Equal(t, "testPassword", secrets.Password) - require.Equal(t, "test-url", secrets.URL) -} - -func TestRedisCacheSecrets_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &RedisCacheSecrets{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} - -func createBaseResource() v1.BaseResource { - return v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: RedisID, - Name: "redis0", - Type: linkrp.RedisCachesResourceType, - Tags: map[string]string{}, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - } -} - -func createBasicResourceProperties() rpv1.BasicResourceProperties { - return rpv1.BasicResourceProperties{ - Application: ApplicationID, - Environment: EnvironmentID, - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion.go b/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion.go deleted file mode 100644 index f9a20372f4..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" -) - -// ConvertTo converts from the versioned SqlDatabase resource to version-agnostic datamodel -// and returns an error if the inputs are invalid. -func (src *SQLDatabaseResource) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.SqlDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: to.String(src.ID), - Name: to.String(src.Name), - Type: to.String(src.Type), - Location: to.String(src.Location), - Tags: to.StringMap(src.Tags), - }, - InternalMetadata: v1.InternalMetadata{ - UpdatedAPIVersion: Version, - AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), - }, - }, - Properties: datamodel.SqlDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Environment: to.String(src.Properties.Environment), - Application: to.String(src.Properties.Application), - }, - }, - } - - properties := src.Properties - - var err error - converted.Properties.ResourceProvisioning, err = toResourceProvisiongDataModel(properties.ResourceProvisioning) - if err != nil { - return nil, err - } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - converted.Properties.Recipe = toRecipeDataModel(properties.Recipe) - } - converted.Properties.Resources = toResourcesDataModel(properties.Resources) - converted.Properties.Database = to.String(properties.Database) - converted.Properties.Server = to.String(properties.Server) - converted.Properties.Port = to.Int32(properties.Port) - converted.Properties.Username = to.String(properties.Username) - if properties.Secrets != nil { - converted.Properties.Secrets = datamodel.SqlDatabaseSecrets{ - ConnectionString: to.String(properties.Secrets.ConnectionString), - Password: to.String(properties.Secrets.Password), - } - } - err = converted.VerifyInputs() - if err != nil { - return nil, err - } - - return converted, nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned SqlDatabase resource. -func (dst *SQLDatabaseResource) ConvertFrom(src v1.DataModelInterface) error { - sql, ok := src.(*datamodel.SqlDatabase) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ID = to.Ptr(sql.ID) - dst.Name = to.Ptr(sql.Name) - dst.Type = to.Ptr(sql.Type) - dst.SystemData = fromSystemDataModel(sql.SystemData) - dst.Location = to.Ptr(sql.Location) - dst.Tags = *to.StringMapPtr(sql.Tags) - dst.Properties = &SQLDatabaseProperties{ - ResourceProvisioning: fromResourceProvisioningDataModel(sql.Properties.ResourceProvisioning), - Resources: fromResourcesDataModel(sql.Properties.Resources), - Database: to.Ptr(sql.Properties.Database), - Server: to.Ptr(sql.Properties.Server), - Port: to.Ptr(sql.Properties.Port), - Status: &ResourceStatus{ - OutputResources: rpv1.BuildExternalOutputResources(sql.Properties.Status.OutputResources), - }, - ProvisioningState: fromProvisioningStateDataModel(sql.InternalMetadata.AsyncProvisioningState), - Environment: to.Ptr(sql.Properties.Environment), - Application: to.Ptr(sql.Properties.Application), - Username: to.Ptr(sql.Properties.Username), - } - if sql.Properties.ResourceProvisioning == linkrp.ResourceProvisioningRecipe { - dst.Properties.Recipe = fromRecipeDataModel(sql.Properties.Recipe) - } - return nil -} - -// ConvertFrom converts from version-agnostic datamodel to the versioned SqlDatabaseSecrets instance -// and returns an error if the conversion fails. -func (dst *SQLDatabaseSecrets) ConvertFrom(src v1.DataModelInterface) error { - sqlSecrets, ok := src.(*datamodel.SqlDatabaseSecrets) - if !ok { - return v1.ErrInvalidModelConversion - } - - dst.ConnectionString = to.Ptr(sqlSecrets.ConnectionString) - dst.Password = to.Ptr(sqlSecrets.Password) - - return nil -} - -// ConvertTo converts from the versioned SqlDatabaseSecrets instance to version-agnostic datamodel -// and returns an error if the conversion fails. -func (src *SQLDatabaseSecrets) ConvertTo() (v1.DataModelInterface, error) { - converted := &datamodel.SqlDatabaseSecrets{ - ConnectionString: to.String(src.ConnectionString), - Password: to.String(src.Password), - } - return converted, nil -} diff --git a/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go b/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go deleted file mode 100644 index 980c7e6597..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/sqldatabase_conversion_test.go +++ /dev/null @@ -1,305 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { - testCases := []struct { - desc string - file string - expected *datamodel.SqlDatabase - }{ - { - desc: "sqldatabase manual resource", - file: "sqldatabase_manual_resource.json", - expected: &datamodel.SqlDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - Name: "sql0", - Type: linkrp.SqlDatabasesResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.SqlDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Resources: []*linkrp.ResourceReference{ - { - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", - }, - }, - Database: "testDatabase", - Server: "testAccount1.sql.cosmos.azure.com", - Port: 1433, - Username: "testUser", - Secrets: datamodel.SqlDatabaseSecrets{ - Password: "testPassword", - ConnectionString: "test-connection-string", - }, - }, - }, - }, - { - desc: "sqldatabase recipe resource", - file: "sqldatabase_recipe_resource.json", - expected: &datamodel.SqlDatabase{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - Name: "sql0", - Type: linkrp.SqlDatabasesResourceType, - Location: v1.LocationGlobal, - Tags: map[string]string{ - "env": "dev", - }, - }, - InternalMetadata: v1.InternalMetadata{ - CreatedAPIVersion: "", - UpdatedAPIVersion: "2022-03-15-privatepreview", - AsyncProvisioningState: v1.ProvisioningStateAccepted, - }, - SystemData: v1.SystemData{}, - }, - Properties: datamodel.SqlDatabaseProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, - Recipe: linkrp.LinkRecipe{ - Name: "sql-test", - Parameters: map[string]any{ - "foo": "bar", - }, - }, - }, - }, - }, - } - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture(tc.file) - versionedResource := &SQLDatabaseResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - // act - dm, err := versionedResource.ConvertTo() - - // assert - require.NoError(t, err) - convertedResource := dm.(*datamodel.SqlDatabase) - - require.Equal(t, tc.expected, convertedResource) - }) - } -} - -func TestSqlDatabase_ConvertDataModelToVersioned(t *testing.T) { - testCases := []struct { - desc string - file string - expected *SQLDatabaseResource - }{ - { - desc: "sqldatabase manual resource datamodel", - file: "sqldatabase_manual_resourcedatamodel.json", - expected: &SQLDatabaseResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &SQLDatabaseProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - ResourceProvisioning: to.Ptr(ResourceProvisioningManual), - Resources: []*ResourceReference{ - { - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase"), - }, - }, - Database: to.Ptr("testDatabase"), - Server: to.Ptr("testAccount1.sql.cosmos.azure.com"), - Port: to.Ptr(int32(1433)), - Username: to.Ptr("testUser"), - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0"), - Name: to.Ptr("sql0"), - Type: to.Ptr(linkrp.SqlDatabasesResourceType), - }, - }, - { - desc: "sqldatabase recipe resource datamodel", - file: "sqldatabase_recipe_resourcedatamodel.json", - expected: &SQLDatabaseResource{ - Location: to.Ptr(v1.LocationGlobal), - Properties: &SQLDatabaseProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - ResourceProvisioning: to.Ptr(ResourceProvisioningRecipe), - Database: to.Ptr("testDatabase"), - Port: to.Ptr(int32(1433)), - Username: to.Ptr("testUser"), - Server: to.Ptr("testAccount1.sql.cosmos.azure.com"), - Recipe: &Recipe{ - Name: to.Ptr("sql-test"), - Parameters: map[string]any{ - "foo": "bar", - }, - }, - ProvisioningState: to.Ptr(ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0"), - Name: to.Ptr("sql0"), - Type: to.Ptr(linkrp.SqlDatabasesResourceType), - }, - }, - } - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - rawPayload := testutil.ReadFixture(tc.file) - resource := &datamodel.SqlDatabase{} - err := json.Unmarshal(rawPayload, resource) - require.NoError(t, err) - - versionedResource := &SQLDatabaseResource{} - err = versionedResource.ConvertFrom(resource) - require.NoError(t, err) - - // Skip system data comparison - versionedResource.SystemData = nil - - require.Equal(t, tc.expected, versionedResource) - }) - } -} - -func TestSqlDatabase_ConvertVersionedToDataModel_InvalidRequest(t *testing.T) { - testset := []struct { - payload string - errType error - message string - }{ - { - "sqldatabase_invalid_properties_resource.json", - &v1.ErrClientRP{}, - "code BadRequest: err multiple errors were found:\n\tserver must be specified when resourceProvisioning is set to manual\n\tport must be specified when resourceProvisioning is set to manual\n\tdatabase must be specified when resourceProvisioning is set to manual", - }, - { - "sqldatabase_invalid_resourceprovisioning_resource.json", - &v1.ErrModelConversion{}, - "$.properties.resourceProvisioning must be one of [manual recipe].", - }, - } - - for _, test := range testset { - t.Run(test.payload, func(t *testing.T) { - rawPayload := testutil.ReadFixture(test.payload) - versionedResource := &SQLDatabaseResource{} - err := json.Unmarshal(rawPayload, versionedResource) - require.NoError(t, err) - - dm, err := versionedResource.ConvertTo() - require.Error(t, err) - require.Nil(t, dm) - require.IsType(t, test.errType, err) - require.Equal(t, test.message, err.Error()) - }) - } -} - -func TestSqlDatabase_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &SQLDatabaseResource{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} - -func TestSqlDatabaseSecrets_ConvertDataModelToVersioned(t *testing.T) { - // arrange - rawPayload := testutil.ReadFixture("sqldatabase_secrets_datamodel.json") - secrets := &datamodel.SqlDatabaseSecrets{} - err := json.Unmarshal(rawPayload, secrets) - require.NoError(t, err) - - // act - versionedResource := &SQLDatabaseSecrets{} - err = versionedResource.ConvertFrom(secrets) - - // assert - require.NoError(t, err) - require.Equal(t, "test-connection-string", secrets.ConnectionString) - require.Equal(t, "testPassword", secrets.Password) -} - -func TestSqlDatabaseSecrets_ConvertFromValidation(t *testing.T) { - validationTests := []struct { - src v1.DataModelInterface - err error - }{ - {&resourcetypeutil.FakeResource{}, v1.ErrInvalidModelConversion}, - {nil, v1.ErrInvalidModelConversion}, - } - - for _, tc := range validationTests { - versioned := &SQLDatabaseSecrets{} - err := versioned.ConvertFrom(tc.src) - require.ErrorAs(t, tc.err, &err) - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidmanual_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidmanual_resource.json deleted file mode 100644 index 776b1af3a3..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidmanual_resource.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "recipe": { - "name": "test-recipe" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidrecipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidrecipe_resource.json deleted file mode 100644 index e9a754043c..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidrecipe_resource.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json deleted file mode 100644 index 151c32b983..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async" - } - ] - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json deleted file mode 100644 index bb7d556381..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "kind": "generic", - "resourceProvisioning": "manual", - "type": "pubsub.kafka", - "version": "v1", - "metadata": { - "foo": "bar" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_resource.json deleted file mode 100644 index e680962f5a..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_resource.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async" - } - ] - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json deleted file mode 100644 index 35a55a8f41..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_datamodel.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "properties": { - "componentName": "test-dpsb", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "recipe", - "recipe": { - "name": "dpsb-recipe" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_resource.json deleted file mode 100644 index 0b237c419c..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_resource.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb", - "name": "test-dpsb", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "recipe", - "recipe": { - "name": "dpsb-recipe" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidrecipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidrecipe_resource.json deleted file mode 100644 index cd90cb7552..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidrecipe_resource.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "type": "secretstores.kubernetes", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidvalues_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidvalues_resource.json deleted file mode 100644 index 870be1d9f6..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_invalidvalues_resource.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-ss", - "name": "test-dpsb", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "recipe": { - "name": "test-recipe" - } - } - } \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resource.json deleted file mode 100644 index f5ea3e5216..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resource.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "kind": "generic", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning":"manual" - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json deleted file mode 100644 index 94d974dcfd..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "componentName": "test-dss", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "kind": "generic", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json deleted file mode 100644 index d6ed2298b0..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resource.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "recipe": { - "name": "daprSecretStore", - "parameters": { - "foo": "bar" - } - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json deleted file mode 100644 index 7eacd3a1b2..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstore_recipe_resourcedatamodel.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/test-dss", - "name": "test-dss", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "componentName": "test-dss", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "recipe": { - "name": "daprSecretStore", - "parameters": { - "foo": "bar" - } - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstoreresource-invalid.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstoreresource-invalid.json deleted file mode 100644 index 45d3ed6d00..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprsecretstoreresource-invalid.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprSecretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Link/daprSecretStores", - "properties": { - "resourceProvisioning": "manual", - "version": 1 - - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidrecipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidrecipe_resource.json deleted file mode 100644 index d6facaeef0..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidrecipe_resource.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidvalues_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidvalues_resource.json deleted file mode 100644 index 316bd5d5cf..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_invalidvalues_resource.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "recipe": { - "name": "test-recipe" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resource.json deleted file mode 100644 index b18478ab23..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resource.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "recipe", - "recipe": { - "name": "recipe-test" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json deleted file mode 100644 index cccd4c79bd..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_recipe_resourcedatamodel.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "componentName": "daprStateStore0", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "recipe-test" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resource.json deleted file mode 100644 index 7ae1e25241..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resource.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ] - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json deleted file mode 100644 index 8ae41dec9a..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/daprstatestore_values_resourcedatamodel.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "tags": { - "env": "dev" - }, - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "properties": { - "componentName": "daprStateStore0", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ] - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json deleted file mode 100644 index 577f161531..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken": "token" - }, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual_nosecrets.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual_nosecrets.json deleted file mode 100644 index 07f4827104..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_manual_nosecrets.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json deleted file mode 100644 index 620ea2acad..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extender_recipe.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "test-recipe" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json deleted file mode 100644 index 0fecbdce28..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties": { - "fromNumber": "222-222-2222" - }, - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json deleted file mode 100644 index 5404711dff..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_manual_nosecrets.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties": { - "fromNumber": "222-222-2222" - }, - "resourceProvisioning": "manual", - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json deleted file mode 100644 index 5c2142a0a8..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderdatamodel_recipe.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "test-recipe" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresource-invalid.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresource-invalid.json deleted file mode 100644 index c5e0ed066d..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresource-invalid.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "properties": { - "secrets": 12345 - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json deleted file mode 100644 index 2a1d36084d..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/extenderresponseresourcedatamodel.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "additionalProperties": { - "fromNumber": "222-222-2222" - }, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalid.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalid.json deleted file mode 100644 index ecb8ef6a07..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalid.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "mode": "resource", - "resource": 12345 - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalidresprovisioning.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalidresprovisioning.json deleted file mode 100644 index a2e4a81560..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-invalidresprovisioning.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "resourceProvisioning": "invalid" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-missinginputs.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-missinginputs.json deleted file mode 100644 index f1deb9bb6c..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource-missinginputs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json deleted file mode 100644 index 72a82c84d1..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database", - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource2.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource2.json deleted file mode 100644 index 4d3c2cf3b4..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource2.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}], - "host": "testAccount.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database" - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe.json deleted file mode 100644 index df483de374..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - }, - "resourceProvisioning": "recipe", - "host": "testAccount.mongo.cosmos.azure.com", - "port": 10255 - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe2.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe2.json deleted file mode 100644 index 2906269b97..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresource_recipe2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "host": "mynewhost.com", - "port": 10256 - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json deleted file mode 100644 index fe8b44806a..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database", - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json deleted file mode 100644 index 5302bd302f..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel2.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" - } - ], - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "test-database" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json deleted file mode 100644 index 864321a177..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel_recipe.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "recipe": { - "name": "cosmosdb", - "parameters": { - "foo": "bar" - } - }, - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255 - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecrets.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecrets.json deleted file mode 100644 index e3236171ba..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecrets.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "password": "testPassword", - "connectionString": "test-connection-string" -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecretsdatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecretsdatamodel.json deleted file mode 100644 index e3236171ba..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/mongodatabasesecretsdatamodel.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "password": "testPassword", - "connectionString": "test-connection-string" -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_properties_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_properties_resource.json deleted file mode 100644 index 15e1210aae..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_properties_resource.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "properties": { - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_resourceprovisioning_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_resourceprovisioning_resource.json deleted file mode 100644 index de3c20e94e..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_invalid_resourceprovisioning_resource.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "properties": { - "resourceProvisioning": "invalid" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json deleted file mode 100644 index 015ff8bdd3..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "location": "global", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning": "manual", - "queue": "testQueue", - "host": "test-host", - "vHost": "test-vhost", - "port": 5672, - "username": "test-user", - "tls": true, - "secrets": { - "uri": "connection://string", - "password": "password" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_resource.json deleted file mode 100644 index 0c8ba30fe1..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_manual_resource.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning":"manual", - "queue": "testQueue", - "host": "test-host", - "vHost": "test-vhost", - "port": 5672, - "username": "test-user", - "tls":true, - "secrets": { - "uri": "connection://string", - "password":"password" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json deleted file mode 100644 index 24f7ef1471..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_datamodel.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "location": "global", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resourceProvisioning": "recipe", - "queue": "testQueue", - "host": "test-host", - "port": 5672, - "vHost": "test-vhost", - "username": "test-user", - "tls": false, - "recipe": { - "name": "rabbitmq", - "parameters": { - "foo": "bar" - } - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json deleted file mode 100644 index 87da40bd42..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmq_recipe_resource.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "tls": false, - "recipe": { - "name": "rabbitmq", - "parameters": { - "foo": "bar" - } - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqresource-invalid.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqresource-invalid.json deleted file mode 100644 index d25ed39514..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqresource-invalid.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "properties": { - "queue": 12345 - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecrets.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecrets.json deleted file mode 100644 index e6ce6e7aa7..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecrets.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "uri": "test-connection-string", - "password": "test-password" -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecretsdatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecretsdatamodel.json deleted file mode 100644 index e6ce6e7aa7..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rabbitmqsecretsdatamodel.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "uri": "test-connection-string", - "password": "test-password" -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid.json deleted file mode 100644 index 8186e64ecf..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "resourceProvisioning": "invalid" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid2.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid2.json deleted file mode 100644 index b57cc3677a..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalid2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "resourceProvisioning": "manual", - "secrets": { - "password": "password" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalidinput.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalidinput.json deleted file mode 100644 index 05601d25ec..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource-invalidinput.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "host": 12345 - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_defaultrecipe.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_defaultrecipe.json deleted file mode 100644 index 83748d6685..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_defaultrecipe.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json deleted file mode 100644 index 0b7f52ed43..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" - } - ], - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "username": "admin", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string", - "url": "test-url" - }, - "tls": true, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual_noresources.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual_noresources.json deleted file mode 100644 index fb2215a2f3..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_manual_noresources.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_named.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_named.json deleted file mode 100644 index 2820edacde..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_named.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis-test" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_overridevalues.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_overridevalues.json deleted file mode 100644 index 66293fd8f0..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresource_recipe_overridevalues.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis-test", - "parameters": { - "port": 6081 - } - }, - "host": "myrediscache.redis.cache.windows.net", - "port": 10255 - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json deleted file mode 100644 index 801d1add95..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json deleted file mode 100644 index f4dd2097bd..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_manual_resources.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1" - } - ], - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "tls": true, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json deleted file mode 100644 index 7db319736a..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_default.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json deleted file mode 100644 index 35a494cea1..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscacheresourcedatamodel_recipe_params.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "recipe": { - "name": "redis-test", - "parameters": { - "port": 6081 - } - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecrets.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecrets.json deleted file mode 100644 index f5cc81d18e..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecrets.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "password": "testPassword", - "connectionString": "test-connection-string", - "url": "test-url" -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecretsdatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecretsdatamodel.json deleted file mode 100644 index f5cc81d18e..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/rediscachesecretsdatamodel.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "password": "testPassword", - "connectionString": "test-connection-string", - "url": "test-url" -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_properties_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_properties_resource.json deleted file mode 100644 index 8c3a953cf8..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_properties_resource.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "properties": { - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_resourceprovisioning_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_resourceprovisioning_resource.json deleted file mode 100644 index 66c13e9497..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_invalid_resourceprovisioning_resource.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "properties": { - "resourceProvisioning": "invalid" - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json deleted file mode 100644 index 68591724a9..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "port": 1433, - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json deleted file mode 100644 index 0ed6b7efec..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual", - "username": "testUser", - "port": 1433 - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resource.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resource.json deleted file mode 100644 index f1261e316c..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resource.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "tags": { - "env": "dev" - }, - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "recipe": { - "name": "sql-test", - "parameters":{ - "foo":"bar" - } - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json deleted file mode 100644 index fc1c1695b5..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "systemData": { - "createdBy": "fakeid@live.com", - "createdByType": "User", - "createdAt": "2021-09-24T19:09:54.2403864Z", - "lastModifiedBy": "fakeid@live.com", - "lastModifiedByType": "User", - "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" - }, - "tags": { - "env": "dev" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", - "recipe": { - "name": "sql-test", - "parameters": { - "foo": "bar" - } - }, - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "recipe", - "username": "testUser", - "port": 1433 - } -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_secrets_datamodel.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_secrets_datamodel.json deleted file mode 100644 index 4f05d5885c..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabase_secrets_datamodel.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "password": "testPassword", - "connectionString": "test-connection-string" -} \ No newline at end of file diff --git a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabaseresource-invalid.json b/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabaseresource-invalid.json deleted file mode 100644 index c4ad92383f..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/testdata/sqldatabaseresource-invalid.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "properties": { - "database": 12345, - "resourceProvisioning":"manual" - } -} diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go deleted file mode 100644 index ea4eb09f0d..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_client_factory.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" -) - -// ClientFactory is a client factory used to create any client in this module. -// Don't use this type directly, use NewClientFactory instead. -type ClientFactory struct { - rootScope string - credential azcore.TokenCredential - options *arm.ClientOptions -} - -// NewClientFactory creates a new instance of ClientFactory with the specified values. -// The parameter values will be propagated to any client created from this factory. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewClientFactory(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options) - if err != nil { - return nil, err - } - return &ClientFactory{ - rootScope: rootScope, credential: credential, - options: options.Clone(), - }, nil -} - -func (c *ClientFactory) NewDaprPubSubBrokerClient() *DaprPubSubBrokerClient { - subClient, _ := NewDaprPubSubBrokerClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewDaprSecretStoreClient() *DaprSecretStoreClient { - subClient, _ := NewDaprSecretStoreClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewDaprStateStoreClient() *DaprStateStoreClient { - subClient, _ := NewDaprStateStoreClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewExtendersClient() *ExtendersClient { - subClient, _ := NewExtendersClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewMongoDatabasesClient() *MongoDatabasesClient { - subClient, _ := NewMongoDatabasesClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewRabbitMqMessageQueuesClient() *RabbitMqMessageQueuesClient { - subClient, _ := NewRabbitMqMessageQueuesClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewRedisCachesClient() *RedisCachesClient { - subClient, _ := NewRedisCachesClient(c.rootScope, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewSQLDatabasesClient() *SQLDatabasesClient { - subClient, _ := NewSQLDatabasesClient(c.rootScope, c.credential, c.options) - return subClient -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go deleted file mode 100644 index 5ad2b299c0..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_constants.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -const ( - moduleName = "v20220315privatepreview" - moduleVersion = "v0.0.1" -) - -// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. -type ActionType string - -const ( - ActionTypeInternal ActionType = "Internal" -) - -// PossibleActionTypeValues returns the possible values for the ActionType const type. -func PossibleActionTypeValues() []ActionType { - return []ActionType{ - ActionTypeInternal, - } -} - -// CreatedByType - The type of identity that created the resource. -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{ - CreatedByTypeApplication, - CreatedByTypeKey, - CreatedByTypeManagedIdentity, - CreatedByTypeUser, - } -} - -// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default -// value is "user,system" -type Origin string - -const ( - OriginSystem Origin = "system" - OriginUser Origin = "user" - OriginUserSystem Origin = "user,system" -) - -// PossibleOriginValues returns the possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{ - OriginSystem, - OriginUser, - OriginUserSystem, - } -} - -// ProvisioningState - Provisioning state of the link at the time the operation was called -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ - ProvisioningStateAccepted, - ProvisioningStateCanceled, - ProvisioningStateDeleting, - ProvisioningStateFailed, - ProvisioningStateProvisioning, - ProvisioningStateSucceeded, - ProvisioningStateUpdating, - } -} - -// ResourceProvisioning - Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', -// where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user -// manages the resource and provides the values. -type ResourceProvisioning string - -const ( - ResourceProvisioningManual ResourceProvisioning = "manual" - ResourceProvisioningRecipe ResourceProvisioning = "recipe" -) - -// PossibleResourceProvisioningValues returns the possible values for the ResourceProvisioning const type. -func PossibleResourceProvisioningValues() []ResourceProvisioning { - return []ResourceProvisioning{ - ResourceProvisioningManual, - ResourceProvisioningRecipe, - } -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go deleted file mode 100644 index d04a66f008..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprpubsubbroker_client.go +++ /dev/null @@ -1,281 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// DaprPubSubBrokerClient contains the methods for the DaprPubSubBroker group. -// Don't use this type directly, use NewDaprPubSubBrokerClient() instead. -type DaprPubSubBrokerClient struct { - internal *arm.Client - rootScope string -} - -// NewDaprPubSubBrokerClient creates a new instance of DaprPubSubBrokerClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDaprPubSubBrokerClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprPubSubBrokerClient, error) { - cl, err := arm.NewClient(moduleName+".DaprPubSubBrokerClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DaprPubSubBrokerClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprPubSubBrokerName - DaprPubSubBroker name -// - resource - Resource create parameters. -// - options - DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate -// method. -func (client *DaprPubSubBrokerClient) CreateOrUpdate(ctx context.Context, daprPubSubBrokerName string, resource DaprPubSubBrokerResource, options *DaprPubSubBrokerClientCreateOrUpdateOptions) (DaprPubSubBrokerClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, daprPubSubBrokerName, resource, options) - if err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprPubSubBrokerClient) createOrUpdateCreateRequest(ctx context.Context, daprPubSubBrokerName string, resource DaprPubSubBrokerResource, options *DaprPubSubBrokerClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprPubSubBrokers/{daprPubSubBrokerName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprPubSubBrokerName == "" { - return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprPubSubBrokerClient) createOrUpdateHandleResponse(resp *http.Response) (DaprPubSubBrokerClientCreateOrUpdateResponse, error) { - result := DaprPubSubBrokerClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResource); err != nil { - return DaprPubSubBrokerClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an existing DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprPubSubBrokerName - DaprPubSubBroker name -// - options - DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete -// method. -func (client *DaprPubSubBrokerClient) BeginDelete(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*runtime.Poller[DaprPubSubBrokerClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, daprPubSubBrokerName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DaprPubSubBrokerClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[DaprPubSubBrokerClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes an existing DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -func (client *DaprPubSubBrokerClient) deleteOperation(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*http.Response, error) { - var err error - req, err := client.deleteCreateRequest(ctx, daprPubSubBrokerName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprPubSubBrokerClient) deleteCreateRequest(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprPubSubBrokers/{daprPubSubBrokerName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprPubSubBrokerName == "" { - return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a DaprPubSubBrokerResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprPubSubBrokerName - DaprPubSubBroker name -// - options - DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. -func (client *DaprPubSubBrokerClient) Get(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientGetOptions) (DaprPubSubBrokerClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, daprPubSubBrokerName, options) - if err != nil { - return DaprPubSubBrokerClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprPubSubBrokerClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DaprPubSubBrokerClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DaprPubSubBrokerClient) getCreateRequest(ctx context.Context, daprPubSubBrokerName string, options *DaprPubSubBrokerClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprPubSubBrokers/{daprPubSubBrokerName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprPubSubBrokerName == "" { - return nil, errors.New("parameter daprPubSubBrokerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprPubSubBrokerName}", url.PathEscape(daprPubSubBrokerName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DaprPubSubBrokerClient) getHandleResponse(resp *http.Response) (DaprPubSubBrokerClientGetResponse, error) { - result := DaprPubSubBrokerClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResource); err != nil { - return DaprPubSubBrokerClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all DaprPubSubBrokerResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.NewListByRootScopePager -// method. -func (client *DaprPubSubBrokerClient) NewListByRootScopePager(options *DaprPubSubBrokerClientListByRootScopeOptions) (*runtime.Pager[DaprPubSubBrokerClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[DaprPubSubBrokerClientListByRootScopeResponse]{ - More: func(page DaprPubSubBrokerClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprPubSubBrokerClientListByRootScopeResponse) (DaprPubSubBrokerClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DaprPubSubBrokerClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprPubSubBrokerClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprPubSubBrokerClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *DaprPubSubBrokerClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprPubSubBrokerClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprPubSubBrokers" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *DaprPubSubBrokerClient) listByRootScopeHandleResponse(resp *http.Response) (DaprPubSubBrokerClientListByRootScopeResponse, error) { - result := DaprPubSubBrokerClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprPubSubBrokerResourceListResult); err != nil { - return DaprPubSubBrokerClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go deleted file mode 100644 index 40e31237eb..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprsecretstore_client.go +++ /dev/null @@ -1,276 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// DaprSecretStoreClient contains the methods for the DaprSecretStore group. -// Don't use this type directly, use NewDaprSecretStoreClient() instead. -type DaprSecretStoreClient struct { - internal *arm.Client - rootScope string -} - -// NewDaprSecretStoreClient creates a new instance of DaprSecretStoreClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDaprSecretStoreClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprSecretStoreClient, error) { - cl, err := arm.NewClient(moduleName+".DaprSecretStoreClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DaprSecretStoreClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a DaprSecretStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprSecretStoreName - DaprSecretStore name -// - resource - Resource create parameters. -// - options - DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate -// method. -func (client *DaprSecretStoreClient) CreateOrUpdate(ctx context.Context, daprSecretStoreName string, resource DaprSecretStoreResource, options *DaprSecretStoreClientCreateOrUpdateOptions) (DaprSecretStoreClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, daprSecretStoreName, resource, options) - if err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprSecretStoreClient) createOrUpdateCreateRequest(ctx context.Context, daprSecretStoreName string, resource DaprSecretStoreResource, options *DaprSecretStoreClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprSecretStores/{daprSecretStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprSecretStoreName == "" { - return nil, errors.New("parameter daprSecretStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprSecretStoreClient) createOrUpdateHandleResponse(resp *http.Response) (DaprSecretStoreClientCreateOrUpdateResponse, error) { - result := DaprSecretStoreClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResource); err != nil { - return DaprSecretStoreClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing DaprSecretStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprSecretStoreName - DaprSecretStore name -// - options - DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. -func (client *DaprSecretStoreClient) Delete(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientDeleteOptions) (DaprSecretStoreClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, daprSecretStoreName, options) - if err != nil { - return DaprSecretStoreClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSecretStoreClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return DaprSecretStoreClientDeleteResponse{}, err - } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprSecretStoreClient) deleteCreateRequest(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprSecretStores/{daprSecretStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprSecretStoreName == "" { - return nil, errors.New("parameter daprSecretStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *DaprSecretStoreClient) deleteHandleResponse(resp *http.Response) (DaprSecretStoreClientDeleteResponse, error) { - result := DaprSecretStoreClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprSecretStoreClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a DaprSecretStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprSecretStoreName - DaprSecretStore name -// - options - DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. -func (client *DaprSecretStoreClient) Get(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientGetOptions) (DaprSecretStoreClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, daprSecretStoreName, options) - if err != nil { - return DaprSecretStoreClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSecretStoreClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DaprSecretStoreClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DaprSecretStoreClient) getCreateRequest(ctx context.Context, daprSecretStoreName string, options *DaprSecretStoreClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprSecretStores/{daprSecretStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprSecretStoreName == "" { - return nil, errors.New("parameter daprSecretStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprSecretStoreName}", url.PathEscape(daprSecretStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DaprSecretStoreClient) getHandleResponse(resp *http.Response) (DaprSecretStoreClientGetResponse, error) { - result := DaprSecretStoreClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResource); err != nil { - return DaprSecretStoreClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all DaprSecretStoreResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.NewListByRootScopePager -// method. -func (client *DaprSecretStoreClient) NewListByRootScopePager(options *DaprSecretStoreClientListByRootScopeOptions) (*runtime.Pager[DaprSecretStoreClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[DaprSecretStoreClientListByRootScopeResponse]{ - More: func(page DaprSecretStoreClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprSecretStoreClientListByRootScopeResponse) (DaprSecretStoreClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DaprSecretStoreClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSecretStoreClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprSecretStoreClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *DaprSecretStoreClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprSecretStoreClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprSecretStores" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *DaprSecretStoreClient) listByRootScopeHandleResponse(resp *http.Response) (DaprSecretStoreClientListByRootScopeResponse, error) { - result := DaprSecretStoreClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSecretStoreResourceListResult); err != nil { - return DaprSecretStoreClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go deleted file mode 100644 index 532e180bf3..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_daprstatestore_client.go +++ /dev/null @@ -1,281 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// DaprStateStoreClient contains the methods for the DaprStateStore group. -// Don't use this type directly, use NewDaprStateStoreClient() instead. -type DaprStateStoreClient struct { - internal *arm.Client - rootScope string -} - -// NewDaprStateStoreClient creates a new instance of DaprStateStoreClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewDaprStateStoreClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprStateStoreClient, error) { - cl, err := arm.NewClient(moduleName+".DaprStateStoreClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DaprStateStoreClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprStateStoreName - DaprStateStore name -// - resource - Resource create parameters. -// - options - DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate -// method. -func (client *DaprStateStoreClient) CreateOrUpdate(ctx context.Context, daprStateStoreName string, resource DaprStateStoreResource, options *DaprStateStoreClientCreateOrUpdateOptions) (DaprStateStoreClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, daprStateStoreName, resource, options) - if err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprStateStoreClient) createOrUpdateCreateRequest(ctx context.Context, daprStateStoreName string, resource DaprStateStoreResource, options *DaprStateStoreClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprStateStores/{daprStateStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprStateStoreName == "" { - return nil, errors.New("parameter daprStateStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprStateStoreClient) createOrUpdateHandleResponse(resp *http.Response) (DaprStateStoreClientCreateOrUpdateResponse, error) { - result := DaprStateStoreClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResource); err != nil { - return DaprStateStoreClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an existing DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprStateStoreName - DaprStateStore name -// - options - DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete -// method. -func (client *DaprStateStoreClient) BeginDelete(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*runtime.Poller[DaprStateStoreClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, daprStateStoreName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DaprStateStoreClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[DaprStateStoreClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes an existing DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -func (client *DaprStateStoreClient) deleteOperation(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*http.Response, error) { - var err error - req, err := client.deleteCreateRequest(ctx, daprStateStoreName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprStateStoreClient) deleteCreateRequest(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprStateStores/{daprStateStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprStateStoreName == "" { - return nil, errors.New("parameter daprStateStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a DaprStateStoreResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - daprStateStoreName - DaprStateStore name -// - options - DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. -func (client *DaprStateStoreClient) Get(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientGetOptions) (DaprStateStoreClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, daprStateStoreName, options) - if err != nil { - return DaprStateStoreClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprStateStoreClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DaprStateStoreClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DaprStateStoreClient) getCreateRequest(ctx context.Context, daprStateStoreName string, options *DaprStateStoreClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprStateStores/{daprStateStoreName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if daprStateStoreName == "" { - return nil, errors.New("parameter daprStateStoreName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{daprStateStoreName}", url.PathEscape(daprStateStoreName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *DaprStateStoreClient) getHandleResponse(resp *http.Response) (DaprStateStoreClientGetResponse, error) { - result := DaprStateStoreClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResource); err != nil { - return DaprStateStoreClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all DaprStateStoreResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.NewListByRootScopePager -// method. -func (client *DaprStateStoreClient) NewListByRootScopePager(options *DaprStateStoreClientListByRootScopeOptions) (*runtime.Pager[DaprStateStoreClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[DaprStateStoreClientListByRootScopeResponse]{ - More: func(page DaprStateStoreClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprStateStoreClientListByRootScopeResponse) (DaprStateStoreClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return DaprStateStoreClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprStateStoreClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DaprStateStoreClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *DaprStateStoreClient) listByRootScopeCreateRequest(ctx context.Context, options *DaprStateStoreClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/daprStateStores" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *DaprStateStoreClient) listByRootScopeHandleResponse(resp *http.Response) (DaprStateStoreClientListByRootScopeResponse, error) { - result := DaprStateStoreClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprStateStoreResourceListResult); err != nil { - return DaprStateStoreClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go deleted file mode 100644 index eddddc6088..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_extenders_client.go +++ /dev/null @@ -1,304 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ExtendersClient contains the methods for the Extenders group. -// Don't use this type directly, use NewExtendersClient() instead. -type ExtendersClient struct { - internal *arm.Client - rootScope string -} - -// NewExtendersClient creates a new instance of ExtendersClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewExtendersClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtendersClient, error) { - cl, err := arm.NewClient(moduleName+".ExtendersClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ExtendersClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a Extender resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender link resource -// - extenderParameters - extender create parameters -// - options - ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate -// method. -func (client *ExtendersClient) CreateOrUpdate(ctx context.Context, extenderName string, extenderParameters ExtenderResource, options *ExtendersClientCreateOrUpdateOptions) (ExtendersClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, extenderName, extenderParameters, options) - if err != nil { - return ExtendersClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ExtendersClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return ExtendersClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ExtendersClient) createOrUpdateCreateRequest(ctx context.Context, extenderName string, extenderParameters ExtenderResource, options *ExtendersClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/extenders/{extenderName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if extenderName == "" { - return nil, errors.New("parameter extenderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, extenderParameters); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ExtendersClient) createOrUpdateHandleResponse(resp *http.Response) (ExtendersClientCreateOrUpdateResponse, error) { - result := ExtendersClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderResource); err != nil { - return ExtendersClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing extender resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender link resource -// - options - ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. -func (client *ExtendersClient) Delete(ctx context.Context, extenderName string, options *ExtendersClientDeleteOptions) (ExtendersClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, extenderName, options) - if err != nil { - return ExtendersClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ExtendersClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return ExtendersClientDeleteResponse{}, err - } - return ExtendersClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ExtendersClient) deleteCreateRequest(ctx context.Context, extenderName string, options *ExtendersClientDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/extenders/{extenderName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if extenderName == "" { - return nil, errors.New("parameter extenderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a extender resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender link resource -// - options - ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. -func (client *ExtendersClient) Get(ctx context.Context, extenderName string, options *ExtendersClientGetOptions) (ExtendersClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, extenderName, options) - if err != nil { - return ExtendersClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ExtendersClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ExtendersClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ExtendersClient) getCreateRequest(ctx context.Context, extenderName string, options *ExtendersClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/extenders/{extenderName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if extenderName == "" { - return nil, errors.New("parameter extenderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ExtendersClient) getHandleResponse(resp *http.Response) (ExtendersClientGetResponse, error) { - result := ExtendersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderResource); err != nil { - return ExtendersClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all extender resources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.NewListByRootScopePager -// method. -func (client *ExtendersClient) NewListByRootScopePager(options *ExtendersClientListByRootScopeOptions) (*runtime.Pager[ExtendersClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[ExtendersClientListByRootScopeResponse]{ - More: func(page ExtendersClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ExtendersClientListByRootScopeResponse) (ExtendersClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ExtendersClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ExtendersClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtendersClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *ExtendersClient) listByRootScopeCreateRequest(ctx context.Context, options *ExtendersClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/extenders" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *ExtendersClient) listByRootScopeHandleResponse(resp *http.Response) (ExtendersClientListByRootScopeResponse, error) { - result := ExtendersClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ExtenderList); err != nil { - return ExtendersClientListByRootScopeResponse{}, err - } - return result, nil -} - -// ListSecrets - Lists secrets values for the specified Extender resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - extenderName - The name of the Extender link resource -// - options - ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. -func (client *ExtendersClient) ListSecrets(ctx context.Context, extenderName string, options *ExtendersClientListSecretsOptions) (ExtendersClientListSecretsResponse, error) { - var err error - req, err := client.listSecretsCreateRequest(ctx, extenderName, options) - if err != nil { - return ExtendersClientListSecretsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ExtendersClientListSecretsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ExtendersClientListSecretsResponse{}, err - } - resp, err := client.listSecretsHandleResponse(httpResp) - return resp, err -} - -// listSecretsCreateRequest creates the ListSecrets request. -func (client *ExtendersClient) listSecretsCreateRequest(ctx context.Context, extenderName string, options *ExtendersClientListSecretsOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/extenders/{extenderName}/listSecrets" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if extenderName == "" { - return nil, errors.New("parameter extenderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{extenderName}", url.PathEscape(extenderName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - 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.Value); err != nil { - return ExtendersClientListSecretsResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go deleted file mode 100644 index 5a7ad2e22f..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models.go +++ /dev/null @@ -1,842 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import "time" - -// BasicDaprResourceProperties - Basic properties of a Dapr component object. -type BasicDaprResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// BasicResourceProperties - Basic properties of a Radius resource. -type BasicResourceProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// DaprPubSubBrokerProperties - DaprPubSubBroker link properties -type DaprPubSubBrokerProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // Metadata for the daprPubSubBroker resource. This should match the values specified in Dapr component spec - Metadata map[string]any - - // The recipe used to automatically deploy underlying infrastructure for the daprPubSubBroker link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // A collection of references to resources associated with the daprPubSubBroker - Resources []*ResourceReference - - // DaprPubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format. - Type *string - - // Dapr component version - Version *string - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string - - // READ-ONLY; Provisioning state of the daprPubSubBroker resource at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// DaprPubSubBrokerResource - DaprPubSubBroker link -type DaprPubSubBrokerResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *DaprPubSubBrokerProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// DaprPubSubBrokerResourceListResult - The response of a DaprPubSubBrokerResource list operation. -type DaprPubSubBrokerResourceListResult struct { - // REQUIRED; The DaprPubSubBrokerResource items on this page - Value []*DaprPubSubBrokerResource - - // The link to the next page of items - NextLink *string -} - -// DaprSecretStoreProperties - DaprSecretStore link properties -type DaprSecretStoreProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // Metadata for the Secret Store resource. This should match the values specified in Dapr component spec - Metadata map[string]any - - // The recipe used to automatically deploy underlying infrastructure for the daprSecretStore link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // Dapr Secret Store type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/ - Type *string - - // Dapr component version - Version *string - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string - - // READ-ONLY; Provisioning state of the dapr secret store link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// DaprSecretStoreResource - DaprSecretStore link -type DaprSecretStoreResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *DaprSecretStoreProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// DaprSecretStoreResourceListResult - The response of a DaprSecretStoreResource list operation. -type DaprSecretStoreResourceListResult struct { - // REQUIRED; The DaprSecretStoreResource items on this page - Value []*DaprSecretStoreResource - - // The link to the next page of items - NextLink *string -} - -// DaprStateStoreProperties - DaprStateStore link properties -type DaprStateStoreProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // Metadata for the state store resource. This should match the values specified in Dapr component spec - Metadata map[string]any - - // The recipe used to automatically deploy underlying infrastructure for the daprStateStore link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // A collection of references to resources associated with the state store - Resources []*ResourceReference - - // Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format. - Type *string - - // Dapr component version - Version *string - - // READ-ONLY; The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to -// use the Dapr component. - ComponentName *string - - // READ-ONLY; Provisioning state of the DaprStateStore link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// DaprStateStoreResource - DaprStateStore link -type DaprStateStoreResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *DaprStateStoreProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// DaprStateStoreResourceListResult - The response of a DaprStateStoreResource list operation. -type DaprStateStoreResourceListResult struct { - // REQUIRED; The DaprStateStoreResource items on this page - Value []*DaprStateStoreResource - - // The link to the next page of items - NextLink *string -} - -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info map[string]any - - // READ-ONLY; The additional info type. - Type *string -} - -// ErrorDetail - The error detail. -type ErrorDetail struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string - - // READ-ONLY; The error details. - Details []*ErrorDetail - - // READ-ONLY; The error message. - Message *string - - // READ-ONLY; The error target. - Target *string -} - -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.). -type ErrorResponse struct { - // The error object. - Error *ErrorDetail -} - -// ExtenderList - Object that includes an array of Extender and a possible link for next set -type ExtenderList struct { - // The link used to fetch the next page of Extender list. - NextLink *string - - // List of Extender resources - Value []*ExtenderResource -} - -// ExtenderProperties - Extender link properties -type ExtenderProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]any - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // The recipe used to automatically deploy underlying infrastructure for the Extender link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // The secret values for the given Extender resource - Secrets map[string]any - - // READ-ONLY; Provisioning state of the extender link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// ExtenderResource - Extender link -type ExtenderResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // REQUIRED; Extender link properties - Properties *ExtenderProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// MongoDatabaseListSecretsResult - The secret values for the given MongoDatabase resource -type MongoDatabaseListSecretsResult struct { - // Connection string used to connect to the target Mongo database - ConnectionString *string - - // Password to use when connecting to the target Mongo database - Password *string -} - -// MongoDatabaseProperties - MongoDatabase link properties -type MongoDatabaseProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // Database name of the target Mongo database - Database *string - - // Host name of the target Mongo database - Host *string - - // Port value of the target Mongo database - Port *int32 - - // The recipe used to automatically deploy underlying infrastructure for the MongoDB link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // List of the resource IDs that support the MongoDB resource - Resources []*ResourceReference - - // Secret values provided for the resource - Secrets *MongoDatabaseSecrets - - // Username to use when connecting to the target Mongo database - Username *string - - // READ-ONLY; Provisioning state of the mongo database link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// MongoDatabaseResource - MongoDatabase link -type MongoDatabaseResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *MongoDatabaseProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// MongoDatabaseResourceListResult - The response of a MongoDatabaseResource list operation. -type MongoDatabaseResourceListResult struct { - // REQUIRED; The MongoDatabaseResource items on this page - Value []*MongoDatabaseResource - - // The link to the next page of items - NextLink *string -} - -// MongoDatabaseSecrets - The secret values for the given MongoDatabase resource -type MongoDatabaseSecrets struct { - // Connection string used to connect to the target Mongo database - ConnectionString *string - - // Password to use when connecting to the target Mongo database - Password *string -} - -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API -type Operation struct { - // Localized display information for this particular operation. - Display *OperationDisplay - - // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType - - // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane -// operations. - IsDataAction *bool - - // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", -// "Microsoft.Compute/virtualMachines/capture/action" - Name *string - - // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default -// value is "user,system" - Origin *Origin -} - -// OperationDisplay - Localized display information for this particular operation. -type OperationDisplay struct { - // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. - Description *string - - // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual -// Machine", "Restart Virtual Machine". - Operation *string - - // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft -// Compute". - Provider *string - - // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job -// Schedule Collections". - Resource *string -} - -// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to -// get the next set of results. -type OperationListResult struct { - // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string - - // READ-ONLY; List of operations supported by the resource provider - Value []*Operation -} - -// RabbitMQListSecretsResult - The secret values for the given RabbitMQMessageQueue resource -type RabbitMQListSecretsResult struct { - // The password used to connect to the RabbitMQ instance - Password *string - - // The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. -// Can be overridden with a custom value - URI *string -} - -// RabbitMQMessageQueueProperties - RabbitMQMessageQueue link properties -type RabbitMQMessageQueueProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // The hostname of the RabbitMQ instance - Host *string - - // The port of the RabbitMQ instance. Defaults to 5672 - Port *int32 - - // The name of the queue - Queue *string - - // The recipe used to automatically deploy underlying infrastructure for the rabbitMQ link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // List of the resource IDs that support the rabbitMQ resource - Resources []*ResourceReference - - // Secrets provided by resources, - Secrets *RabbitMQSecrets - - // Specifies whether to use SSL when connecting to the RabbitMQ instance - TLS *bool - - // The username to use when connecting to the RabbitMQ instance - Username *string - - // The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost. - VHost *string - - // READ-ONLY; Provisioning state of the rabbitMQ message queue link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// RabbitMQMessageQueueResource - RabbitMQMessageQueue link -type RabbitMQMessageQueueResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *RabbitMQMessageQueueProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// RabbitMQMessageQueueResourceListResult - The response of a RabbitMQMessageQueueResource list operation. -type RabbitMQMessageQueueResourceListResult struct { - // REQUIRED; The RabbitMQMessageQueueResource items on this page - Value []*RabbitMQMessageQueueResource - - // The link to the next page of items - NextLink *string -} - -// RabbitMQSecrets - The secret values for the given RabbitMQMessageQueue resource -type RabbitMQSecrets struct { - // The password used to connect to the RabbitMQ instance - Password *string - - // The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. -// Can be overridden with a custom value - URI *string -} - -// Recipe - The recipe used to automatically deploy underlying infrastructure for a link -type Recipe struct { - // REQUIRED; The name of the recipe within the environment to use - Name *string - - // Key/value parameters to pass into the recipe at deployment - Parameters map[string]any -} - -// RedisCacheListSecretsResult - The secret values for the given RedisCache resource -type RedisCacheListSecretsResult struct { - // The connection string used to connect to the Redis cache - ConnectionString *string - - // The password for this Redis cache instance - Password *string - - // The URL used to connect to the Redis cache - URL *string -} - -// RedisCacheProperties - RedisCache link properties -type RedisCacheProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // The host name of the target Redis cache - Host *string - - // The port value of the target Redis cache - Port *int32 - - // The recipe used to automatically deploy underlying infrastructure for the Redis caches link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // List of the resource IDs that support the Redis resource - Resources []*ResourceReference - - // Secrets provided by resource - Secrets *RedisCacheSecrets - - // Specifies whether to enable SSL connections to the Redis cache - TLS *bool - - // The username for Redis cache - Username *string - - // READ-ONLY; Provisioning state of the redis cache link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// RedisCacheResource - RedisCache link -type RedisCacheResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *RedisCacheProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// RedisCacheResourceListResult - The response of a RedisCacheResource list operation. -type RedisCacheResourceListResult struct { - // REQUIRED; The RedisCacheResource items on this page - Value []*RedisCacheResource - - // The link to the next page of items - NextLink *string -} - -// RedisCacheSecrets - The secret values for the given RedisCache resource -type RedisCacheSecrets struct { - // The connection string used to connect to the Redis cache - ConnectionString *string - - // The password for this Redis cache instance - Password *string - - // The URL used to connect to the Redis cache - URL *string -} - -// Resource - Common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ResourceReference - Describes a reference to an existing resource -type ResourceReference struct { - // REQUIRED; Resource id of an existing resource - ID *string -} - -// ResourceStatus - Status of a resource. -type ResourceStatus struct { - // Properties of an output resource - OutputResources []map[string]any -} - -// SQLDatabaseListSecretsResult - The secret values for the given SqlDatabase resource -type SQLDatabaseListSecretsResult struct { - // Connection string used to connect to the target Sql database - ConnectionString *string - - // Password to use when connecting to the target Sql database - Password *string -} - -// SQLDatabaseProperties - SqlDatabase properties -type SQLDatabaseProperties struct { - // REQUIRED; Fully qualified resource ID for the environment that the link is linked to - Environment *string - - // Fully qualified resource ID for the application that the link is consumed by - Application *string - - // The name of the Sql database. - Database *string - - // Port value of the target Sql database - Port *int32 - - // The recipe used to automatically deploy underlying infrastructure for the sqldatabases link - Recipe *Recipe - - // Specifies how the underlying service/resource is provisioned and managed. - ResourceProvisioning *ResourceProvisioning - - // List of the resource IDs that support the SqlDatabase resource - Resources []*ResourceReference - - // Secret values provided for the resource - Secrets *SQLDatabaseSecrets - - // The fully qualified domain name of the Sql database. - Server *string - - // Username to use when connecting to the target Sql database - Username *string - - // READ-ONLY; Provisioning state of the Sql database link at the time the operation was called - ProvisioningState *ProvisioningState - - // READ-ONLY; Status of a resource. - Status *ResourceStatus -} - -// SQLDatabaseResource - SqlDatabase link -type SQLDatabaseResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The resource-specific properties for this resource. - Properties *SQLDatabaseProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// SQLDatabaseResourceListResult - The response of a SqlDatabaseResource list operation. -type SQLDatabaseResourceListResult struct { - // REQUIRED; The SqlDatabaseResource items on this page - Value []*SQLDatabaseResource - - // The link to the next page of items - NextLink *string -} - -// SQLDatabaseSecrets - The secret values for the given SqlDatabase resource -type SQLDatabaseSecrets struct { - // Connection string used to connect to the target Sql database - ConnectionString *string - - // Password to use when connecting to the target Sql database - Password *string -} - -// SystemData - Metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // The timestamp of resource creation (UTC). - CreatedAt *time.Time - - // The identity that created the resource. - CreatedBy *string - - // The type of identity that created the resource. - CreatedByType *CreatedByType - - // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time - - // The identity that last modified the resource. - LastModifiedBy *string - - // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType -} - -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go deleted file mode 100644 index 8e5b7ed185..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_models_serde.go +++ /dev/null @@ -1,2009 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type BasicDaprResourceProperties. -func (b BasicDaprResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", b.Application) - populate(objectMap, "componentName", b.ComponentName) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicDaprResourceProperties. -func (b *BasicDaprResourceProperties) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &b.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. -func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", b.Application) - populate(objectMap, "environment", b.Environment) - populate(objectMap, "status", b.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicResourceProperties. -func (b *BasicResourceProperties) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &b.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &b.Environment) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerProperties. -func (d DaprPubSubBrokerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", d.Application) - populate(objectMap, "componentName", d.ComponentName) - populate(objectMap, "environment", d.Environment) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "recipe", d.Recipe) - populate(objectMap, "resourceProvisioning", d.ResourceProvisioning) - populate(objectMap, "resources", d.Resources) - populate(objectMap, "status", d.Status) - populate(objectMap, "type", d.Type) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprPubSubBrokerProperties. -func (d *DaprPubSubBrokerProperties) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResource. -func (d DaprPubSubBrokerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprPubSubBrokerResource. -func (d *DaprPubSubBrokerResource) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprPubSubBrokerResourceListResult. -func (d DaprPubSubBrokerResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprPubSubBrokerResourceListResult. -func (d *DaprPubSubBrokerResourceListResult) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreProperties. -func (d DaprSecretStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", d.Application) - populate(objectMap, "componentName", d.ComponentName) - populate(objectMap, "environment", d.Environment) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "recipe", d.Recipe) - populate(objectMap, "resourceProvisioning", d.ResourceProvisioning) - populate(objectMap, "status", d.Status) - populate(objectMap, "type", d.Type) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretStoreProperties. -func (d *DaprSecretStoreProperties) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResource. -func (d DaprSecretStoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretStoreResource. -func (d *DaprSecretStoreResource) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprSecretStoreResourceListResult. -func (d DaprSecretStoreResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretStoreResourceListResult. -func (d *DaprSecretStoreResourceListResult) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprStateStoreProperties. -func (d DaprStateStoreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", d.Application) - populate(objectMap, "componentName", d.ComponentName) - populate(objectMap, "environment", d.Environment) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "recipe", d.Recipe) - populate(objectMap, "resourceProvisioning", d.ResourceProvisioning) - populate(objectMap, "resources", d.Resources) - populate(objectMap, "status", d.Status) - populate(objectMap, "type", d.Type) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprStateStoreProperties. -func (d *DaprStateStoreProperties) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &d.Application) - delete(rawMsg, key) - case "componentName": - err = unpopulate(val, "ComponentName", &d.ComponentName) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &d.Environment) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &d.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &d.ResourceProvisioning) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &d.Resources) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResource. -func (d DaprStateStoreResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprStateStoreResource. -func (d *DaprStateStoreResource) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &d.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DaprStateStoreResourceListResult. -func (d DaprStateStoreResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprStateStoreResourceListResult. -func (d *DaprStateStoreResourceListResult) 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) 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 "info": - err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. -func (e *ErrorDetail) 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 "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - 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 ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) 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 "error": - err = unpopulate(val, "Error", &e.Error) - 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 ExtenderList. -func (e ExtenderList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderList. -func (e *ExtenderList) 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 "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - 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) - populate(objectMap, "application", e.Application) - populate(objectMap, "environment", e.Environment) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "recipe", e.Recipe) - populate(objectMap, "resourceProvisioning", e.ResourceProvisioning) - populate(objectMap, "secrets", e.Secrets) - populate(objectMap, "status", e.Status) - if e.AdditionalProperties != nil { - for key, val := range e.AdditionalProperties { - objectMap[key] = val - } - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderProperties. -func (e *ExtenderProperties) 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 "application": - err = unpopulate(val, "Application", &e.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &e.Environment) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &e.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &e.ResourceProvisioning) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &e.Secrets) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) - default: - if e.AdditionalProperties == nil { - e.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - e.AdditionalProperties[key] = aux - } - 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 ExtenderResource. -func (e ExtenderResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtenderResource. -func (e *ExtenderResource) 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 "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 MongoDatabaseListSecretsResult. -func (m MongoDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", m.ConnectionString) - populate(objectMap, "password", m.Password) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseListSecretsResult. -func (m *MongoDatabaseListSecretsResult) 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", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDatabaseProperties. -func (m MongoDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", m.Application) - populate(objectMap, "database", m.Database) - populate(objectMap, "environment", m.Environment) - populate(objectMap, "host", m.Host) - populate(objectMap, "port", m.Port) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "recipe", m.Recipe) - populate(objectMap, "resourceProvisioning", m.ResourceProvisioning) - populate(objectMap, "resources", m.Resources) - populate(objectMap, "secrets", m.Secrets) - populate(objectMap, "status", m.Status) - populate(objectMap, "username", m.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseProperties. -func (m *MongoDatabaseProperties) 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", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &m.Application) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &m.Database) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &m.Environment) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &m.Host) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &m.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &m.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &m.ResourceProvisioning) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &m.Resources) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &m.Secrets) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &m.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResource. -func (m MongoDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseResource. -func (m *MongoDatabaseResource) 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", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDatabaseResourceListResult. -func (m MongoDatabaseResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseResourceListResult. -func (m *MongoDatabaseResourceListResult) 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", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type MongoDatabaseSecrets. -func (m MongoDatabaseSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", m.ConnectionString) - populate(objectMap, "password", m.Password) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDatabaseSecrets. -func (m *MongoDatabaseSecrets) 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", m, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &m.ConnectionString) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &m.Password) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "actionType", o.ActionType) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "actionType": - err = unpopulate(val, "ActionType", &o.ActionType) - delete(rawMsg, key) - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) - delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) 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", o, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RabbitMQListSecretsResult. -func (r RabbitMQListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "password", r.Password) - populate(objectMap, "uri", r.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQListSecretsResult. -func (r *RabbitMQListSecretsResult) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "password": - err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &r.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RabbitMQMessageQueueProperties. -func (r RabbitMQMessageQueueProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", r.Application) - populate(objectMap, "environment", r.Environment) - populate(objectMap, "host", r.Host) - populate(objectMap, "port", r.Port) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "queue", r.Queue) - populate(objectMap, "recipe", r.Recipe) - populate(objectMap, "resourceProvisioning", r.ResourceProvisioning) - populate(objectMap, "resources", r.Resources) - populate(objectMap, "secrets", r.Secrets) - populate(objectMap, "status", r.Status) - populate(objectMap, "tls", r.TLS) - populate(objectMap, "username", r.Username) - populate(objectMap, "vHost", r.VHost) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQMessageQueueProperties. -func (r *RabbitMQMessageQueueProperties) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "queue": - err = unpopulate(val, "Queue", &r.Queue) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) - case "vHost": - err = unpopulate(val, "VHost", &r.VHost) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RabbitMQMessageQueueResource. -func (r RabbitMQMessageQueueResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQMessageQueueResource. -func (r *RabbitMQMessageQueueResource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RabbitMQMessageQueueResourceListResult. -func (r RabbitMQMessageQueueResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQMessageQueueResourceListResult. -func (r *RabbitMQMessageQueueResourceListResult) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RabbitMQSecrets. -func (r RabbitMQSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "password", r.Password) - populate(objectMap, "uri", r.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RabbitMQSecrets. -func (r *RabbitMQSecrets) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "password": - err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &r.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Recipe. -func (r Recipe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", r.Name) - populate(objectMap, "parameters", r.Parameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Recipe. -func (r *Recipe) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &r.Parameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RedisCacheListSecretsResult. -func (r RedisCacheListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", r.ConnectionString) - populate(objectMap, "password", r.Password) - populate(objectMap, "url", r.URL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheListSecretsResult. -func (r *RedisCacheListSecretsResult) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &r.ConnectionString) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RedisCacheProperties. -func (r RedisCacheProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", r.Application) - populate(objectMap, "environment", r.Environment) - populate(objectMap, "host", r.Host) - populate(objectMap, "port", r.Port) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "recipe", r.Recipe) - populate(objectMap, "resourceProvisioning", r.ResourceProvisioning) - populate(objectMap, "resources", r.Resources) - populate(objectMap, "secrets", r.Secrets) - populate(objectMap, "status", r.Status) - populate(objectMap, "tls", r.TLS) - populate(objectMap, "username", r.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheProperties. -func (r *RedisCacheProperties) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &r.Application) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &r.Environment) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &r.Host) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &r.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &r.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &r.ResourceProvisioning) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &r.Resources) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &r.Secrets) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &r.Status) - delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &r.TLS) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &r.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RedisCacheResource. -func (r RedisCacheResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheResource. -func (r *RedisCacheResource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RedisCacheResourceListResult. -func (r RedisCacheResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheResourceListResult. -func (r *RedisCacheResourceListResult) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RedisCacheSecrets. -func (r RedisCacheSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", r.ConnectionString) - populate(objectMap, "password", r.Password) - populate(objectMap, "url", r.URL) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RedisCacheSecrets. -func (r *RedisCacheSecrets) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &r.ConnectionString) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &r.Password) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceReference. -func (r ResourceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceReference. -func (r *ResourceReference) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceStatus. -func (r ResourceStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "outputResources", r.OutputResources) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceStatus. -func (r *ResourceStatus) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "outputResources": - err = unpopulate(val, "OutputResources", &r.OutputResources) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseListSecretsResult. -func (s SQLDatabaseListSecretsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", s.ConnectionString) - populate(objectMap, "password", s.Password) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseListSecretsResult. -func (s *SQLDatabaseListSecretsResult) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &s.ConnectionString) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseProperties. -func (s SQLDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "application", s.Application) - populate(objectMap, "database", s.Database) - populate(objectMap, "environment", s.Environment) - populate(objectMap, "port", s.Port) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "recipe", s.Recipe) - populate(objectMap, "resourceProvisioning", s.ResourceProvisioning) - populate(objectMap, "resources", s.Resources) - populate(objectMap, "secrets", s.Secrets) - populate(objectMap, "server", s.Server) - populate(objectMap, "status", s.Status) - populate(objectMap, "username", s.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseProperties. -func (s *SQLDatabaseProperties) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "application": - err = unpopulate(val, "Application", &s.Application) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &s.Database) - delete(rawMsg, key) - case "environment": - err = unpopulate(val, "Environment", &s.Environment) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &s.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "recipe": - err = unpopulate(val, "Recipe", &s.Recipe) - delete(rawMsg, key) - case "resourceProvisioning": - err = unpopulate(val, "ResourceProvisioning", &s.ResourceProvisioning) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &s.Resources) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &s.Server) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &s.Status) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &s.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResource. -func (s SQLDatabaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseResource. -func (s *SQLDatabaseResource) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseResourceListResult. -func (s SQLDatabaseResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseResourceListResult. -func (s *SQLDatabaseResourceListResult) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SQLDatabaseSecrets. -func (s SQLDatabaseSecrets) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", s.ConnectionString) - populate(objectMap, "password", s.Password) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDatabaseSecrets. -func (s *SQLDatabaseSecrets) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &s.ConnectionString) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) 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", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &t.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -func populate(m map[string]any, k string, v any) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go deleted file mode 100644 index 36b40eca4b..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_mongodatabases_client.go +++ /dev/null @@ -1,334 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// MongoDatabasesClient contains the methods for the MongoDatabases group. -// Don't use this type directly, use NewMongoDatabasesClient() instead. -type MongoDatabasesClient struct { - internal *arm.Client - rootScope string -} - -// NewMongoDatabasesClient creates a new instance of MongoDatabasesClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewMongoDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MongoDatabasesClient, error) { - cl, err := arm.NewClient(moduleName+".MongoDatabasesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &MongoDatabasesClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a MongoDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - mongoDatabaseName - The name of the MongoDatabase link resource -// - resource - Resource create parameters. -// - options - MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate -// method. -func (client *MongoDatabasesClient) CreateOrUpdate(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientCreateOrUpdateOptions) (MongoDatabasesClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, mongoDatabaseName, resource, options) - if err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *MongoDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, mongoDatabaseName string, resource MongoDatabaseResource, options *MongoDatabasesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if mongoDatabaseName == "" { - return nil, errors.New("parameter mongoDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *MongoDatabasesClient) createOrUpdateHandleResponse(resp *http.Response) (MongoDatabasesClientCreateOrUpdateResponse, error) { - result := MongoDatabasesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.MongoDatabaseResource); err != nil { - return MongoDatabasesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// BeginDelete - Deletes an existing MongoDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - mongoDatabaseName - The name of the MongoDatabase link resource -// - options - MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete -// method. -func (client *MongoDatabasesClient) BeginDelete(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*runtime.Poller[MongoDatabasesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, mongoDatabaseName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MongoDatabasesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken[MongoDatabasesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Deletes an existing MongoDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -func (client *MongoDatabasesClient) deleteOperation(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*http.Response, error) { - var err error - req, err := client.deleteCreateRequest(ctx, mongoDatabaseName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *MongoDatabasesClient) deleteCreateRequest(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if mongoDatabaseName == "" { - return nil, errors.New("parameter mongoDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a MongoDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - mongoDatabaseName - The name of the MongoDatabase link resource -// - options - MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. -func (client *MongoDatabasesClient) Get(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientGetOptions) (MongoDatabasesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, mongoDatabaseName, options) - if err != nil { - return MongoDatabasesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoDatabasesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MongoDatabasesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *MongoDatabasesClient) getCreateRequest(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if mongoDatabaseName == "" { - return nil, errors.New("parameter mongoDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *MongoDatabasesClient) getHandleResponse(resp *http.Response) (MongoDatabasesClientGetResponse, error) { - result := MongoDatabasesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoDatabaseResource); err != nil { - return MongoDatabasesClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all MongoDatabaseResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.NewListByRootScopePager -// method. -func (client *MongoDatabasesClient) NewListByRootScopePager(options *MongoDatabasesClientListByRootScopeOptions) (*runtime.Pager[MongoDatabasesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[MongoDatabasesClientListByRootScopeResponse]{ - More: func(page MongoDatabasesClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *MongoDatabasesClientListByRootScopeResponse) (MongoDatabasesClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return MongoDatabasesClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoDatabasesClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDatabasesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *MongoDatabasesClient) listByRootScopeCreateRequest(ctx context.Context, options *MongoDatabasesClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/mongoDatabases" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *MongoDatabasesClient) listByRootScopeHandleResponse(resp *http.Response) (MongoDatabasesClientListByRootScopeResponse, error) { - result := MongoDatabasesClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoDatabaseResourceListResult); err != nil { - return MongoDatabasesClientListByRootScopeResponse{}, err - } - return result, nil -} - -// ListSecrets - Lists secrets values for the specified MongoDatabase resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - mongoDatabaseName - The name of the MongoDatabase link resource -// - options - MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets -// method. -func (client *MongoDatabasesClient) ListSecrets(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientListSecretsOptions) (MongoDatabasesClientListSecretsResponse, error) { - var err error - req, err := client.listSecretsCreateRequest(ctx, mongoDatabaseName, options) - if err != nil { - return MongoDatabasesClientListSecretsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return MongoDatabasesClientListSecretsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return MongoDatabasesClientListSecretsResponse{}, err - } - resp, err := client.listSecretsHandleResponse(httpResp) - return resp, err -} - -// listSecretsCreateRequest creates the ListSecrets request. -func (client *MongoDatabasesClient) listSecretsCreateRequest(ctx context.Context, mongoDatabaseName string, options *MongoDatabasesClientListSecretsOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}/listSecrets" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if mongoDatabaseName == "" { - return nil, errors.New("parameter mongoDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{mongoDatabaseName}", url.PathEscape(mongoDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSecretsHandleResponse handles the ListSecrets response. -func (client *MongoDatabasesClient) listSecretsHandleResponse(resp *http.Response) (MongoDatabasesClientListSecretsResponse, error) { - result := MongoDatabasesClientListSecretsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoDatabaseListSecretsResult); err != nil { - return MongoDatabasesClientListSecretsResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go deleted file mode 100644 index 8954f5730b..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_operations_client.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" -) - -// OperationsClient contains the methods for the Operations group. -// Don't use this type directly, use NewOperationsClient() instead. -type OperationsClient struct { - internal *arm.Client -} - -// NewOperationsClient creates a new instance of OperationsClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { - cl, err := arm.NewClient(moduleName+".OperationsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &OperationsClient{ - internal: cl, - } - return client, nil -} - -// NewListPager - List the operations for the provider -// -// Generated from API version 2022-03-15-privatepreview -// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) (*runtime.Pager[OperationsClientListResponse]) { - return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ - More: func(page OperationsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return OperationsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return OperationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { - urlPath := "/providers/Applications.Link/operations" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { - return OperationsClientListResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go deleted file mode 100644 index 3c131dadda..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_options.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -// DaprPubSubBrokerClientBeginDeleteOptions contains the optional parameters for the DaprPubSubBrokerClient.BeginDelete method. -type DaprPubSubBrokerClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DaprPubSubBrokerClientCreateOrUpdateOptions contains the optional parameters for the DaprPubSubBrokerClient.CreateOrUpdate -// method. -type DaprPubSubBrokerClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerClientGetOptions contains the optional parameters for the DaprPubSubBrokerClient.Get method. -type DaprPubSubBrokerClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprPubSubBrokerClientListByRootScopeOptions contains the optional parameters for the DaprPubSubBrokerClient.NewListByRootScopePager -// method. -type DaprPubSubBrokerClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprSecretStoreClient.CreateOrUpdate -// method. -type DaprSecretStoreClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientDeleteOptions contains the optional parameters for the DaprSecretStoreClient.Delete method. -type DaprSecretStoreClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientGetOptions contains the optional parameters for the DaprSecretStoreClient.Get method. -type DaprSecretStoreClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprSecretStoreClientListByRootScopeOptions contains the optional parameters for the DaprSecretStoreClient.NewListByRootScopePager -// method. -type DaprSecretStoreClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// DaprStateStoreClientBeginDeleteOptions contains the optional parameters for the DaprStateStoreClient.BeginDelete method. -type DaprStateStoreClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DaprStateStoreClientCreateOrUpdateOptions contains the optional parameters for the DaprStateStoreClient.CreateOrUpdate -// method. -type DaprStateStoreClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprStateStoreClientGetOptions contains the optional parameters for the DaprStateStoreClient.Get method. -type DaprStateStoreClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprStateStoreClientListByRootScopeOptions contains the optional parameters for the DaprStateStoreClient.NewListByRootScopePager -// method. -type DaprStateStoreClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientCreateOrUpdateOptions contains the optional parameters for the ExtendersClient.CreateOrUpdate method. -type ExtendersClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientDeleteOptions contains the optional parameters for the ExtendersClient.Delete method. -type ExtendersClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientGetOptions contains the optional parameters for the ExtendersClient.Get method. -type ExtendersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientListByRootScopeOptions contains the optional parameters for the ExtendersClient.NewListByRootScopePager -// method. -type ExtendersClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// ExtendersClientListSecretsOptions contains the optional parameters for the ExtendersClient.ListSecrets method. -type ExtendersClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientBeginDeleteOptions contains the optional parameters for the MongoDatabasesClient.BeginDelete method. -type MongoDatabasesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MongoDatabasesClientCreateOrUpdateOptions contains the optional parameters for the MongoDatabasesClient.CreateOrUpdate -// method. -type MongoDatabasesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientGetOptions contains the optional parameters for the MongoDatabasesClient.Get method. -type MongoDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientListByRootScopeOptions contains the optional parameters for the MongoDatabasesClient.NewListByRootScopePager -// method. -type MongoDatabasesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// MongoDatabasesClientListSecretsOptions contains the optional parameters for the MongoDatabasesClient.ListSecrets method. -type MongoDatabasesClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqMessageQueuesClient.CreateOrUpdate -// method. -type RabbitMqMessageQueuesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientDeleteOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Delete method. -type RabbitMqMessageQueuesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientGetOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Get method. -type RabbitMqMessageQueuesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqMessageQueuesClient.NewListByRootScopePager -// method. -type RabbitMqMessageQueuesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// RabbitMqMessageQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListSecrets -// method. -type RabbitMqMessageQueuesClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate method. -type RedisCachesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. -type RedisCachesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. -type RedisCachesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.NewListByRootScopePager -// method. -type RedisCachesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. -type RedisCachesClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate method. -type SQLDatabasesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. -type SQLDatabasesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. -type SQLDatabasesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.NewListByRootScopePager -// method. -type SQLDatabasesClientListByRootScopeOptions struct { - // placeholder for future optional parameters -} - -// SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets method. -type SQLDatabasesClientListSecretsOptions struct { - // placeholder for future optional parameters -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go deleted file mode 100644 index 46ad8fb156..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rabbitmqmessagequeues_client.go +++ /dev/null @@ -1,331 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// RabbitMqMessageQueuesClient contains the methods for the RabbitMqMessageQueues group. -// Don't use this type directly, use NewRabbitMqMessageQueuesClient() instead. -type RabbitMqMessageQueuesClient struct { - internal *arm.Client - rootScope string -} - -// NewRabbitMqMessageQueuesClient creates a new instance of RabbitMqMessageQueuesClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRabbitMqMessageQueuesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RabbitMqMessageQueuesClient, error) { - cl, err := arm.NewClient(moduleName+".RabbitMqMessageQueuesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RabbitMqMessageQueuesClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a RabbitMQMessageQueueResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// - resource - Resource create parameters. -// - options - RabbitMqMessageQueuesClientCreateOrUpdateOptions contains the optional parameters for the RabbitMqMessageQueuesClient.CreateOrUpdate -// method. -func (client *RabbitMqMessageQueuesClient) CreateOrUpdate(ctx context.Context, rabbitMQMessageQueueName string, resource RabbitMQMessageQueueResource, options *RabbitMqMessageQueuesClientCreateOrUpdateOptions) (RabbitMqMessageQueuesClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, rabbitMQMessageQueueName, resource, options) - if err != nil { - return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RabbitMqMessageQueuesClient) createOrUpdateCreateRequest(ctx context.Context, rabbitMQMessageQueueName string, resource RabbitMQMessageQueueResource, options *RabbitMqMessageQueuesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if rabbitMQMessageQueueName == "" { - return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RabbitMqMessageQueuesClient) createOrUpdateHandleResponse(resp *http.Response) (RabbitMqMessageQueuesClientCreateOrUpdateResponse, error) { - result := RabbitMqMessageQueuesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.RabbitMQMessageQueueResource); err != nil { - return RabbitMqMessageQueuesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing RabbitMQMessageQueueResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// - options - RabbitMqMessageQueuesClientDeleteOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Delete -// method. -func (client *RabbitMqMessageQueuesClient) Delete(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientDeleteOptions) (RabbitMqMessageQueuesClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, rabbitMQMessageQueueName, options) - if err != nil { - return RabbitMqMessageQueuesClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RabbitMqMessageQueuesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return RabbitMqMessageQueuesClientDeleteResponse{}, err - } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err -} - -// deleteCreateRequest creates the Delete request. -func (client *RabbitMqMessageQueuesClient) deleteCreateRequest(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if rabbitMQMessageQueueName == "" { - return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *RabbitMqMessageQueuesClient) deleteHandleResponse(resp *http.Response) (RabbitMqMessageQueuesClientDeleteResponse, error) { - result := RabbitMqMessageQueuesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return RabbitMqMessageQueuesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a RabbitMQMessageQueueResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// - options - RabbitMqMessageQueuesClientGetOptions contains the optional parameters for the RabbitMqMessageQueuesClient.Get -// method. -func (client *RabbitMqMessageQueuesClient) Get(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientGetOptions) (RabbitMqMessageQueuesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, rabbitMQMessageQueueName, options) - if err != nil { - return RabbitMqMessageQueuesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RabbitMqMessageQueuesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RabbitMqMessageQueuesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RabbitMqMessageQueuesClient) getCreateRequest(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if rabbitMQMessageQueueName == "" { - return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RabbitMqMessageQueuesClient) getHandleResponse(resp *http.Response) (RabbitMqMessageQueuesClientGetResponse, error) { - result := RabbitMqMessageQueuesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RabbitMQMessageQueueResource); err != nil { - return RabbitMqMessageQueuesClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all RabbitMQMessageQueueResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - RabbitMqMessageQueuesClientListByRootScopeOptions contains the optional parameters for the RabbitMqMessageQueuesClient.NewListByRootScopePager -// method. -func (client *RabbitMqMessageQueuesClient) NewListByRootScopePager(options *RabbitMqMessageQueuesClientListByRootScopeOptions) (*runtime.Pager[RabbitMqMessageQueuesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[RabbitMqMessageQueuesClientListByRootScopeResponse]{ - More: func(page RabbitMqMessageQueuesClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RabbitMqMessageQueuesClientListByRootScopeResponse) (RabbitMqMessageQueuesClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RabbitMqMessageQueuesClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RabbitMqMessageQueuesClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RabbitMqMessageQueuesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *RabbitMqMessageQueuesClient) listByRootScopeCreateRequest(ctx context.Context, options *RabbitMqMessageQueuesClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *RabbitMqMessageQueuesClient) listByRootScopeHandleResponse(resp *http.Response) (RabbitMqMessageQueuesClientListByRootScopeResponse, error) { - result := RabbitMqMessageQueuesClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RabbitMQMessageQueueResourceListResult); err != nil { - return RabbitMqMessageQueuesClientListByRootScopeResponse{}, err - } - return result, nil -} - -// ListSecrets - Lists secrets values for the specified RabbitMQMessageQueue resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - rabbitMQMessageQueueName - The name of the RabbitMQMessageQueue link resource -// - options - RabbitMqMessageQueuesClientListSecretsOptions contains the optional parameters for the RabbitMqMessageQueuesClient.ListSecrets -// method. -func (client *RabbitMqMessageQueuesClient) ListSecrets(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientListSecretsOptions) (RabbitMqMessageQueuesClientListSecretsResponse, error) { - var err error - req, err := client.listSecretsCreateRequest(ctx, rabbitMQMessageQueueName, options) - if err != nil { - return RabbitMqMessageQueuesClientListSecretsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RabbitMqMessageQueuesClientListSecretsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RabbitMqMessageQueuesClientListSecretsResponse{}, err - } - resp, err := client.listSecretsHandleResponse(httpResp) - return resp, err -} - -// listSecretsCreateRequest creates the ListSecrets request. -func (client *RabbitMqMessageQueuesClient) listSecretsCreateRequest(ctx context.Context, rabbitMQMessageQueueName string, options *RabbitMqMessageQueuesClientListSecretsOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}/listSecrets" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if rabbitMQMessageQueueName == "" { - return nil, errors.New("parameter rabbitMQMessageQueueName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{rabbitMQMessageQueueName}", url.PathEscape(rabbitMQMessageQueueName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSecretsHandleResponse handles the ListSecrets response. -func (client *RabbitMqMessageQueuesClient) listSecretsHandleResponse(resp *http.Response) (RabbitMqMessageQueuesClientListSecretsResponse, error) { - result := RabbitMqMessageQueuesClientListSecretsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RabbitMQListSecretsResult); err != nil { - return RabbitMqMessageQueuesClientListSecretsResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go deleted file mode 100644 index ce1861a050..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_rediscaches_client.go +++ /dev/null @@ -1,328 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// RedisCachesClient contains the methods for the RedisCaches group. -// Don't use this type directly, use NewRedisCachesClient() instead. -type RedisCachesClient struct { - internal *arm.Client - rootScope string -} - -// NewRedisCachesClient creates a new instance of RedisCachesClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewRedisCachesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RedisCachesClient, error) { - cl, err := arm.NewClient(moduleName+".RedisCachesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &RedisCachesClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a RedisCacheResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - redisCacheName - The name of the RedisCache link resource -// - resource - Resource create parameters. -// - options - RedisCachesClientCreateOrUpdateOptions contains the optional parameters for the RedisCachesClient.CreateOrUpdate -// method. -func (client *RedisCachesClient) CreateOrUpdate(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientCreateOrUpdateOptions) (RedisCachesClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, redisCacheName, resource, options) - if err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return RedisCachesClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RedisCachesClient) createOrUpdateCreateRequest(ctx context.Context, redisCacheName string, resource RedisCacheResource, options *RedisCachesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if redisCacheName == "" { - return nil, errors.New("parameter redisCacheName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RedisCachesClient) createOrUpdateHandleResponse(resp *http.Response) (RedisCachesClientCreateOrUpdateResponse, error) { - result := RedisCachesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.RedisCacheResource); err != nil { - return RedisCachesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing RedisCacheResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - redisCacheName - The name of the RedisCache link resource -// - options - RedisCachesClientDeleteOptions contains the optional parameters for the RedisCachesClient.Delete method. -func (client *RedisCachesClient) Delete(ctx context.Context, redisCacheName string, options *RedisCachesClientDeleteOptions) (RedisCachesClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, redisCacheName, options) - if err != nil { - return RedisCachesClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RedisCachesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return RedisCachesClientDeleteResponse{}, err - } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err -} - -// deleteCreateRequest creates the Delete request. -func (client *RedisCachesClient) deleteCreateRequest(ctx context.Context, redisCacheName string, options *RedisCachesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if redisCacheName == "" { - return nil, errors.New("parameter redisCacheName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *RedisCachesClient) deleteHandleResponse(resp *http.Response) (RedisCachesClientDeleteResponse, error) { - result := RedisCachesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return RedisCachesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a RedisCacheResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - redisCacheName - The name of the RedisCache link resource -// - options - RedisCachesClientGetOptions contains the optional parameters for the RedisCachesClient.Get method. -func (client *RedisCachesClient) Get(ctx context.Context, redisCacheName string, options *RedisCachesClientGetOptions) (RedisCachesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, redisCacheName, options) - if err != nil { - return RedisCachesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RedisCachesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RedisCachesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *RedisCachesClient) getCreateRequest(ctx context.Context, redisCacheName string, options *RedisCachesClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if redisCacheName == "" { - return nil, errors.New("parameter redisCacheName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *RedisCachesClient) getHandleResponse(resp *http.Response) (RedisCachesClientGetResponse, error) { - result := RedisCachesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RedisCacheResource); err != nil { - return RedisCachesClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all RedisCacheResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - RedisCachesClientListByRootScopeOptions contains the optional parameters for the RedisCachesClient.NewListByRootScopePager -// method. -func (client *RedisCachesClient) NewListByRootScopePager(options *RedisCachesClientListByRootScopeOptions) (*runtime.Pager[RedisCachesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[RedisCachesClientListByRootScopeResponse]{ - More: func(page RedisCachesClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *RedisCachesClientListByRootScopeResponse) (RedisCachesClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return RedisCachesClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RedisCachesClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RedisCachesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *RedisCachesClient) listByRootScopeCreateRequest(ctx context.Context, options *RedisCachesClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/redisCaches" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *RedisCachesClient) listByRootScopeHandleResponse(resp *http.Response) (RedisCachesClientListByRootScopeResponse, error) { - result := RedisCachesClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RedisCacheResourceListResult); err != nil { - return RedisCachesClientListByRootScopeResponse{}, err - } - return result, nil -} - -// ListSecrets - Lists secrets values for the specified RedisCache resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - redisCacheName - The name of the RedisCache link resource -// - options - RedisCachesClientListSecretsOptions contains the optional parameters for the RedisCachesClient.ListSecrets method. -func (client *RedisCachesClient) ListSecrets(ctx context.Context, redisCacheName string, options *RedisCachesClientListSecretsOptions) (RedisCachesClientListSecretsResponse, error) { - var err error - req, err := client.listSecretsCreateRequest(ctx, redisCacheName, options) - if err != nil { - return RedisCachesClientListSecretsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return RedisCachesClientListSecretsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return RedisCachesClientListSecretsResponse{}, err - } - resp, err := client.listSecretsHandleResponse(httpResp) - return resp, err -} - -// listSecretsCreateRequest creates the ListSecrets request. -func (client *RedisCachesClient) listSecretsCreateRequest(ctx context.Context, redisCacheName string, options *RedisCachesClientListSecretsOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}/listSecrets" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if redisCacheName == "" { - return nil, errors.New("parameter redisCacheName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{redisCacheName}", url.PathEscape(redisCacheName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSecretsHandleResponse handles the ListSecrets response. -func (client *RedisCachesClient) listSecretsHandleResponse(resp *http.Response) (RedisCachesClientListSecretsResponse, error) { - result := RedisCachesClientListSecretsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RedisCacheListSecretsResult); err != nil { - return RedisCachesClientListSecretsResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go deleted file mode 100644 index b37d36fcf0..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_response_types.go +++ /dev/null @@ -1,254 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -// DaprPubSubBrokerClientCreateOrUpdateResponse contains the response from method DaprPubSubBrokerClient.CreateOrUpdate. -type DaprPubSubBrokerClientCreateOrUpdateResponse struct { - // DaprPubSubBroker link - DaprPubSubBrokerResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// DaprPubSubBrokerClientDeleteResponse contains the response from method DaprPubSubBrokerClient.BeginDelete. -type DaprPubSubBrokerClientDeleteResponse struct { - // placeholder for future response values -} - -// DaprPubSubBrokerClientGetResponse contains the response from method DaprPubSubBrokerClient.Get. -type DaprPubSubBrokerClientGetResponse struct { - // DaprPubSubBroker link - DaprPubSubBrokerResource -} - -// DaprPubSubBrokerClientListByRootScopeResponse contains the response from method DaprPubSubBrokerClient.NewListByRootScopePager. -type DaprPubSubBrokerClientListByRootScopeResponse struct { - // The response of a DaprPubSubBrokerResource list operation. - DaprPubSubBrokerResourceListResult -} - -// DaprSecretStoreClientCreateOrUpdateResponse contains the response from method DaprSecretStoreClient.CreateOrUpdate. -type DaprSecretStoreClientCreateOrUpdateResponse struct { - // DaprSecretStore link - DaprSecretStoreResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// DaprSecretStoreClientDeleteResponse contains the response from method DaprSecretStoreClient.Delete. -type DaprSecretStoreClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// DaprSecretStoreClientGetResponse contains the response from method DaprSecretStoreClient.Get. -type DaprSecretStoreClientGetResponse struct { - // DaprSecretStore link - DaprSecretStoreResource -} - -// DaprSecretStoreClientListByRootScopeResponse contains the response from method DaprSecretStoreClient.NewListByRootScopePager. -type DaprSecretStoreClientListByRootScopeResponse struct { - // The response of a DaprSecretStoreResource list operation. - DaprSecretStoreResourceListResult -} - -// DaprStateStoreClientCreateOrUpdateResponse contains the response from method DaprStateStoreClient.CreateOrUpdate. -type DaprStateStoreClientCreateOrUpdateResponse struct { - // DaprStateStore link - DaprStateStoreResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// DaprStateStoreClientDeleteResponse contains the response from method DaprStateStoreClient.BeginDelete. -type DaprStateStoreClientDeleteResponse struct { - // placeholder for future response values -} - -// DaprStateStoreClientGetResponse contains the response from method DaprStateStoreClient.Get. -type DaprStateStoreClientGetResponse struct { - // DaprStateStore link - DaprStateStoreResource -} - -// DaprStateStoreClientListByRootScopeResponse contains the response from method DaprStateStoreClient.NewListByRootScopePager. -type DaprStateStoreClientListByRootScopeResponse struct { - // The response of a DaprStateStoreResource list operation. - DaprStateStoreResourceListResult -} - -// ExtendersClientCreateOrUpdateResponse contains the response from method ExtendersClient.CreateOrUpdate. -type ExtendersClientCreateOrUpdateResponse struct { - // Extender link - ExtenderResource -} - -// ExtendersClientDeleteResponse contains the response from method ExtendersClient.Delete. -type ExtendersClientDeleteResponse struct { - // placeholder for future response values -} - -// ExtendersClientGetResponse contains the response from method ExtendersClient.Get. -type ExtendersClientGetResponse struct { - // Extender link - ExtenderResource -} - -// ExtendersClientListByRootScopeResponse contains the response from method ExtendersClient.NewListByRootScopePager. -type ExtendersClientListByRootScopeResponse struct { - // Object that includes an array of Extender and a possible link for next set - ExtenderList -} - -// ExtendersClientListSecretsResponse contains the response from method ExtendersClient.ListSecrets. -type ExtendersClientListSecretsResponse struct { - // The secret values for the given Extender resource - Value map[string]any -} - -// MongoDatabasesClientCreateOrUpdateResponse contains the response from method MongoDatabasesClient.CreateOrUpdate. -type MongoDatabasesClientCreateOrUpdateResponse struct { - // MongoDatabase link - MongoDatabaseResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// MongoDatabasesClientDeleteResponse contains the response from method MongoDatabasesClient.BeginDelete. -type MongoDatabasesClientDeleteResponse struct { - // placeholder for future response values -} - -// MongoDatabasesClientGetResponse contains the response from method MongoDatabasesClient.Get. -type MongoDatabasesClientGetResponse struct { - // MongoDatabase link - MongoDatabaseResource -} - -// MongoDatabasesClientListByRootScopeResponse contains the response from method MongoDatabasesClient.NewListByRootScopePager. -type MongoDatabasesClientListByRootScopeResponse struct { - // The response of a MongoDatabaseResource list operation. - MongoDatabaseResourceListResult -} - -// MongoDatabasesClientListSecretsResponse contains the response from method MongoDatabasesClient.ListSecrets. -type MongoDatabasesClientListSecretsResponse struct { - // The secret values for the given MongoDatabase resource - MongoDatabaseListSecretsResult -} - -// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. -type OperationsClientListResponse struct { - // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. - OperationListResult -} - -// RabbitMqMessageQueuesClientCreateOrUpdateResponse contains the response from method RabbitMqMessageQueuesClient.CreateOrUpdate. -type RabbitMqMessageQueuesClientCreateOrUpdateResponse struct { - // RabbitMQMessageQueue link - RabbitMQMessageQueueResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// RabbitMqMessageQueuesClientDeleteResponse contains the response from method RabbitMqMessageQueuesClient.Delete. -type RabbitMqMessageQueuesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// RabbitMqMessageQueuesClientGetResponse contains the response from method RabbitMqMessageQueuesClient.Get. -type RabbitMqMessageQueuesClientGetResponse struct { - // RabbitMQMessageQueue link - RabbitMQMessageQueueResource -} - -// RabbitMqMessageQueuesClientListByRootScopeResponse contains the response from method RabbitMqMessageQueuesClient.NewListByRootScopePager. -type RabbitMqMessageQueuesClientListByRootScopeResponse struct { - // The response of a RabbitMQMessageQueueResource list operation. - RabbitMQMessageQueueResourceListResult -} - -// RabbitMqMessageQueuesClientListSecretsResponse contains the response from method RabbitMqMessageQueuesClient.ListSecrets. -type RabbitMqMessageQueuesClientListSecretsResponse struct { - // The secret values for the given RabbitMQMessageQueue resource - RabbitMQListSecretsResult -} - -// RedisCachesClientCreateOrUpdateResponse contains the response from method RedisCachesClient.CreateOrUpdate. -type RedisCachesClientCreateOrUpdateResponse struct { - // RedisCache link - RedisCacheResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// RedisCachesClientDeleteResponse contains the response from method RedisCachesClient.Delete. -type RedisCachesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// RedisCachesClientGetResponse contains the response from method RedisCachesClient.Get. -type RedisCachesClientGetResponse struct { - // RedisCache link - RedisCacheResource -} - -// RedisCachesClientListByRootScopeResponse contains the response from method RedisCachesClient.NewListByRootScopePager. -type RedisCachesClientListByRootScopeResponse struct { - // The response of a RedisCacheResource list operation. - RedisCacheResourceListResult -} - -// RedisCachesClientListSecretsResponse contains the response from method RedisCachesClient.ListSecrets. -type RedisCachesClientListSecretsResponse struct { - // The secret values for the given RedisCache resource - RedisCacheListSecretsResult -} - -// SQLDatabasesClientCreateOrUpdateResponse contains the response from method SQLDatabasesClient.CreateOrUpdate. -type SQLDatabasesClientCreateOrUpdateResponse struct { - // SqlDatabase link - SQLDatabaseResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// SQLDatabasesClientDeleteResponse contains the response from method SQLDatabasesClient.Delete. -type SQLDatabasesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 -} - -// SQLDatabasesClientGetResponse contains the response from method SQLDatabasesClient.Get. -type SQLDatabasesClientGetResponse struct { - // SqlDatabase link - SQLDatabaseResource -} - -// SQLDatabasesClientListByRootScopeResponse contains the response from method SQLDatabasesClient.NewListByRootScopePager. -type SQLDatabasesClientListByRootScopeResponse struct { - // The response of a SqlDatabaseResource list operation. - SQLDatabaseResourceListResult -} - -// SQLDatabasesClientListSecretsResponse contains the response from method SQLDatabasesClient.ListSecrets. -type SQLDatabasesClientListSecretsResponse struct { - // The secret values for the given SqlDatabase resource - SQLDatabaseListSecretsResult -} - diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go b/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go deleted file mode 100644 index 7a4b38e117..0000000000 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_sqldatabases_client.go +++ /dev/null @@ -1,329 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// SQLDatabasesClient contains the methods for the SQLDatabases group. -// Don't use this type directly, use NewSQLDatabasesClient() instead. -type SQLDatabasesClient struct { - internal *arm.Client - rootScope string -} - -// NewSQLDatabasesClient creates a new instance of SQLDatabasesClient with the specified values. -// - rootScope - The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID} -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSQLDatabasesClient(rootScope string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLDatabasesClient, error) { - cl, err := arm.NewClient(moduleName+".SQLDatabasesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SQLDatabasesClient{ - rootScope: rootScope, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a SqlDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - sqlDatabaseName - The name of the SqlDatabase link resource -// - resource - Resource create parameters. -// - options - SQLDatabasesClientCreateOrUpdateOptions contains the optional parameters for the SQLDatabasesClient.CreateOrUpdate -// method. -func (client *SQLDatabasesClient) CreateOrUpdate(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientCreateOrUpdateOptions) (SQLDatabasesClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, sqlDatabaseName, resource, options) - if err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return SQLDatabasesClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SQLDatabasesClient) createOrUpdateCreateRequest(ctx context.Context, sqlDatabaseName string, resource SQLDatabaseResource, options *SQLDatabasesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if sqlDatabaseName == "" { - return nil, errors.New("parameter sqlDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *SQLDatabasesClient) createOrUpdateHandleResponse(resp *http.Response) (SQLDatabasesClientCreateOrUpdateResponse, error) { - result := SQLDatabasesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.SQLDatabaseResource); err != nil { - return SQLDatabasesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing SqlDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - sqlDatabaseName - The name of the SqlDatabase link resource -// - options - SQLDatabasesClientDeleteOptions contains the optional parameters for the SQLDatabasesClient.Delete method. -func (client *SQLDatabasesClient) Delete(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientDeleteOptions) (SQLDatabasesClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, sqlDatabaseName, options) - if err != nil { - return SQLDatabasesClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SQLDatabasesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return SQLDatabasesClientDeleteResponse{}, err - } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err -} - -// deleteCreateRequest creates the Delete request. -func (client *SQLDatabasesClient) deleteCreateRequest(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if sqlDatabaseName == "" { - return nil, errors.New("parameter sqlDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *SQLDatabasesClient) deleteHandleResponse(resp *http.Response) (SQLDatabasesClientDeleteResponse, error) { - result := SQLDatabasesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return SQLDatabasesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a SqlDatabaseResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - sqlDatabaseName - The name of the SqlDatabase link resource -// - options - SQLDatabasesClientGetOptions contains the optional parameters for the SQLDatabasesClient.Get method. -func (client *SQLDatabasesClient) Get(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientGetOptions) (SQLDatabasesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, sqlDatabaseName, options) - if err != nil { - return SQLDatabasesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SQLDatabasesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SQLDatabasesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *SQLDatabasesClient) getCreateRequest(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientGetOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if sqlDatabaseName == "" { - return nil, errors.New("parameter sqlDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *SQLDatabasesClient) getHandleResponse(resp *http.Response) (SQLDatabasesClientGetResponse, error) { - result := SQLDatabasesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SQLDatabaseResource); err != nil { - return SQLDatabasesClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all SqlDatabaseResources in the given root scope -// -// Generated from API version 2022-03-15-privatepreview -// - options - SQLDatabasesClientListByRootScopeOptions contains the optional parameters for the SQLDatabasesClient.NewListByRootScopePager -// method. -func (client *SQLDatabasesClient) NewListByRootScopePager(options *SQLDatabasesClientListByRootScopeOptions) (*runtime.Pager[SQLDatabasesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[SQLDatabasesClientListByRootScopeResponse]{ - More: func(page SQLDatabasesClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SQLDatabasesClientListByRootScopeResponse) (SQLDatabasesClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return SQLDatabasesClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SQLDatabasesClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLDatabasesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *SQLDatabasesClient) listByRootScopeCreateRequest(ctx context.Context, options *SQLDatabasesClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/sqlDatabases" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *SQLDatabasesClient) listByRootScopeHandleResponse(resp *http.Response) (SQLDatabasesClientListByRootScopeResponse, error) { - result := SQLDatabasesClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SQLDatabaseResourceListResult); err != nil { - return SQLDatabasesClientListByRootScopeResponse{}, err - } - return result, nil -} - -// ListSecrets - Lists secrets values for the specified SqlDatabase resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-03-15-privatepreview -// - sqlDatabaseName - The name of the SqlDatabase link resource -// - options - SQLDatabasesClientListSecretsOptions contains the optional parameters for the SQLDatabasesClient.ListSecrets -// method. -func (client *SQLDatabasesClient) ListSecrets(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientListSecretsOptions) (SQLDatabasesClientListSecretsResponse, error) { - var err error - req, err := client.listSecretsCreateRequest(ctx, sqlDatabaseName, options) - if err != nil { - return SQLDatabasesClientListSecretsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return SQLDatabasesClientListSecretsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return SQLDatabasesClientListSecretsResponse{}, err - } - resp, err := client.listSecretsHandleResponse(httpResp) - return resp, err -} - -// listSecretsCreateRequest creates the ListSecrets request. -func (client *SQLDatabasesClient) listSecretsCreateRequest(ctx context.Context, sqlDatabaseName string, options *SQLDatabasesClientListSecretsOptions) (*policy.Request, error) { - urlPath := "/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}/listSecrets" - urlPath = strings.ReplaceAll(urlPath, "{rootScope}", client.rootScope) - if sqlDatabaseName == "" { - return nil, errors.New("parameter sqlDatabaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sqlDatabaseName}", url.PathEscape(sqlDatabaseName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-15-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listSecretsHandleResponse handles the ListSecrets response. -func (client *SQLDatabasesClient) listSecretsHandleResponse(resp *http.Response) (SQLDatabasesClientListSecretsResponse, error) { - result := SQLDatabasesClientListSecretsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SQLDatabaseListSecretsResult); err != nil { - return SQLDatabasesClientListSecretsResponse{}, err - } - return result, nil -} - diff --git a/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter.go b/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter.go deleted file mode 100644 index 22a54469f3..0000000000 --- a/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// DaprPubSubBrokerDataModelFromVersioned converts version agnostic DaprPubSubBroker datamodel to versioned model. -// It returns an error if the version is not supported. -func DaprPubSubBrokerDataModelToVersioned(model *datamodel.DaprPubSubBroker, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.DaprPubSubBrokerResource{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// DaprPubSubBrokerDataModelToVersioned converts versioned DaprPubSubBroker model to datamodel and returns -// an error if the version is unsupported. -func DaprPubSubBrokerDataModelFromVersioned(content []byte, version string) (*datamodel.DaprPubSubBroker, error) { - switch version { - case v20220315privatepreview.Version: - am := &v20220315privatepreview.DaprPubSubBrokerResource{} - if err := json.Unmarshal(content, am); err != nil { - return nil, err - } - dm, err := am.ConvertTo() - if err != nil { - return nil, err - } - - return dm.(*datamodel.DaprPubSubBroker), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go b/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go deleted file mode 100644 index 0cb58be2ee..0000000000 --- a/pkg/linkrp/datamodel/converter/daprpubsubbroker_converter_test.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "testing" - "time" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestDaprPubSubBrokerDataModelToVersioned(t *testing.T) { - createdAt, err := time.Parse(time.RFC3339Nano, "2021-09-24T19:09:54.2403864Z") - require.NoError(t, err) - - lastModifiedAt, err := time.Parse(time.RFC3339Nano, "2021-09-24T20:09:54.2403864Z") - require.NoError(t, err) - - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - expected *v20220315privatepreview.DaprPubSubBrokerResource - err error - }{ - { - "../../api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_datamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.DaprPubSubBrokerResource{}, - &v20220315privatepreview.DaprPubSubBrokerResource{ - Location: to.Ptr("global"), - Properties: &v20220315privatepreview.DaprPubSubBrokerProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - Metadata: map[string]interface{}{ - "foo": "bar", - }, - Recipe: nil, - ResourceProvisioning: to.Ptr(v20220315privatepreview.ResourceProvisioningManual), - Resources: []*v20220315privatepreview.ResourceReference{ - { - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/radius-eastus-async"), - }, - }, - Type: to.Ptr("pubsub.azure.servicebus"), - Version: to.Ptr("v1"), - ComponentName: to.Ptr("test-dpsb"), - ProvisioningState: to.Ptr(v20220315privatepreview.ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&v20220315privatepreview.ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb"), - Name: to.Ptr("test-dpsb"), - SystemData: &v20220315privatepreview.SystemData{ - CreatedAt: &createdAt, - CreatedBy: to.Ptr("fakeid@live.com"), - CreatedByType: to.Ptr(v20220315privatepreview.CreatedByTypeUser), - LastModifiedAt: &lastModifiedAt, - LastModifiedBy: to.Ptr("fakeid@live.com"), - LastModifiedByType: to.Ptr(v20220315privatepreview.CreatedByTypeUser), - }, - Type: to.Ptr("Applications.Link/daprPubSubBrokers"), - }, - nil, - }, - { - "../../api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_generic_datamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.DaprPubSubBrokerResource{}, - &v20220315privatepreview.DaprPubSubBrokerResource{ - Location: to.Ptr("global"), - Properties: &v20220315privatepreview.DaprPubSubBrokerProperties{ - Environment: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env"), - Application: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app"), - Metadata: map[string]interface{}{ - "foo": "bar", - }, - Recipe: nil, - ResourceProvisioning: to.Ptr(v20220315privatepreview.ResourceProvisioningManual), - Resources: nil, - Type: to.Ptr("pubsub.kafka"), - Version: to.Ptr("v1"), - ComponentName: to.Ptr("test-dpsb"), - ProvisioningState: to.Ptr(v20220315privatepreview.ProvisioningStateAccepted), - Status: resourcetypeutil.MustPopulateResourceStatus(&v20220315privatepreview.ResourceStatus{}), - }, - Tags: map[string]*string{ - "env": to.Ptr("dev"), - }, - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/daprPubSubBrokers/test-dpsb"), - Name: to.Ptr("test-dpsb"), - SystemData: &v20220315privatepreview.SystemData{ - CreatedAt: &createdAt, - CreatedBy: to.Ptr("fakeid@live.com"), - CreatedByType: to.Ptr(v20220315privatepreview.CreatedByTypeUser), - LastModifiedAt: &lastModifiedAt, - LastModifiedBy: to.Ptr("fakeid@live.com"), - LastModifiedByType: to.Ptr(v20220315privatepreview.CreatedByTypeUser), - }, - Type: to.Ptr("Applications.Link/daprPubSubBrokers"), - }, - nil, - }, - { - "", - "unsupported", - nil, - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.DaprPubSubBroker{} - _ = json.Unmarshal(c, dm) - - am, err := DaprPubSubBrokerDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - require.Equal(t, tc.expected, am) - } - }) - } -} - -func TestDaprPubSubBrokerDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidrecipe_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: "multiple errors were found:\n\tmetadata cannot be specified when resourceProvisioning is set to recipe (default)\n\ttype cannot be specified when resourceProvisioning is set to recipe (default)\n\tversion cannot be specified when resourceProvisioning is set to recipe (default)", - }, - }, - { - "../../api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_invalidmanual_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{ - Code: "BadRequest", - Message: "multiple errors were found:\n\trecipe details cannot be specified when resourceProvisioning is set to manual\n\tmetadata must be specified when resourceProvisioning is set to manual\n\ttype must be specified when resourceProvisioning is set to manual\n\tversion must be specified when resourceProvisioning is set to manual", - }, - }, - { - "../../api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_recipe_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/daprpubsubbroker/daprpubsubbroker_manual_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := DaprPubSubBrokerDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.Equal(t, tc.err, err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/daprsecretstore_converter.go b/pkg/linkrp/datamodel/converter/daprsecretstore_converter.go deleted file mode 100644 index 61c5dfc871..0000000000 --- a/pkg/linkrp/datamodel/converter/daprsecretstore_converter.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// DaprSecretStoreDataModelToVersioned converts a DaprSecretStore data model to a versioned model interface based on the version provided, -// and returns an error if the version is unsupported. -func DaprSecretStoreDataModelToVersioned(model *datamodel.DaprSecretStore, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.DaprSecretStoreResource{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// DaprSecretStoreDataModelFromVersioned unmarshals a JSON content into a DaprSecretStoreResource object and then converts -// it to a DaprSecretStore object, returning an error if either of these steps fail. -func DaprSecretStoreDataModelFromVersioned(content []byte, version string) (*datamodel.DaprSecretStore, error) { - switch version { - case v20220315privatepreview.Version: - am := &v20220315privatepreview.DaprSecretStoreResource{} - if err := json.Unmarshal(content, am); err != nil { - return nil, err - } - dm, err := am.ConvertTo() - if err != nil { - return nil, err - } - return dm.(*datamodel.DaprSecretStore), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/daprsecretstore_converter_test.go b/pkg/linkrp/datamodel/converter/daprsecretstore_converter_test.go deleted file mode 100644 index 8846596a87..0000000000 --- a/pkg/linkrp/datamodel/converter/daprsecretstore_converter_test.go +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "errors" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestDaprSecretStoreDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/daprsecretstore_manual_resourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.DaprSecretStoreResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.DaprSecretStore{} - _ = json.Unmarshal(c, dm) - am, err := DaprSecretStoreDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestDaprSecretStoreDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/daprsecretstore_manual_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/daprsecretstoreresource-invalid.json", - "2022-03-15-privatepreview", - errors.New("json: cannot unmarshal number into Go struct field DaprSecretStoreProperties.properties.version of type string"), - }, - { - "../../api/v20220315privatepreview/testdata/daprsecretstore_invalidvalues_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: "BadRequest", Message: "multiple errors were found:\n\trecipe details cannot be specified when resourceProvisioning is set to manual\n\tmetadata must be specified when resourceProvisioning is set to manual\n\ttype must be specified when resourceProvisioning is set to manual\n\tversion must be specified when resourceProvisioning is set to manual"}, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := DaprSecretStoreDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/daprstatestore_converter.go b/pkg/linkrp/datamodel/converter/daprstatestore_converter.go deleted file mode 100644 index 7006604e60..0000000000 --- a/pkg/linkrp/datamodel/converter/daprstatestore_converter.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// DaprStateStoreDataModelToVersioned converts a DaprStateStore data model to a versioned model interface -// and returns an error if the version is unsupported. -func DaprStateStoreDataModelToVersioned(model *datamodel.DaprStateStore, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.DaprStateStoreResource{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// DaprStateStoreDataModelFromVersioned unmarshals a JSON byte slice into a DaprStateStoreResource object and converts it -// to a DaprStateStore object, returning an error if either operation fails. -func DaprStateStoreDataModelFromVersioned(content []byte, version string) (*datamodel.DaprStateStore, error) { - switch version { - case v20220315privatepreview.Version: - am := &v20220315privatepreview.DaprStateStoreResource{} - if err := json.Unmarshal(content, am); err != nil { - return nil, err - } - dm, err := am.ConvertTo() - if err != nil { - return nil, err - } - - return dm.(*datamodel.DaprStateStore), nil - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/daprstatestore_converter_test.go b/pkg/linkrp/datamodel/converter/daprstatestore_converter_test.go deleted file mode 100644 index 82240a8db0..0000000000 --- a/pkg/linkrp/datamodel/converter/daprstatestore_converter_test.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestDaprStateStoreDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/daprstatestoresqlserverresourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.DaprStateStoreResource{}, - nil, - }, - { - "../../api/v20220315privatepreview/testdata/daprstatestoreazuretablestorageresourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.DaprStateStoreResource{}, - nil, - }, - { - "../../api/v20220315privatepreview/testdata/daprstatestogenericreresourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.DaprStateStoreResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.DaprStateStore{} - _ = json.Unmarshal(c, dm) - am, err := DaprStateStoreDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestDaprStateStoreDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/daprstatestore_invalidrecipe_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: v1.CodeInvalid, Message: "multiple errors were found:\n\tmetadata cannot be specified when resourceProvisioning is set to recipe (default)\n\ttype cannot be specified when resourceProvisioning is set to recipe (default)\n\tversion cannot be specified when resourceProvisioning is set to recipe (default)"}, - }, - { - "../../api/v20220315privatepreview/testdata/daprstatestore_invalidvalues_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: "BadRequest", Message: "multiple errors were found:\n\trecipe details cannot be specified when resourceProvisioning is set to manual\n\tmetadata must be specified when resourceProvisioning is set to manual\n\ttype must be specified when resourceProvisioning is set to manual\n\tversion must be specified when resourceProvisioning is set to manual"}, - }, - { - "../../api/v20220315privatepreview/testdata/daprstatestore_recipe_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/daprstatestore_values_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := DaprStateStoreDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.Equal(t, tc.err, err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/extender_converter.go b/pkg/linkrp/datamodel/converter/extender_converter.go deleted file mode 100644 index 9c041369bd..0000000000 --- a/pkg/linkrp/datamodel/converter/extender_converter.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// ExtenderDataModelToVersioned converts a datamodel.Extender to a versioned model interface based on the given version -// string, returning an error if the conversion fails. -func ExtenderDataModelToVersioned(model *datamodel.Extender, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.ExtenderResource{} - err := versioned.ConvertFrom(model) - if err != nil { - return nil, err - } - - return versioned, nil - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// ExtenderDataModelFromVersioned unmarshals a JSON byte slice into a version-specific ExtenderResource struct, then -// converts it to a datamodel.Extender struct and returns it, or returns an error if the unmarshal or conversion fails. -func ExtenderDataModelFromVersioned(content []byte, version string) (*datamodel.Extender, error) { - switch version { - case v20220315privatepreview.Version: - am := &v20220315privatepreview.ExtenderResource{} - if err := json.Unmarshal(content, am); err != nil { - return nil, err - } - dm, err := am.ConvertTo() - if err != nil { - return nil, err - } - return dm.(*datamodel.Extender), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/extender_converter_test.go b/pkg/linkrp/datamodel/converter/extender_converter_test.go deleted file mode 100644 index 743f1c134c..0000000000 --- a/pkg/linkrp/datamodel/converter/extender_converter_test.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "errors" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestExtenderDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/extenderresourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.ExtenderResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.Extender{} - _ = json.Unmarshal(c, dm) - am, err := ExtenderDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestExtenderDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/extender_manual.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/extenderresource-invalid.json", - "2022-03-15-privatepreview", - errors.New("json: cannot unmarshal number into Go struct field ExtenderProperties.properties.resource of type string"), - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := ExtenderDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/mongodatabase_converter.go b/pkg/linkrp/datamodel/converter/mongodatabase_converter.go deleted file mode 100644 index 00c9197d01..0000000000 --- a/pkg/linkrp/datamodel/converter/mongodatabase_converter.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// MongoDatabaseDataModelToVersioned converts a MongoDatabase data model to a versioned model interface based on the -// specified version, and returns an error if the version is not supported. -func MongoDatabaseDataModelToVersioned(model *datamodel.MongoDatabase, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.MongoDatabaseResource{} - err := versioned.ConvertFrom(model) - return versioned, err - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// MongoDatabaseDataModelFromVersioned takes in a byte slice and a version string and returns a MongoDatabase instance and -// an error if the version is unsupported. -func MongoDatabaseDataModelFromVersioned(content []byte, version string) (*datamodel.MongoDatabase, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.MongoDatabaseResource{} - if err := json.Unmarshal(content, versioned); err != nil { - return nil, err - } - dm, err := versioned.ConvertTo() - if err != nil { - return nil, err - } - return dm.(*datamodel.MongoDatabase), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// MongoDatabaseSecretsDataModelFromVersioned converts version agnostic MongoDatabaseSecrets datamodel to versioned model. -// - -// MongoDatabaseSecretsDataModelToVersioned converts a MongoDatabaseSecrets data model to a versioned model interface and -// returns an error if the version is not supported. -func MongoDatabaseSecretsDataModelToVersioned(model *datamodel.MongoDatabaseSecrets, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.MongoDatabaseSecrets{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/mongodatabase_converter_test.go b/pkg/linkrp/datamodel/converter/mongodatabase_converter_test.go deleted file mode 100644 index 782eff07cf..0000000000 --- a/pkg/linkrp/datamodel/converter/mongodatabase_converter_test.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "errors" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestMongoDatabaseDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/mongodatabaseresourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.MongoDatabaseResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.MongoDatabase{} - _ = json.Unmarshal(c, dm) - am, err := MongoDatabaseDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} -func TestMongoDatabaseDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/mongodatabaseresource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/mongodatabaseresource-invalid.json", - "2022-03-15-privatepreview", - errors.New("json: cannot unmarshal number into Go struct field MongoDatabaseProperties.properties.resource of type string"), - }, - { - "../../api/v20220315privatepreview/testdata/mongodatabaseresource-missinginputs.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: "BadRequest", Message: "multiple errors were found:\n\thost must be specified when resourceProvisioning is set to manual\n\tport must be specified when resourceProvisioning is set to manual\n\tdatabase must be specified when resourceProvisioning is set to manual"}, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := MongoDatabaseDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} - -func TestMongoDatabaseSecretsDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/mongodatabasesecretsdatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.MongoDatabaseSecrets{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.MongoDatabaseSecrets{} - _ = json.Unmarshal(c, dm) - am, err := MongoDatabaseSecretsDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/rabbitmq_converter.go b/pkg/linkrp/datamodel/converter/rabbitmq_converter.go deleted file mode 100644 index 0ddd5079b8..0000000000 --- a/pkg/linkrp/datamodel/converter/rabbitmq_converter.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// RabbitMQMessageQueueDataModelToVersioned converts a datamodel.RabbitMQMessageQueue to a versioned model interface based -// on the given version, and returns an error if the version is not supported. -func RabbitMQMessageQueueDataModelToVersioned(model *datamodel.RabbitMQMessageQueue, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RabbitMQMessageQueueResource{} - err := versioned.ConvertFrom(model) - return versioned, err - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// RabbitMQMessageQueueDataModelFromVersioned unmarshals a JSON byte slice into a versioned RabbitMQMessageQueueResource -// struct, then converts it to a datamodel.RabbitMQMessageQueue struct and returns it, or returns an error if the version -// is unsupported. -func RabbitMQMessageQueueDataModelFromVersioned(content []byte, version string) (*datamodel.RabbitMQMessageQueue, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RabbitMQMessageQueueResource{} - if err := json.Unmarshal(content, versioned); err != nil { - return nil, err - } - dm, err := versioned.ConvertTo() - if err != nil { - return nil, err - } - return dm.(*datamodel.RabbitMQMessageQueue), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// RabbitMQSecretsDataModelToVersioned converts a datamodel.RabbitMQSecrets to a versioned model based on the given -// version string, or returns an error if the version is not supported. -func RabbitMQSecretsDataModelToVersioned(model *datamodel.RabbitMQSecrets, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RabbitMQSecrets{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/rabbitmq_converter_test.go b/pkg/linkrp/datamodel/converter/rabbitmq_converter_test.go deleted file mode 100644 index 4cfe2aa85a..0000000000 --- a/pkg/linkrp/datamodel/converter/rabbitmq_converter_test.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "errors" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestRabbitMQMessageQueueDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/rabbitmq_manual_datamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.RabbitMQMessageQueueResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.RabbitMQMessageQueue{} - _ = json.Unmarshal(c, dm) - am, err := RabbitMQMessageQueueDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestRabbitMQMessageQueueDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/rabbitmq_manual_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/rabbitmqresource-invalid.json", - "2022-03-15-privatepreview", - errors.New("json: cannot unmarshal number into Go struct field RabbitMQMessageQueueProperties.properties.resource of type string"), - }, - { - "../../api/v20220315privatepreview/testdata/rabbitmq_invalid_properties_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: "BadRequest", Message: "queue is required when resourceProvisioning is manual"}, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := RabbitMQMessageQueueDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} - -func TestRabbitMQSecretsDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/rabbitmqsecretsdatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.RabbitMQSecrets{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.RabbitMQSecrets{} - _ = json.Unmarshal(c, dm) - am, err := RabbitMQSecretsDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/rediscache_converter.go b/pkg/linkrp/datamodel/converter/rediscache_converter.go deleted file mode 100644 index 8bef090432..0000000000 --- a/pkg/linkrp/datamodel/converter/rediscache_converter.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// RedisCacheDataModelToVersioned converts a RedisCache data model to a versioned model interface and returns an error if -// the conversion fails. -func RedisCacheDataModelToVersioned(model *datamodel.RedisCache, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RedisCacheResource{} - err := versioned.ConvertFrom(model) - if err != nil { - return nil, err - } - - return versioned, nil - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// RedisCacheDataModelFromVersioned converts a versioned RedisCacheResource to a datamodel.RedisCache and returns an error -// if the conversion fails. -func RedisCacheDataModelFromVersioned(content []byte, version string) (*datamodel.RedisCache, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RedisCacheResource{} - if err := json.Unmarshal(content, versioned); err != nil { - return nil, err - } - dm, err := versioned.ConvertTo() - if err != nil { - return nil, err - } - return dm.(*datamodel.RedisCache), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// RedisCacheSecretsDataModelToVersioned takes in a pointer to a RedisCacheSecrets datamodel and a version string, and -// returns a VersionedModelInterface and an error if the version is not supported. -func RedisCacheSecretsDataModelToVersioned(model *datamodel.RedisCacheSecrets, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.RedisCacheSecrets{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/rediscache_converter_test.go b/pkg/linkrp/datamodel/converter/rediscache_converter_test.go deleted file mode 100644 index a7cccf06e0..0000000000 --- a/pkg/linkrp/datamodel/converter/rediscache_converter_test.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "errors" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestRedisCacheDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/rediscacheresourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.RedisCacheResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.RedisCache{} - _ = json.Unmarshal(c, dm) - am, err := RedisCacheDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestRedisCacheDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/rediscacheresource_manual.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/rediscacheresource-invalidinput.json", - "2022-03-15-privatepreview", - errors.New("json: cannot unmarshal number into Go struct field RedisCacheProperties.properties.host of type string"), - }, - { - "../../api/v20220315privatepreview/testdata/rediscacheresource-invalid2.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: "BadRequest", Message: "multiple errors were found:\n\thost must be specified when resourceProvisioning is set to manual\n\tport must be specified when resourceProvisioning is set to manual"}, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := RedisCacheDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} - -func TestRedisCacheSecretsDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/rediscachesecretsdatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.RedisCacheSecrets{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.RedisCacheSecrets{} - _ = json.Unmarshal(c, dm) - am, err := RedisCacheSecretsDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/converter/sqldatabase_converter.go b/pkg/linkrp/datamodel/converter/sqldatabase_converter.go deleted file mode 100644 index 22702b5f2f..0000000000 --- a/pkg/linkrp/datamodel/converter/sqldatabase_converter.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" -) - -// SqlDatabaseDataModelToVersioned converts a SqlDatabase data model to a VersionedModelInterface based on the specified -// version, returning an error if the version is unsupported. -func SqlDatabaseDataModelToVersioned(model *datamodel.SqlDatabase, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.SQLDatabaseResource{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// SqlDatabaseDataModelFromVersioned takes in a byte slice and a version string and returns a SqlDatabase object and an -// error if one occurs. -func SqlDatabaseDataModelFromVersioned(content []byte, version string) (*datamodel.SqlDatabase, error) { - switch version { - case v20220315privatepreview.Version: - am := &v20220315privatepreview.SQLDatabaseResource{} - if err := json.Unmarshal(content, am); err != nil { - return nil, err - } - dm, err := am.ConvertTo() - if err != nil { - return nil, err - } - return dm.(*datamodel.SqlDatabase), err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} - -// This function converts a SqlDatabaseSecretsDataModel to a VersionedModelInterface based on the version provided, and -// returns an error if the version is unsupported. -func SqlDatabaseSecretsDataModelToVersioned(model *datamodel.SqlDatabaseSecrets, version string) (v1.VersionedModelInterface, error) { - switch version { - case v20220315privatepreview.Version: - versioned := &v20220315privatepreview.SQLDatabaseSecrets{} - err := versioned.ConvertFrom(model) - return versioned, err - - default: - return nil, v1.ErrUnsupportedAPIVersion - } -} diff --git a/pkg/linkrp/datamodel/converter/sqldatabase_converter_test.go b/pkg/linkrp/datamodel/converter/sqldatabase_converter_test.go deleted file mode 100644 index aee8c83222..0000000000 --- a/pkg/linkrp/datamodel/converter/sqldatabase_converter_test.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package converter - -import ( - "encoding/json" - "errors" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/stretchr/testify/require" -) - -// Validates type conversion between versioned client side data model and RP data model. -func TestSqlDatabaseDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/sqldatabase_manual_resourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.SQLDatabaseResource{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.SqlDatabase{} - _ = json.Unmarshal(c, dm) - am, err := SqlDatabaseDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} - -func TestSqlDatabaseDataModelFromVersioned(t *testing.T) { - testset := []struct { - versionedModelFile string - apiVersion string - err error - }{ - { - "../../api/v20220315privatepreview/testdata/sqldatabase_manual_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/sqldatabase_recipe_resource.json", - "2022-03-15-privatepreview", - nil, - }, - { - "../../api/v20220315privatepreview/testdata/sqldatabaseresource-invalid.json", - "2022-03-15-privatepreview", - errors.New("json: cannot unmarshal number into Go struct field SqlDatabaseProperties.properties.database of type string"), - }, - { - "../../api/v20220315privatepreview/testdata/sqldatabase_invalid_properties_resource.json", - "2022-03-15-privatepreview", - &v1.ErrClientRP{Code: v1.CodeInvalid, Message: "multiple errors were found:\n\tserver must be specified when resourceProvisioning is set to manual\n\tport must be specified when resourceProvisioning is set to manual\n\tdatabase must be specified when resourceProvisioning is set to manual"}, - }, - { - "", - "unsupported", - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.versionedModelFile) - dm, err := SqlDatabaseDataModelFromVersioned(c, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiVersion, dm.InternalMetadata.UpdatedAPIVersion) - } - }) - } -} - -func TestSqlDatabaseSecretsDataModelToVersioned(t *testing.T) { - testset := []struct { - dataModelFile string - apiVersion string - apiModelType any - err error - }{ - { - "../../api/v20220315privatepreview/testdata/sqldatabase_secrets_datamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.SQLDatabaseSecrets{}, - nil, - }, - { - "../../api/v20220315privatepreview/testdata/sqldatabase_recipe_resourcedatamodel.json", - "2022-03-15-privatepreview", - &v20220315privatepreview.SQLDatabaseSecrets{}, - nil, - }, - { - "", - "unsupported", - nil, - v1.ErrUnsupportedAPIVersion, - }, - } - - for _, tc := range testset { - t.Run(tc.apiVersion, func(t *testing.T) { - c := loadTestData(tc.dataModelFile) - dm := &datamodel.SqlDatabaseSecrets{} - _ = json.Unmarshal(c, dm) - am, err := SqlDatabaseSecretsDataModelToVersioned(dm, tc.apiVersion) - if tc.err != nil { - require.ErrorAs(t, tc.err, &err) - } else { - require.NoError(t, err) - require.IsType(t, tc.apiModelType, am) - } - }) - } -} diff --git a/pkg/linkrp/datamodel/daprdetector.go b/pkg/linkrp/datamodel/daprdetector.go deleted file mode 100644 index 871edef361..0000000000 --- a/pkg/linkrp/datamodel/daprdetector.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "context" - - apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -const ( - daprComponentCRD = "components.dapr.io" - - // DaprMissingError is an error message that can be used when Dapr is not installed on the cluster. - DaprMissingError = "Dapr is not installed in your Kubernetes cluster. Please install Dapr by following the instructions at https://docs.dapr.io/operations/hosting/kubernetes/kubernetes-deploy/." -) - -// IsDaprInstalled will check for Dapr to be installed in the deployment environment and return -// and true if it is installed. Callers of this function can use DaprMissingError for a friendly error -// message to send back to users. -// -// This check is based on the Dapr Component CRD, and only supports Kubernetes. It checks if the Dapr component -// CustomResourceDefinition exists in the Kubernetes cluster and returns a boolean and an error if one occurs. -func IsDaprInstalled(ctx context.Context, kubeClient client.Client) (bool, error) { - crd := &apiextv1.CustomResourceDefinition{} - err := kubeClient.Get(ctx, client.ObjectKey{Name: daprComponentCRD}, crd) - if apierrors.IsNotFound(err) { - return false, nil - } else if err != nil { - return false, err - } - - return true, nil -} diff --git a/pkg/linkrp/datamodel/daprpubsubbroker.go b/pkg/linkrp/datamodel/daprpubsubbroker.go deleted file mode 100644 index e5b0383d8f..0000000000 --- a/pkg/linkrp/datamodel/daprpubsubbroker.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// DaprPubSubBroker represents DaprPubSubBroker link resource. -type DaprPubSubBroker struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties DaprPubSubBrokerProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput applies the properties changes based on the deployment output. It updates the -// OutputResources of the DaprPubSubBroker resource with the output resources from a DeploymentOutput object. -func (r *DaprPubSubBroker) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - return nil -} - -// OutputResources returns the OutputResources of the DaprPubSubBroker resource. -func (r *DaprPubSubBroker) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the DaprPubSubBroker resource i.e. application resources metadata. -func (r *DaprPubSubBroker) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type of the DaprPubSubBroker resource. -func (daprPubSub *DaprPubSubBroker) ResourceTypeName() string { - return linkrp.DaprPubSubBrokersResourceType -} - -// Recipe returns the recipe information of the resource. Returns nil if recipe execution is disabled. -func (r *DaprPubSubBroker) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &r.Properties.Recipe -} - -// DaprPubSubBrokerProperties represents the properties of DaprPubSubBroker resource. -type DaprPubSubBrokerProperties struct { - rpv1.BasicResourceProperties - rpv1.BasicDaprResourceProperties - - // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - - // Metadata of the Dapr Pub/Sub Broker resource. - Metadata map[string]any `json:"metadata,omitempty"` - - // The recipe used to automatically deploy underlying infrastructure for the Dapr Pub/Sub Broker resource. - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - - // List of the resource IDs that support the Dapr Pub/Sub Broker resource. - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - - // Type of the Dapr Pub/Sub Broker resource. - Type string `json:"type,omitempty"` - - // Version of the Dapr Pub/Sub Broker resource. - Version string `json:"version,omitempty"` -} diff --git a/pkg/linkrp/datamodel/daprsecretstore.go b/pkg/linkrp/datamodel/daprsecretstore.go deleted file mode 100644 index ea2388e74a..0000000000 --- a/pkg/linkrp/datamodel/daprsecretstore.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// DaprSecretStore represents DaprSecretStore link resource. -type DaprSecretStore struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties DaprSecretStoreProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput updates the Status.OutputResources field of Properties with the DeployedOutputResources -// from the DeploymentOutput and returns no error. -func (r *DaprSecretStore) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - return nil -} - -// OutputResources returns the OutputResources array from Properties of the DaprSecretStore resource. -func (r *DaprSecretStore) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the DaprSecretStore resource i.e. application resources metadata. -func (r *DaprSecretStore) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type of the DaprSecretStore resource. -func (daprSecretStore *DaprSecretStore) ResourceTypeName() string { - return linkrp.DaprSecretStoresResourceType -} - -// DaprSecretStoreProperties represents the properties of DaprSecretStore resource. -type DaprSecretStoreProperties struct { - rpv1.BasicResourceProperties - rpv1.BasicDaprResourceProperties - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` -} - -// Recipe returns the Recipe from the DaprSecretStore Properties if ResourceProvisioning is not set to Manual, -// otherwise it returns nil. -func (daprSecretStore *DaprSecretStore) Recipe() *linkrp.LinkRecipe { - if daprSecretStore.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &daprSecretStore.Properties.Recipe -} diff --git a/pkg/linkrp/datamodel/daprstatestore.go b/pkg/linkrp/datamodel/daprstatestore.go deleted file mode 100644 index 17b4d6a20c..0000000000 --- a/pkg/linkrp/datamodel/daprstatestore.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// DaprStateStore represents DaprStateStore link resource. -type DaprStateStore struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties DaprStateStoreProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput updates the DaprStateStore resource with the DeploymentOutput values. -func (r *DaprStateStore) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - r.ComputedValues = do.ComputedValues - r.SecretValues = do.SecretValues - if cn, ok := do.ComputedValues[renderers.ComponentNameKey].(string); ok { - r.Properties.ComponentName = cn - } - return nil -} - -// OutputResources returns the OutputResources from the Properties of the DaprStateStore resource. -func (r *DaprStateStore) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the DaprStateStore resource i.e. application resources metadata. -func (r *DaprStateStore) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type of the DaprStateStore resource. -func (daprStateStore *DaprStateStore) ResourceTypeName() string { - return linkrp.DaprStateStoresResourceType -} - -// Recipe returns the recipe information of the resource. It returns nil if the ResourceProvisioning is set to manual. -func (r *DaprStateStore) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &r.Properties.Recipe -} - -// DaprStateStoreProperties represents the properties of DaprStateStore resource. -type DaprStateStoreProperties struct { - rpv1.BasicResourceProperties - rpv1.BasicDaprResourceProperties - // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - Metadata map[string]any `json:"metadata,omitempty"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - Type string `json:"type,omitempty"` - Version string `json:"version,omitempty"` -} diff --git a/pkg/linkrp/datamodel/daprstatestore_test.go b/pkg/linkrp/datamodel/daprstatestore_test.go deleted file mode 100644 index c4f3c21f66..0000000000 --- a/pkg/linkrp/datamodel/daprstatestore_test.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "testing" - - "github.com/project-radius/radius/pkg/linkrp/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/stretchr/testify/require" -) - -func TestDaprStateStore_ApplyDeploymentOutput(t *testing.T) { - tests := []struct { - name string - dss *DaprStateStore - do *rpv1.DeploymentOutput - wantErr bool - }{ - { - name: "with component name", - dss: &DaprStateStore{}, - do: &rpv1.DeploymentOutput{ - DeployedOutputResources: []rpv1.OutputResource{ - { - LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - ID: resources.MustParse("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/test-sa"), - }, - }, - ComputedValues: map[string]any{ - renderers.ComponentNameKey: "dapr-state-store-test", - }, - }, - wantErr: false, - }, - { - name: "without component name", - dss: &DaprStateStore{}, - do: &rpv1.DeploymentOutput{ - DeployedOutputResources: []rpv1.OutputResource{ - { - LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - ID: resources.MustParse("/subscriptions/test-sub/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/test-sa"), - }, - }, - ComputedValues: map[string]any{}, - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if err := tt.dss.ApplyDeploymentOutput(*tt.do); (err != nil) != tt.wantErr { - t.Errorf("DaprStateStore.ApplyDeploymentOutput() error = %v, wantErr %v", err, tt.wantErr) - } - - if !tt.wantErr { - require.EqualValues(t, tt.do.DeployedOutputResources, tt.dss.Properties.Status.OutputResources) - require.EqualValues(t, tt.do.ComputedValues, tt.dss.ComputedValues) - require.EqualValues(t, tt.do.SecretValues, tt.dss.SecretValues) - require.Condition(t, func() bool { - if tt.do.ComputedValues[renderers.ComponentNameKey] != nil { - return tt.dss.Properties.ComponentName == tt.do.ComputedValues[renderers.ComponentNameKey] - } - return tt.dss.Properties.ComponentName == "" - }, "component name should be equal") - } - }) - } -} diff --git a/pkg/linkrp/datamodel/extender.go b/pkg/linkrp/datamodel/extender.go deleted file mode 100644 index 64222be6d1..0000000000 --- a/pkg/linkrp/datamodel/extender.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// Extender represents Extender link resource. -type Extender struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties ExtenderProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput updates the Status of Properties of the Extender resource with the DeployedOutputResources and returns no error. -func (r *Extender) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - return nil -} - -// OutputResources returns the OutputResources of the Extender resource. -func (r *Extender) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the Extender resource. -func (r *Extender) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type of the extender resource. -func (extender *Extender) ResourceTypeName() string { - return linkrp.ExtendersResourceType -} - -// Recipe returns the LinkRecipe associated with the Extender if the ResourceProvisioning is not set to Manual, -// otherwise it returns nil. -func (extender *Extender) Recipe() *linkrp.LinkRecipe { - if extender.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &extender.Properties.Recipe -} - -// ExtenderProperties represents the properties of Extender resource. -type ExtenderProperties struct { - rpv1.BasicResourceProperties - // Additional properties for the resource - AdditionalProperties map[string]any `json:"additionalProperties,omitempty"` - // Secrets values provided for the resource - Secrets map[string]any `json:"secrets,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the Extender - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` -} diff --git a/pkg/linkrp/datamodel/mongodatabase.go b/pkg/linkrp/datamodel/mongodatabase.go deleted file mode 100644 index bcd599cb94..0000000000 --- a/pkg/linkrp/datamodel/mongodatabase.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "fmt" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// MongoDatabase represents MongoDatabase link resource. -type MongoDatabase struct { - v1.BaseResource - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata - - // Properties is the properties of the resource. - Properties MongoDatabaseProperties `json:"properties"` -} - -// MongoDatabaseProperties represents the properties of MongoDatabase resource. -type MongoDatabaseProperties struct { - rpv1.BasicResourceProperties - // Secrets values provided for the resource - Secrets MongoDatabaseSecrets `json:"secrets,omitempty"` - // Host name of the target Mongo database - Host string `json:"host,omitempty"` - // Port value of the target Mongo database - Port int32 `json:"port,omitempty"` - // Database name of the target Mongo database - Database string `json:"database,omitempty"` - // The recipe used to automatically deploy underlying infrastructure for the MongoDB link - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - // List of the resource IDs that support the MongoDB resource - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // Username of the Mongo database - Username string `json:"username,omitempty"` -} - -// Secrets values consisting of secrets provided for the resource -type MongoDatabaseSecrets struct { - Password string `json:"password"` - ConnectionString string `json:"connectionString"` -} - -// IsEmpty checks if the MongoDatabaseSecrets instance is empty. -func (mongoSecrets MongoDatabaseSecrets) IsEmpty() bool { - return mongoSecrets == MongoDatabaseSecrets{} -} - -// VerifyInputs checks if the manual resource provisioning fields are set and returns an error if any of them are missing. -func (mongodb *MongoDatabase) VerifyInputs() error { - msgs := []string{} - if mongodb.Properties.ResourceProvisioning != "" && mongodb.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if mongodb.Properties.Host == "" { - msgs = append(msgs, "host must be specified when resourceProvisioning is set to manual") - } - if mongodb.Properties.Port == 0 { - msgs = append(msgs, "port must be specified when resourceProvisioning is set to manual") - } - if mongodb.Properties.Database == "" { - msgs = append(msgs, "database must be specified when resourceProvisioning is set to manual") - } - } - - if len(msgs) == 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - - return nil -} - -// ApplyDeploymentOutput updates the MongoDatabase instance's database property, output resources, computed values -// and secret values with the given DeploymentOutput. -func (r *MongoDatabase) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - r.ComputedValues = do.ComputedValues - r.SecretValues = do.SecretValues - if database, ok := do.ComputedValues[renderers.DatabaseNameValue].(string); ok { - r.Properties.Database = database - } - - return nil -} - -// OutputResources returns the OutputResources of the MongoDatabase instance. -func (r *MongoDatabase) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the MongoDatabase instance i.e. application resource metadata. -func (r *MongoDatabase) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// Recipe returns the LinkRecipe associated with the MongoDatabase instance, or nil if the -// ResourceProvisioning is set to Manual. -func (r *MongoDatabase) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &r.Properties.Recipe -} - -// ResourceTypeName returns the resource type for MongoDatabase resource. -func (mongoSecrets *MongoDatabaseSecrets) ResourceTypeName() string { - return linkrp.MongoDatabasesResourceType -} - -// ResourceTypeName returns the resource type for MongoDatabase resource. -func (mongo *MongoDatabase) ResourceTypeName() string { - return linkrp.MongoDatabasesResourceType -} diff --git a/pkg/linkrp/datamodel/rabbitmq.go b/pkg/linkrp/datamodel/rabbitmq.go deleted file mode 100644 index 1bf8f4c7c2..0000000000 --- a/pkg/linkrp/datamodel/rabbitmq.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "fmt" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// RabbitMQMessageQueue represents RabbitMQMessageQueue link resource. -type RabbitMQMessageQueue struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties RabbitMQMessageQueueProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput updates the output resources of the RabbitMQMessageQueue resource with -// the DeployedOutputResources. -func (r *RabbitMQMessageQueue) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - return nil -} - -// OutputResources returns the OutputResources of the RabbitMQMessageQueue resource. -func (r *RabbitMQMessageQueue) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the RabbitMQMessageQueue resource. -func (r *RabbitMQMessageQueue) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type for RabbitMQMessageQueue resource. -func (rabbitmq *RabbitMQMessageQueue) ResourceTypeName() string { - return linkrp.RabbitMQMessageQueuesResourceType -} - -// RabbitMQMessageQueueProperties represents the properties of RabbitMQMessageQueue response resource. -type RabbitMQMessageQueueProperties struct { - rpv1.BasicResourceProperties - Queue string `json:"queue,omitempty"` - Host string `json:"host,omitempty"` - Port int32 `json:"port,omitempty"` - VHost string `json:"vHost,omitempty"` - Username string `json:"username,omitempty"` - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - Secrets RabbitMQSecrets `json:"secrets,omitempty"` - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - TLS bool `json:"tls,omitempty"` -} - -// Secrets values consisting of secrets provided for the resource -type RabbitMQSecrets struct { - URI string `json:"uri,omitempty"` - Password string `json:"password,omitempty"` -} - -// ResourceTypeName returns the resource type for RabbitMQMessageQueue resource. -func (rabbitmq RabbitMQSecrets) ResourceTypeName() string { - return linkrp.RabbitMQMessageQueuesResourceType -} - -// Recipe returns the LinkRecipe associated with the RabbitMQMessageQueue resource, or nil if the -// ResourceProvisioning is set to Manual. -func (r *RabbitMQMessageQueue) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &r.Properties.Recipe -} - -// VerifyInputs checks if the required fields are present in the RabbitMQMessageQueue instance and returns an error if not. -func (rabbitmq *RabbitMQMessageQueue) VerifyInputs() error { - properties := rabbitmq.Properties - msgs := []string{} - if properties.ResourceProvisioning != "" && properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if properties.Queue == "" { - return &v1.ErrClientRP{Code: "Bad Request", Message: fmt.Sprintf("queue is required when resourceProvisioning is %s", linkrp.ResourceProvisioningManual)} - } - if properties.Host == "" { - msgs = append(msgs, "host must be specified when resourceProvisioning is set to manual") - } - if properties.Port == 0 { - msgs = append(msgs, "port must be specified when resourceProvisioning is set to manual") - } - if properties.Username == "" && properties.Secrets.Password != "" { - msgs = append(msgs, "username must be provided with password") - } - } - if len(msgs) == 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - return nil -} diff --git a/pkg/linkrp/datamodel/rediscache.go b/pkg/linkrp/datamodel/rediscache.go deleted file mode 100644 index 11d42c10d6..0000000000 --- a/pkg/linkrp/datamodel/rediscache.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "errors" - "fmt" - "strconv" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// RedisCache represents RedisCache link resource. -type RedisCache struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties RedisCacheProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput sets the Status, ComputedValues, SecretValues, Host, Port and Username properties of the -// RedisCache instance based on the DeploymentOutput object. -func (r *RedisCache) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - r.ComputedValues = do.ComputedValues - r.SecretValues = do.SecretValues - if host, ok := do.ComputedValues[renderers.Host].(string); ok { - r.Properties.Host = host - } - if port, ok := do.ComputedValues[renderers.Port]; ok { - if port != nil { - switch p := port.(type) { - case float64: - r.Properties.Port = int32(p) - case int32: - r.Properties.Port = p - case string: - converted, err := strconv.Atoi(p) - if err != nil { - return err - } - r.Properties.Port = int32(converted) - default: - return errors.New("unhandled type for the property port") - } - } - } - if username, ok := do.ComputedValues[renderers.UsernameStringValue].(string); ok { - r.Properties.Username = username - } - return nil -} - -// OutputResources returns the OutputResources of the RedisCache resource. -func (r *RedisCache) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the RedisCache resource. -func (r *RedisCache) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type of RedisCache resource. -func (redis *RedisCache) ResourceTypeName() string { - return linkrp.RedisCachesResourceType -} - -// Recipe returns the LinkRecipe from the RedisCache Properties if ResourceProvisioning is not set to Manual, -// otherwise it returns nil. -func (redis *RedisCache) Recipe() *linkrp.LinkRecipe { - if redis.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &redis.Properties.Recipe -} - -// IsEmpty checks if the RedisCacheSecrets instance is empty or not. -func (redisSecrets *RedisCacheSecrets) IsEmpty() bool { - return redisSecrets == nil || *redisSecrets == RedisCacheSecrets{} -} - -// VerifyInputs checks if the required fields are set when the resourceProvisioning is set to manual -// and returns an error if not. -func (redisCache *RedisCache) VerifyInputs() error { - msgs := []string{} - if redisCache.Properties.ResourceProvisioning != "" && redisCache.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if redisCache.Properties.Host == "" { - msgs = append(msgs, "host must be specified when resourceProvisioning is set to manual") - } - if redisCache.Properties.Port == 0 { - msgs = append(msgs, "port must be specified when resourceProvisioning is set to manual") - } - } - - if len(msgs) == 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - - return nil -} - -type RedisCacheProperties struct { - rpv1.BasicResourceProperties - // The host name of the target Redis cache - Host string `json:"host,omitempty"` - - // The port value of the target Redis cache - Port int32 `json:"port,omitempty"` - - // The username for Redis cache - Username string `json:"username,omitempty"` - - // Specifies whether to enable non-SSL or SSL connections - TLS bool `json:"tls,omitempty"` - - // The recipe used to automatically deploy underlying infrastructure for the Redis caches link - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - - // Secrets provided by resource - Secrets RedisCacheSecrets `json:"secrets,omitempty"` - - // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - - // List of the resource IDs that support the Redis resource - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` -} - -// Secrets values consisting of secrets provided for the resource -type RedisCacheSecrets struct { - ConnectionString string `json:"connectionString"` - Password string `json:"password"` - URL string `json:"url"` -} - -// ResourceTypeName returns the resource type of RedisCache resource. -func (redis RedisCacheSecrets) ResourceTypeName() string { - return linkrp.RedisCachesResourceType -} diff --git a/pkg/linkrp/datamodel/sqldatabase.go b/pkg/linkrp/datamodel/sqldatabase.go deleted file mode 100644 index 62e933c71f..0000000000 --- a/pkg/linkrp/datamodel/sqldatabase.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "fmt" - "strings" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" -) - -// Recipe returns the LinkRecipe associated with the SqlDatabase instance if the ResourceProvisioning is not -// set to Manual, otherwise it returns nil. -func (sql *SqlDatabase) Recipe() *linkrp.LinkRecipe { - if sql.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - return nil - } - return &sql.Properties.Recipe -} - -// SqlDatabase represents SqlDatabase link resource. -type SqlDatabase struct { - v1.BaseResource - - // Properties is the properties of the resource. - Properties SqlDatabaseProperties `json:"properties"` - - // LinkMetadata represents internal DataModel properties common to all link types. - LinkMetadata -} - -// ApplyDeploymentOutput updates the output resources of a SqlDatabase resource with the output resources of a DeploymentOutput -// object and returns no error. -func (r *SqlDatabase) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - return nil -} - -// OutputResources returns the OutputResources of the SqlDatabase resource. -func (r *SqlDatabase) OutputResources() []rpv1.OutputResource { - return r.Properties.Status.OutputResources -} - -// ResourceMetadata returns the BasicResourceProperties of the SqlDatabase resource. -func (r *SqlDatabase) ResourceMetadata() *rpv1.BasicResourceProperties { - return &r.Properties.BasicResourceProperties -} - -// ResourceTypeName returns the resource type of the SqlDatabase resource. -func (sql *SqlDatabase) ResourceTypeName() string { - return linkrp.SqlDatabasesResourceType -} - -// SqlDatabaseProperties represents the properties of SqlDatabase resource. -type SqlDatabaseProperties struct { - rpv1.BasicResourceProperties - // The recipe used to automatically deploy underlying infrastructure for the SqlDB link - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - // Database name of the target Sql database - Database string `json:"database,omitempty"` - // The fully qualified domain name of the Sql database - Server string `json:"server,omitempty"` - // Port value of the target Sql database - Port int32 `json:"port,omitempty"` - // Specifies how the underlying service/resource is provisioned and managed - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - // List of the resource IDs that support the SqlDB resource - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - // Username of the Sql database - Username string `json:"username,omitempty"` - // Secrets values provided for the resource - Secrets SqlDatabaseSecrets `json:"secrets,omitempty"` -} - -// Secrets values consisting of secrets provided for the resource -type SqlDatabaseSecrets struct { - Password string `json:"password"` - ConnectionString string `json:"connectionString"` -} - -// VerifyInputs checks that the inputs for manual resource provisioning are all provided -// - -// VerifyInputs checks if the required fields are set when the resourceProvisioning is set to manual and returns an error -// if any of the required fields are not set. -func (sql *SqlDatabase) VerifyInputs() error { - msgs := []string{} - if sql.Properties.ResourceProvisioning != "" && sql.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { - if sql.Properties.Server == "" { - msgs = append(msgs, "server must be specified when resourceProvisioning is set to manual") - } - if sql.Properties.Port == 0 { - msgs = append(msgs, "port must be specified when resourceProvisioning is set to manual") - } - if sql.Properties.Database == "" { - msgs = append(msgs, "database must be specified when resourceProvisioning is set to manual") - } - } - - if len(msgs) == 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: msgs[0], - } - } else if len(msgs) > 1 { - return &v1.ErrClientRP{ - Code: v1.CodeInvalid, - Message: fmt.Sprintf("multiple errors were found:\n\t%v", strings.Join(msgs, "\n\t")), - } - } - - return nil -} - -// IsEmpty checks if the SqlDatabaseSecrets struct is empty. -func (sqlSecrets SqlDatabaseSecrets) IsEmpty() bool { - return sqlSecrets == SqlDatabaseSecrets{} -} - -// ResourceTypeName returns the resource type of the SqlDatabase resource. -func (sqlSecrets *SqlDatabaseSecrets) ResourceTypeName() string { - return linkrp.SqlDatabasesResourceType -} diff --git a/pkg/linkrp/frontend/controller/extenders/listsecretsextender.go b/pkg/linkrp/frontend/controller/extenders/listsecretsextender.go deleted file mode 100644 index f0c948b2b8..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/listsecretsextender.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package extenders - -import ( - "context" - "net/http" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" -) - -var _ ctrl.Controller = (*ListSecretsExtender)(nil) - -// ListSecretsExtender is the controller implementation to list secrets for the to access the connected extender resource resource id passed in the request body. -type ListSecretsExtender struct { - ctrl.Operation[*datamodel.Extender, datamodel.Extender] -} - -// NewListSecretsExtender creates a new instance of ListSecretsExtender. -func NewListSecretsExtender(opts ctrl.Options) (ctrl.Controller, error) { - return &ListSecretsExtender{ - Operation: ctrl.NewOperation(opts, - ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - }), - }, nil -} - -// Run returns secrets values for the specified Extender resource -func (ctrl *ListSecretsExtender) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { - sCtx := v1.ARMRequestContextFromContext(ctx) - - // Request route for listsecrets has name of the operation as suffix which should be removed to get the resource id. - // route id format: subscriptions//resourceGroups//providers/Applications.Link/extenders//listsecrets - parsedResourceID := sCtx.ResourceID.Truncate() - resource, _, err := ctrl.GetResource(ctx, parsedResourceID) - if err != nil { - return nil, err - } - - if resource == nil { - return rest.NewNotFoundResponse(sCtx.ResourceID), nil - } - - secrets := map[string]string{} - for key, secret := range resource.SecretValues { - secrets[key] = secret.Value - } - - return rest.NewOKResponse(secrets), nil -} diff --git a/pkg/linkrp/frontend/controller/extenders/listsecretsextender_test.go b/pkg/linkrp/frontend/controller/extenders/listsecretsextender_test.go deleted file mode 100644 index c788061996..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/listsecretsextender_test.go +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package extenders - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "net/http/httptest" - "testing" - - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" -) - -func TestListSecrets_20220315PrivatePreview(t *testing.T) { - setupTest := func(tb testing.TB) (func(tb testing.TB), *store.MockStorageClient, *statusmanager.MockStatusManager) { - mctrl := gomock.NewController(t) - mds := store.NewMockStorageClient(mctrl) - msm := statusmanager.NewMockStatusManager(mctrl) - - return func(tb testing.TB) { - mctrl.Finish() - }, mds, msm - } - ctx := context.Background() - - _, extenderDataModel, _ := getTestModels20220315privatepreview() - expectedSecrets := map[string]any{ - "accountSid": "sid", - "authToken:": "token", - } - - t.Run("listSecrets non-existing resource", func(t *testing.T) { - teardownTest, mds, msm := setupTest(t) - defer teardownTest(t) - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - - mds. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{ID: id} - }) - - opts := ctrl.Options{ - StorageClient: mds, - StatusManager: msm, - } - - ctl, err := NewListSecretsExtender(opts) - - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - require.Equal(t, 404, w.Result().StatusCode) - }) - - t.Run("listSecrets existing resource", func(t *testing.T) { - teardownTest, mds, msm := setupTest(t) - defer teardownTest(t) - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - - mds. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: extenderDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mds, - StatusManager: msm, - } - - ctl, err := NewListSecretsExtender(opts) - - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := map[string]any{} - _ = json.Unmarshal(w.Body.Bytes(), &actualOutput) - - require.Equal(t, expectedSecrets["accountSid"], actualOutput["accountSid"]) - require.Equal(t, expectedSecrets["authToken"], actualOutput["authToken"]) - }) - - t.Run("listSecrets error retrieving resource", func(t *testing.T) { - teardownTest, mds, msm := setupTest(t) - defer teardownTest(t) - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - w := httptest.NewRecorder() - - mds. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, errors.New("failed to get the resource from data store") - }) - - opts := ctrl.Options{ - StorageClient: mds, - StatusManager: msm, - } - - ctl, err := NewListSecretsExtender(opts) - - require.NoError(t, err) - _, err = ctl.Run(ctx, w, req) - require.Error(t, err) - }) - -} diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_datamodel.json deleted file mode 100644 index 61ee87a2eb..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_datamodel.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", - "name": "extender0", - "type": "applications.link/extenders", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "additionalProperties":{ - "fromNumber": "222-222-2222" - }, - "secrets": { - "accountSid": "sid", - "authToken:": "token" - } - }, - "computedValues": { - "fromNumber": "222-222-2222" - }, - "secretValues": { - "accountSid": { - "value": "sid" - }, - "authToken:": { - "value": "token" - } - }, - "resourceProvisioning": "manual", - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input.json deleted file mode 100644 index 42988b83f8..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input_diff_env.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input_diff_env.json deleted file mode 100644 index 51cff92fd1..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_input_diff_env.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/invalid", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json deleted file mode 100644 index 3c460ec960..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_output.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", - "location": "West US", - "name": "extender0", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual", - "provisioningState": "Succeeded" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.link/extenders" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_requestheaders.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_requestheaders.json deleted file mode 100644 index 22a1e736a9..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreview_requestheaders.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "en-US", - "Content-Length": "305", - "Content-Type": "application/json; charset=utf-8", - "Referer": "https://radius.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0?api-version=2022-03-15-privatepreview", - "Traceparent": "00-000011048df2134ca37c9a689c3a0000-0000000000000000-01", - "User-Agent": "ARMClient/1.6.0.0", - "Via": "1.1 Azure", - "X-Azure-Requestchain": "hops=1", - "X-Fd-Clienthttpversion": "1.1", - "X-Fd-Clientip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Fd-Edgeenvironment": "fake", - "X-Fd-Eventid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Impressionguid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Originalurl": "https://radius.dev:443/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/extenders/extender0?api-version=2022-03-15-privatepreview", - "X-Fd-Partner": "AzureResourceManager_Test", - "X-Fd-Ref": "Ref A: xxxx Ref B: xxxx Ref C: 2022-03-22T18:54:50Z", - "X-Fd-Revip": "country=United States,iso=us,state=Washington,city=Redmond,zip=00000,tz=-8,asn=0,lat=0,long=-1,countrycf=8,citycf=8", - "X-Fd-Routekey": "000075000", - "X-Fd-Socketip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Forwarded-For": "192.168.0.10", - "X-Forwarded-Host": "radius.dev", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https", - "X-Forwarded-Scheme": "https", - "X-Ms-Activity-Vector": "IN.0P", - "X-Ms-Arm-Network-Source": "PublicNetwork", - "X-Ms-Arm-Request-Tracking-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Arm-Resource-System-Data": "{\"lastModifiedBy\":\"fake@hotmail.com\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2022-03-22T18:57:52.6857175Z\"}", - "X-Ms-Arm-Service-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Acr": "1", - "X-Ms-Client-Alt-Sec-Id": "1:live.com:0006000017E40000", - "X-Ms-Client-App-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-App-Id-Acr": "0", - "X-Ms-Client-Audience": "https://management.core.windows.net/", - "X-Ms-Client-Authentication-Methods": "pwd", - "X-Ms-Client-Authorization-Source": "RoleBased", - "X-Ms-Client-Family-Name-Encoded": "fake", - "X-Ms-Client-Given-Name-Encoded": "fake", - "X-Ms-Client-Identity-Provider": "live.com", - "X-Ms-Client-Ip-Address": "192.168.0.10", - "X-Ms-Client-Issuer": "https://sts.windows-ppe.net/00000000-0000-0000-0000-000000000000/", - "X-Ms-Client-Location": "centralus", - "X-Ms-Client-Object-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Principal-Group-Membership-Source": "Token", - "X-Ms-Client-Principal-Id": "000000000000000", - "X-Ms-Client-Principal-Name": "live.com#fake@hotmail.com", - "X-Ms-Client-Puid": "000000000000000", - "X-Ms-Client-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Scope": "user_impersonation", - "X-Ms-Client-Tenant-Id": "00000000-0000-0000-0000-000000000001", - "X-Ms-Client-Wids": "00000000-0000-0000-0000-000000000000, 00000000-0000-0000-0000-000000000001", - "X-Ms-Correlation-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Home-Tenant-Id": "00000000-0000-0000-0000-000000000002", - "X-Ms-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Routing-Request-Id": "CENTRALUS:20220322T185452Z:00000000-0000-0000-0000-000000000000", - "X-Original-Forwarded-For": "0000:0000:0000:1:449b:f928:e40a:a351", - "X-Real-Ip": "192.168.0.10", - "X-Request-Id": "1000f6040000000000004bc7d1666424", - "X-Scheme": "https" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json b/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json deleted file mode 100644 index ffd9386a6a..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/testdata/20220315privatepreviewgetandlist_output.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/extenders/extender0", - "location": "West US", - "name": "extender0", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "resourceProvisioning": "manual", - "provisioningState": "Succeeded" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.link/extenders" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/extenders/types.go b/pkg/linkrp/frontend/controller/extenders/types.go deleted file mode 100644 index 62a0d3668e..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package extenders - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/linkrp/frontend/controller/extenders/v20220315privatepreview_test.go b/pkg/linkrp/frontend/controller/extenders/v20220315privatepreview_test.go deleted file mode 100644 index f6567a8034..0000000000 --- a/pkg/linkrp/frontend/controller/extenders/v20220315privatepreview_test.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package extenders - -import ( - "encoding/json" - - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/test/testutil" -) - -const testHeaderfile = "20220315privatepreview_requestheaders.json" - -func getTestModels20220315privatepreview() (input *v20220315privatepreview.ExtenderResource, dataModel *datamodel.Extender, output *v20220315privatepreview.ExtenderResource) { - rawInput := testutil.ReadFixture("20220315privatepreview_input.json") - input = &v20220315privatepreview.ExtenderResource{} - _ = json.Unmarshal(rawInput, input) - - rawDataModel := testutil.ReadFixture("20220315privatepreview_datamodel.json") - dataModel = &datamodel.Extender{} - _ = json.Unmarshal(rawDataModel, dataModel) - - rawExpectedOutput := testutil.ReadFixture("20220315privatepreview_output.json") - output = &v20220315privatepreview.ExtenderResource{} - _ = json.Unmarshal(rawExpectedOutput, output) - - return input, dataModel, output -} diff --git a/pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go b/pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go deleted file mode 100644 index 056ad749f1..0000000000 --- a/pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -import ( - "context" - "net/http" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -var _ ctrl.Controller = (*ListSecretsMongoDatabase)(nil) - -// ListSecretsMongoDatabase is the controller implementation to list secrets for the to access the connected mongo database resource resource id passed in the request body. -type ListSecretsMongoDatabase struct { - ctrl.Operation[*datamodel.MongoDatabase, datamodel.MongoDatabase] -} - -// NewListSecretsMongoDatabase creates a new instance of ListSecretsMongoDatabase, or an error if the controller could not be created. -func NewListSecretsMongoDatabase(opts ctrl.Options) (ctrl.Controller, error) { - return &ListSecretsMongoDatabase{ - Operation: ctrl.NewOperation(opts, - ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - }), - }, nil -} - -// Run returns secrets values for the specified MongoDatabase resource -func (ctrl *ListSecretsMongoDatabase) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { - sCtx := v1.ARMRequestContextFromContext(ctx) - - parsedResourceID := sCtx.ResourceID.Truncate() - resource, _, err := ctrl.GetResource(ctx, parsedResourceID) - if err != nil { - return nil, err - } - - if resource == nil { - return rest.NewNotFoundResponse(sCtx.ResourceID), nil - } - - mongoSecrets := datamodel.MongoDatabaseSecrets{} - if password, ok := resource.SecretValues[renderers.PasswordStringHolder]; ok { - mongoSecrets.Password = password.Value - } - if connectionString, ok := resource.SecretValues[renderers.ConnectionStringValue]; ok { - mongoSecrets.ConnectionString = connectionString.Value - } - - versioned, _ := converter.MongoDatabaseSecretsDataModelToVersioned(&mongoSecrets, sCtx.APIVersion) - return rest.NewOKResponse(versioned), nil -} diff --git a/pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go b/pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go deleted file mode 100644 index 244fd81e5f..0000000000 --- a/pkg/linkrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "net/http/httptest" - "testing" - - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/ucp/store" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" -) - -func TestListSecrets_20220315PrivatePreview(t *testing.T) { - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mStorageClient := store.NewMockStorageClient(mctrl) - ctx := context.Background() - - _, mongoDataModel, _ := getTestModels20220315privatepreview() - - t.Run("listSecrets non-existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{ID: id} - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsMongoDatabase(opts) - - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - require.Equal(t, 404, w.Result().StatusCode) - }) - - t.Run("listSecrets existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - renderers.UsernameStringValue: "testUser", - renderers.PasswordStringHolder: "testPassword", - renderers.ConnectionStringValue: "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: mongoDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsMongoDatabase(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.MongoDatabaseSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[renderers.ConnectionStringValue], *actualOutput.ConnectionString) - require.Equal(t, expectedSecrets[renderers.PasswordStringHolder], *actualOutput.Password) - }) - - t.Run("listSecrets existing resource partial secrets", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - renderers.UsernameStringValue: "testUser", - renderers.ConnectionStringValue: "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: mongoDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsMongoDatabase(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.MongoDatabaseSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[renderers.ConnectionStringValue], *actualOutput.ConnectionString) - }) - - t.Run("listSecrets error retrieving resource", func(t *testing.T) { - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - w := httptest.NewRecorder() - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, errors.New("failed to get the resource from data store") - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsMongoDatabase(opts) - require.NoError(t, err) - - _, err = ctl.Run(ctx, w, req) - require.Error(t, err) - }) - -} diff --git a/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json deleted file mode 100644 index 29c85e0176..0000000000 --- a/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_datamodel.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/mongodatabases/mongo0", - "name": "mongo0", - "type": "applications.link/mongodatabases", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db" - } - ], - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "secrets": { - "username": "testUser", - "password": "testPassword", - "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" - }, - "database": "db" - }, - "computedValues": { - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255 - }, - "secretValues": { - "username": { - "value": "testUser" - }, - "password": { - "value": "testPassword" - }, - "connectionString": { - "value": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_requestheaders.json b/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_requestheaders.json deleted file mode 100644 index 8a8af67d72..0000000000 --- a/pkg/linkrp/frontend/controller/mongodatabases/testdata/20220315privatepreview_requestheaders.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "en-US", - "Content-Length": "305", - "Content-Type": "application/json; charset=utf-8", - "Referer": "https://radius.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/mongodatabases/mongo0?api-version=2022-03-15-privatepreview", - "Traceparent": "00-000011048df2134ca37c9a689c3a0000-0000000000000000-01", - "User-Agent": "ARMClient/1.6.0.0", - "Via": "1.1 Azure", - "X-Azure-Requestchain": "hops=1", - "X-Fd-Clienthttpversion": "1.1", - "X-Fd-Clientip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Fd-Edgeenvironment": "fake", - "X-Fd-Eventid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Impressionguid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Originalurl": "https://radius.dev:443/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongodatabase/mongo0?api-version=2022-03-15-privatepreview", - "X-Fd-Partner": "AzureResourceManager_Test", - "X-Fd-Ref": "Ref A: xxxx Ref B: xxxx Ref C: 2022-03-22T18:54:50Z", - "X-Fd-Revip": "country=United States,iso=us,state=Washington,city=Redmond,zip=00000,tz=-8,asn=0,lat=0,long=-1,countrycf=8,citycf=8", - "X-Fd-Routekey": "000075000", - "X-Fd-Socketip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Forwarded-For": "192.168.0.10", - "X-Forwarded-Host": "radius.dev", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https", - "X-Forwarded-Scheme": "https", - "X-Ms-Activity-Vector": "IN.0P", - "X-Ms-Arm-Network-Source": "PublicNetwork", - "X-Ms-Arm-Request-Tracking-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Arm-Resource-System-Data": "{\"lastModifiedBy\":\"fake@hotmail.com\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2022-03-22T18:57:52.6857175Z\"}", - "X-Ms-Arm-Service-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Acr": "1", - "X-Ms-Client-Alt-Sec-Id": "1:live.com:0006000017E40000", - "X-Ms-Client-App-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-App-Id-Acr": "0", - "X-Ms-Client-Audience": "https://management.core.windows.net/", - "X-Ms-Client-Authentication-Methods": "pwd", - "X-Ms-Client-Authorization-Source": "RoleBased", - "X-Ms-Client-Family-Name-Encoded": "fake", - "X-Ms-Client-Given-Name-Encoded": "fake", - "X-Ms-Client-Identity-Provider": "live.com", - "X-Ms-Client-Ip-Address": "192.168.0.10", - "X-Ms-Client-Issuer": "https://sts.windows-ppe.net/00000000-0000-0000-0000-000000000000/", - "X-Ms-Client-Location": "centralus", - "X-Ms-Client-Object-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Principal-Group-Membership-Source": "Token", - "X-Ms-Client-Principal-Id": "000000000000000", - "X-Ms-Client-Principal-Name": "live.com#fake@hotmail.com", - "X-Ms-Client-Puid": "000000000000000", - "X-Ms-Client-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Scope": "user_impersonation", - "X-Ms-Client-Tenant-Id": "00000000-0000-0000-0000-000000000001", - "X-Ms-Client-Wids": "00000000-0000-0000-0000-000000000000, 00000000-0000-0000-0000-000000000001", - "X-Ms-Correlation-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Home-Tenant-Id": "00000000-0000-0000-0000-000000000002", - "X-Ms-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Routing-Request-Id": "CENTRALUS:20220322T185452Z:00000000-0000-0000-0000-000000000000", - "X-Original-Forwarded-For": "0000:0000:0000:1:449b:f928:e40a:a351", - "X-Real-Ip": "192.168.0.10", - "X-Request-Id": "1000f6040000000000004bc7d1666424", - "X-Scheme": "https" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/mongodatabases/types.go b/pkg/linkrp/frontend/controller/mongodatabases/types.go deleted file mode 100644 index c9833d3940..0000000000 --- a/pkg/linkrp/frontend/controller/mongodatabases/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/linkrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go b/pkg/linkrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go deleted file mode 100644 index 94eda475fb..0000000000 --- a/pkg/linkrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -import ( - "encoding/json" - - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/test/testutil" -) - -const testHeaderfile = "20220315privatepreview_requestheaders.json" - -func getTestModels20220315privatepreview() (input *v20220315privatepreview.MongoDatabaseResource, dataModel *datamodel.MongoDatabase, output *v20220315privatepreview.MongoDatabaseResource) { - rawDataModel := testutil.ReadFixture("20220315privatepreview_datamodel.json") - dataModel = &datamodel.MongoDatabase{} - _ = json.Unmarshal(rawDataModel, dataModel) - - return input, dataModel, output -} diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq.go b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq.go deleted file mode 100644 index 5f02d83e2c..0000000000 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rabbitmqmessagequeues - -import ( - "context" - "net/http" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -var _ ctrl.Controller = (*ListSecretsRabbitMQMessageQueue)(nil) - -// ListSecretsRabbitMQMessageQueue is the controller implementation to list secrets for the to access the connected rabbitMQ resource resource id passed in the request body. -type ListSecretsRabbitMQMessageQueue struct { - ctrl.Operation[*datamodel.RabbitMQMessageQueue, datamodel.RabbitMQMessageQueue] -} - -// NewListSecretsRabbitMQMessageQueue creates a new instance of ListSecretsRabbitMQMessageQueue. -func NewListSecretsRabbitMQMessageQueue(opts ctrl.Options) (ctrl.Controller, error) { - return &ListSecretsRabbitMQMessageQueue{ - Operation: ctrl.NewOperation(opts, - ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - }), - }, nil -} - -// Run returns secrets values for the specified RabbitMQMessageQueue resource -func (ctrl *ListSecretsRabbitMQMessageQueue) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { - sCtx := v1.ARMRequestContextFromContext(ctx) - - // Request route for listsecrets has name of the operation as suffix which should be removed to get the resource id. - // route id format: subscriptions//resourceGroups//providers/Applications.Link/rabbitMQMessageQueues//listsecrets - parsedResourceID := sCtx.ResourceID.Truncate() - resource, _, err := ctrl.GetResource(ctx, parsedResourceID) - if err != nil { - return nil, err - } - - if resource == nil { - return rest.NewNotFoundResponse(sCtx.ResourceID), nil - } - - rabbitMQSecrets := datamodel.RabbitMQSecrets{} - if uri, ok := resource.SecretValues[renderers.URI]; ok { - rabbitMQSecrets.URI = uri.Value - } - if password, ok := resource.SecretValues[renderers.PasswordStringHolder]; ok { - rabbitMQSecrets.Password = password.Value - } - - versioned, _ := converter.RabbitMQSecretsDataModelToVersioned(&rabbitMQSecrets, sCtx.APIVersion) - return rest.NewOKResponse(versioned), nil -} diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq_test.go b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq_test.go deleted file mode 100644 index e4e444676a..0000000000 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/listsecretsrabbitmq_test.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rabbitmqmessagequeues - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "net/http/httptest" - "testing" - - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/ucp/store" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" -) - -func TestListSecrets_20220315PrivatePreview(t *testing.T) { - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mStorageClient := store.NewMockStorageClient(mctrl) - ctx := context.Background() - - _, rabbitMQDataModel, _ := getTestModels20220315privatepreview() - - t.Run("listSecrets non-existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{ID: id} - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsRabbitMQMessageQueue(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 404, w.Result().StatusCode) - }) - - t.Run("listSecrets existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - renderers.URI: "connection://string", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: rabbitMQDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsRabbitMQMessageQueue(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.RabbitMQSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[renderers.URI], *actualOutput.URI) - }) - - t.Run("listSecrets error retrieving resource", func(t *testing.T) { - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - w := httptest.NewRecorder() - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, errors.New("failed to get the resource from data store") - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsRabbitMQMessageQueue(opts) - require.NoError(t, err) - - _, err = ctl.Run(ctx, w, req) - require.Error(t, err) - }) - -} diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json deleted file mode 100644 index af82e27f5f..0000000000 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_datamodel.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/rabbitmqmessagequeues/rabbitmq0", - "name": "rabbitmq0", - "type": "applications.link/rabbitmqmessagequeues", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "queue": "testQueue", - "secrets": { - "uri": "connection://string", - "password": "password" - } - }, - "computedValues": { - "queue": "testQueue" - }, - "secretValues": { - "uri": { - "value": "connection://string" - }, - "password": { - "value": "password" - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_requestheaders.json b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_requestheaders.json deleted file mode 100644 index c99c07a811..0000000000 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/testdata/20220315privatepreview_requestheaders.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "en-US", - "Content-Length": "305", - "Content-Type": "application/json; charset=utf-8", - "Referer": "https://radius.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/rabbitmqmessagequeues/rabbitmq0?api-version=2022-03-15-privatepreview", - "Traceparent": "00-000011048df2134ca37c9a689c3a0000-0000000000000000-01", - "User-Agent": "ARMClient/1.6.0.0", - "Via": "1.1 Azure", - "X-Azure-Requestchain": "hops=1", - "X-Fd-Clienthttpversion": "1.1", - "X-Fd-Clientip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Fd-Edgeenvironment": "fake", - "X-Fd-Eventid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Impressionguid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Originalurl": "https://radius.dev:443/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rabbitmqmessagequeue/rabbitmq0?api-version=2022-03-15-privatepreview", - "X-Fd-Partner": "AzureResourceManager_Test", - "X-Fd-Ref": "Ref A: xxxx Ref B: xxxx Ref C: 2022-03-22T18:54:50Z", - "X-Fd-Revip": "country=United States,iso=us,state=Washington,city=Redmond,zip=00000,tz=-8,asn=0,lat=0,long=-1,countrycf=8,citycf=8", - "X-Fd-Routekey": "000075000", - "X-Fd-Socketip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Forwarded-For": "192.168.0.10", - "X-Forwarded-Host": "radius.dev", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https", - "X-Forwarded-Scheme": "https", - "X-Ms-Activity-Vector": "IN.0P", - "X-Ms-Arm-Network-Source": "PublicNetwork", - "X-Ms-Arm-Request-Tracking-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Arm-Resource-System-Data": "{\"lastModifiedBy\":\"fake@hotmail.com\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2022-03-22T18:57:52.6857175Z\"}", - "X-Ms-Arm-Service-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Acr": "1", - "X-Ms-Client-Alt-Sec-Id": "1:live.com:0006000017E40000", - "X-Ms-Client-App-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-App-Id-Acr": "0", - "X-Ms-Client-Audience": "https://management.core.windows.net/", - "X-Ms-Client-Authentication-Methods": "pwd", - "X-Ms-Client-Authorization-Source": "RoleBased", - "X-Ms-Client-Family-Name-Encoded": "fake", - "X-Ms-Client-Given-Name-Encoded": "fake", - "X-Ms-Client-Identity-Provider": "live.com", - "X-Ms-Client-Ip-Address": "192.168.0.10", - "X-Ms-Client-Issuer": "https://sts.windows-ppe.net/00000000-0000-0000-0000-000000000000/", - "X-Ms-Client-Location": "centralus", - "X-Ms-Client-Object-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Principal-Group-Membership-Source": "Token", - "X-Ms-Client-Principal-Id": "000000000000000", - "X-Ms-Client-Principal-Name": "live.com#fake@hotmail.com", - "X-Ms-Client-Puid": "000000000000000", - "X-Ms-Client-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Scope": "user_impersonation", - "X-Ms-Client-Tenant-Id": "00000000-0000-0000-0000-000000000001", - "X-Ms-Client-Wids": "00000000-0000-0000-0000-000000000000, 00000000-0000-0000-0000-000000000001", - "X-Ms-Correlation-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Home-Tenant-Id": "00000000-0000-0000-0000-000000000002", - "X-Ms-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Routing-Request-Id": "CENTRALUS:20220322T185452Z:00000000-0000-0000-0000-000000000000", - "X-Original-Forwarded-For": "0000:0000:0000:1:449b:f928:e40a:a351", - "X-Real-Ip": "192.168.0.10", - "X-Request-Id": "1000f6040000000000004bc7d1666424", - "X-Scheme": "https" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/types.go b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/types.go deleted file mode 100644 index c9b8865de2..0000000000 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rabbitmqmessagequeues - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/v20220315privatepreview_test.go b/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/v20220315privatepreview_test.go deleted file mode 100644 index 7a6922291c..0000000000 --- a/pkg/linkrp/frontend/controller/rabbitmqmessagequeues/v20220315privatepreview_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rabbitmqmessagequeues - -import ( - "encoding/json" - - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/test/testutil" -) - -const testHeaderfile = "20220315privatepreview_requestheaders.json" - -func getTestModels20220315privatepreview() (input *v20220315privatepreview.RabbitMQMessageQueueResource, dataModel *datamodel.RabbitMQMessageQueue, output *v20220315privatepreview.RabbitMQMessageQueueResource) { - rawDataModel := testutil.ReadFixture("20220315privatepreview_datamodel.json") - dataModel = &datamodel.RabbitMQMessageQueue{} - _ = json.Unmarshal(rawDataModel, dataModel) - - return input, dataModel, output -} diff --git a/pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache.go b/pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache.go deleted file mode 100644 index 0774e6f3fb..0000000000 --- a/pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rediscaches - -import ( - "context" - "errors" - "net/http" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/ucp/store" -) - -var _ ctrl.Controller = (*ListSecretsRedisCache)(nil) - -// ListSecretsRedisCache is the controller implementation to list secrets for the to access the connected redis cache resource resource id passed in the request body. -type ListSecretsRedisCache struct { - ctrl.Operation[*datamodel.RedisCache, datamodel.RedisCache] -} - -// NewListSecretsRedisCache creates a new instance of ListSecretsRedisCache and returns it without an error. -func NewListSecretsRedisCache(opts ctrl.Options) (ctrl.Controller, error) { - return &ListSecretsRedisCache{ - Operation: ctrl.NewOperation(opts, - ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - }), - }, nil -} - -// Run returns secrets values for the specified RedisCache resource -func (ctrl *ListSecretsRedisCache) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { - sCtx := v1.ARMRequestContextFromContext(ctx) - - // Request route for listsecrets has name of the operation as suffix which should be removed to get the resource id. - // route id format: subscriptions//resourceGroups//providers/Applications.Link/redisCaches//listsecrets - parsedResourceID := sCtx.ResourceID.Truncate() - resource, _, err := ctrl.GetResource(ctx, parsedResourceID) - if err != nil { - if errors.Is(&store.ErrNotFound{ID: parsedResourceID.String()}, err) { - return rest.NewNotFoundResponse(sCtx.ResourceID), nil - } - return nil, err - } - - if resource == nil { - return rest.NewNotFoundResponse(sCtx.ResourceID), nil - } - - redisSecrets := datamodel.RedisCacheSecrets{} - if password, ok := resource.SecretValues[renderers.PasswordStringHolder]; ok { - redisSecrets.Password = password.Value - } - if connectionString, ok := resource.SecretValues[renderers.ConnectionStringValue]; ok { - redisSecrets.ConnectionString = connectionString.Value - } - - versioned, _ := converter.RedisCacheSecretsDataModelToVersioned(&redisSecrets, sCtx.APIVersion) - return rest.NewOKResponse(versioned), nil -} diff --git a/pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache_test.go b/pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache_test.go deleted file mode 100644 index 4d8594cb1c..0000000000 --- a/pkg/linkrp/frontend/controller/rediscaches/listsecretsrediscache_test.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rediscaches - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "net/http/httptest" - "testing" - - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/renderers" - "github.com/project-radius/radius/pkg/ucp/store" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" -) - -func TestListSecrets_20220315PrivatePreview(t *testing.T) { - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mStorageClient := store.NewMockStorageClient(mctrl) - ctx := context.Background() - - _, redisDataModel, _ := getTestModels20220315privatepreview() - - t.Run("listSecrets non-existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{ID: id} - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - ctl, err := NewListSecretsRedisCache(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 404, w.Result().StatusCode) - }) - - t.Run("listSecrets existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - renderers.PasswordStringHolder: "testPassword", - renderers.ConnectionStringValue: "test-connection-string", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: redisDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsRedisCache(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.RedisCacheSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[renderers.ConnectionStringValue], *actualOutput.ConnectionString) - require.Equal(t, expectedSecrets[renderers.PasswordStringHolder], *actualOutput.Password) - }) - - t.Run("listSecrets existing resource partial secrets", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - renderers.PasswordStringHolder: "testPassword", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: redisDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsRedisCache(opts) - require.NoError(t, err) - - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.RedisCacheSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[renderers.PasswordStringHolder], *actualOutput.Password) - }) - - t.Run("listSecrets error retrieving resource", func(t *testing.T) { - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - w := httptest.NewRecorder() - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, errors.New("failed to get the resource from data store") - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsRedisCache(opts) - require.NoError(t, err) - - _, err = ctl.Run(ctx, w, req) - require.Error(t, err) - }) - -} diff --git a/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json deleted file mode 100644 index 968bea1612..0000000000 --- a/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_datamodel.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/rediscaches/redis0", - "name": "redis0", - "type": "applications.link/rediscaches", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache" - } - ], - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" - }, - "username": "redisusername" - }, - "computedValues": { - "host": "myrediscache.redis.cache.windows.net", - "port": 10255, - "username": "redisusername" - }, - "secretValues": { - "password": { - "value": "testPassword" - }, - "connectionString": { - "value": "test-connection-string" - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_requestheaders.json b/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_requestheaders.json deleted file mode 100644 index 550f994e9f..0000000000 --- a/pkg/linkrp/frontend/controller/rediscaches/testdata/20220315privatepreview_requestheaders.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "en-US", - "Content-Length": "305", - "Content-Type": "application/json; charset=utf-8", - "Referer": "https://radius.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/rediscaches/redis0?api-version=2022-03-15-privatepreview", - "Traceparent": "00-000011048df2134ca37c9a689c3a0000-0000000000000000-01", - "User-Agent": "ARMClient/1.6.0.0", - "Via": "1.1 Azure", - "X-Azure-Requestchain": "hops=1", - "X-Fd-Clienthttpversion": "1.1", - "X-Fd-Clientip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Fd-Edgeenvironment": "fake", - "X-Fd-Eventid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Impressionguid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Originalurl": "https://radius.dev:443/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/rediscache/redis0?api-version=2022-03-15-privatepreview", - "X-Fd-Partner": "AzureResourceManager_Test", - "X-Fd-Ref": "Ref A: xxxx Ref B: xxxx Ref C: 2022-03-22T18:54:50Z", - "X-Fd-Revip": "country=United States,iso=us,state=Washington,city=Redmond,zip=00000,tz=-8,asn=0,lat=0,long=-1,countrycf=8,citycf=8", - "X-Fd-Routekey": "000075000", - "X-Fd-Socketip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Forwarded-For": "192.168.0.10", - "X-Forwarded-Host": "radius.dev", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https", - "X-Forwarded-Scheme": "https", - "X-Ms-Activity-Vector": "IN.0P", - "X-Ms-Arm-Network-Source": "PublicNetwork", - "X-Ms-Arm-Request-Tracking-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Arm-Resource-System-Data": "{\"lastModifiedBy\":\"fake@hotmail.com\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2022-03-22T18:57:52.6857175Z\"}", - "X-Ms-Arm-Service-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Acr": "1", - "X-Ms-Client-Alt-Sec-Id": "1:live.com:0006000017E40000", - "X-Ms-Client-App-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-App-Id-Acr": "0", - "X-Ms-Client-Audience": "https://management.core.windows.net/", - "X-Ms-Client-Authentication-Methods": "pwd", - "X-Ms-Client-Authorization-Source": "RoleBased", - "X-Ms-Client-Family-Name-Encoded": "fake", - "X-Ms-Client-Given-Name-Encoded": "fake", - "X-Ms-Client-Identity-Provider": "live.com", - "X-Ms-Client-Ip-Address": "192.168.0.10", - "X-Ms-Client-Issuer": "https://sts.windows-ppe.net/00000000-0000-0000-0000-000000000000/", - "X-Ms-Client-Location": "centralus", - "X-Ms-Client-Object-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Principal-Group-Membership-Source": "Token", - "X-Ms-Client-Principal-Id": "000000000000000", - "X-Ms-Client-Principal-Name": "live.com#fake@hotmail.com", - "X-Ms-Client-Puid": "000000000000000", - "X-Ms-Client-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Scope": "user_impersonation", - "X-Ms-Client-Tenant-Id": "00000000-0000-0000-0000-000000000001", - "X-Ms-Client-Wids": "00000000-0000-0000-0000-000000000000, 00000000-0000-0000-0000-000000000001", - "X-Ms-Correlation-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Home-Tenant-Id": "00000000-0000-0000-0000-000000000002", - "X-Ms-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Routing-Request-Id": "CENTRALUS:20220322T185452Z:00000000-0000-0000-0000-000000000000", - "X-Original-Forwarded-For": "0000:0000:0000:1:449b:f928:e40a:a351", - "X-Real-Ip": "192.168.0.10", - "X-Request-Id": "1000f6040000000000004bc7d1666424", - "X-Scheme": "https" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/rediscaches/types.go b/pkg/linkrp/frontend/controller/rediscaches/types.go deleted file mode 100644 index 17e9f7961a..0000000000 --- a/pkg/linkrp/frontend/controller/rediscaches/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rediscaches - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/linkrp/frontend/controller/rediscaches/v20220315privatepreview_test.go b/pkg/linkrp/frontend/controller/rediscaches/v20220315privatepreview_test.go deleted file mode 100644 index 43ad718a12..0000000000 --- a/pkg/linkrp/frontend/controller/rediscaches/v20220315privatepreview_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rediscaches - -import ( - "encoding/json" - - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/test/testutil" -) - -const testHeaderfile = "20220315privatepreview_requestheaders.json" - -func getTestModels20220315privatepreview() (input *v20220315privatepreview.RedisCacheResource, dataModel *datamodel.RedisCache, output *v20220315privatepreview.RedisCacheResource) { - rawDataModel := testutil.ReadFixture("20220315privatepreview_datamodel.json") - dataModel = &datamodel.RedisCache{} - _ = json.Unmarshal(rawDataModel, dataModel) - - return input, dataModel, output -} diff --git a/pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase.go b/pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase.go deleted file mode 100644 index 1bb441a5cc..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sqldatabases - -import ( - "context" - "net/http" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -var _ ctrl.Controller = (*ListSecretsSqlDatabase)(nil) - -// ListSecretsSqlDatabase is the controller implementation to list secrets for the to access the connected sql database resource resource id passed in the request body. -type ListSecretsSqlDatabase struct { - ctrl.Operation[*datamodel.SqlDatabase, datamodel.SqlDatabase] -} - -// NewListSecretsSqlDatabase creates a new instance of ListSecretsSqlDatabase. -func NewListSecretsSqlDatabase(opts ctrl.Options) (ctrl.Controller, error) { - return &ListSecretsSqlDatabase{ - Operation: ctrl.NewOperation(opts, - ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - }), - }, nil -} - -// Run returns secrets values for the specified SqlDatabase resource -func (ctrl *ListSecretsSqlDatabase) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { - sCtx := v1.ARMRequestContextFromContext(ctx) - - parsedResourceID := sCtx.ResourceID.Truncate() - resource, _, err := ctrl.GetResource(ctx, parsedResourceID) - if err != nil { - return nil, err - } - - if resource == nil { - return rest.NewNotFoundResponse(sCtx.ResourceID), nil - } - - sqlSecrets := datamodel.SqlDatabaseSecrets{} - if password, ok := resource.SecretValues[renderers.PasswordStringHolder]; ok { - sqlSecrets.Password = password.Value - } - if connectionString, ok := resource.SecretValues[renderers.ConnectionStringValue]; ok { - sqlSecrets.ConnectionString = connectionString.Value - } - - versioned, _ := converter.SqlDatabaseSecretsDataModelToVersioned(&sqlSecrets, sCtx.APIVersion) - return rest.NewOKResponse(versioned), nil -} diff --git a/pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go b/pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go deleted file mode 100644 index 53845ac180..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go +++ /dev/null @@ -1,176 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sqldatabases - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "net/http/httptest" - "testing" - - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/ucp/store" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" -) - -func TestListSecrets_20220315PrivatePreview(t *testing.T) { - const ( - usernameStringValue string = "username" - passwordStringValue string = "password" - connectionStringValue string = "connectionString" - ) - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mStorageClient := store.NewMockStorageClient(mctrl) - ctx := context.Background() - - _, sqlDataModel, _ := getTestModels20220315privatepreview() - - t.Run("listSecrets non-existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, &store.ErrNotFound{ID: id} - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsSqlDatabase(opts) - - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - require.Equal(t, 404, w.Result().StatusCode) - }) - - t.Run("listSecrets existing resource", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - passwordStringValue: "testPassword", - connectionStringValue: "Data Source=tcp:testAccount1.sql.cosmos.azure.com,1433;Initial Catalog=testDatabase;User Id=testUser;Password=testPassword;Encrypt=True;TrustServerCertificate=True", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: sqlDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsSqlDatabase(opts) - - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.SQLDatabaseSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[connectionStringValue], *actualOutput.ConnectionString) - require.Equal(t, expectedSecrets[passwordStringValue], *actualOutput.Password) - }) - - t.Run("listSecrets existing resource partial secrets", func(t *testing.T) { - w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - expectedSecrets := map[string]any{ - connectionStringValue: "Data Source=tcp:testAccount1.sql.cosmos.azure.com,1433;Initial Catalog=testDatabase;User Id=testUser;Password=testPassword;Encrypt=True;TrustServerCertificate=True", - } - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return &store.Object{ - Metadata: store.Metadata{ID: id}, - Data: sqlDataModel, - }, nil - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsSqlDatabase(opts) - - require.NoError(t, err) - resp, err := ctl.Run(ctx, w, req) - require.NoError(t, err) - _ = resp.Apply(ctx, w, req) - require.Equal(t, 200, w.Result().StatusCode) - - actualOutput := &v20220315privatepreview.SQLDatabaseSecrets{} - _ = json.Unmarshal(w.Body.Bytes(), actualOutput) - - require.Equal(t, expectedSecrets[connectionStringValue], *actualOutput.ConnectionString) - }) - - t.Run("listSecrets error retrieving resource", func(t *testing.T) { - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, testHeaderfile, nil) - require.NoError(t, err) - ctx := rpctest.NewARMRequestContext(req) - w := httptest.NewRecorder() - - mStorageClient. - EXPECT(). - Get(gomock.Any(), gomock.Any()). - DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { - return nil, errors.New("failed to get the resource from data store") - }) - - opts := ctrl.Options{ - StorageClient: mStorageClient, - } - - ctl, err := NewListSecretsSqlDatabase(opts) - - require.NoError(t, err) - _, err = ctl.Run(ctx, w, req) - require.Error(t, err) - }) - -} diff --git a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json deleted file mode 100644 index 10d92b06a7..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_datamodel.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/sqldatabases/sql0", - "name": "sql0", - "type": "applications.link/sqldatabases", - "location": "West US", - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "resourceProvisioning": "manual", - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "port": 1433, - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "Data Source=tcp:testAccount1.sql.cosmos.azure.com,1433;Initial Catalog=testDatabase;User Id=testUser;Password=testPassword;Encrypt=True;TrustServerCertificate=True" - } - }, - "computedValues": { - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "port": 1433, - "username": "testUser" - }, - "secretValues": { - "password": { - "value": "testPassword" - }, - "connectionString": { - "value": "Data Source=tcp:testAccount1.sql.cosmos.azure.com,1433;Initial Catalog=testDatabase;User Id=testUser;Password=testPassword;Encrypt=True;TrustServerCertificate=True" - } - }, - "tenantId": "00000000-0000-0000-0000-000000000000", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroup": "radius-test-rg", - "createdApiVersion": "2022-03-15-privatepreview", - "updatedApiVersion": "2022-03-15-privatepreview" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_input.json b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_input.json deleted file mode 100644 index 904cf96ea5..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_input.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual", - "port": 1433, - "username": "testUser", - "secrets": { - "password": "testPassword", - "connectionString": "Data Source=tcp:testAccount1.sql.cosmos.azure.com,1433;Initial Catalog=testDatabase;User Id=testUser;Password=testPassword;Encrypt=True;TrustServerCertificate=True" - } - } -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json deleted file mode 100644 index 53c9d4359e..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_output.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/sqldatabases/sql0", - "location": "West US", - "name": "sql0", - "properties": { - "status": { - "outputResources": [ - { - "id": "/planes/test/local/providers/Test.Namespace/testResources/test-resource" - } - ] - }, - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "provisioningState": "Succeeded", - "resourceProvisioning": "manual", - "port": 1433, - "username": "testUser" - }, - "systemData": { - "createdAt": "2022-03-22T18:54:52.6857175Z", - "createdBy": "fake@hotmail.com", - "createdByType": "User", - "lastModifiedAt": "2022-03-22T18:57:52.6857175Z", - "lastModifiedBy": "fake@hotmail.com", - "lastModifiedByType": "User" - }, - "tags": {}, - "type": "applications.link/sqldatabases" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_requestheaders.json b/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_requestheaders.json deleted file mode 100644 index d6aa6f52bb..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/testdata/20220315privatepreview_requestheaders.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "Accept": "application/json", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "en-US", - "Content-Length": "305", - "Content-Type": "application/json; charset=utf-8", - "Referer": "https://radius.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/applications.link/sqldatabases/sql0?api-version=2022-03-15-privatepreview", - "Traceparent": "00-000011048df2134ca37c9a689c3a0000-0000000000000000-01", - "User-Agent": "ARMClient/1.6.0.0", - "Via": "1.1 Azure", - "X-Azure-Requestchain": "hops=1", - "X-Fd-Clienthttpversion": "1.1", - "X-Fd-Clientip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Fd-Edgeenvironment": "fake", - "X-Fd-Eventid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Impressionguid": "00005A12DDEC4F8B80B65BB768190000", - "X-Fd-Originalurl": "https://radius.dev:443/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/sqldatabase/sql0?api-version=2022-03-15-privatepreview", - "X-Fd-Partner": "AzureResourceManager_Test", - "X-Fd-Ref": "Ref A: xxxx Ref B: xxxx Ref C: 2022-03-22T18:54:50Z", - "X-Fd-Revip": "country=United States,iso=us,state=Washington,city=Redmond,zip=00000,tz=-8,asn=0,lat=0,long=-1,countrycf=8,citycf=8", - "X-Fd-Routekey": "000075000", - "X-Fd-Socketip": "0000:0000:0000:1:0000:0000:0000:0000", - "X-Forwarded-For": "192.168.0.10", - "X-Forwarded-Host": "radius.dev", - "X-Forwarded-Port": "443", - "X-Forwarded-Proto": "https", - "X-Forwarded-Scheme": "https", - "X-Ms-Activity-Vector": "IN.0P", - "X-Ms-Arm-Network-Source": "PublicNetwork", - "X-Ms-Arm-Request-Tracking-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Arm-Resource-System-Data": "{\"lastModifiedBy\":\"fake@hotmail.com\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2022-03-22T18:57:52.6857175Z\"}", - "X-Ms-Arm-Service-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Acr": "1", - "X-Ms-Client-Alt-Sec-Id": "1:live.com:0006000017E40000", - "X-Ms-Client-App-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-App-Id-Acr": "0", - "X-Ms-Client-Audience": "https://management.core.windows.net/", - "X-Ms-Client-Authentication-Methods": "pwd", - "X-Ms-Client-Authorization-Source": "RoleBased", - "X-Ms-Client-Family-Name-Encoded": "fake", - "X-Ms-Client-Given-Name-Encoded": "fake", - "X-Ms-Client-Identity-Provider": "live.com", - "X-Ms-Client-Ip-Address": "192.168.0.10", - "X-Ms-Client-Issuer": "https://sts.windows-ppe.net/00000000-0000-0000-0000-000000000000/", - "X-Ms-Client-Location": "centralus", - "X-Ms-Client-Object-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Principal-Group-Membership-Source": "Token", - "X-Ms-Client-Principal-Id": "000000000000000", - "X-Ms-Client-Principal-Name": "live.com#fake@hotmail.com", - "X-Ms-Client-Puid": "000000000000000", - "X-Ms-Client-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Client-Scope": "user_impersonation", - "X-Ms-Client-Tenant-Id": "00000000-0000-0000-0000-000000000001", - "X-Ms-Client-Wids": "00000000-0000-0000-0000-000000000000, 00000000-0000-0000-0000-000000000001", - "X-Ms-Correlation-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Home-Tenant-Id": "00000000-0000-0000-0000-000000000002", - "X-Ms-Request-Id": "00000000-0000-0000-0000-000000000000", - "X-Ms-Routing-Request-Id": "CENTRALUS:20220322T185452Z:00000000-0000-0000-0000-000000000000", - "X-Original-Forwarded-For": "0000:0000:0000:1:449b:f928:e40a:a351", - "X-Real-Ip": "192.168.0.10", - "X-Request-Id": "1000f6040000000000004bc7d1666424", - "X-Scheme": "https" -} \ No newline at end of file diff --git a/pkg/linkrp/frontend/controller/sqldatabases/types.go b/pkg/linkrp/frontend/controller/sqldatabases/types.go deleted file mode 100644 index 1e801ba341..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/types.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sqldatabases - -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" -) diff --git a/pkg/linkrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go b/pkg/linkrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go deleted file mode 100644 index b4da57c9f3..0000000000 --- a/pkg/linkrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package sqldatabases - -import ( - "encoding/json" - - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/test/testutil" -) - -const testHeaderfile = "20220315privatepreview_requestheaders.json" - -func getTestModels20220315privatepreview() (input *v20220315privatepreview.SQLDatabaseResource, dataModel *datamodel.SqlDatabase, output *v20220315privatepreview.SQLDatabaseResource) { - rawInput := testutil.ReadFixture("20220315privatepreview_input.json") - input = &v20220315privatepreview.SQLDatabaseResource{} - _ = json.Unmarshal(rawInput, input) - - rawDataModel := testutil.ReadFixture("20220315privatepreview_datamodel.json") - dataModel = &datamodel.SqlDatabase{} - _ = json.Unmarshal(rawDataModel, dataModel) - - rawExpectedOutput := testutil.ReadFixture("20220315privatepreview_output.json") - output = &v20220315privatepreview.SQLDatabaseResource{} - _ = json.Unmarshal(rawExpectedOutput, output) - - return input, dataModel, output -} diff --git a/pkg/linkrp/frontend/controller/types.go b/pkg/linkrp/frontend/controller/types.go deleted file mode 100644 index 0d016b7d74..0000000000 --- a/pkg/linkrp/frontend/controller/types.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controller - -import ( - "time" -) - -var ( - // AsyncOperationRetryAfter is polling interval for async create/update or delete resource operations. - AsyncOperationRetryAfter = time.Duration(5) * time.Second - - // AsyncCreateOrUpdateMongoDatabaseTimeout is the timeout for async create or update mongo database - AsyncCreateOrUpdateMongoDatabaseTimeout = time.Duration(10) * time.Minute - // AsyncDeleteMongoDatabaseTimeout is the timeout for async delete mongo database - AsyncDeleteMongoDatabaseTimeout = time.Duration(15) * time.Minute - - // AsyncCreateOrUpdateSqlTimeout is the timeout for async create or update sql database - AsyncCreateOrUpdateSqlDatabaseTimeout = time.Duration(10) * time.Minute - // AsyncDeleteSqlDatabaseTimeout is the timeout for async delete sql database - AsyncDeleteSqlDatabaseTimeout = time.Duration(15) * time.Minute - - // AsyncCreateOrUpdateRedisCacheTimeout is the timeout for async create or update redis cache - AsyncCreateOrUpdateRedisCacheTimeout = time.Duration(60) * time.Minute - // AsyncDeleteRedisCacheTimeout is the timeout for async delete redis cache - AsyncDeleteRedisCacheTimeout = time.Duration(30) * time.Minute - - // AsyncCreateOrUpdateRabbitMQTimeout is the timeout for async create or update rabbitMQ - AsyncCreateOrUpdateRabbitMQTimeout = time.Duration(60) * time.Minute - // AsyncDeleteRabbitMQTimeout is the timeout for async delete rabbitMQ - AsyncDeleteRabbitMQTimeout = time.Duration(30) * time.Minute - - // AsyncCreateOrUpdateDaprStateStoreTimeout is the timeout for async create or update dapr state store - AsyncCreateOrUpdateDaprStateStoreTimeout = time.Duration(60) * time.Minute - // AsyncDeleteDaprStateStoreTimeout is the timeout for async delete dapr state store - AsyncDeleteDaprStateStoreTimeout = time.Duration(30) * time.Minute - - // AsyncCreateOrUpdateDaprSecretStoreTimeout is the timeout for async create or update dapr secret store - AsyncCreateOrUpdateDaprSecretStoreTimeout = time.Duration(60) * time.Minute - // AsyncDeleteDaprSecretStoreTimeout is the timeout for async delete dapr secret store - AsyncDeleteDaprSecretStoreTimeout = time.Duration(30) * time.Minute - - // AsyncCreateOrUpdateDaprPubSubBrokerTimeout is the timeout for async create or update dapr pub sub broker - AsyncCreateOrUpdateDaprPubSubBrokerTimeout = time.Duration(60) * time.Minute - // AsyncDeleteDaprPubSubBrokerTimeout is the timeout for async delete dapr pub sub broker - AsyncDeleteDaprPubSubBrokerTimeout = time.Duration(30) * time.Minute - - // AsyncCreateOrUpdateExtenderTimeout is the timeout for async create or update extender - AsyncCreateOrUpdateExtenderTimeout = time.Duration(60) * time.Minute - // AsyncDeleteExtenderTimeout is the timeout for async delete extender - AsyncDeleteExtenderTimeout = time.Duration(30) * time.Minute -) diff --git a/pkg/linkrp/frontend/handler/routes.go b/pkg/linkrp/frontend/handler/routes.go deleted file mode 100644 index a65a58ab7e..0000000000 --- a/pkg/linkrp/frontend/handler/routes.go +++ /dev/null @@ -1,1744 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "context" - - "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - frontend_ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/linkrp" - rp_frontend "github.com/project-radius/radius/pkg/rp/frontend" - "github.com/project-radius/radius/pkg/validator" - "github.com/project-radius/radius/swagger" - - // TODO: Rename alias to remove n prefix for resources in new namespace - dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" - dapr_conv "github.com/project-radius/radius/pkg/daprrp/datamodel/converter" - ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - ds_conv "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - mongon_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/mongodatabases" - redisn_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/rediscaches" - sqln_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/sqldatabases" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/datamodel/converter" - link_frontend_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller" - extender_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/extenders" - mongo_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/mongodatabases" - rabbitmq_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/rabbitmqmessagequeues" - redis_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/rediscaches" - sql_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/sqldatabases" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - msg_conv "github.com/project-radius/radius/pkg/messagingrp/datamodel/converter" - msg_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" -) - -const ( - LinkProviderNamespace = "Applications.Link" - DaprProviderNamespace = "Applications.Dapr" - DatastoresProviderNamespace = "Applications.Datastores" - MessagingProviderNamespace = "Applications.Messaging" - resourceGroupPath = "/resourcegroups/{resourceGroupName}" -) - -// AddRoutes configures routes and handlers for Datastores, Messaging, Dapr Resource Providers. -func AddRoutes(ctx context.Context, router chi.Router, isARM bool, ctrlOpts frontend_ctrl.Options) error { - rootScopePath := ctrlOpts.PathBase - rootScopePath += getRootScopePath(isARM) - - // URLs may use either the subscription/plane scope or resource group scope. - // These paths are order sensitive and the longer path MUST be registered first. - prefixes := []string{ - rootScopePath + resourceGroupPath, - rootScopePath, - } - - err := AddLinkRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) - if err != nil { - return err - } - - err = AddMessagingRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) - if err != nil { - return err - } - - err = AddDaprRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) - if err != nil { - return err - } - - err = AddDatastoresRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) - if err != nil { - return err - } - - return nil -} - -// AddMessagingRoutes configures the default ARM handlers and registers handlers for the RabbitMQQueue resource type for -// the List, Get, Put, Patch and Delete operations. -func AddMessagingRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { - // Configure the default ARM handlers. - err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, MessagingProviderNamespace, NewGetOperations, ctrlOpts) - if err != nil { - return err - } - - specLoader, err := validator.LoadSpec(ctx, MessagingProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") - if err != nil { - return err - } - - validator := validator.APIValidator(validator.Options{ - SpecLoader: specLoader, - ResourceTypeGetter: validator.RadiusResourceTypeGetter, - }) - - // Register resource routers. - // - // Note: We have to follow the below rules to enable API validators: - // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. - // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. - - // rabbitmqqueues router handlers: - rmqPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.messaging/rabbitmqqueues", validator) - rmqResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.messaging/rabbitmqqueues", validator) - rmqResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.messaging/rabbitmqqueues/{rabbitMQQueueName}", validator) - - // Messaging handlers: - handlerOptions := []server.HandlerOptions{ - { - ParentRouter: rmqPlaneRouter, - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ - RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, - ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: rmqResourceGroupRouter, - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ - RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, - ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, - }) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ - RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, - ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, - }) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ - RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, - ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[msg_dm.RabbitMQQueue]{ - rp_frontend.PrepareRadiusResource[*msg_dm.RabbitMQQueue], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRabbitMQTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ - RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, - ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[msg_dm.RabbitMQQueue]{ - rp_frontend.PrepareRadiusResource[*msg_dm.RabbitMQQueue], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRabbitMQTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ - RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, - ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteRabbitMQTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: rmqResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.N_RabbitMQQueuesResourceType, - Method: msg_ctrl.OperationListSecret, - ControllerFactory: msg_ctrl.NewListSecretsRabbitMQQueue, - }, - } - - for _, h := range handlerOptions { - if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { - return err - } - } - - return nil -} - -// AddDaprRoutes configures the default ARM handlers and adds handlers for Dapr resources such as Dapr PubSubBroker, -// SecretStore and StateStore. It registers handlers for various operations on these resources. -func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { - - // Dapr - Configure the default ARM handlers. - err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, DaprProviderNamespace, NewGetOperations, ctrlOpts) - if err != nil { - return err - } - - specLoader, err := validator.LoadSpec(ctx, DaprProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") - if err != nil { - return err - } - - validator := validator.APIValidator(validator.Options{ - SpecLoader: specLoader, - ResourceTypeGetter: validator.RadiusResourceTypeGetter, - }) - - // Register resource routers. - // - // Note: We have to follow the below rules to enable API validators: - // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. - // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. - - pubsubPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/pubsubbrokers", validator) - pubsubResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers", validator) - pubsubResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers/{pubSubBrokerName}", validator) - - handlerOptions := []server.HandlerOptions{ - { - ParentRouter: pubsubPlaneRouter, - ResourceType: linkrp.N_DaprPubSubBrokersResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ - RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, - ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: pubsubResourceGroupRouter, - ResourceType: linkrp.N_DaprPubSubBrokersResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ - RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, - ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, - }) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.N_DaprPubSubBrokersResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ - RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, - ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, - }) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.N_DaprPubSubBrokersResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ - RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, - ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprPubSubBroker]{ - rp_frontend.PrepareRadiusResource[*dapr_dm.DaprPubSubBroker], - rp_frontend.PrepareDaprResource[*dapr_dm.DaprPubSubBroker], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.N_DaprPubSubBrokersResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ - RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, - ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprPubSubBroker]{ - rp_frontend.PrepareRadiusResource[*dapr_dm.DaprPubSubBroker], - rp_frontend.PrepareDaprResource[*dapr_dm.DaprPubSubBroker], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.N_DaprPubSubBrokersResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ - RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, - ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - } - - secretStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/secretstores", validator) - secretStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores", validator) - secretStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores/{secretStoreName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: secretStorePlaneRouter, - ResourceType: linkrp.N_DaprSecretStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ - RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: secretStoreResourceGroupRouter, - ResourceType: linkrp.N_DaprSecretStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ - RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.N_DaprSecretStoresResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ - RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.N_DaprSecretStoresResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ - RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprSecretStore]{ - rp_frontend.PrepareRadiusResource[*dapr_dm.DaprSecretStore], - rp_frontend.PrepareDaprResource[*dapr_dm.DaprSecretStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.N_DaprSecretStoresResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ - RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprSecretStore]{ - rp_frontend.PrepareRadiusResource[*dapr_dm.DaprSecretStore], - rp_frontend.PrepareDaprResource[*dapr_dm.DaprSecretStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.N_DaprSecretStoresResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ - RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteDaprSecretStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - stateStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/statestores", validator) - stateStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores", validator) - stateStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores/{stateStoreName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: stateStorePlaneRouter, - ResourceType: linkrp.N_DaprStateStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ - RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: stateStoreResourceGroupRouter, - ResourceType: linkrp.N_DaprStateStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ - RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.N_DaprStateStoresResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ - RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.N_DaprStateStoresResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ - RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprStateStore]{ - rp_frontend.PrepareRadiusResource[*dapr_dm.DaprStateStore], - rp_frontend.PrepareDaprResource[*dapr_dm.DaprStateStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.N_DaprStateStoresResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ - RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprStateStore]{ - rp_frontend.PrepareRadiusResource[*dapr_dm.DaprStateStore], - rp_frontend.PrepareDaprResource[*dapr_dm.DaprStateStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.N_DaprStateStoresResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ - RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, - ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteDaprStateStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - for _, h := range handlerOptions { - if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { - return err - } - } - - return nil -} - -// AddDatastoresRoutes configures the routes and handlers for Datastores Resource Provider. It registers handlers for List, Get, Put, -// Patch, and Delete operations for MongoDatabase, RedisCache, and SqlDatabase resources. -func AddDatastoresRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { - // Datastores - Configure the default ARM handlers. - err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, DatastoresProviderNamespace, NewGetOperations, ctrlOpts) - if err != nil { - return err - } - - specLoader, err := validator.LoadSpec(ctx, DatastoresProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") - if err != nil { - return err - } - - validator := validator.APIValidator(validator.Options{ - SpecLoader: specLoader, - ResourceTypeGetter: validator.RadiusResourceTypeGetter, - }) - - // Register resource routers. - // - // Note: We have to follow the below rules to enable API validators: - // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. - // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. - - mongoPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.datastores/mongodatabases", validator) - mongoResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/mongodatabases", validator) - mongoResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/mongodatabases/{mongoDatabaseName}", validator) - - // Datastores handlers: - handlerOptions := []server.HandlerOptions{ - { - ParentRouter: mongoPlaneRouter, - ResourceType: linkrp.N_MongoDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ - RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: mongoResourceGroupRouter, - ResourceType: linkrp.N_MongoDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ - RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.N_MongoDatabasesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ - RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.N_MongoDatabasesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ - RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.MongoDatabase]{ - rp_frontend.PrepareRadiusResource[*ds_dm.MongoDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateMongoDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.MongoDatabase]{ - rp_frontend.PrepareRadiusResource[*datamodel.MongoDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateMongoDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.N_MongoDatabasesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ - RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteMongoDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: mongoResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.N_MongoDatabasesResourceType, - Method: mongon_ctrl.OperationListSecret, - ControllerFactory: mongon_ctrl.NewListSecretsMongoDatabase, - }, - } - - redisPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.datastores/rediscaches", validator) - redisResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/rediscaches", validator) - redisResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/rediscaches/{redisCacheName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: redisPlaneRouter, - ResourceType: linkrp.N_RedisCachesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ - RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, - ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: redisResourceGroupRouter, - ResourceType: linkrp.N_RedisCachesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ - RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, - ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, - }) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.N_RedisCachesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ - RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, - ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, - }) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.N_RedisCachesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ - RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, - ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.RedisCache]{ - rp_frontend.PrepareRadiusResource[*ds_dm.RedisCache], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRedisCacheTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.N_RedisCachesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ - RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, - ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.RedisCache]{ - rp_frontend.PrepareRadiusResource[*ds_dm.RedisCache], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRedisCacheTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.N_RedisCachesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ - RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, - ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteRedisCacheTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: redisResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.N_RedisCachesResourceType, - Method: redisn_ctrl.OperationListSecret, - ControllerFactory: redisn_ctrl.NewListSecretsRedisCache, - }, - }...) - - sqlPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.datastores/sqldatabases", validator) - sqlResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/sqldatabases", validator) - sqlResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/sqldatabases/{sqlDatabaseName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: sqlPlaneRouter, - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ - RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: sqlResourceGroupRouter, - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ - RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ - RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ - RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.SqlDatabase]{ - rp_frontend.PrepareRadiusResource[*ds_dm.SqlDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateSqlDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ - RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.SqlDatabase]{ - rp_frontend.PrepareRadiusResource[*ds_dm.SqlDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateSqlDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ - RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, - ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteSqlDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: sqlResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.N_SqlDatabasesResourceType, - Method: sqln_ctrl.OperationListSecret, - ControllerFactory: sqln_ctrl.NewListSecretsSqlDatabase, - }, - }...) - - for _, h := range handlerOptions { - if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { - return err - } - } - - return nil -} - -// AddLinkRoutes sets up routes and registers handlers for various operations (GET, PUT, PATCH, DELETE) on different -// resources (MongoDatabases, DaprPubSubBrokers, DaprSecretStores, DaprStateStores, Extenders, RedisCaches, -// RabbitMQMessageQueues and SQLDatabases). It also sets up the necessary options for each handler. -func AddLinkRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { - // Configure the default ARM handlers. - err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, LinkProviderNamespace, NewGetOperations, ctrlOpts) - if err != nil { - return err - } - - specLoader, err := validator.LoadSpec(ctx, LinkProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") - if err != nil { - return err - } - - validator := validator.APIValidator(validator.Options{ - SpecLoader: specLoader, - ResourceTypeGetter: validator.RadiusResourceTypeGetter, - }) - - // Register resource routers. - // - // Note: We have to follow the below rules to enable API validators: - // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. - // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. - - mongoPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/mongodatabases", validator) - mongoResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/mongodatabases", validator) - mongoResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/mongodatabases/{mongoDatabaseName}", validator) - - handlerOptions := []server.HandlerOptions{ - { - ParentRouter: mongoPlaneRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: mongoResourceGroupRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.MongoDatabase]{ - rp_frontend.PrepareRadiusResource[*datamodel.MongoDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateMongoDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.MongoDatabase]{ - rp_frontend.PrepareRadiusResource[*datamodel.MongoDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateMongoDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: mongoResourceRouter, - ResourceType: linkrp.MongoDatabasesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.MongoDatabase]{ - RequestConverter: converter.MongoDatabaseDataModelFromVersioned, - ResponseConverter: converter.MongoDatabaseDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteMongoDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: mongoResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.MongoDatabasesResourceType, - Method: mongo_ctrl.OperationListSecret, - ControllerFactory: mongo_ctrl.NewListSecretsMongoDatabase, - }, - } - - pubsubPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/daprpubsubbrokers", validator) - pubsubResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/daprpubsubbrokers", validator) - pubsubResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/daprpubsubbrokers/{daprPubSubBrokerName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: pubsubPlaneRouter, - ResourceType: linkrp.DaprPubSubBrokersResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprPubSubBroker]{ - RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, - ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: pubsubResourceGroupRouter, - ResourceType: linkrp.DaprPubSubBrokersResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprPubSubBroker]{ - RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, - ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, - }) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.DaprPubSubBrokersResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprPubSubBroker]{ - RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, - ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, - }) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.DaprPubSubBrokersResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprPubSubBroker]{ - RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, - ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprPubSubBroker]{ - rp_frontend.PrepareDaprResource[*datamodel.DaprPubSubBroker], - rp_frontend.PrepareRadiusResource[*datamodel.DaprPubSubBroker], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.DaprPubSubBrokersResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprPubSubBroker]{ - RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, - ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprPubSubBroker]{ - rp_frontend.PrepareDaprResource[*datamodel.DaprPubSubBroker], - rp_frontend.PrepareRadiusResource[*datamodel.DaprPubSubBroker], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: pubsubResourceRouter, - ResourceType: linkrp.DaprPubSubBrokersResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprPubSubBroker]{ - RequestConverter: converter.DaprPubSubBrokerDataModelFromVersioned, - ResponseConverter: converter.DaprPubSubBrokerDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - secretStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/daprsecretstores", validator) - secretStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/daprsecretstores", validator) - secretStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/daprsecretstores/{daprSecretStoreName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: secretStorePlaneRouter, - ResourceType: linkrp.DaprSecretStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprSecretStore]{ - RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, - ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: secretStoreResourceGroupRouter, - ResourceType: linkrp.DaprSecretStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprSecretStore]{ - RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, - ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.DaprSecretStoresResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprSecretStore]{ - RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, - ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.DaprSecretStoresResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprSecretStore]{ - RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, - ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprSecretStore]{ - rp_frontend.PrepareDaprResource[*datamodel.DaprSecretStore], - rp_frontend.PrepareRadiusResource[*datamodel.DaprSecretStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.DaprSecretStoresResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprSecretStore]{ - RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, - ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprSecretStore]{ - rp_frontend.PrepareDaprResource[*datamodel.DaprSecretStore], - rp_frontend.PrepareRadiusResource[*datamodel.DaprSecretStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: linkrp.DaprSecretStoresResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprSecretStore]{ - RequestConverter: converter.DaprSecretStoreDataModelFromVersioned, - ResponseConverter: converter.DaprSecretStoreDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteDaprSecretStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - stateStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/daprstatestores", validator) - stateStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/daprstatestores", validator) - stateStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/daprstatestores/{daprStateStoreName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: stateStorePlaneRouter, - ResourceType: linkrp.DaprStateStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprStateStore]{ - RequestConverter: converter.DaprStateStoreDataModelFromVersioned, - ResponseConverter: converter.DaprStateStoreDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: stateStoreResourceGroupRouter, - ResourceType: linkrp.DaprStateStoresResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprStateStore]{ - RequestConverter: converter.DaprStateStoreDataModelFromVersioned, - ResponseConverter: converter.DaprStateStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.DaprStateStoresResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprStateStore]{ - RequestConverter: converter.DaprStateStoreDataModelFromVersioned, - ResponseConverter: converter.DaprStateStoreDataModelToVersioned, - }) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.DaprStateStoresResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprStateStore]{ - RequestConverter: converter.DaprStateStoreDataModelFromVersioned, - ResponseConverter: converter.DaprStateStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprStateStore]{ - rp_frontend.PrepareDaprResource[*datamodel.DaprStateStore], - rp_frontend.PrepareRadiusResource[*datamodel.DaprStateStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.DaprStateStoresResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprStateStore]{ - RequestConverter: converter.DaprStateStoreDataModelFromVersioned, - ResponseConverter: converter.DaprStateStoreDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.DaprStateStore]{ - rp_frontend.PrepareDaprResource[*datamodel.DaprStateStore], - rp_frontend.PrepareRadiusResource[*datamodel.DaprStateStore], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: stateStoreResourceRouter, - ResourceType: linkrp.DaprStateStoresResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.DaprStateStore]{ - RequestConverter: converter.DaprStateStoreDataModelFromVersioned, - ResponseConverter: converter.DaprStateStoreDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteDaprStateStoreTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - redisPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/rediscaches", validator) - redisResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/rediscaches", validator) - redisResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/rediscaches/{redisCacheName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: redisPlaneRouter, - ResourceType: linkrp.RedisCachesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: redisResourceGroupRouter, - ResourceType: linkrp.RedisCachesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - }) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.RedisCachesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - }) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.RedisCachesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.RedisCache]{ - rp_frontend.PrepareRadiusResource[*datamodel.RedisCache], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRedisCacheTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.RedisCachesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.RedisCache]{ - rp_frontend.PrepareRadiusResource[*datamodel.RedisCache], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRedisCacheTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: redisResourceRouter, - ResourceType: linkrp.RedisCachesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.RedisCache]{ - RequestConverter: converter.RedisCacheDataModelFromVersioned, - ResponseConverter: converter.RedisCacheDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteRedisCacheTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: redisResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.RedisCachesResourceType, - Method: redis_ctrl.OperationListSecret, - ControllerFactory: redis_ctrl.NewListSecretsRedisCache, - }, - }...) - - rmqPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/rabbitmqmessagequeues", validator) - rmqResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/rabbitmqmessagequeues", validator) - rmqResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/rabbitmqmessagequeues/{rabbitMQMessageQueueName}", validator) - - // Messaging handlers: - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: rmqPlaneRouter, - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: rmqResourceGroupRouter, - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - }) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - }) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.RabbitMQMessageQueue]{ - rp_frontend.PrepareRadiusResource[*datamodel.RabbitMQMessageQueue], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRabbitMQTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.RabbitMQMessageQueue]{ - rp_frontend.PrepareRadiusResource[*datamodel.RabbitMQMessageQueue], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateRabbitMQTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: rmqResourceRouter, - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.RabbitMQMessageQueue]{ - RequestConverter: converter.RabbitMQMessageQueueDataModelFromVersioned, - ResponseConverter: converter.RabbitMQMessageQueueDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteRabbitMQTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: rmqResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.RabbitMQMessageQueuesResourceType, - Method: rabbitmq_ctrl.OperationListSecret, - ControllerFactory: rabbitmq_ctrl.NewListSecretsRabbitMQMessageQueue, - }, - }...) - - sqlPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/sqldatabases", validator) - sqlResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/sqldatabases", validator) - sqlResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/sqldatabases/{sqlDatabaseName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: sqlPlaneRouter, - ResourceType: linkrp.SqlDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: sqlResourceGroupRouter, - ResourceType: linkrp.SqlDatabasesResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.SqlDatabasesResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - }) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.SqlDatabasesResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.SqlDatabase]{ - rp_frontend.PrepareRadiusResource[*datamodel.SqlDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateSqlDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.SqlDatabasesResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.SqlDatabase]{ - rp_frontend.PrepareRadiusResource[*datamodel.SqlDatabase], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateSqlDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: sqlResourceRouter, - ResourceType: linkrp.SqlDatabasesResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.SqlDatabase]{ - RequestConverter: converter.SqlDatabaseDataModelFromVersioned, - ResponseConverter: converter.SqlDatabaseDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteSqlDatabaseTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: sqlResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.SqlDatabasesResourceType, - Method: sql_ctrl.OperationListSecret, - ControllerFactory: sql_ctrl.NewListSecretsSqlDatabase, - }, - }...) - - extPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.link/extenders", validator) - extResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/extenders", validator) - extResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.link/extenders/{extenderName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: extPlaneRouter, - ResourceType: linkrp.ExtendersResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: extResourceGroupRouter, - ResourceType: linkrp.ExtendersResourceType, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - }) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: linkrp.ExtendersResourceType, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - }) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: linkrp.ExtendersResourceType, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Extender]{ - rp_frontend.PrepareRadiusResource[*datamodel.Extender], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateExtenderTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: linkrp.ExtendersResourceType, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Extender]{ - rp_frontend.PrepareRadiusResource[*datamodel.Extender], - }, - AsyncOperationTimeout: link_frontend_ctrl.AsyncCreateOrUpdateExtenderTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: linkrp.ExtendersResourceType, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - AsyncOperationTimeout: link_frontend_ctrl.AsyncDeleteExtenderTimeout, - AsyncOperationRetryAfter: link_frontend_ctrl.AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: extResourceRouter, - Path: "/listsecrets", - ResourceType: linkrp.ExtendersResourceType, - Method: extender_ctrl.OperationListSecret, - ControllerFactory: extender_ctrl.NewListSecretsExtender, - }, - }...) - - for _, h := range handlerOptions { - if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { - return err - } - } - - return nil -} - -func getRootScopePath(isARM bool) string { - if isARM { - return "/subscriptions/{subscriptionID}" - } - return "/planes/radius/{planeName}" -} diff --git a/pkg/linkrp/frontend/handler/routes_test.go b/pkg/linkrp/frontend/handler/routes_test.go deleted file mode 100644 index e02e59e412..0000000000 --- a/pkg/linkrp/frontend/handler/routes_test.go +++ /dev/null @@ -1,522 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "context" - "net/http" - "testing" - - "github.com/go-chi/chi/v5" - "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/linkrp" - extender_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/extenders" - mongo_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/mongodatabases" - rabbitmq_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/rabbitmqmessagequeues" - redis_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/rediscaches" - sql_ctrl "github.com/project-radius/radius/pkg/linkrp/frontend/controller/sqldatabases" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" -) - -var handlerTests = []rpctest.HandlerTestSpec{ - // Routes for resources after Split Namespaces - { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.messaging/rabbitmqqueues", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RabbitMQQueuesResourceType, Method: rabbitmq_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprPubSubBrokersResourceType, Method: v1.OperationList}, - Path: "/providers/applications.dapr/pubsubbrokers", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprPubSubBrokersResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprPubSubBrokersResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprPubSubBrokersResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprPubSubBrokersResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprPubSubBrokersResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprSecretStoresResourceType, Method: v1.OperationList}, - Path: "/providers/applications.dapr/secretstores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprSecretStoresResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprSecretStoresResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprSecretStoresResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprSecretStoresResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprSecretStoresResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprStateStoresResourceType, Method: v1.OperationList}, - Path: "/providers/applications.dapr/statestores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprStateStoresResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.dapr/statestores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprStateStoresResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprStateStoresResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprStateStoresResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_DaprStateStoresResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.datastores/mongodatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_MongoDatabasesResourceType, Method: mongo_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.datastores/rediscaches", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_RedisCachesResourceType, Method: redis_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.datastores/sqldatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.N_SqlDatabasesResourceType, Method: sql_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprPubSubBrokersResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/daprpubsubbrokers", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprPubSubBrokersResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/daprpubsubbrokers", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprPubSubBrokersResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/daprpubsubbrokers/daprpubsub", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprPubSubBrokersResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/daprpubsubbrokers/daprpubsub", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprPubSubBrokersResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/daprpubsubbrokers/daprpubsub", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprPubSubBrokersResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/daprpubsubbrokers/daprpubsub", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprSecretStoresResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/daprsecretstores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprSecretStoresResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/daprsecretstores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprSecretStoresResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/daprsecretstores/daprsecretstore", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprSecretStoresResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/daprsecretstores/daprsecretstore", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprSecretStoresResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/daprsecretstores/daprsecretstore", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprSecretStoresResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/daprsecretstores/daprsecretstore", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprStateStoresResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/daprstatestores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprStateStoresResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/daprstatestores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprStateStoresResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/daprstatestores/daprstatestore", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprStateStoresResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/daprstatestores/daprstatestore", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprStateStoresResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/daprstatestores/daprstatestore", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.DaprStateStoresResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/daprstatestores/daprstatestore", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/extenders", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/extenders", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/extenders/extender", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/extenders/extender", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/extenders/extender", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/extenders/extender", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.ExtendersResourceType, Method: extender_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.link/extenders/extender/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/mongodatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/mongodatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/mongodatabases/mongo", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/mongodatabases/mongo", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/mongodatabases/mongo", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/mongodatabases/mongo", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.MongoDatabasesResourceType, Method: mongo_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.link/mongodatabases/mongo/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/rediscaches", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/rediscaches", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/rediscaches/redis", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/rediscaches/redis", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/rediscaches/redis", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/rediscaches/redis", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.RedisCachesResourceType, Method: redis_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.link/rediscaches/redis/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/rabbitmqmessagequeues", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/rabbitmqmessagequeues", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/rabbitmqmessagequeues/rabbitmq", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/rabbitmqmessagequeues/rabbitmq", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/rabbitmqmessagequeues/rabbitmq", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/rabbitmqmessagequeues/rabbitmq", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.RabbitMQMessageQueuesResourceType, Method: rabbitmq_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.link/rabbitmqmessagequeues/rabbitmq/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: v1.OperationList}, - Path: "/providers/applications.link/sqldatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.link/sqldatabases", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.link/sqldatabases/sql", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.link/sqldatabases/sql", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.link/sqldatabases/sql", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.link/sqldatabases/sql", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: linkrp.SqlDatabasesResourceType, Method: sql_ctrl.OperationListSecret}, - Path: "/resourcegroups/testrg/providers/applications.link/sqldatabases/sql/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: "Applications.Link/operationStatuses", Method: v1.OperationGetOperationStatuses}, - Path: "/providers/applications.link/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: "Applications.Link/operationStatuses", Method: v1.OperationGetOperationResult}, - Path: "/providers/applications.link/locations/global/operationresults/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGetOperationStatuses}, - Path: "/providers/applications.messaging/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGetOperationResult}, - Path: "/providers/applications.messaging/locations/global/operationresults/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, - { - OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGetOperationStatuses}, - Path: "/providers/applications.dapr/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGetOperationResult}, - Path: "/providers/applications.dapr/locations/global/operationresults/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, -} - -func TestHandlers(t *testing.T) { - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mockSP := dataprovider.NewMockDataStorageProvider(mctrl) - mockSC := store.NewMockStorageClient(mctrl) - - mockSC.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.Object{}, nil).AnyTimes() - mockSC.EXPECT().Save(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() - mockSP.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Return(store.StorageClient(mockSC), nil).AnyTimes() - - t.Run("UCP", func(t *testing.T) { - // Test handlers for UCP resources. - rpctest.AssertRouters(t, handlerTests, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { - r := chi.NewRouter() - return r, AddRoutes(ctx, r, false, ctrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}) - }) - }) - - t.Run("Azure", func(t *testing.T) { - // Add azure specific handlers. - azureHandlerTests := append(handlerTests, []rpctest.HandlerTestSpec{ - { - OperationType: v1.OperationType{Type: "Applications.Link/providers", Method: v1.OperationGet}, - Path: "/providers/applications.link/operations", - Method: http.MethodGet, - WithoutRootScope: true, - SkipOperationTypeValidation: true, - }, { - OperationType: v1.OperationType{Type: "Applications.Messaging/providers", Method: v1.OperationGet}, - Path: "/providers/applications.messaging/operations", - Method: http.MethodGet, - WithoutRootScope: true, - SkipOperationTypeValidation: true, - }, - { - OperationType: v1.OperationType{Type: "Applications.Dapr/providers", Method: v1.OperationGet}, - Path: "/providers/applications.dapr/operations", - Method: http.MethodGet, - WithoutRootScope: true, - SkipOperationTypeValidation: true, - }, - { - OperationType: v1.OperationType{Type: "Applications.Datastores/providers", Method: v1.OperationGet}, - Path: "/providers/applications.datastores/operations", - Method: http.MethodGet, - WithoutRootScope: true, - SkipOperationTypeValidation: true, - }, - }...) - - // Test handlers for Azure resources - rpctest.AssertRouters(t, azureHandlerTests, "", "/subscriptions/00000000-0000-0000-0000-000000000000", func(ctx context.Context) (chi.Router, error) { - r := chi.NewRouter() - return r, AddRoutes(ctx, r, true, ctrl.Options{PathBase: "", DataProvider: mockSP}) - }) - }) -} diff --git a/pkg/linkrp/processors/daprpubsubbrokers/doc.go b/pkg/linkrp/processors/daprpubsubbrokers/doc.go deleted file mode 100644 index 10043dcfac..0000000000 --- a/pkg/linkrp/processors/daprpubsubbrokers/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// daprpubsubbrokers contains the resource processor for Dapr Pub Sub Brokers. See the processors package for more information. -package daprpubsubbrokers diff --git a/pkg/linkrp/processors/daprpubsubbrokers/processor.go b/pkg/linkrp/processors/daprpubsubbrokers/processor.go deleted file mode 100644 index 26263a462b..0000000000 --- a/pkg/linkrp/processors/daprpubsubbrokers/processor.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package daprpubsubbrokers - -import ( - "context" - - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/handlers" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime_client "sigs.k8s.io/controller-runtime/pkg/client" -) - -type Processor struct { - Client runtime_client.Client -} - -// Process validates resource properties, and applies output values from the recipe output. If the resource is -// being provisioned manually, it creates a Dapr component in Kubernetes. -func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubBroker, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - validator.AddResourcesField(&resource.Properties.Resources) - validator.AddComputedStringField("componentName", &resource.Properties.ComponentName, func() (string, *processors.ValidationError) { - return kubernetes.NormalizeDaprResourceName(resource.Name), nil - }) - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - if resource.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - // If the resource is being provisioned by recipe then we expect the recipe to create the Dapr Component - // in Kubernetes. At this point we're done so we can just return. - return nil - } - - // If the resource is being provisioned manually then *we* are responsible for creating the Dapr Component. - // Let's do this now. - - applicationID, err := resources.ParseResource(resource.Properties.Application) - if err != nil { - return err // This should already be validated by this point. - } - - component, err := dapr.ConstructDaprGeneric( - dapr.DaprGeneric{ - Metadata: resource.Properties.Metadata, - Type: to.Ptr(resource.Properties.Type), - Version: to.Ptr(resource.Properties.Version), - }, - options.RuntimeConfiguration.Kubernetes.Namespace, - resource.Properties.ComponentName, - applicationID.Name(), - resource.Name, - linkrp.DaprPubSubBrokersResourceType) - if err != nil { - return err - } - - err = kubeutil.PatchNamespace(ctx, p.Client, component.GetNamespace()) - if err != nil { - return &processors.ResourceError{Inner: err} - } - - err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, linkrp.DaprPubSubBrokersResourceType) - if err != nil { - return &processors.ValidationError{Message: err.Error()} - } - - err = p.Client.Patch(ctx, &component, runtime_client.Apply, &runtime_client.PatchOptions{FieldManager: kubernetes.FieldManager}) - if err != nil { - return &processors.ResourceError{Inner: err} - } - - deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) - deployed.RadiusManaged = to.Ptr(true) - resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) - - return nil -} diff --git a/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go b/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go deleted file mode 100644 index cfe0023178..0000000000 --- a/pkg/linkrp/processors/daprpubsubbrokers/processor_test.go +++ /dev/null @@ -1,333 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package daprpubsubbrokers - -import ( - "context" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/k8sutil" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/kubectl/pkg/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func Test_Process(t *testing.T) { - const externalResourceID1 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Cache/redis/myredis1" - const externalResourceID2 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Cache/redis/myredis2" - const kubernetesResource = "/planes/kubernetes/local/namespaces/test-namespace/providers/dapr.io/Component/test-component" - const appID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Core/applications/test-app" - const envID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Core/environments/test-env" - const componentName = "test-dapr-pubsub-broker" - - t.Run("success - recipe", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme), - } - - resource := &datamodel.DaprPubSubBroker{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: componentName, - }, - }, - Properties: datamodel.DaprPubSubBrokerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: appID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - externalResourceID1, - kubernetesResource, - }, - Values: map[string]any{}, // Component name will be computed for resource name. - Secrets: map[string]any{}, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - - // No components created for a recipe - err = processor.Client.List(context.Background(), &components, - &client.ListOptions{ - Namespace: options.RuntimeConfiguration.Kubernetes.Namespace, - }, - ) - require.NoError(t, err) - require.Empty(t, components.Items) - }) - - t.Run("success - manual", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test-namespace"}}), - } - - resource := &datamodel.DaprPubSubBroker{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprPubSubBrokerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: appID, - Environment: envID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{ - "config": "extrasecure", - }, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, - Type: "pubsub.redis", - Version: "v1", - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField(resource.Properties.Resources) - - generated := &unstructured.Unstructured{ - Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", - "metadata": map[string]any{ - "namespace": "test-namespace", - "name": "test-dapr-pubsub-broker", - "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", linkrp.DaprPubSubBrokersResourceType), - "resourceVersion": "1", - }, - "spec": map[string]any{ - "type": "pubsub.redis", - "version": "v1", - "metadata": []any{ - map[string]any{ - "name": "config", - "value": "extrasecure", - }, - }, - }, - }, - } - - component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) - component.RadiusManaged = to.Ptr(true) - expectedOutputResources = append(expectedOutputResources, component) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.NotEmpty(t, components.Items) - require.Equal(t, []unstructured.Unstructured{*generated}, components.Items) - }) - - t.Run("success - recipe with overrides", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme), - } - - resource := &datamodel.DaprPubSubBroker{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprPubSubBrokerProperties{ - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - externalResourceID2, - kubernetesResource, - }, - - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "componentName": "akskdf", - }, - Secrets: map[string]any{}, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - resourcesFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField(resource.Properties.Resources) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, resourcesFieldOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - err = processor.Client.List(context.Background(), &components, - &client.ListOptions{ - Namespace: options.RuntimeConfiguration.Kubernetes.Namespace, - }, - ) - require.NoError(t, err) - require.Empty(t, components.Items) - }) - - t.Run("failure - duplicate component", func(t *testing.T) { - // Create a duplicate with the same component name. - existing, err := dapr.ConstructDaprGeneric( - dapr.DaprGeneric{ - Type: to.Ptr("pubsub.redis"), - Version: to.Ptr("v1"), - Metadata: map[string]any{}, - }, - "test-namespace", - "test-dapr-pubsub-broker", - "test-app", - "some-other-other-name", - linkrp.DaprPubSubBrokersResourceType) - require.NoError(t, err) - - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test-namespace"}}, &existing), - } - resource := &datamodel.DaprPubSubBroker{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprPubSubBrokerProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: appID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{"config": "extrasecure"}, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, - Type: "pubsub.redis", - Version: "v1", - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - } - - err = processor.Process(context.Background(), resource, options) - require.Error(t, err) - assert.IsType(t, &processors.ValidationError{}, err) - assert.Equal(t, "the Dapr component name '\"test-dapr-pubsub-broker\"' is already in use by another resource. Dapr component and resource names must be unique across all Dapr types (eg: StateStores, PubSubBrokers, SecretStores, etc.). Please select a new name and try again", err.Error()) - }) -} diff --git a/pkg/linkrp/processors/daprsecretstores/doc.go b/pkg/linkrp/processors/daprsecretstores/doc.go deleted file mode 100644 index 4e06d921d3..0000000000 --- a/pkg/linkrp/processors/daprsecretstores/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// daprsecretstores contains the resource processor for Dapr Secret Stores. See the processors package for more information. -package daprsecretstores diff --git a/pkg/linkrp/processors/daprsecretstores/processor.go b/pkg/linkrp/processors/daprsecretstores/processor.go deleted file mode 100644 index 1990cbf970..0000000000 --- a/pkg/linkrp/processors/daprsecretstores/processor.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package daprsecretstores - -import ( - "context" - - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/handlers" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime_client "sigs.k8s.io/controller-runtime/pkg/client" -) - -type Processor struct { - Client runtime_client.Client -} - -// Process validates resource properties, and applies output values from the recipe output. If the resource is being -// provisioned manually, it creates a Dapr component in Kubernetes. -func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretStore, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - validator.AddComputedStringField("componentName", &resource.Properties.ComponentName, func() (string, *processors.ValidationError) { - return kubernetes.NormalizeDaprResourceName(resource.Name), nil - }) - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - if resource.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - // If the resource is being provisioned by recipe then we expect the recipe to create the Dapr Component - // in Kubernetes. At this point we're done so we can just return. - return nil - } - // If the resource is being provisioned manually then *we* are responsible for creating the Dapr Component. - // Let's do this now. - - applicationID, err := resources.ParseResource(resource.Properties.Application) - if err != nil { - return err // This should already be validated by this point. - } - - component, err := dapr.ConstructDaprGeneric( - dapr.DaprGeneric{ - Metadata: resource.Properties.Metadata, - Type: to.Ptr(resource.Properties.Type), - Version: to.Ptr(resource.Properties.Version), - }, - options.RuntimeConfiguration.Kubernetes.Namespace, - resource.Properties.ComponentName, - applicationID.Name(), - resource.Name, - linkrp.DaprSecretStoresResourceType) - if err != nil { - return err - } - - err = kubeutil.PatchNamespace(ctx, p.Client, component.GetNamespace()) - if err != nil { - return &processors.ResourceError{Inner: err} - } - - err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, linkrp.DaprSecretStoresResourceType) - if err != nil { - return &processors.ValidationError{Message: err.Error()} - } - - err = p.Client.Patch(ctx, &component, runtime_client.Apply, &runtime_client.PatchOptions{FieldManager: kubernetes.FieldManager}) - if err != nil { - return &processors.ResourceError{Inner: err} - } - - deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) - deployed.RadiusManaged = to.Ptr(true) - resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) - - return nil -} diff --git a/pkg/linkrp/processors/daprsecretstores/processor_test.go b/pkg/linkrp/processors/daprsecretstores/processor_test.go deleted file mode 100644 index dbcdeba80a..0000000000 --- a/pkg/linkrp/processors/daprsecretstores/processor_test.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package daprsecretstores - -import ( - "context" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/k8sutil" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/kubectl/pkg/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func Test_Process(t *testing.T) { - const kubernetesResource = "/planes/kubernetes/local/namespaces/test-namespace/providers/dapr.io/Component/test-component" - const applicationID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Core/applications/test-app" - const componentName = "test-component" - - t.Run("success - recipe", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme), - } - - resource := &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: componentName, - }, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - }, - } - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - kubernetesResource, - }, - Values: map[string]any{}, // Component name will be computed for resource name. - Secrets: map[string]any{}, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - - // No components created for a recipe - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.Empty(t, components.Items) - }) - - t.Run("success - values", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test-namespace"}}), - } - - resource := &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{"config": "extrasecure"}, - Type: "secretstores.kubernetes", - Version: "v1", - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - generated := &unstructured.Unstructured{ - Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", - "metadata": map[string]any{ - "namespace": "test-namespace", - "name": "test-component", - "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", linkrp.DaprSecretStoresResourceType), - "resourceVersion": "1", - }, - "spec": map[string]any{ - "type": "secretstores.kubernetes", - "version": "v1", - "metadata": []any{ - map[string]any{ - "name": "config", - "value": "extrasecure", - }, - }, - }, - }, - } - - component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) - component.RadiusManaged = to.Ptr(true) - expectedOutputResources := []rpv1.OutputResource{component} - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.NotEmpty(t, components.Items) - require.Equal(t, []unstructured.Unstructured{*generated}, components.Items) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme), - } - - resource := &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - }, - } - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - kubernetesResource, - }, - - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "componentName": "akskdf", - }, - Secrets: map[string]any{}, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.Empty(t, components.Items) - }) - - t.Run("failure - duplicate component", func(t *testing.T) { - // Create a duplicate with the same component name. - existing, err := dapr.ConstructDaprGeneric( - dapr.DaprGeneric{ - Type: to.Ptr("secretstores.kubernetes"), - Version: to.Ptr("v1"), - Metadata: map[string]any{}, - }, - "test-namespace", - "test-component", - "test-app", - "some-other-other-name", - linkrp.DaprSecretStoresResourceType) - require.NoError(t, err) - - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test-namespace"}}, &existing), - } - resource := &datamodel.DaprSecretStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprSecretStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{"config": "extrasecure"}, - Type: "secretstores.kubernetes", - Version: "v1", - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - } - - err = processor.Process(context.Background(), resource, options) - require.Error(t, err) - assert.IsType(t, &processors.ValidationError{}, err) - assert.Equal(t, "the Dapr component name '\"test-component\"' is already in use by another resource. Dapr component and resource names must be unique across all Dapr types (eg: StateStores, PubSubBrokers, SecretStores, etc.). Please select a new name and try again", err.Error()) - }) -} diff --git a/pkg/linkrp/processors/daprstatestores/doc.go b/pkg/linkrp/processors/daprstatestores/doc.go deleted file mode 100644 index b15a2f1143..0000000000 --- a/pkg/linkrp/processors/daprstatestores/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// daprstatestores contains the resource processor for Dapr State Stores. See the processors package for more information. -package daprstatestores diff --git a/pkg/linkrp/processors/daprstatestores/processor.go b/pkg/linkrp/processors/daprstatestores/processor.go deleted file mode 100644 index dc7f64bc51..0000000000 --- a/pkg/linkrp/processors/daprstatestores/processor.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package daprstatestores - -import ( - "context" - - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/handlers" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime_client "sigs.k8s.io/controller-runtime/pkg/client" -) - -type Processor struct { - Client runtime_client.Client -} - -// Process validates resource properties, and applies output values from the recipe output. If the resource is being -// provisioned manually, it creates a Dapr component in Kubernetes. -func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateStore, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - validator.AddResourcesField(&resource.Properties.Resources) - validator.AddComputedStringField("componentName", &resource.Properties.ComponentName, func() (string, *processors.ValidationError) { - return kubernetes.NormalizeDaprResourceName(resource.Name), nil - }) - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - if resource.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { - // If the resource is being provisioned by recipe then we expect the recipe to create the Dapr Component - // in Kubernetes. At this point we're done so we can just return. - return nil - } - - // If the resource is being provisioned manually then *we* are responsible for creating the Dapr Component. - // Let's do this now. - - applicationID, err := resources.ParseResource(resource.Properties.Application) - if err != nil { - return err // This should already be validated by this point. - } - - component, err := dapr.ConstructDaprGeneric( - dapr.DaprGeneric{ - Metadata: resource.Properties.Metadata, - Type: to.Ptr(resource.Properties.Type), - Version: to.Ptr(resource.Properties.Version), - }, - options.RuntimeConfiguration.Kubernetes.Namespace, - resource.Properties.ComponentName, - applicationID.Name(), - resource.Name, - linkrp.DaprStateStoresResourceType) - if err != nil { - return err - } - - err = kubeutil.PatchNamespace(ctx, p.Client, component.GetNamespace()) - if err != nil { - return &processors.ResourceError{Inner: err} - } - - err = handlers.CheckDaprResourceNameUniqueness(ctx, p.Client, resource.Properties.ComponentName, options.RuntimeConfiguration.Kubernetes.Namespace, resource.Name, linkrp.DaprStateStoresResourceType) - if err != nil { - return &processors.ValidationError{Message: err.Error()} - } - - err = p.Client.Patch(ctx, &component, runtime_client.Apply, &runtime_client.PatchOptions{FieldManager: kubernetes.FieldManager}) - if err != nil { - return &processors.ResourceError{Inner: err} - } - - deployed := rpv1.NewKubernetesOutputResource("Component", &component, metav1.ObjectMeta{Name: component.GetName(), Namespace: component.GetNamespace()}) - deployed.RadiusManaged = to.Ptr(true) - resource.Properties.Status.OutputResources = append(resource.Properties.Status.OutputResources, deployed) - - return nil -} diff --git a/pkg/linkrp/processors/daprstatestores/processor_test.go b/pkg/linkrp/processors/daprstatestores/processor_test.go deleted file mode 100644 index b98afdaa0a..0000000000 --- a/pkg/linkrp/processors/daprstatestores/processor_test.go +++ /dev/null @@ -1,330 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package daprstatestores - -import ( - "context" - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers/dapr" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/test/k8sutil" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/kubectl/pkg/scheme" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -func Test_Process(t *testing.T) { - - const externalResourceID1 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Cache/redis/myredis1" - const externalResourceID2 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Cache/redis/myredis2" - const kubernetesResource = "/planes/kubernetes/local/namespaces/test-namespace/providers/dapr.io/Component/test-component" - const applicationID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Core/applications/test-app" - const componentName = "test-component" - - t.Run("success - recipe", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme), - } - - resource := &datamodel.DaprStateStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: componentName, - }, - }, - Properties: datamodel.DaprStateStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - }, - } - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - externalResourceID1, - kubernetesResource, - }, - Values: map[string]any{}, // Component name will be computed for resource name. - Secrets: map[string]any{}, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - - // No components created for a recipe - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.Empty(t, components.Items) - }) - - t.Run("success - manual", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test-namespace"}}), - } - - resource := &datamodel.DaprStateStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprStateStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{"config": "extrasecure"}, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, - Type: "state.redis", - Version: "v1", - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField(resource.Properties.Resources) - - generated := &unstructured.Unstructured{ - Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", - "metadata": map[string]any{ - "namespace": "test-namespace", - "name": "test-component", - "labels": kubernetes.MakeDescriptiveDaprLabels("test-app", "some-other-name", linkrp.DaprStateStoresResourceType), - "resourceVersion": "1", - }, - "spec": map[string]any{ - "type": "state.redis", - "version": "v1", - "metadata": []any{ - map[string]any{ - "name": "config", - "value": "extrasecure", - }, - }, - }, - }, - } - - component := rpv1.NewKubernetesOutputResource("Component", generated, metav1.ObjectMeta{Name: generated.GetName(), Namespace: generated.GetNamespace()}) - component.RadiusManaged = to.Ptr(true) - component.CreateResource = &rpv1.Resource{ - Data: generated, - ResourceType: resourcemodel.ResourceType{ - Provider: resourcemodel.ProviderKubernetes, - Type: resources_kubernetes.ResourceTypeDaprComponent, - }, - } - expectedOutputResources = append(expectedOutputResources, component) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.NotEmpty(t, components.Items) - require.Equal(t, []unstructured.Unstructured{*generated}, components.Items) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme), - } - - resource := &datamodel.DaprStateStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprStateStoreProperties{ - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - }, - } - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - externalResourceID2, - kubernetesResource, - }, - - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "componentName": "akskdf", - }, - Secrets: map[string]any{}, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, componentName, resource.Properties.ComponentName) - - expectedValues := map[string]any{ - "componentName": componentName, - } - expectedSecrets := map[string]rpv1.SecretValueReference{} - - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - resourcesFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField(resource.Properties.Resources) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, resourcesFieldOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - - components := unstructured.UnstructuredList{} - components.SetAPIVersion("dapr.io/v1alpha1") - components.SetKind("Component") - err = processor.Client.List(context.Background(), &components, &client.ListOptions{Namespace: options.RuntimeConfiguration.Kubernetes.Namespace}) - require.NoError(t, err) - require.Empty(t, components.Items) - }) - - t.Run("failure - duplicate component", func(t *testing.T) { - // Create a duplicate with the same component name. - existing, err := dapr.ConstructDaprGeneric( - dapr.DaprGeneric{ - Type: to.Ptr("state.redis"), - Version: to.Ptr("v1"), - Metadata: map[string]any{}, - }, - "test-namespace", - "test-component", - "test-app", - "some-other-other-name", - linkrp.DaprStateStoresResourceType) - require.NoError(t, err) - - processor := Processor{ - Client: k8sutil.NewFakeKubeClient(scheme.Scheme, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: "test-namespace"}}, &existing), - } - resource := &datamodel.DaprStateStore{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "some-other-name", - }, - }, - Properties: datamodel.DaprStateStoreProperties{ - BasicResourceProperties: rpv1.BasicResourceProperties{ - Application: applicationID, - }, - BasicDaprResourceProperties: rpv1.BasicDaprResourceProperties{ - ComponentName: componentName, - }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, - Metadata: map[string]any{"config": "extrasecure"}, - Resources: []*linkrp.ResourceReference{{ID: externalResourceID1}}, - Type: "state.redis", - Version: "v1", - }, - } - - options := processors.Options{ - RuntimeConfiguration: recipes.RuntimeConfiguration{ - Kubernetes: &recipes.KubernetesRuntime{ - Namespace: "test-namespace", - }, - }, - } - - err = processor.Process(context.Background(), resource, options) - require.Error(t, err) - assert.IsType(t, &processors.ValidationError{}, err) - assert.Equal(t, "the Dapr component name '\"test-component\"' is already in use by another resource. Dapr component and resource names must be unique across all Dapr types (eg: StateStores, PubSubBrokers, SecretStores, etc.). Please select a new name and try again", err.Error()) - }) -} diff --git a/pkg/linkrp/processors/extenders/doc.go b/pkg/linkrp/processors/extenders/doc.go deleted file mode 100644 index 70871bf83a..0000000000 --- a/pkg/linkrp/processors/extenders/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// extenders contains the resource processor for extenders. See the processors package for more information. -package extenders diff --git a/pkg/linkrp/processors/extenders/processor.go b/pkg/linkrp/processors/extenders/processor.go deleted file mode 100644 index 1ca1bf77d8..0000000000 --- a/pkg/linkrp/processors/extenders/processor.go +++ /dev/null @@ -1,71 +0,0 @@ -package extenders - -import ( - "context" - "fmt" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/recipes" -) - -// Processor is a processor for Extender resources. -type Processor struct { -} - -// Process implements the processors.Processor interface for Extender resources. It validates and merges output values from -// the recipe output with the existing values in the resource. It returns an error if the secret values are not of type string -// or if any of the other validations fail. -func (p *Processor) Process(ctx context.Context, resource *datamodel.Extender, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - - computedValues := mergeOutputValues(resource.Properties.AdditionalProperties, options.RecipeOutput, false) - for k, val := range computedValues { - value := val - validator.AddOptionalAnyField(k, value) - } - - secretValues := mergeOutputValues(resource.Properties.Secrets, options.RecipeOutput, true) - for k, val := range secretValues { - if secret, ok := val.(string); !ok { - return &processors.ValidationError{Message: fmt.Sprintf("secret '%s' must be of type string", k)} - } else { - value := secret - validator.AddOptionalSecretField(k, &value) - } - } - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - if options.RecipeOutput != nil { - resource.Properties.AdditionalProperties = options.RecipeOutput.Values - resource.Properties.Secrets = options.RecipeOutput.Secrets - } - - return nil -} - -func mergeOutputValues(properties map[string]any, recipeOutput *recipes.RecipeOutput, secret bool) map[string]any { - values := make(map[string]any) - for k, val := range properties { - values[k] = val - } - if recipeOutput == nil { - return values - } - - var recipeProperties map[string]any - if secret { - recipeProperties = recipeOutput.Secrets - } else { - recipeProperties = recipeOutput.Values - } - - for k, val := range recipeProperties { - values[k] = val - } - return values -} diff --git a/pkg/linkrp/processors/extenders/processor_test.go b/pkg/linkrp/processors/extenders/processor_test.go deleted file mode 100644 index 24946d6b28..0000000000 --- a/pkg/linkrp/processors/extenders/processor_test.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package extenders - -import ( - "context" - "testing" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/stretchr/testify/require" -) - -const ( - extenderResourceID1 = "/planes/aws/aws/accounts/123341234/regions/us-west-2/providers/AWS.S3/Bucket/myBucket" - extenderResourceID2 = "/planes/aws/aws/accounts/123341234/regions/us-west-2/providers/AWS.S3/Bucket/myBucket2" - password = "testpassword" -) - -func Test_Process(t *testing.T) { - processor := Processor{} - t.Run("success - recipe", func(t *testing.T) { - resource := &datamodel.Extender{} - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - extenderResourceID1, - }, - Values: map[string]any{ - "bucketName": "myBucket", - "region": "westus", - }, - Secrets: map[string]any{ - "databaseSecret": password, - "adminSecret": password, - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, "myBucket", resource.Properties.AdditionalProperties["bucketName"]) - require.Equal(t, "westus", resource.Properties.AdditionalProperties["region"]) - require.Equal(t, password, resource.Properties.Secrets["databaseSecret"]) - require.Equal(t, password, resource.Properties.Secrets["adminSecret"]) - - expectedValues := map[string]any{ - "bucketName": "myBucket", - "region": "westus", - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "databaseSecret": { - Value: password, - }, - "adminSecret": { - Value: password, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - manual", func(t *testing.T) { - resource := &datamodel.Extender{ - Properties: datamodel.ExtenderProperties{ - AdditionalProperties: map[string]any{"bucketName": "myBucket"}, - Secrets: map[string]any{ - "databaseSecret": password, - }, - }, - } - err := processor.Process(context.Background(), resource, processors.Options{}) - require.NoError(t, err) - - require.Equal(t, "myBucket", resource.Properties.AdditionalProperties["bucketName"]) - require.Equal(t, password, resource.Properties.Secrets["databaseSecret"]) - - expectedValues := map[string]any{ - "bucketName": "myBucket", - } - - expectedSecrets := map[string]rpv1.SecretValueReference{ - "databaseSecret": { - Value: password, - }, - } - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - resource := &datamodel.Extender{ - Properties: datamodel.ExtenderProperties{ - AdditionalProperties: map[string]any{ - "bucketName": "myBucket", - }, - Secrets: map[string]any{ - "databaseSecret": password, - }, - }, - } - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - extenderResourceID2, - }, - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "bucketName": "myBucket2", - }, - Secrets: map[string]any{ - "databaseSecret": "overridepassword", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, "myBucket2", resource.Properties.AdditionalProperties["bucketName"]) - require.Equal(t, "overridepassword", resource.Properties.Secrets["databaseSecret"]) - - expectedValues := map[string]any{ - "bucketName": "myBucket2", - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "databaseSecret": { - Value: "overridepassword", - }, - } - - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("failure - missing required values", func(t *testing.T) { - resource := &datamodel.Extender{ - Properties: datamodel.ExtenderProperties{ - Secrets: map[string]any{ - "databaseSecret": 24, - }, - }, - } - options := processors.Options{RecipeOutput: &recipes.RecipeOutput{}} - - err := processor.Process(context.Background(), resource, options) - require.Error(t, err) - require.IsType(t, &processors.ValidationError{}, err) - require.Equal(t, `secret 'databaseSecret' must be of type string`, err.Error()) - - }) -} - -func Test_MergeOutputValues(t *testing.T) { - resource := &datamodel.Extender{ - Properties: datamodel.ExtenderProperties{ - AdditionalProperties: map[string]any{"bucketName": "myBucket"}, - Secrets: map[string]any{ - "databaseSecret1": password, - }, - }, - } - propertiesMap := mergeOutputValues(resource.Properties.AdditionalProperties, nil, false) - require.Equal(t, resource.Properties.AdditionalProperties, propertiesMap) - secretsMap := mergeOutputValues(resource.Properties.Secrets, nil, true) - require.Equal(t, resource.Properties.Secrets, secretsMap) - - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - extenderResourceID1, - }, - Values: map[string]any{ - "region": "westus", - }, - Secrets: map[string]any{ - "databaseSecret2": password, - "adminSecret": password, - }, - }, - } - - expectedAdditionalProperties := map[string]any{ - "bucketName": "myBucket", - "region": "westus", - } - expectedSecrets := map[string]any{ - "databaseSecret1": password, - "databaseSecret2": password, - "adminSecret": password, - } - - propertiesMap = mergeOutputValues(resource.Properties.AdditionalProperties, options.RecipeOutput, false) - require.Equal(t, expectedAdditionalProperties, propertiesMap) - secretsMap = mergeOutputValues(resource.Properties.Secrets, options.RecipeOutput, true) - require.Equal(t, expectedSecrets, secretsMap) -} diff --git a/pkg/linkrp/processors/mongodatabases/doc.go b/pkg/linkrp/processors/mongodatabases/doc.go deleted file mode 100644 index f2b3458a41..0000000000 --- a/pkg/linkrp/processors/mongodatabases/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// mongodatabases contains the resource processor for Mongo databases. See the processors package for more information. -package mongodatabases diff --git a/pkg/linkrp/processors/mongodatabases/processor.go b/pkg/linkrp/processors/mongodatabases/processor.go deleted file mode 100644 index 4ddf999827..0000000000 --- a/pkg/linkrp/processors/mongodatabases/processor.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -import ( - "context" - "fmt" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -// Processor is a processor for MongoDB resources. -type Processor struct { -} - -// Process implements the processors.Processor interface for MongoDB resources. It validates MongoDatabase properties -// and applies the values from the RecipeOutput. -func (p *Processor) Process(ctx context.Context, resource *datamodel.MongoDatabase, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - - validator.AddResourcesField(&resource.Properties.Resources) - validator.AddRequiredStringField(renderers.Host, &resource.Properties.Host) - validator.AddRequiredInt32Field(renderers.Port, &resource.Properties.Port) - validator.AddRequiredStringField(renderers.DatabaseNameValue, &resource.Properties.Database) - validator.AddOptionalStringField(renderers.UsernameStringValue, &resource.Properties.Username) - validator.AddOptionalSecretField(renderers.PasswordStringHolder, &resource.Properties.Secrets.Password) - validator.AddComputedSecretField(renderers.ConnectionStringValue, &resource.Properties.Secrets.ConnectionString, func() (string, *processors.ValidationError) { - return p.computeConnectionString(resource), nil - }) - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - return nil -} - -func (p *Processor) computeConnectionString(resource *datamodel.MongoDatabase) string { - connectionString := "mongodb://" - - if resource.Properties.Username != "" { - connectionString += resource.Properties.Username + ":" - } - if resource.Properties.Secrets.Password != "" { - connectionString += resource.Properties.Secrets.Password + "@" - } - - connectionString = fmt.Sprintf("%s%s:%v/%s", connectionString, resource.Properties.Host, resource.Properties.Port, resource.Properties.Database) - return connectionString -} diff --git a/pkg/linkrp/processors/mongodatabases/processor_test.go b/pkg/linkrp/processors/mongodatabases/processor_test.go deleted file mode 100644 index cd359b07c1..0000000000 --- a/pkg/linkrp/processors/mongodatabases/processor_test.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package mongodatabases - -import ( - "context" - "testing" - - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/stretchr/testify/require" -) - -func Test_Process(t *testing.T) { - processor := Processor{} - - const azureMongoResourceID1 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.DocumentDB/mongo/mongodb1" - const azureMongoResourceID2 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.DocumentDB/mongo/mongodb2" - - const host = "test.mongo.cosmos.azure.com" - const port = 10255 - const username = "testuser" - const password = "testpassword" - const database = "authdb" - const connectionString = "mongodb://testuser:testpassword@test.mongo.cosmos.azure.com:10255/authdb" - - t.Run("success - recipe", func(t *testing.T) { - resource := &datamodel.MongoDatabase{} - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - azureMongoResourceID1, - }, - Values: map[string]any{ - "host": host, - "port": port, - "database": database, - "username": username, - }, - Secrets: map[string]any{ - "password": password, - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, host, resource.Properties.Host) - require.Equal(t, int32(port), resource.Properties.Port) - require.Equal(t, database, resource.Properties.Database) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - - expectedValues := map[string]any{ - "host": host, - "port": int32(port), - "database": database, - "username": username, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "connectionString": { - Value: connectionString, - }, - "password": { - Value: password, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - manual", func(t *testing.T) { - resource := &datamodel.MongoDatabase{ - Properties: datamodel.MongoDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureMongoResourceID1}}, - Host: host, - Port: port, - Database: database, - Username: username, - Secrets: datamodel.MongoDatabaseSecrets{ - Password: password, - ConnectionString: connectionString, - }, - }, - } - err := processor.Process(context.Background(), resource, processors.Options{}) - require.NoError(t, err) - - require.Equal(t, host, resource.Properties.Host) - require.Equal(t, int32(port), resource.Properties.Port) - require.Equal(t, database, resource.Properties.Database) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - - expectedValues := map[string]any{ - "host": host, - "port": int32(port), - "database": database, - "username": username, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "connectionString": { - Value: connectionString, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ - { - ID: azureMongoResourceID1, - }, - }) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - resource := &datamodel.MongoDatabase{ - Properties: datamodel.MongoDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureMongoResourceID1}}, - Host: host, - Port: port, - Database: database, - Username: username, - Secrets: datamodel.MongoDatabaseSecrets{ - Password: password, - ConnectionString: connectionString, - }, - }, - } - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - azureMongoResourceID2, - }, - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "host": "asdf", - "port": 3333, - "database": "asdf", - "username": username, - }, - Secrets: map[string]any{ - "password": "asdf", - "connectionString": "asdf", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, host, resource.Properties.Host) - require.Equal(t, int32(port), resource.Properties.Port) - require.Equal(t, database, resource.Properties.Database) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - - expectedValues := map[string]any{ - "host": host, - "port": int32(port), - "database": database, - "username": username, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "connectionString": { - Value: connectionString, - }, - } - - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ - { - ID: azureMongoResourceID1, - }, - }) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, resourceFieldOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("failure - missing required values", func(t *testing.T) { - resource := &datamodel.MongoDatabase{} - options := processors.Options{RecipeOutput: &recipes.RecipeOutput{}} - - err := processor.Process(context.Background(), resource, options) - require.Error(t, err) - require.IsType(t, &processors.ValidationError{}, err) - require.Equal(t, `validation returned multiple errors: - -the connection value "host" should be provided by the recipe, set '.properties.host' to provide a value manually -the connection value "port" should be provided by the recipe, set '.properties.port' to provide a value manually -the connection value "database" should be provided by the recipe, set '.properties.database' to provide a value manually`, err.Error()) - }) -} diff --git a/pkg/linkrp/processors/rabbitmqmessagequeues/doc.go b/pkg/linkrp/processors/rabbitmqmessagequeues/doc.go deleted file mode 100644 index b43e4837d5..0000000000 --- a/pkg/linkrp/processors/rabbitmqmessagequeues/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// rabbitmqmessagequeues contains the resource processor for rabbitMQ. See the processors package for more information. -package rabbitmqmessagequeues diff --git a/pkg/linkrp/processors/rabbitmqmessagequeues/processor.go b/pkg/linkrp/processors/rabbitmqmessagequeues/processor.go deleted file mode 100644 index 67a29f0485..0000000000 --- a/pkg/linkrp/processors/rabbitmqmessagequeues/processor.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rabbitmqmessagequeues - -import ( - "context" - "fmt" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -const ( - Queue = "queue" - // RabbitMQSSLPort is the default port for RabbitMQ SSL connections. - RabbitMQSSLPort = 5671 -) - -// Processor is a processor for RabbitMQQueue resources. -type Processor struct { -} - -// Process implements the processors.Processor interface for RabbitMQQueue resources. It validates the required and computed -// RabbitMQMessageQueue properties and applies the values from the RecipeOutput. It returns an error if validation fails. - -func (p *Processor) Process(ctx context.Context, resource *datamodel.RabbitMQMessageQueue, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - validator.AddResourcesField(&resource.Properties.Resources) - validator.AddRequiredStringField(Queue, &resource.Properties.Queue) - validator.AddRequiredStringField(renderers.Host, &resource.Properties.Host) - validator.AddOptionalStringField(renderers.VHost, &resource.Properties.VHost) - validator.AddRequiredInt32Field(renderers.Port, &resource.Properties.Port) - validator.AddOptionalStringField(renderers.UsernameStringValue, &resource.Properties.Username) - validator.AddOptionalSecretField(renderers.PasswordStringHolder, &resource.Properties.Secrets.Password) - validator.AddComputedBoolField(renderers.TLS, &resource.Properties.TLS, func() (bool, *processors.ValidationError) { - return p.computeSSL(resource), nil - }) - validator.AddComputedSecretField(renderers.URI, &resource.Properties.Secrets.URI, func() (string, *processors.ValidationError) { - return p.computeURI(resource), nil - }) - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - return nil -} - -func (p *Processor) computeURI(resource *datamodel.RabbitMQMessageQueue) string { - rabbitMQProtocol := "amqp" - if resource.Properties.TLS { - rabbitMQProtocol = "amqps" - } - usernamePassword := "" - if resource.Properties.Username != "" || resource.Properties.Secrets.Password != "" { - usernamePassword = fmt.Sprintf("%s:%s@", resource.Properties.Username, resource.Properties.Secrets.Password) - } - return fmt.Sprintf("%s://%s%s:%v/%s", rabbitMQProtocol, usernamePassword, resource.Properties.Host, resource.Properties.Port, resource.Properties.VHost) -} - -func (p *Processor) computeSSL(resource *datamodel.RabbitMQMessageQueue) bool { - return resource.Properties.Port == RabbitMQSSLPort -} diff --git a/pkg/linkrp/processors/rabbitmqmessagequeues/processor_test.go b/pkg/linkrp/processors/rabbitmqmessagequeues/processor_test.go deleted file mode 100644 index 8be096c76e..0000000000 --- a/pkg/linkrp/processors/rabbitmqmessagequeues/processor_test.go +++ /dev/null @@ -1,190 +0,0 @@ -/* -Copyright 2023 The Radius Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package rabbitmqmessagequeues - -import ( - "context" - "testing" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/stretchr/testify/require" -) - -func Test_Process(t *testing.T) { - processor := Processor{} - - const queue = "test-queue" - const uri = "connection://string" - const host = "test-host" - const vHost = "test-vHost" - const port int32 = 5672 - const username = "test-user" - const password = "test-password" - rabbitMQOutputResources := []string{ - "/planes/kubernetes/local/namespaces/rabbitmq/providers/core/Service/rabbitmq-svc", - "/planes/kubernetes/local/namespaces/rabbitmq/providers/apps/Deployment/rabbitmq-deployment", - } - - t.Run("success - recipe", func(t *testing.T) { - resource := &datamodel.RabbitMQMessageQueue{} - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: rabbitMQOutputResources, - Values: map[string]any{ - "queue": queue, - "host": host, - "port": port, - "username": username, - "vHost": vHost, - "tls": true, - }, - Secrets: map[string]any{ - "password": password, - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, queue, resource.Properties.Queue) - expectedValues := map[string]any{ - "queue": queue, - "host": host, - "port": port, - "username": username, - "vHost": vHost, - "tls": true, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "uri": { - Value: "amqps://test-user:test-password@test-host:5672/test-vHost", - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - manual", func(t *testing.T) { - resource := &datamodel.RabbitMQMessageQueue{ - Properties: datamodel.RabbitMQMessageQueueProperties{ - Queue: queue, - Host: host, - Port: port, - Username: username, - }, - } - err := processor.Process(context.Background(), resource, processors.Options{}) - require.NoError(t, err) - - require.Equal(t, queue, resource.Properties.Queue) - - expectedValues := map[string]any{ - "queue": queue, - "host": host, - "port": port, - "username": username, - "tls": false, - } - require.NoError(t, err) - require.Equal(t, expectedValues, resource.ComputedValues) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - resource := &datamodel.RabbitMQMessageQueue{ - Properties: datamodel.RabbitMQMessageQueueProperties{ - Queue: "new-queue", - Host: "new-host", - Port: int32(5671), - Username: "new-user", - Secrets: datamodel.RabbitMQSecrets{ - Password: "new-passoword", - URI: uri, - }, - }, - } - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: rabbitMQOutputResources, - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "queue": queue, - "host": host, - "port": port, - "username": username, - }, - Secrets: map[string]any{ - "password": password, - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, "new-queue", resource.Properties.Queue) - - expectedValues := map[string]any{ - "queue": "new-queue", - "host": "new-host", - "port": int32(5671), - "username": "new-user", - "tls": true, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: "new-passoword", - }, - "uri": { - Value: uri, - }, - } - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("failure - missing required values", func(t *testing.T) { - resource := &datamodel.RabbitMQMessageQueue{} - options := processors.Options{RecipeOutput: &recipes.RecipeOutput{}} - - err := processor.Process(context.Background(), resource, options) - require.Error(t, err) - require.IsType(t, &processors.ValidationError{}, err) - require.Equal(t, `validation returned multiple errors: - -the connection value "queue" should be provided by the recipe, set '.properties.queue' to provide a value manually -the connection value "host" should be provided by the recipe, set '.properties.host' to provide a value manually -the connection value "port" should be provided by the recipe, set '.properties.port' to provide a value manually`, err.Error()) - - }) -} diff --git a/pkg/linkrp/processors/rediscaches/doc.go b/pkg/linkrp/processors/rediscaches/doc.go deleted file mode 100644 index 2dd50cd6ca..0000000000 --- a/pkg/linkrp/processors/rediscaches/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// rediscaches contains the resource processor for redis caches. See the processors package for more information. -package rediscaches diff --git a/pkg/linkrp/processors/rediscaches/processor.go b/pkg/linkrp/processors/rediscaches/processor.go deleted file mode 100644 index d6242e1a2e..0000000000 --- a/pkg/linkrp/processors/rediscaches/processor.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rediscaches - -import ( - "context" - "fmt" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -const ( - // RedisNonSSLPort is the default port for Redis non-SSL connections. - RedisNonSSLPort = 6379 - - // RedisSSLPort is the default port for Redis SSL connections. - RedisSSLPort = 6380 -) - -// Processor is a processor for RedisCache resources. -type Processor struct { -} - -// Process implements the processors.Processor interface for RedisCache resources. It validates the input parameters and computes -// the connection string and connection URI for the RedisCache resource, and applies the values from the RecipeOutput. -func (p *Processor) Process(ctx context.Context, resource *datamodel.RedisCache, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - - validator.AddResourcesField(&resource.Properties.Resources) - validator.AddRequiredStringField(renderers.Host, &resource.Properties.Host) - validator.AddRequiredInt32Field(renderers.Port, &resource.Properties.Port) - validator.AddOptionalStringField(renderers.UsernameStringValue, &resource.Properties.Username) - validator.AddComputedBoolField(renderers.TLS, &resource.Properties.TLS, func() (bool, *processors.ValidationError) { - return p.computeSSL(resource), nil - }) - validator.AddOptionalSecretField(renderers.PasswordStringHolder, &resource.Properties.Secrets.Password) - validator.AddComputedSecretField(renderers.ConnectionStringValue, &resource.Properties.Secrets.ConnectionString, func() (string, *processors.ValidationError) { - return p.computeConnectionString(resource), nil - }) - validator.AddComputedSecretField(renderers.ConnectionURIValue, &resource.Properties.Secrets.URL, func() (string, *processors.ValidationError) { - return p.computeConnectionURI(resource), nil - }) - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - return nil -} - -func (p *Processor) computeSSL(resource *datamodel.RedisCache) bool { - return resource.Properties.Port == RedisSSLPort -} - -func (p *Processor) computeConnectionString(resource *datamodel.RedisCache) string { - connectionString := fmt.Sprintf("%s:%v,abortConnect=False", resource.Properties.Host, resource.Properties.Port) - if resource.Properties.TLS { - connectionString = connectionString + ",ssl=True" - } - - if resource.Properties.Username != "" { - connectionString = connectionString + ",user=" + resource.Properties.Username - } - if resource.Properties.Secrets.Password != "" { - connectionString = connectionString + ",password=" + resource.Properties.Secrets.Password - } - - return connectionString -} - -func (p *Processor) computeConnectionURI(resource *datamodel.RedisCache) string { - // Redis connection URIs are of the form: redis://[username:password@]host[:port][/db-number][?option=value] - connectionURI := "redis://" - if resource.Properties.TLS { - connectionURI = "rediss://" - } - - if resource.Properties.Username != "" { - connectionURI += resource.Properties.Username - } - if resource.Properties.Secrets.Password != "" { - connectionURI += ":" + resource.Properties.Secrets.Password + "@" - } - - connectionURI = fmt.Sprintf("%s%s:%v/0?", connectionURI, resource.Properties.Host, resource.Properties.Port) - return connectionURI -} diff --git a/pkg/linkrp/processors/rediscaches/processor_test.go b/pkg/linkrp/processors/rediscaches/processor_test.go deleted file mode 100644 index fc774ee185..0000000000 --- a/pkg/linkrp/processors/rediscaches/processor_test.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package rediscaches - -import ( - "context" - "testing" - - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/stretchr/testify/require" -) - -func Test_Process(t *testing.T) { - processor := Processor{} - - const azureRedisResourceID1 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Cache/redis/myredis1" - const azureRedisResourceID2 = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Cache/redis/myredis2" - const host = "myredis.redis.cache.windows.net" - const connectionString = "myredis.redis.cache.windows.net:6380,abortConnect=False,ssl=True,user=testuser,password=testpassword" - const connectionString_NonSSL = "myredis.redis.cache.windows.net:6379,abortConnect=False,user=testuser,password=testpassword" - const connectionURI = "rediss://testuser:testpassword@myredis.redis.cache.windows.net:6380/0?" - const connectionURI_NonSSL = "redis://testuser:testpassword@myredis.redis.cache.windows.net:6379/0?" - const username = "testuser" - const password = "testpassword" - - t.Run("success - recipe", func(t *testing.T) { - resource := &datamodel.RedisCache{} - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - azureRedisResourceID1, - }, - Values: map[string]any{ - "host": host, - "port": RedisNonSSLPort, - "username": username, - }, - Secrets: map[string]any{ - "password": password, - // Let the connection string be computed, it will result in the same value - // as the variable 'connectionString' - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, host, resource.Properties.Host) - require.Equal(t, int32(RedisNonSSLPort), resource.Properties.Port) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, false, resource.Properties.TLS) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString_NonSSL, resource.Properties.Secrets.ConnectionString) - require.Equal(t, connectionURI_NonSSL, resource.Properties.Secrets.URL) - - expectedValues := map[string]any{ - "host": host, - "port": int32(RedisNonSSLPort), - "username": username, - "tls": false, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "connectionString": { - Value: connectionString_NonSSL, - }, - "password": { - Value: password, - }, - "url": { - Value: connectionURI_NonSSL, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - manual", func(t *testing.T) { - resource := &datamodel.RedisCache{ - Properties: datamodel.RedisCacheProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureRedisResourceID1}}, - Host: host, - Port: RedisSSLPort, - Username: username, - TLS: true, - Secrets: datamodel.RedisCacheSecrets{ - Password: password, - ConnectionString: connectionString, - URL: connectionURI, - }, - }, - } - err := processor.Process(context.Background(), resource, processors.Options{}) - require.NoError(t, err) - - require.Equal(t, host, resource.Properties.Host) - require.Equal(t, int32(RedisSSLPort), resource.Properties.Port) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - require.Equal(t, connectionURI, resource.Properties.Secrets.URL) - - expectedValues := map[string]any{ - "host": host, - "port": int32(RedisSSLPort), - "username": username, - "tls": true, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "connectionString": { - Value: connectionString, - }, - "url": { - Value: connectionURI, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ - { - ID: azureRedisResourceID1, - }, - }) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - resource := &datamodel.RedisCache{ - Properties: datamodel.RedisCacheProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureRedisResourceID1}}, - Host: host, - Port: RedisNonSSLPort, - Username: username, - TLS: true, - - Secrets: datamodel.RedisCacheSecrets{ - Password: password, - ConnectionString: connectionString, - }, - }, - } - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - azureRedisResourceID2, - }, - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "host": "asdf", - "port": 3333, - "username": "asdf", - }, - Secrets: map[string]any{ - "password": "asdf", - "connectionString": "asdf", - "url": "asdf", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, host, resource.Properties.Host) - require.Equal(t, int32(RedisNonSSLPort), resource.Properties.Port) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - require.Equal(t, "asdf", resource.Properties.Secrets.URL) - - expectedValues := map[string]any{ - "host": host, - "port": int32(RedisNonSSLPort), - "username": username, - "tls": true, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "connectionString": { - Value: connectionString, - }, - "url": { - Value: "asdf", - }, - } - - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ - { - ID: azureRedisResourceID1, - }, - }) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, resourceFieldOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("failure - missing required values", func(t *testing.T) { - resource := &datamodel.RedisCache{} - options := processors.Options{RecipeOutput: &recipes.RecipeOutput{}} - - err := processor.Process(context.Background(), resource, options) - require.Error(t, err) - require.IsType(t, &processors.ValidationError{}, err) - require.Equal(t, `validation returned multiple errors: - -the connection value "host" should be provided by the recipe, set '.properties.host' to provide a value manually -the connection value "port" should be provided by the recipe, set '.properties.port' to provide a value manually`, err.Error()) - }) -} diff --git a/pkg/linkrp/processors/sqldatabases/doc.go b/pkg/linkrp/processors/sqldatabases/doc.go deleted file mode 100644 index 5688fbd2f2..0000000000 --- a/pkg/linkrp/processors/sqldatabases/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// ------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// ------------------------------------------------------------ - -// sqldatabases contains the resource processor for sql databases. See the processors package for more information. -package sqldatabases diff --git a/pkg/linkrp/processors/sqldatabases/processor.go b/pkg/linkrp/processors/sqldatabases/processor.go deleted file mode 100644 index e3772b5aad..0000000000 --- a/pkg/linkrp/processors/sqldatabases/processor.go +++ /dev/null @@ -1,55 +0,0 @@ -// ------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// ------------------------------------------------------------ - -package sqldatabases - -import ( - "context" - "fmt" - - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" -) - -// Processor is a processor for SqlDatabase resources. -type Processor struct { -} - -// Process implements the processors.Processor interface for SqlDatabase resources. It validates the given resource properties -// and sets the computed values and secrets in the resource, and applies the values from the RecipeOutput. -func (p *Processor) Process(ctx context.Context, resource *datamodel.SqlDatabase, options processors.Options) error { - validator := processors.NewValidator(&resource.ComputedValues, &resource.SecretValues, &resource.Properties.Status.OutputResources) - - validator.AddResourcesField(&resource.Properties.Resources) - validator.AddRequiredStringField(renderers.DatabaseNameValue, &resource.Properties.Database) - validator.AddRequiredStringField(renderers.ServerNameValue, &resource.Properties.Server) - validator.AddRequiredInt32Field(renderers.Port, &resource.Properties.Port) - validator.AddOptionalStringField(renderers.UsernameStringValue, &resource.Properties.Username) - validator.AddOptionalSecretField(renderers.PasswordStringHolder, &resource.Properties.Secrets.Password) - validator.AddComputedSecretField(renderers.ConnectionStringValue, &resource.Properties.Secrets.ConnectionString, func() (string, *processors.ValidationError) { - return p.computeConnectionString(resource), nil - }) - - err := validator.SetAndValidate(options.RecipeOutput) - if err != nil { - return err - } - - return nil -} - -func (p *Processor) computeConnectionString(resource *datamodel.SqlDatabase) string { - var username, password string - if resource.Properties.Username != "" { - username = "User Id=" + resource.Properties.Username - } - if resource.Properties.Secrets.Password != "" { - password = "Password=" + resource.Properties.Secrets.Password - } - - connectionString := fmt.Sprintf("Data Source=tcp:%s,%v;Initial Catalog=%s;%s;%s;Encrypt=True;TrustServerCertificate=True", resource.Properties.Server, resource.Properties.Port, resource.Properties.Database, username, password) - return connectionString -} diff --git a/pkg/linkrp/processors/sqldatabases/processor_test.go b/pkg/linkrp/processors/sqldatabases/processor_test.go deleted file mode 100644 index 392c78f54d..0000000000 --- a/pkg/linkrp/processors/sqldatabases/processor_test.go +++ /dev/null @@ -1,224 +0,0 @@ -// ------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -// ------------------------------------------------------------ - -package sqldatabases - -import ( - "context" - "testing" - - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/stretchr/testify/require" -) - -func Test_Process(t *testing.T) { - processor := Processor{} - - const azureSqlResourceID = "/subscriptions/85716382-7362-45c3-ae03-2126e459a123/resourceGroups/RadiusFunctionalTest/providers/Microsoft.Sql/servers/mssql-radiustest/databases/database-radiustest" - const server = "sql.server" - const database = "database-radiustest" - const port = 1433 - const username = "testuser" - const password = "testpassword" - const connectionString = "Data Source=tcp:sql.server,1433;Initial Catalog=database-radiustest;User Id=testuser;Password=testpassword;Encrypt=True;TrustServerCertificate=True" - - t.Run("success - recipe", func(t *testing.T) { - resource := &datamodel.SqlDatabase{} - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - azureSqlResourceID, - }, - Values: map[string]any{ - "database": database, - "server": server, - "port": port, - "username": username, - }, - Secrets: map[string]any{ - "password": password, - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, database, resource.Properties.Database) - require.Equal(t, server, resource.Properties.Server) - require.Equal(t, int32(port), resource.Properties.Port) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - - expectedValues := map[string]any{ - "database": database, - "server": server, - "port": int32(port), - "username": username, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "connectionString": { - Value: connectionString, - }, - "password": { - Value: password, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - manual", func(t *testing.T) { - resource := &datamodel.SqlDatabase{ - Properties: datamodel.SqlDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureSqlResourceID}}, - Database: database, - Server: server, - Port: port, - Username: username, - Secrets: datamodel.SqlDatabaseSecrets{ - Password: password, - ConnectionString: connectionString, - }, - }, - } - err := processor.Process(context.Background(), resource, processors.Options{}) - require.NoError(t, err) - - require.Equal(t, database, resource.Properties.Database) - require.Equal(t, server, resource.Properties.Server) - require.Equal(t, int32(port), resource.Properties.Port) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - - expectedValues := map[string]any{ - "database": database, - "server": server, - "port": int32(port), - "username": username, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "connectionString": { - Value: connectionString, - }, - } - - expectedOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ - { - ID: azureSqlResourceID, - }, - }) - require.NoError(t, err) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("success - recipe with value overrides", func(t *testing.T) { - resource := &datamodel.SqlDatabase{ - Properties: datamodel.SqlDatabaseProperties{ - Resources: []*linkrp.ResourceReference{{ID: azureSqlResourceID}}, - Database: database, - Server: server, - Port: port, - Username: username, - Secrets: datamodel.SqlDatabaseSecrets{ - Password: password, - ConnectionString: connectionString, - }, - }, - } - options := processors.Options{ - RecipeOutput: &recipes.RecipeOutput{ - Resources: []string{ - azureSqlResourceID, - }, - // Values and secrets will be overridden by the resource. - Values: map[string]any{ - "database": "override-database", - "server": "override.server", - "port": 3333, - "username": username, - }, - Secrets: map[string]any{ - "password": "asdf", - "connectionString": "asdf", - }, - }, - } - - err := processor.Process(context.Background(), resource, options) - require.NoError(t, err) - - require.Equal(t, database, resource.Properties.Database) - require.Equal(t, server, resource.Properties.Server) - require.Equal(t, int32(port), resource.Properties.Port) - require.Equal(t, username, resource.Properties.Username) - require.Equal(t, password, resource.Properties.Secrets.Password) - require.Equal(t, connectionString, resource.Properties.Secrets.ConnectionString) - - expectedValues := map[string]any{ - "database": database, - "server": server, - "port": int32(port), - "username": username, - } - expectedSecrets := map[string]rpv1.SecretValueReference{ - "password": { - Value: password, - }, - "connectionString": { - Value: connectionString, - }, - } - expectedOutputResources := []rpv1.OutputResource{} - - recipeOutputResources, err := processors.GetOutputResourcesFromRecipe(options.RecipeOutput) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, recipeOutputResources...) - - resourceFieldOutputResources, err := processors.GetOutputResourcesFromResourcesField([]*linkrp.ResourceReference{ - { - ID: azureSqlResourceID, - }, - }) - require.NoError(t, err) - expectedOutputResources = append(expectedOutputResources, resourceFieldOutputResources...) - - require.Equal(t, expectedValues, resource.ComputedValues) - require.Equal(t, expectedSecrets, resource.SecretValues) - require.Equal(t, expectedOutputResources, resource.Properties.Status.OutputResources) - }) - - t.Run("failure - missing required values", func(t *testing.T) { - resource := &datamodel.SqlDatabase{} - options := processors.Options{RecipeOutput: &recipes.RecipeOutput{}} - - err := processor.Process(context.Background(), resource, options) - require.Error(t, err) - require.IsType(t, &processors.ValidationError{}, err) - require.Equal(t, `validation returned multiple errors: - -the connection value "database" should be provided by the recipe, set '.properties.database' to provide a value manually -the connection value "server" should be provided by the recipe, set '.properties.server' to provide a value manually -the connection value "port" should be provided by the recipe, set '.properties.port' to provide a value manually`, err.Error()) - - }) -} diff --git a/pkg/logging/logfields.go b/pkg/logging/logfields.go index ba82c6b47e..a2f59545fd 100644 --- a/pkg/logging/logfields.go +++ b/pkg/logging/logfields.go @@ -17,9 +17,7 @@ package logging const ( AppCoreLoggerName string = "applications.core" - AppLinkLoggerName string = "applications.link" - - ServiceName string = "rp" + ServiceName string = "rp" ) // Field names for structured logging diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go index 251a4aef3e..00d6eeb5c6 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go @@ -20,8 +20,8 @@ import ( "fmt" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -73,24 +73,24 @@ func fromProvisioningStateDataModel(state v1.ProvisioningState) *ProvisioningSta return &converted } -func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (linkrp.ResourceProvisioning, error) { +func toResourceProvisiongDataModel(provisioning *ResourceProvisioning) (portableresources.ResourceProvisioning, error) { if provisioning == nil { - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil } switch *provisioning { case ResourceProvisioningManual: - return linkrp.ResourceProvisioningManual, nil + return portableresources.ResourceProvisioningManual, nil case ResourceProvisioningRecipe: - return linkrp.ResourceProvisioningRecipe, nil + return portableresources.ResourceProvisioningRecipe, nil default: return "", &v1.ErrModelConversion{PropertyName: "$.properties.resourceProvisioning", ValidValue: fmt.Sprintf("one of %s", PossibleResourceProvisioningValues())} } } -func fromResourceProvisioningDataModel(provisioning linkrp.ResourceProvisioning) *ResourceProvisioning { +func fromResourceProvisioningDataModel(provisioning portableresources.ResourceProvisioning) *ResourceProvisioning { var converted ResourceProvisioning switch provisioning { - case linkrp.ResourceProvisioningManual: + case portableresources.ResourceProvisioningManual: converted = ResourceProvisioningManual default: converted = ResourceProvisioningRecipe @@ -110,13 +110,13 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { } } -func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { - return linkrp.LinkRecipe{ + return portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, } } - recipe := linkrp.LinkRecipe{} + recipe := portableresources.LinkRecipe{} if r.Name == nil { recipe.Name = v20220315privatepreview.DefaultRecipeName } else { @@ -128,27 +128,27 @@ func toRecipeDataModel(r *Recipe) linkrp.LinkRecipe { return recipe } -func fromRecipeDataModel(r linkrp.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, } } -func toResourcesDataModel(r []*ResourceReference) []*linkrp.ResourceReference { +func toResourcesDataModel(r []*ResourceReference) []*portableresources.ResourceReference { if r == nil { return nil } - resources := make([]*linkrp.ResourceReference, len(r)) + resources := make([]*portableresources.ResourceReference, len(r)) for i, resource := range r { - resources[i] = &linkrp.ResourceReference{ + resources[i] = &portableresources.ResourceReference{ ID: to.String(resource.ID), } } return resources } -func fromResourcesDataModel(r []*linkrp.ResourceReference) []*ResourceReference { +func fromResourcesDataModel(r []*portableresources.ResourceReference) []*ResourceReference { if r == nil { return nil } diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go index 1e6c38fc52..9507919e4a 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go @@ -20,8 +20,8 @@ import ( "testing" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/project-radius/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -117,11 +117,11 @@ func TestFromSystemDataModel(t *testing.T) { func TestToRecipeDataModel(t *testing.T) { testset := []struct { versioned *Recipe - datamodel linkrp.LinkRecipe + datamodel portableresources.LinkRecipe }{ { nil, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, }, }, @@ -132,7 +132,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: "test", Parameters: map[string]any{ "foo": "bar", @@ -145,7 +145,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - linkrp.LinkRecipe{ + portableresources.LinkRecipe{ Name: v20220315privatepreview.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", @@ -161,15 +161,15 @@ func TestToRecipeDataModel(t *testing.T) { func TestFromResourcesDataModel(t *testing.T) { testset := []struct { - DMResources []*linkrp.ResourceReference + DMResources []*portableresources.ResourceReference VersionedResources []*ResourceReference }{ { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, + DMResources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, }, { - DMResources: []*linkrp.ResourceReference{}, + DMResources: []*portableresources.ResourceReference{}, VersionedResources: []*ResourceReference{}, }, } @@ -183,15 +183,15 @@ func TestFromResourcesDataModel(t *testing.T) { func TestToResourcesDataModel(t *testing.T) { testset := []struct { - DMResources []*linkrp.ResourceReference + DMResources []*portableresources.ResourceReference VersionedResources []*ResourceReference }{ { - DMResources: []*linkrp.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, + DMResources: []*portableresources.ResourceReference{{ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1"}}, VersionedResources: []*ResourceReference{{ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache")}, {ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Microsoft.Cache/Redis/testCache1")}}, }, { - DMResources: []*linkrp.ResourceReference{}, + DMResources: []*portableresources.ResourceReference{}, VersionedResources: []*ResourceReference{}, }, } diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go index 05dd39b4a3..53f4a38d14 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go @@ -18,8 +18,8 @@ package v20220315privatepreview import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" ) @@ -55,7 +55,7 @@ func (src *RabbitMQQueueResource) ConvertTo() (v1.DataModelInterface, error) { return nil, err } - if converted.Properties.ResourceProvisioning != linkrp.ResourceProvisioningManual { + if converted.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { converted.Properties.Recipe = toRecipeDataModel(properties.Recipe) } converted.Properties.Resources = toResourcesDataModel(properties.Resources) @@ -109,7 +109,7 @@ func (dst *RabbitMQQueueResource) ConvertFrom(src v1.DataModelInterface) error { Resources: fromResourcesDataModel(rabbitmq.Properties.Resources), TLS: to.Ptr(rabbitmq.Properties.TLS), } - if rabbitmq.Properties.ResourceProvisioning == linkrp.ResourceProvisioningRecipe { + if rabbitmq.Properties.ResourceProvisioning == portableresources.ResourceProvisioningRecipe { dst.Properties.Recipe = fromRecipeDataModel(rabbitmq.Properties.Recipe) } return nil diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go index bc3c69d677..8644272dbe 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go @@ -21,8 +21,8 @@ import ( "testing" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" "github.com/project-radius/radius/test/testutil" @@ -44,7 +44,7 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", Name: "rabbitmq0", - Type: linkrp.N_RabbitMQQueuesResourceType, + Type: portableresources.RabbitMQQueuesResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -62,7 +62,7 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningManual, + ResourceProvisioning: portableresources.ResourceProvisioningManual, Queue: "testQueue", Host: "test-host", VHost: "test-vhost", @@ -84,7 +84,7 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel(t *testing.T) { TrackedResource: v1.TrackedResource{ ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", Name: "rabbitmq0", - Type: linkrp.N_RabbitMQQueuesResourceType, + Type: portableresources.RabbitMQQueuesResourceType, Location: v1.LocationGlobal, Tags: map[string]string{ "env": "dev", @@ -102,9 +102,9 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel(t *testing.T) { Application: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/applications/test-app", Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, - ResourceProvisioning: linkrp.ResourceProvisioningRecipe, + ResourceProvisioning: portableresources.ResourceProvisioningRecipe, TLS: false, - Recipe: linkrp.LinkRecipe{ + Recipe: portableresources.LinkRecipe{ Name: "rabbitmq", Parameters: map[string]any{ "foo": "bar", @@ -163,7 +163,7 @@ func TestRabbitMQQueue_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0"), Name: to.Ptr("rabbitmq0"), - Type: to.Ptr(linkrp.N_RabbitMQQueuesResourceType), + Type: to.Ptr(portableresources.RabbitMQQueuesResourceType), }, }, { @@ -195,7 +195,7 @@ func TestRabbitMQQueue_ConvertDataModelToVersioned(t *testing.T) { }, ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0"), Name: to.Ptr("rabbitmq0"), - Type: to.Ptr(linkrp.N_RabbitMQQueuesResourceType), + Type: to.Ptr(portableresources.RabbitMQQueuesResourceType), }, }, } diff --git a/pkg/messagingrp/datamodel/rabbitmq.go b/pkg/messagingrp/datamodel/rabbitmq.go index 30d1ead1c3..9f00dfb0a7 100644 --- a/pkg/messagingrp/datamodel/rabbitmq.go +++ b/pkg/messagingrp/datamodel/rabbitmq.go @@ -21,20 +21,20 @@ import ( "strings" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/linkrp" - linkrp_dm "github.com/project-radius/radius/pkg/linkrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" + pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) -// RabbitMQQueue represents RabbitMQQueue link resource. +// RabbitMQQueue represents RabbitMQQueue portable resource. type RabbitMQQueue struct { v1.BaseResource // Properties is the properties of the resource. Properties RabbitMQQueueProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all link types. - linkrp_dm.LinkMetadata + // LinkMetadata represents internal DataModel properties common to all portable resource types. + pr_dm.LinkMetadata } // ApplyDeploymentOutput updates the RabbitMQQueue instance with the DeployedOutputResources from the @@ -56,22 +56,22 @@ func (r *RabbitMQQueue) ResourceMetadata() *rpv1.BasicResourceProperties { // ResourceTypeName returns the resource type name for RabbitMQ queues. func (rabbitmq *RabbitMQQueue) ResourceTypeName() string { - return linkrp.N_RabbitMQQueuesResourceType + return portableresources.RabbitMQQueuesResourceType } // RabbitMQQueueProperties represents the properties of RabbitMQQueue response resource. type RabbitMQQueueProperties struct { rpv1.BasicResourceProperties - Queue string `json:"queue,omitempty"` - Host string `json:"host,omitempty"` - Port int32 `json:"port,omitempty"` - VHost string `json:"vHost,omitempty"` - Username string `json:"username,omitempty"` - Resources []*linkrp.ResourceReference `json:"resources,omitempty"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` - Secrets RabbitMQSecrets `json:"secrets,omitempty"` - ResourceProvisioning linkrp.ResourceProvisioning `json:"resourceProvisioning,omitempty"` - TLS bool `json:"tls,omitempty"` + Queue string `json:"queue,omitempty"` + Host string `json:"host,omitempty"` + Port int32 `json:"port,omitempty"` + VHost string `json:"vHost,omitempty"` + Username string `json:"username,omitempty"` + Resources []*portableresources.ResourceReference `json:"resources,omitempty"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Secrets RabbitMQSecrets `json:"secrets,omitempty"` + ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` + TLS bool `json:"tls,omitempty"` } // Secrets values consisting of secrets provided for the resource @@ -82,13 +82,13 @@ type RabbitMQSecrets struct { // ResourceTypeName returns the resource type name for RabbitMQ queues. func (rabbitmq RabbitMQSecrets) ResourceTypeName() string { - return linkrp.N_RabbitMQQueuesResourceType + return portableresources.RabbitMQQueuesResourceType } // Recipe returns the recipe for the RabbitMQQueue. It gets the LinkRecipe associated with the RabbitMQQueue instance // if the ResourceProvisioning is not set to Manual, otherwise it returns nil. -func (r *RabbitMQQueue) Recipe() *linkrp.LinkRecipe { - if r.Properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { +func (r *RabbitMQQueue) Recipe() *portableresources.LinkRecipe { + if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } return &r.Properties.Recipe @@ -98,9 +98,9 @@ func (r *RabbitMQQueue) Recipe() *linkrp.LinkRecipe { func (rabbitmq *RabbitMQQueue) VerifyInputs() error { properties := rabbitmq.Properties msgs := []string{} - if properties.ResourceProvisioning != "" && properties.ResourceProvisioning == linkrp.ResourceProvisioningManual { + if properties.ResourceProvisioning != "" && properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { if properties.Queue == "" { - return &v1.ErrClientRP{Code: "Bad Request", Message: fmt.Sprintf("queue is required when resourceProvisioning is %s", linkrp.ResourceProvisioningManual)} + return &v1.ErrClientRP{Code: "Bad Request", Message: fmt.Sprintf("queue is required when resourceProvisioning is %s", portableresources.ResourceProvisioningManual)} } if properties.Host == "" { msgs = append(msgs, "host must be specified when resourceProvisioning is set to manual") diff --git a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go index 80800135fc..115281a777 100644 --- a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go +++ b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go @@ -23,9 +23,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/renderers" msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" msg_conv "github.com/project-radius/radius/pkg/messagingrp/datamodel/converter" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) var _ ctrl.Controller = (*ListSecretsRabbitMQQueue)(nil) diff --git a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go index dc7130e104..1f4f4975d1 100644 --- a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go +++ b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go @@ -27,8 +27,8 @@ import ( "github.com/golang/mock/gomock" ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/linkrp/renderers" "github.com/project-radius/radius/pkg/messagingrp/api/v20220315privatepreview" + "github.com/project-radius/radius/pkg/portableresources/renderers" "github.com/project-radius/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/messagingrp/processors/rabbitmqqueues/processor.go b/pkg/messagingrp/processors/rabbitmqqueues/processor.go index c9ebded77a..90422a60ef 100644 --- a/pkg/messagingrp/processors/rabbitmqqueues/processor.go +++ b/pkg/messagingrp/processors/rabbitmqqueues/processor.go @@ -20,9 +20,9 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/renderers" msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources/processors" + "github.com/project-radius/radius/pkg/portableresources/renderers" ) const ( diff --git a/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go b/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go index a9a7a1c0cf..a49bf419b9 100644 --- a/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go +++ b/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go @@ -18,8 +18,8 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/stretchr/testify/require" diff --git a/pkg/linkrp/api/v20220315privatepreview/util.go b/pkg/portableresources/api/v20220315privatepreview/util.go similarity index 85% rename from pkg/linkrp/api/v20220315privatepreview/util.go rename to pkg/portableresources/api/v20220315privatepreview/util.go index 880eb0cf42..43bad67e57 100644 --- a/pkg/linkrp/api/v20220315privatepreview/util.go +++ b/pkg/portableresources/api/v20220315privatepreview/util.go @@ -20,6 +20,10 @@ import ( "time" ) +// DefaultRecipeName represents the default recipe name. +const DefaultRecipeName = "default" + +// TODO: To be moved to a common package armrpc/api/v1 // UnmarshalTimeString unmarshals a string representation of a time in RFC3339 format into a time.Time object. func UnmarshalTimeString(ts string) *time.Time { var tt timeRFC3339 diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/types.go b/pkg/portableresources/api/v20220315privatepreview/util_test.go similarity index 51% rename from pkg/datastoresrp/frontend/controller/rediscaches/types.go rename to pkg/portableresources/api/v20220315privatepreview/util_test.go index 17e9f7961a..c96f73f120 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/types.go +++ b/pkg/portableresources/api/v20220315privatepreview/util_test.go @@ -14,9 +14,25 @@ See the License for the specific language governing permissions and limitations under the License. */ -package rediscaches +package v20220315privatepreview -const ( - // User defined operation names - OperationListSecret = "LISTSECRETS" +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" ) + +// TODO: To be moved to a common package armrpc/api/v1 +func TestUnmarshalTimeString(t *testing.T) { + parsedTime := UnmarshalTimeString("2021-09-24T19:09:00.000000Z") + require.NotNil(t, parsedTime) + + require.Equal(t, 2021, parsedTime.Year()) + require.Equal(t, time.Month(9), parsedTime.Month()) + require.Equal(t, 24, parsedTime.Day()) + + parsedTime = UnmarshalTimeString("") + require.NotNil(t, parsedTime) + require.Equal(t, 1, parsedTime.Year()) +} diff --git a/pkg/linkrp/api/v20220315privatepreview/version.go b/pkg/portableresources/api/v20220315privatepreview/version.go similarity index 100% rename from pkg/linkrp/api/v20220315privatepreview/version.go rename to pkg/portableresources/api/v20220315privatepreview/version.go diff --git a/pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go similarity index 97% rename from pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go rename to pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go index 30ea6fa1d0..7a36699595 100644 --- a/pkg/linkrp/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ b/pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go @@ -19,7 +19,7 @@ import ( "time" ) - +// TODO: Code to be moved to a common package armrpc/api/v1 const ( utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` diff --git a/pkg/linkrp/backend/controller/createorupdateresource.go b/pkg/portableresources/backend/controller/createorupdateresource.go similarity index 96% rename from pkg/linkrp/backend/controller/createorupdateresource.go rename to pkg/portableresources/backend/controller/createorupdateresource.go index 56da670549..b5e98a11bf 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource.go +++ b/pkg/portableresources/backend/controller/createorupdateresource.go @@ -21,8 +21,8 @@ import ( "errors" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources/datamodel" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" "github.com/project-radius/radius/pkg/recipes/engine" @@ -30,7 +30,7 @@ import ( "github.com/project-radius/radius/pkg/ucp/store" ) -// CreateOrUpdateResource is the async operation controller to create or update Applications.Link resources. +// CreateOrUpdateResource is the async operation controller to create or update portable resources. type CreateOrUpdateResource[P interface { *T rpv1.RadiusResourceModel diff --git a/pkg/linkrp/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go similarity index 96% rename from pkg/linkrp/backend/controller/createorupdateresource_test.go rename to pkg/portableresources/backend/controller/createorupdateresource_test.go index 587e2210f5..e9f00f4319 100644 --- a/pkg/linkrp/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -28,9 +28,9 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/datamodel" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" "github.com/project-radius/radius/pkg/recipes/engine" @@ -49,7 +49,7 @@ const ( type TestResource struct { v1.BaseResource - // LinkMetadata represents internal DataModel properties common to all link types. + // LinkMetadata represents internal DataModel properties common to all portable resource types. datamodel.LinkMetadata // Properties is the properties of the resource. @@ -76,14 +76,14 @@ func (r *TestResource) ResourceMetadata() *rpv1.BasicResourceProperties { } // Recipe returns a pointer to the LinkRecipe stored in the Properties field of the TestResource struct. -func (t *TestResource) Recipe() *linkrp.LinkRecipe { +func (t *TestResource) Recipe() *portableresources.LinkRecipe { return &t.Properties.Recipe } type TestResourceProperties struct { rpv1.BasicResourceProperties - IsProcessed bool `json:"isProcessed"` - Recipe linkrp.LinkRecipe `json:"recipe,omitempty"` + IsProcessed bool `json:"isProcessed"` + Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` } type SuccessProcessor struct { diff --git a/pkg/linkrp/backend/controller/deleteresource.go b/pkg/portableresources/backend/controller/deleteresource.go similarity index 71% rename from pkg/linkrp/backend/controller/deleteresource.go rename to pkg/portableresources/backend/controller/deleteresource.go index 88f5b1d65a..579e2014a5 100644 --- a/pkg/linkrp/backend/controller/deleteresource.go +++ b/pkg/portableresources/backend/controller/deleteresource.go @@ -23,12 +23,12 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - corerp_dm "github.com/project-radius/radius/pkg/corerp/datamodel" + ext_dm "github.com/project-radius/radius/pkg/corerp/datamodel" dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/datamodel" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/engine" rpv1 "github.com/project-radius/radius/pkg/rp/v1" @@ -37,7 +37,7 @@ import ( var _ ctrl.Controller = (*DeleteResource)(nil) -// DeleteResource is the async operation controller to delete Applications.Link resource. +// DeleteResource is the async operation controller to delete a portable resource. type DeleteResource struct { ctrl.BaseController engine engine.Engine @@ -106,38 +106,22 @@ func (c *DeleteResource) Run(ctx context.Context, request *ctrl.Request) (ctrl.R func getDataModel(id resources.ID) (v1.ResourceDataModel, error) { resourceType := strings.ToLower(id.Type()) switch resourceType { - case strings.ToLower(linkrp.MongoDatabasesResourceType): - return &datamodel.MongoDatabase{}, nil - case strings.ToLower(linkrp.RedisCachesResourceType): - return &datamodel.RedisCache{}, nil - case strings.ToLower(linkrp.SqlDatabasesResourceType): - return &datamodel.SqlDatabase{}, nil - case strings.ToLower(linkrp.DaprStateStoresResourceType): - return &datamodel.DaprStateStore{}, nil - case strings.ToLower(linkrp.RabbitMQMessageQueuesResourceType): - return &datamodel.RabbitMQMessageQueue{}, nil - case strings.ToLower(linkrp.DaprSecretStoresResourceType): - return &datamodel.DaprSecretStore{}, nil - case strings.ToLower(linkrp.DaprPubSubBrokersResourceType): - return &datamodel.DaprPubSubBroker{}, nil - case strings.ToLower(linkrp.ExtendersResourceType): - return &datamodel.Extender{}, nil - case strings.ToLower(linkrp.N_MongoDatabasesResourceType): + case strings.ToLower(portableresources.MongoDatabasesResourceType): return &ds_dm.MongoDatabase{}, nil - case strings.ToLower(linkrp.N_RedisCachesResourceType): + case strings.ToLower(portableresources.RedisCachesResourceType): return &ds_dm.RedisCache{}, nil - case strings.ToLower(linkrp.N_SqlDatabasesResourceType): + case strings.ToLower(portableresources.SqlDatabasesResourceType): return &ds_dm.SqlDatabase{}, nil - case strings.ToLower(linkrp.N_DaprStateStoresResourceType): + case strings.ToLower(portableresources.DaprStateStoresResourceType): return &dapr_dm.DaprStateStore{}, nil - case strings.ToLower(linkrp.N_RabbitMQQueuesResourceType): + case strings.ToLower(portableresources.RabbitMQQueuesResourceType): return &msg_dm.RabbitMQQueue{}, nil - case strings.ToLower(linkrp.N_DaprSecretStoresResourceType): + case strings.ToLower(portableresources.DaprSecretStoresResourceType): return &dapr_dm.DaprSecretStore{}, nil - case strings.ToLower(linkrp.N_DaprPubSubBrokersResourceType): + case strings.ToLower(portableresources.DaprPubSubBrokersResourceType): return &dapr_dm.DaprPubSubBroker{}, nil - case strings.ToLower(linkrp.N_ExtendersResourceType): - return &corerp_dm.Extender{}, nil + case strings.ToLower(portableresources.ExtendersResourceType): + return &ext_dm.Extender{}, nil default: return nil, fmt.Errorf("async delete operation unsupported on resource type: %q. Resource ID: %q", resourceType, id.String()) } diff --git a/pkg/linkrp/backend/controller/deleteresource_test.go b/pkg/portableresources/backend/controller/deleteresource_test.go similarity index 92% rename from pkg/linkrp/backend/controller/deleteresource_test.go rename to pkg/portableresources/backend/controller/deleteresource_test.go index 1169286441..2b6f45f12f 100644 --- a/pkg/linkrp/backend/controller/deleteresource_test.go +++ b/pkg/portableresources/backend/controller/deleteresource_test.go @@ -42,7 +42,7 @@ var outputResource = rpv1.OutputResource{ } func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { - resourceID := "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/mongoDatabases/mongo0" + resourceID := "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0" setupTest := func(tb testing.TB) (func(tb testing.TB), *store.MockStorageClient, *ctrl.Request, *engine.MockEngine) { mctrl := gomock.NewController(t) @@ -51,7 +51,7 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { req := &ctrl.Request{ OperationID: uuid.New(), - OperationType: "APPLICATIONS.LINK/MONGODATABASES|DELETE", + OperationType: "APPLICATIONS.DATASTORES/MONGODATABASES|DELETE", ResourceID: resourceID, CorrelationID: uuid.NewString(), OperationTimeout: &ctrl.DefaultAsyncOperationTimeout, @@ -158,8 +158,8 @@ func TestDeleteResourceRunInvalidResourceType_20220315PrivatePreview(t *testing. req := &ctrl.Request{ OperationID: uuid.New(), - OperationType: "APPLICATIONS.LINK/INVALID|DELETE", - ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/invalidType/invalid", + OperationType: "APPLICATIONS.DAPR/INVALID|DELETE", + ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/invalidType/invalid", CorrelationID: uuid.NewString(), OperationTimeout: &ctrl.DefaultAsyncOperationTimeout, } @@ -189,6 +189,6 @@ func TestDeleteResourceRunInvalidResourceType_20220315PrivatePreview(t *testing. _, err = ctrl.Run(context.Background(), req) require.Error(t, err) - require.Equal(t, "async delete operation unsupported on resource type: \"applications.link/invalidtype\". Resource ID: \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Link/invalidType/invalid\"", err.Error()) + require.Equal(t, "async delete operation unsupported on resource type: \"applications.dapr/invalidtype\". Resource ID: \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/invalidType/invalid\"", err.Error()) }) } diff --git a/pkg/linkrp/backend/service.go b/pkg/portableresources/backend/service.go similarity index 59% rename from pkg/linkrp/backend/service.go rename to pkg/portableresources/backend/service.go index 899bc6e009..3edb43196f 100644 --- a/pkg/linkrp/backend/service.go +++ b/pkg/portableresources/backend/service.go @@ -32,20 +32,11 @@ import ( mongo_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/mongodatabases" redis_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/rediscaches" sql_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/sqldatabases" - "github.com/project-radius/radius/pkg/linkrp" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/frontend/handler" - "github.com/project-radius/radius/pkg/linkrp/processors" - "github.com/project-radius/radius/pkg/linkrp/processors/daprpubsubbrokers" - "github.com/project-radius/radius/pkg/linkrp/processors/daprsecretstores" - "github.com/project-radius/radius/pkg/linkrp/processors/daprstatestores" - "github.com/project-radius/radius/pkg/linkrp/processors/extenders" - "github.com/project-radius/radius/pkg/linkrp/processors/mongodatabases" - "github.com/project-radius/radius/pkg/linkrp/processors/rabbitmqmessagequeues" - "github.com/project-radius/radius/pkg/linkrp/processors/rediscaches" - "github.com/project-radius/radius/pkg/linkrp/processors/sqldatabases" msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" "github.com/project-radius/radius/pkg/messagingrp/processors/rabbitmqqueues" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/portableresources/frontend/handler" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/configloader" @@ -55,7 +46,7 @@ import ( "github.com/project-radius/radius/pkg/sdk/clients" ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - backend_ctrl "github.com/project-radius/radius/pkg/linkrp/backend/controller" + backend_ctrl "github.com/project-radius/radius/pkg/portableresources/backend/controller" "github.com/project-radius/radius/pkg/ucp/secret/provider" ) @@ -69,14 +60,14 @@ func NewService(options hostoptions.HostOptions) *Service { return &Service{ worker.Service{ Options: options, - ProviderName: handler.LinkProviderNamespace, + ProviderName: handler.PortableResourcesNamespace, }, } } -// Name returns a string containing the namespace of the LinkProvider. +// Name returns a string containing the namespace of the Resource Provider. func (s *Service) Name() string { - return fmt.Sprintf("%s async worker", handler.LinkProviderNamespace) + return fmt.Sprintf("%s async worker", handler.PortableResourcesNamespace) } // Run initializes the service and registers controllers for each resource type to handle create/update/delete operations. @@ -115,65 +106,31 @@ func (s *Service) Run(ctx context.Context) error { TypeName string CreatePutController func(options ctrl.Options) (ctrl.Controller, error) }{ - {linkrp.MongoDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &mongodatabases.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.MongoDatabase, datamodel.MongoDatabase](processor, engine, client, configLoader, options) - }}, - {linkrp.RedisCachesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &rediscaches.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.RedisCache, datamodel.RedisCache](processor, engine, client, configLoader, options) - }}, - {linkrp.SqlDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &sqldatabases.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.SqlDatabase, datamodel.SqlDatabase](processor, engine, client, configLoader, options) - }}, - {linkrp.RabbitMQMessageQueuesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &rabbitmqmessagequeues.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.RabbitMQMessageQueue, datamodel.RabbitMQMessageQueue](processor, engine, client, configLoader, options) - }}, - {linkrp.DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &daprstatestores.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.DaprStateStore, datamodel.DaprStateStore](processor, engine, client, configLoader, options) - }}, - {linkrp.DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &daprsecretstores.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.DaprSecretStore, datamodel.DaprSecretStore](processor, engine, client, configLoader, options) - }}, - {linkrp.DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &daprpubsubbrokers.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.DaprPubSubBroker, datamodel.DaprPubSubBroker](processor, engine, client, configLoader, options) - }}, - {linkrp.ExtendersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &extenders.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](processor, engine, client, configLoader, options) - }}, - - // Updates for Spliting Linkrp Namespace - {linkrp.N_RabbitMQQueuesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.RabbitMQQueuesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &rabbitmqqueues.Processor{} return backend_ctrl.NewCreateOrUpdateResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, client, configLoader, options) }}, - {linkrp.N_DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &statestores.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, client, configLoader, options) }}, - {linkrp.N_DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &secretstores.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, client, configLoader, options) }}, - {linkrp.N_DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &pubsubbrokers.Processor{Client: s.KubeClient} return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, client, configLoader, options) }}, - {linkrp.N_MongoDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.MongoDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &mongo_prc.Processor{} return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](processor, engine, client, configLoader, options) }}, - {linkrp.N_RedisCachesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.RedisCachesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &redis_prc.Processor{} return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.RedisCache, ds_dm.RedisCache](processor, engine, client, configLoader, options) }}, - {linkrp.N_SqlDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { + {portableresources.SqlDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &sql_prc.Processor{} return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](processor, engine, client, configLoader, options) }}, diff --git a/pkg/linkrp/datamodel/doc.go b/pkg/portableresources/datamodel/doc.go similarity index 86% rename from pkg/linkrp/datamodel/doc.go rename to pkg/portableresources/datamodel/doc.go index 81ecd10f0b..f56e857b98 100644 --- a/pkg/linkrp/datamodel/doc.go +++ b/pkg/portableresources/datamodel/doc.go @@ -15,7 +15,7 @@ limitations under the License. */ // This is the version nuetral data model. Structures present in this package must be used internally. -// API version specific models should be exist under /pkg/linkrp/api. This api package should be able +// API version specific models should be exist under /pkg/portableresources/api. This api package should be able // to convert among the versions. package datamodel diff --git a/pkg/linkrp/datamodel/linkmetadata.go b/pkg/portableresources/datamodel/linkmetadata.go similarity index 70% rename from pkg/linkrp/datamodel/linkmetadata.go rename to pkg/portableresources/datamodel/linkmetadata.go index ac02d56066..46fee4597b 100644 --- a/pkg/linkrp/datamodel/linkmetadata.go +++ b/pkg/portableresources/datamodel/linkmetadata.go @@ -17,11 +17,11 @@ limitations under the License. package datamodel import ( - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) -// LinkMetadata represents internal DataModel properties common to all link types. +// LinkMetadata represents internal DataModel properties common to all portable resource types. type LinkMetadata struct { // ComputedValues map is any resource values that will be needed for more operations. // For example; database name to generate secrets for cosmos DB. @@ -30,18 +30,18 @@ type LinkMetadata struct { // Stores action to retrieve secret values. For Azure, connectionstring is accessed through cosmos listConnectionString operation, if secrets are not provided as input SecretValues map[string]rpv1.SecretValueReference `json:"secretValues,omitempty"` - RecipeData linkrp.RecipeData `json:"recipeData,omitempty"` + RecipeData portableresources.RecipeData `json:"recipeData,omitempty"` } -// LinkMode specifies how to build a Link. Options are to build automatically via ‘recipe’ or ‘resource’, or build manually via ‘values’. Selection determines which set of fields to additionally require. +// LinkMode specifies how to build a portable resource. Options are to build automatically via ‘recipe’ or ‘resource’, or build manually via ‘values’. Selection determines which set of fields to additionally require. type LinkMode string const ( - // LinkModeRecipe is the recipe mode for link deployment + // LinkModeRecipe is the recipe mode for portable resource deployment LinkModeRecipe LinkMode = "recipe" - // LinkModeResource is the resource mode for link deployment + // LinkModeResource is the resource mode for portable resource deployment LinkModeResource LinkMode = "resource" - // LinkModeResource is the values mode for link deployment + // LinkModeResource is the values mode for portable resource deployment LinkModeValues LinkMode = "values" // RecipeContextParameter is the parameter context for recipe deployment RecipeContextParameter string = "context" diff --git a/pkg/linkrp/datamodel/recipes.go b/pkg/portableresources/datamodel/recipes.go similarity index 81% rename from pkg/linkrp/datamodel/recipes.go rename to pkg/portableresources/datamodel/recipes.go index 4b1ae33136..cf756cabee 100644 --- a/pkg/linkrp/datamodel/recipes.go +++ b/pkg/portableresources/datamodel/recipes.go @@ -15,17 +15,17 @@ limitations under the License. */ // This is the version nuetral data model. Structures present in this package must be used internally. -// API version specific models should be exist under /pkg/linkrp/api. This api package should be able +// API version specific models should be exist under /pkg/portableresources/api. This api package should be able // to convert among the versions. package datamodel import ( - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" ) // RecipeDataModel should be implemented on the datamodel of types that support recipes. type RecipeDataModel interface { // Recipe provides access to the user-specified recipe configuration. Can return nil. - Recipe() *linkrp.LinkRecipe + Recipe() *portableresources.LinkRecipe } diff --git a/pkg/linkrp/frontend/handler/getoperations.go b/pkg/portableresources/frontend/handler/getoperations.go similarity index 50% rename from pkg/linkrp/frontend/handler/getoperations.go rename to pkg/portableresources/frontend/handler/getoperations.go index cc2a746a6b..b9b32ccc33 100644 --- a/pkg/linkrp/frontend/handler/getoperations.go +++ b/pkg/portableresources/frontend/handler/getoperations.go @@ -23,7 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + v20220315privatepreview "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" ) var _ ctrl.Controller = (*GetOperations)(nil) @@ -48,333 +48,12 @@ func (opctrl *GetOperations) Run(ctx context.Context, w http.ResponseWriter, req return rest.NewOKResponse(opctrl.availableOperationsV1()), nil } - return rest.NewNotFoundAPIVersionResponse("operations", LinkProviderNamespace, sCtx.APIVersion), nil + return rest.NewNotFoundAPIVersionResponse("operations", PortableResourcesNamespace, sCtx.APIVersion), nil } func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { return &v1.PaginatedList{ Value: []any{ - &v1.Operation{ - Name: "Applications.Link/operations/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "operations", - Operation: "Get operations", - Description: "Get the list of operations.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/mongoDatabases/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "mongoDatabases", - Operation: "Get/List mongoDatabases", - Description: "Gets/Lists mongoDatabase link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/mongoDatabases/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "mongoDatabases", - Operation: "Create/Update mongoDatabases", - Description: "Creates or updates a mongo database link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/mongoDatabases/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "mongoDatabases", - Operation: "Delete mongoDatabase", - Description: "Deletes a mongoDatabase link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/mongoDatabases/listsecrets/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "mongoDatabases", - Operation: "List secrets", - Description: "Lists mongoDatabase secrets.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/register/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: LinkProviderNamespace, - Operation: "Register Applications.Link resource provider", - Description: "Registers 'Applications.Link' resource provider with a subscription.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/unregister/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "Applications.Link", - Operation: "Unregister 'Applications.Link' resource provider", - Description: "Unregisters 'Applications.Link' resource provider with a subscription.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/sqlDatabases/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "sqlDatabases", - Operation: "Get/List sqlDatabases", - Description: "Gets/Lists sqlDatabase link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/sqlDatabases/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "sqlDatabases", - Operation: "Create/Update sqlDatabases", - Description: "Creates or updates a sql database link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/sqlDatabases/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "sqlDatabases", - Operation: "Delete sqlDatabase", - Description: "Deletes a sqlDatabase link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/sqlDatabases/listsecrets/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "sqlDatabases", - Operation: "List secrets", - Description: "Lists sqlDatabase secrets.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/redisCaches/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "redisCaches", - Operation: "Get/List redisCaches", - Description: "Gets/Lists redisCache link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/redisCaches/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "redisCaches", - Operation: "Create/Update redisCaches", - Description: "Creates or updates a redisCache link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/redisCaches/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "redisCaches", - Operation: "Delete redisCache", - Description: "Deletes a redisCache link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/redisCaches/listsecrets/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "redisCaches", - Operation: "List secrets", - Description: "Lists redisCache secrets.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/rabbitMQMessageQueues/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "rabbitMQMessageQueues", - Operation: "Get/List rabbitMQMessageQueues", - Description: "Gets/Lists rabbitMQMessageQueue link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/rabbitMQMessageQueues/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "rabbitMQMessageQueues", - Operation: "Create/Update rabbitMQMessageQueues", - Description: "Creates or updates a rabbitMQMessageQueue link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/rabbitMQMessageQueues/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "rabbitMQMessageQueues", - Operation: "Delete rabbitMQMessageQueue", - Description: "Deletes a rabbitMQMessageQueue link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/rabbitMQMessageQueues/listsecrets/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "rabbitMQMessageQueues", - Operation: "List secrets", - Description: "Lists rabbitMQMessageQueue secrets.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/extenders/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "extenders", - Operation: "Get/List extenders", - Description: "Gets/Lists extender link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/extenders/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "extenders", - Operation: "Create/Update extenders", - Description: "Creates or updates a extender link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/extenders/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "extenders", - Operation: "Delete extender", - Description: "Deletes a extender link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/extenders/listsecrets/action", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "extenders", - Operation: "List secrets", - Description: "Lists extender secrets.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprSecretStores/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprSecretStores", - Operation: "Get/List daprSecretStores", - Description: "Gets/Lists daprSecretStore link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprSecretStores/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprSecretStores", - Operation: "Create/Update daprSecretStores", - Description: "Creates or updates a daprSecretStore link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprSecretStores/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprSecretStores", - Operation: "Delete daprSecretStore", - Description: "Deletes a daprSecretStore link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprStateStores/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprStateStores", - Operation: "Get/List daprStateStores", - Description: "Gets/Lists daprStateStore link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprStateStores/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprStateStores", - Operation: "Create/Update daprStateStores", - Description: "Creates or updates a daprStateStore link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprStateStores/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprStateStores", - Operation: "Delete daprStateStore", - Description: "Deletes a daprStateStore link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprPubSubBrokers/read", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprPubSubBrokers", - Operation: "Get/List daprPubSubBrokers", - Description: "Gets/Lists daprPubSubBroker link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprPubSubBrokers/write", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprPubSubBrokers", - Operation: "Create/Update daprPubSubBrokers", - Description: "Creates or updates a daprPubSubBroker link.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Link/daprPubSubBrokers/delete", - Display: &v1.OperationDisplayProperties{ - Provider: LinkProviderNamespace, - Resource: "daprPubSubBrokers", - Operation: "Delete daprPubSubBroker", - Description: "Deletes a daprPubSubBroker link.", - }, - IsDataAction: false, - }, - // Split Namespace Resources &v1.Operation{ Name: "Applications.Dapr/operations/read", Display: &v1.OperationDisplayProperties{ @@ -411,7 +90,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "mongoDatabases", Operation: "Get/List mongoDatabases", - Description: "Gets/Lists mongoDatabase link(s).", + Description: "Gets/Lists mongoDatabase resource(s).", }, IsDataAction: false, }, @@ -421,7 +100,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "mongoDatabases", Operation: "Create/Update mongoDatabases", - Description: "Creates or updates a mongo database link.", + Description: "Creates or updates a mongo database resource.", }, IsDataAction: false, }, @@ -431,7 +110,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "mongoDatabases", Operation: "Delete mongoDatabase", - Description: "Deletes a mongoDatabase link.", + Description: "Deletes a mongoDatabase resource.", }, IsDataAction: false, }, @@ -511,7 +190,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "sqlDatabases", Operation: "Get/List sqlDatabases", - Description: "Gets/Lists sqlDatabase link(s).", + Description: "Gets/Lists sqlDatabase resource(s).", }, IsDataAction: false, }, @@ -521,7 +200,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "sqlDatabases", Operation: "Create/Update sqlDatabases", - Description: "Creates or updates a sql database link.", + Description: "Creates or updates a sql database resource.", }, IsDataAction: false, }, @@ -531,7 +210,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "sqlDatabases", Operation: "Delete sqlDatabase", - Description: "Deletes a sqlDatabase link.", + Description: "Deletes a sqlDatabase resource.", }, IsDataAction: false, }, @@ -541,7 +220,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "redisCaches", Operation: "Get/List redisCaches", - Description: "Gets/Lists redisCache link(s).", + Description: "Gets/Lists redisCache resource(s).", }, IsDataAction: false, }, @@ -551,7 +230,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "redisCaches", Operation: "Create/Update redisCaches", - Description: "Creates or updates a redisCache link.", + Description: "Creates or updates a redisCache resource.", }, IsDataAction: false, }, @@ -561,7 +240,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DatastoresProviderNamespace, Resource: "redisCaches", Operation: "Delete redisCache", - Description: "Deletes a redisCache link.", + Description: "Deletes a redisCache resource.", }, IsDataAction: false, }, @@ -581,7 +260,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: MessagingProviderNamespace, Resource: "rabbitMQQueues", Operation: "Get/List rabbitMQQueues", - Description: "Gets/Lists rabbitMQQueue link(s).", + Description: "Gets/Lists rabbitMQQueue resource(s).", }, IsDataAction: false, }, @@ -591,7 +270,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: MessagingProviderNamespace, Resource: "rabbitMQQueues", Operation: "Create/Update rabbitMQQueues", - Description: "Creates or updates a rabbitMQQueue link.", + Description: "Creates or updates a rabbitMQQueue resource.", }, IsDataAction: false, }, @@ -601,7 +280,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: MessagingProviderNamespace, Resource: "rabbitMQQueues", Operation: "Delete rabbitMQQueue", - Description: "Deletes a rabbitMQQueue link.", + Description: "Deletes a rabbitMQQueue resource.", }, IsDataAction: false, }, @@ -621,7 +300,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprSecretStores", Operation: "Get/List daprSecretStores", - Description: "Gets/Lists daprSecretStore link(s).", + Description: "Gets/Lists daprSecretStore resource(s).", }, IsDataAction: false, }, @@ -631,7 +310,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprSecretStores", Operation: "Create/Update daprSecretStores", - Description: "Creates or updates a daprSecretStore link.", + Description: "Creates or updates a daprSecretStore resource.", }, IsDataAction: false, }, @@ -641,7 +320,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprSecretStores", Operation: "Delete daprSecretStore", - Description: "Deletes a daprSecretStore link.", + Description: "Deletes a daprSecretStore resource.", }, IsDataAction: false, }, @@ -651,7 +330,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprStateStores", Operation: "Get/List daprStateStores", - Description: "Gets/Lists daprStateStore link(s).", + Description: "Gets/Lists daprStateStore resource(s).", }, IsDataAction: false, }, @@ -661,7 +340,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprStateStores", Operation: "Create/Update daprStateStores", - Description: "Creates or updates a daprStateStore link.", + Description: "Creates or updates a daprStateStore resource.", }, IsDataAction: false, }, @@ -671,7 +350,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprStateStores", Operation: "Delete daprStateStore", - Description: "Deletes a daprStateStore link.", + Description: "Deletes a daprStateStore resource.", }, IsDataAction: false, }, @@ -681,7 +360,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprPubSubBrokers", Operation: "Get/List daprPubSubBrokers", - Description: "Gets/Lists daprPubSubBroker link(s).", + Description: "Gets/Lists daprPubSubBroker resource(s).", }, IsDataAction: false, }, @@ -691,7 +370,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprPubSubBrokers", Operation: "Create/Update daprPubSubBrokers", - Description: "Creates or updates a daprPubSubBroker link.", + Description: "Creates or updates a daprPubSubBroker resource.", }, IsDataAction: false, }, @@ -701,7 +380,7 @@ func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { Provider: DaprProviderNamespace, Resource: "daprPubSubBrokers", Operation: "Delete daprPubSubBroker", - Description: "Deletes a daprPubSubBroker link.", + Description: "Deletes a daprPubSubBroker resource.", }, IsDataAction: false, }, diff --git a/pkg/linkrp/frontend/handler/getoperations_test.go b/pkg/portableresources/frontend/handler/getoperations_test.go similarity index 92% rename from pkg/linkrp/frontend/handler/getoperations_test.go rename to pkg/portableresources/frontend/handler/getoperations_test.go index 2324bba775..c2adb9674f 100644 --- a/pkg/linkrp/frontend/handler/getoperations_test.go +++ b/pkg/portableresources/frontend/handler/getoperations_test.go @@ -24,7 +24,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/project-radius/radius/pkg/linkrp/api/v20220315privatepreview" + v20220315privatepreview "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/stretchr/testify/require" ) @@ -47,7 +47,7 @@ func TestRunWith20220315PrivatePreview(t *testing.T) { case *rest.OKResponse: pagination, ok := v.Body.(*v1.PaginatedList) require.True(t, ok) - require.Equal(t, 65, len(pagination.Value)) + require.Equal(t, 33, len(pagination.Value)) default: require.Truef(t, false, "should not return error") } diff --git a/pkg/portableresources/frontend/handler/routes.go b/pkg/portableresources/frontend/handler/routes.go new file mode 100644 index 0000000000..723175c1c8 --- /dev/null +++ b/pkg/portableresources/frontend/handler/routes.go @@ -0,0 +1,909 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package handler + +import ( + "context" + "time" + + "github.com/go-chi/chi/v5" + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + frontend_ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" + "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/project-radius/radius/pkg/armrpc/frontend/server" + "github.com/project-radius/radius/pkg/portableresources" + rp_frontend "github.com/project-radius/radius/pkg/rp/frontend" + "github.com/project-radius/radius/pkg/validator" + "github.com/project-radius/radius/swagger" + + dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" + dapr_conv "github.com/project-radius/radius/pkg/daprrp/datamodel/converter" + dapr_ctrl "github.com/project-radius/radius/pkg/daprrp/frontend/controller" + ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" + ds_conv "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" + ds_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller" + mongo_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/mongodatabases" + redis_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/rediscaches" + sql_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/sqldatabases" + msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" + msg_conv "github.com/project-radius/radius/pkg/messagingrp/datamodel/converter" + msg_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller" + rmq_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" +) + +const ( + // resourceGroupPath is the path for resource groups. + resourceGroupPath = "/resourcegroups/{resourceGroupName}" + + // PortableResourcesNamespace is the name representing group of portable resource providers. + PortableResourcesNamespace = "Applications.Datastores" + + // DaprProviderNamespace is the namespace for Dapr provider. + DaprProviderNamespace = "Applications.Dapr" + + // DatastoresProviderNamespace is the namespace for Datastores provider. + DatastoresProviderNamespace = "Applications.Datastores" + + // MessagingProviderNamespace is the namespace for Messaging provider. + MessagingProviderNamespace = "Applications.Messaging" + + // AsyncOperationRetryAfter is the polling interval for async create/update or delete resource operations. + AsyncOperationRetryAfter = time.Duration(5) * time.Second +) + +// AddRoutes configures routes and handlers for Datastores, Messaging, Dapr Resource Providers. +func AddRoutes(ctx context.Context, router chi.Router, isARM bool, ctrlOpts frontend_ctrl.Options) error { + rootScopePath := ctrlOpts.PathBase + rootScopePath += getRootScopePath(isARM) + + // URLs may use either the subscription/plane scope or resource group scope. + // These paths are order sensitive and the longer path MUST be registered first. + prefixes := []string{ + rootScopePath + resourceGroupPath, + rootScopePath, + } + + err := AddMessagingRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) + if err != nil { + return err + } + + err = AddDaprRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) + if err != nil { + return err + } + + err = AddDatastoresRoutes(ctx, router, rootScopePath, prefixes, isARM, ctrlOpts) + if err != nil { + return err + } + + return nil +} + +// AddMessagingRoutes configures the default ARM handlers and registers handlers for the RabbitMQQueue resource type for +// the List, Get, Put, Patch and Delete operations. +func AddMessagingRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { + // Configure the default ARM handlers. + err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, MessagingProviderNamespace, NewGetOperations, ctrlOpts) + if err != nil { + return err + } + + specLoader, err := validator.LoadSpec(ctx, MessagingProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") + if err != nil { + return err + } + + validator := validator.APIValidator(validator.Options{ + SpecLoader: specLoader, + ResourceTypeGetter: validator.RadiusResourceTypeGetter, + }) + + // Register resource routers. + // + // Note: We have to follow the below rules to enable API validators: + // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. + // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. + + // rabbitmqqueues router handlers: + rmqPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.messaging/rabbitmqqueues", validator) + rmqResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.messaging/rabbitmqqueues", validator) + rmqResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.messaging/rabbitmqqueues/{rabbitMQQueueName}", validator) + + // Messaging handlers: + handlerOptions := []server.HandlerOptions{ + { + ParentRouter: rmqPlaneRouter, + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ + RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, + ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: rmqResourceGroupRouter, + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ + RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, + ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, + }) + }, + }, + { + ParentRouter: rmqResourceRouter, + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ + RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, + ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, + }) + }, + }, + { + ParentRouter: rmqResourceRouter, + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ + RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, + ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[msg_dm.RabbitMQQueue]{ + rp_frontend.PrepareRadiusResource[*msg_dm.RabbitMQQueue], + }, + AsyncOperationTimeout: msg_ctrl.AsyncCreateOrUpdateRabbitMQTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: rmqResourceRouter, + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ + RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, + ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[msg_dm.RabbitMQQueue]{ + rp_frontend.PrepareRadiusResource[*msg_dm.RabbitMQQueue], + }, + AsyncOperationTimeout: msg_ctrl.AsyncCreateOrUpdateRabbitMQTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: rmqResourceRouter, + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[msg_dm.RabbitMQQueue]{ + RequestConverter: msg_conv.RabbitMQQueueDataModelFromVersioned, + ResponseConverter: msg_conv.RabbitMQQueueDataModelToVersioned, + AsyncOperationTimeout: msg_ctrl.AsyncDeleteRabbitMQTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: rmqResourceRouter, + Path: "/listsecrets", + ResourceType: portableresources.RabbitMQQueuesResourceType, + Method: rmq_ctrl.OperationListSecret, + ControllerFactory: rmq_ctrl.NewListSecretsRabbitMQQueue, + }, + } + + for _, h := range handlerOptions { + if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { + return err + } + } + + return nil +} + +// AddDaprRoutes configures the default ARM handlers and adds handlers for Dapr resources such as Dapr PubSubBroker, +// SecretStore and StateStore. It registers handlers for various operations on these resources. +func AddDaprRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { + + // Dapr - Configure the default ARM handlers. + err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, DaprProviderNamespace, NewGetOperations, ctrlOpts) + if err != nil { + return err + } + + specLoader, err := validator.LoadSpec(ctx, DaprProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") + if err != nil { + return err + } + + validator := validator.APIValidator(validator.Options{ + SpecLoader: specLoader, + ResourceTypeGetter: validator.RadiusResourceTypeGetter, + }) + + // Register resource routers. + // + // Note: We have to follow the below rules to enable API validators: + // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. + // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. + + pubsubPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/pubsubbrokers", validator) + pubsubResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers", validator) + pubsubResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/pubsubbrokers/{pubSubBrokerName}", validator) + + handlerOptions := []server.HandlerOptions{ + { + ParentRouter: pubsubPlaneRouter, + ResourceType: portableresources.DaprPubSubBrokersResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ + RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, + ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: pubsubResourceGroupRouter, + ResourceType: portableresources.DaprPubSubBrokersResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ + RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, + ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, + }) + }, + }, + { + ParentRouter: pubsubResourceRouter, + ResourceType: portableresources.DaprPubSubBrokersResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ + RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, + ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, + }) + }, + }, + { + ParentRouter: pubsubResourceRouter, + ResourceType: portableresources.DaprPubSubBrokersResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ + RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, + ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprPubSubBroker]{ + rp_frontend.PrepareRadiusResource[*dapr_dm.DaprPubSubBroker], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprPubSubBroker], + }, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: pubsubResourceRouter, + ResourceType: portableresources.DaprPubSubBrokersResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ + RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, + ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprPubSubBroker]{ + rp_frontend.PrepareRadiusResource[*dapr_dm.DaprPubSubBroker], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprPubSubBroker], + }, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: pubsubResourceRouter, + ResourceType: portableresources.DaprPubSubBrokersResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprPubSubBroker]{ + RequestConverter: dapr_conv.PubSubBrokerDataModelFromVersioned, + ResponseConverter: dapr_conv.PubSubBrokerDataModelToVersioned, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprPubSubBrokerTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + } + + secretStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/secretstores", validator) + secretStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores", validator) + secretStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/secretstores/{secretStoreName}", validator) + + handlerOptions = append(handlerOptions, []server.HandlerOptions{ + { + ParentRouter: secretStorePlaneRouter, + ResourceType: portableresources.DaprSecretStoresResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ + RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: secretStoreResourceGroupRouter, + ResourceType: portableresources.DaprSecretStoresResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ + RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, + }) + }, + }, + { + ParentRouter: secretStoreResourceRouter, + ResourceType: portableresources.DaprSecretStoresResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ + RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, + }) + }, + }, + { + ParentRouter: secretStoreResourceRouter, + ResourceType: portableresources.DaprSecretStoresResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ + RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprSecretStore]{ + rp_frontend.PrepareRadiusResource[*dapr_dm.DaprSecretStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprSecretStore], + }, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: secretStoreResourceRouter, + ResourceType: portableresources.DaprSecretStoresResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ + RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprSecretStore]{ + rp_frontend.PrepareRadiusResource[*dapr_dm.DaprSecretStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprSecretStore], + }, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprSecretStoreTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: secretStoreResourceRouter, + ResourceType: portableresources.DaprSecretStoresResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprSecretStore]{ + RequestConverter: dapr_conv.SecretStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.SecretStoreDataModelToVersioned, + AsyncOperationTimeout: dapr_ctrl.AsyncDeleteDaprSecretStoreTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + }...) + + stateStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.dapr/statestores", validator) + stateStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores", validator) + stateStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.dapr/statestores/{stateStoreName}", validator) + + handlerOptions = append(handlerOptions, []server.HandlerOptions{ + { + ParentRouter: stateStorePlaneRouter, + ResourceType: portableresources.DaprStateStoresResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ + RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: stateStoreResourceGroupRouter, + ResourceType: portableresources.DaprStateStoresResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ + RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, + }) + }, + }, + { + ParentRouter: stateStoreResourceRouter, + ResourceType: portableresources.DaprStateStoresResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ + RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, + }) + }, + }, + { + ParentRouter: stateStoreResourceRouter, + ResourceType: portableresources.DaprStateStoresResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ + RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprStateStore]{ + rp_frontend.PrepareRadiusResource[*dapr_dm.DaprStateStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprStateStore], + }, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: stateStoreResourceRouter, + ResourceType: portableresources.DaprStateStoresResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ + RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[dapr_dm.DaprStateStore]{ + rp_frontend.PrepareRadiusResource[*dapr_dm.DaprStateStore], + rp_frontend.PrepareDaprResource[*dapr_dm.DaprStateStore], + }, + AsyncOperationTimeout: dapr_ctrl.AsyncCreateOrUpdateDaprStateStoreTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: stateStoreResourceRouter, + ResourceType: portableresources.DaprStateStoresResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[dapr_dm.DaprStateStore]{ + RequestConverter: dapr_conv.StateStoreDataModelFromVersioned, + ResponseConverter: dapr_conv.StateStoreDataModelToVersioned, + AsyncOperationTimeout: dapr_ctrl.AsyncDeleteDaprStateStoreTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + }...) + + for _, h := range handlerOptions { + if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { + return err + } + } + + return nil +} + +// AddDatastoresRoutes configures the routes and handlers for Datastores Resource Provider. It registers handlers for List, Get, Put, +// Patch, and Delete operations for MongoDatabase, RedisCache, and SqlDatabase resources. +func AddDatastoresRoutes(ctx context.Context, r chi.Router, rootScopePath string, prefixes []string, isARM bool, ctrlOpts frontend_ctrl.Options) error { + // Datastores - Configure the default ARM handlers. + err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, DatastoresProviderNamespace, NewGetOperations, ctrlOpts) + if err != nil { + return err + } + + specLoader, err := validator.LoadSpec(ctx, DatastoresProviderNamespace, swagger.SpecFiles, prefixes, "rootScope") + if err != nil { + return err + } + + validator := validator.APIValidator(validator.Options{ + SpecLoader: specLoader, + ResourceTypeGetter: validator.RadiusResourceTypeGetter, + }) + + // Register resource routers. + // + // Note: We have to follow the below rules to enable API validators: + // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. + // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. + + mongoPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.datastores/mongodatabases", validator) + mongoResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/mongodatabases", validator) + mongoResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/mongodatabases/{mongoDatabaseName}", validator) + + // Datastores handlers: + handlerOptions := []server.HandlerOptions{ + { + ParentRouter: mongoPlaneRouter, + ResourceType: portableresources.MongoDatabasesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ + RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: mongoResourceGroupRouter, + ResourceType: portableresources.MongoDatabasesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ + RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, + }) + }, + }, + { + ParentRouter: mongoResourceRouter, + ResourceType: portableresources.MongoDatabasesResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ + RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, + }) + }, + }, + { + ParentRouter: mongoResourceRouter, + ResourceType: portableresources.MongoDatabasesResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ + RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.MongoDatabase]{ + rp_frontend.PrepareRadiusResource[*ds_dm.MongoDatabase], + }, + AsyncOperationTimeout: ds_ctrl.AsyncCreateOrUpdateMongoDatabaseTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: mongoResourceRouter, + ResourceType: portableresources.MongoDatabasesResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ + RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.MongoDatabase]{ + rp_frontend.PrepareRadiusResource[*ds_dm.MongoDatabase], + }, + AsyncOperationTimeout: ds_ctrl.AsyncCreateOrUpdateMongoDatabaseTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: mongoResourceRouter, + ResourceType: portableresources.MongoDatabasesResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[ds_dm.MongoDatabase]{ + RequestConverter: ds_conv.MongoDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.MongoDatabaseDataModelToVersioned, + AsyncOperationTimeout: ds_ctrl.AsyncDeleteMongoDatabaseTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: mongoResourceRouter, + Path: "/listsecrets", + ResourceType: portableresources.MongoDatabasesResourceType, + Method: ds_ctrl.OperationListSecret, + ControllerFactory: mongo_ctrl.NewListSecretsMongoDatabase, + }, + } + + redisPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.datastores/rediscaches", validator) + redisResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/rediscaches", validator) + redisResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/rediscaches/{redisCacheName}", validator) + + handlerOptions = append(handlerOptions, []server.HandlerOptions{ + { + ParentRouter: redisPlaneRouter, + ResourceType: portableresources.RedisCachesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ + RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, + ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: redisResourceGroupRouter, + ResourceType: portableresources.RedisCachesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ + RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, + ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, + }) + }, + }, + { + ParentRouter: redisResourceRouter, + ResourceType: portableresources.RedisCachesResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ + RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, + ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, + }) + }, + }, + { + ParentRouter: redisResourceRouter, + ResourceType: portableresources.RedisCachesResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ + RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, + ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.RedisCache]{ + rp_frontend.PrepareRadiusResource[*ds_dm.RedisCache], + }, + AsyncOperationTimeout: ds_ctrl.AsyncCreateOrUpdateRedisCacheTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: redisResourceRouter, + ResourceType: portableresources.RedisCachesResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ + RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, + ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.RedisCache]{ + rp_frontend.PrepareRadiusResource[*ds_dm.RedisCache], + }, + AsyncOperationTimeout: ds_ctrl.AsyncCreateOrUpdateRedisCacheTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: redisResourceRouter, + ResourceType: portableresources.RedisCachesResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[ds_dm.RedisCache]{ + RequestConverter: ds_conv.RedisCacheDataModelFromVersioned, + ResponseConverter: ds_conv.RedisCacheDataModelToVersioned, + AsyncOperationTimeout: ds_ctrl.AsyncDeleteRedisCacheTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: redisResourceRouter, + Path: "/listsecrets", + ResourceType: portableresources.RedisCachesResourceType, + Method: ds_ctrl.OperationListSecret, + ControllerFactory: redis_ctrl.NewListSecretsRedisCache, + }, + }...) + + sqlPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.datastores/sqldatabases", validator) + sqlResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/sqldatabases", validator) + sqlResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.datastores/sqldatabases/{sqlDatabaseName}", validator) + + handlerOptions = append(handlerOptions, []server.HandlerOptions{ + { + ParentRouter: sqlPlaneRouter, + ResourceType: portableresources.SqlDatabasesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ + RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, + ListRecursiveQuery: true, + }) + }, + }, + { + ParentRouter: sqlResourceGroupRouter, + ResourceType: portableresources.SqlDatabasesResourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, + frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ + RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, + }) + }, + }, + { + ParentRouter: sqlResourceRouter, + ResourceType: portableresources.SqlDatabasesResourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, + frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ + RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, + }) + }, + }, + { + ParentRouter: sqlResourceRouter, + ResourceType: portableresources.SqlDatabasesResourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ + RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.SqlDatabase]{ + rp_frontend.PrepareRadiusResource[*ds_dm.SqlDatabase], + }, + AsyncOperationTimeout: ds_ctrl.AsyncCreateOrUpdateSqlDatabaseTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: sqlResourceRouter, + ResourceType: portableresources.SqlDatabasesResourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, + frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ + RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, + UpdateFilters: []frontend_ctrl.UpdateFilter[ds_dm.SqlDatabase]{ + rp_frontend.PrepareRadiusResource[*ds_dm.SqlDatabase], + }, + AsyncOperationTimeout: ds_ctrl.AsyncCreateOrUpdateSqlDatabaseTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: sqlResourceRouter, + ResourceType: portableresources.SqlDatabasesResourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, + frontend_ctrl.ResourceOptions[ds_dm.SqlDatabase]{ + RequestConverter: ds_conv.SqlDatabaseDataModelFromVersioned, + ResponseConverter: ds_conv.SqlDatabaseDataModelToVersioned, + AsyncOperationTimeout: ds_ctrl.AsyncDeleteSqlDatabaseTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + ) + }, + }, + { + ParentRouter: sqlResourceRouter, + Path: "/listsecrets", + ResourceType: portableresources.SqlDatabasesResourceType, + Method: ds_ctrl.OperationListSecret, + ControllerFactory: sql_ctrl.NewListSecretsSqlDatabase, + }, + }...) + + for _, h := range handlerOptions { + if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { + return err + } + } + + return nil +} + +func getRootScopePath(isARM bool) string { + if isARM { + return "/subscriptions/{subscriptionID}" + } + return "/planes/radius/{planeName}" +} diff --git a/pkg/portableresources/frontend/handler/routes_test.go b/pkg/portableresources/frontend/handler/routes_test.go new file mode 100644 index 0000000000..71289e4b1e --- /dev/null +++ b/pkg/portableresources/frontend/handler/routes_test.go @@ -0,0 +1,292 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package handler + +import ( + "context" + "net/http" + "testing" + + "github.com/go-chi/chi/v5" + "github.com/golang/mock/gomock" + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" + "github.com/project-radius/radius/pkg/armrpc/rpctest" + ds_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller" + rabbitmq_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" + "github.com/project-radius/radius/pkg/portableresources" + "github.com/project-radius/radius/pkg/ucp/dataprovider" + "github.com/project-radius/radius/pkg/ucp/store" +) + +var handlerTests = []rpctest.HandlerTestSpec{ + { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: v1.OperationList}, + Path: "/providers/applications.messaging/rabbitmqqueues", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.RabbitMQQueuesResourceType, Method: rabbitmq_ctrl.OperationListSecret}, + Path: "/resourcegroups/testrg/providers/applications.messaging/rabbitmqqueues/rabbitmq/listsecrets", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprPubSubBrokersResourceType, Method: v1.OperationList}, + Path: "/providers/applications.dapr/pubsubbrokers", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprPubSubBrokersResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprPubSubBrokersResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprPubSubBrokersResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprPubSubBrokersResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprPubSubBrokersResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.dapr/pubsubbrokers/daprpubsub", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprSecretStoresResourceType, Method: v1.OperationList}, + Path: "/providers/applications.dapr/secretstores", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprSecretStoresResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprSecretStoresResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprSecretStoresResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprSecretStoresResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprSecretStoresResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.dapr/secretstores/daprsecretstore", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprStateStoresResourceType, Method: v1.OperationList}, + Path: "/providers/applications.dapr/statestores", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprStateStoresResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.dapr/statestores", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprStateStoresResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprStateStoresResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprStateStoresResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.DaprStateStoresResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.dapr/statestores/daprstatestore", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: v1.OperationList}, + Path: "/providers/applications.datastores/mongodatabases", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.MongoDatabasesResourceType, Method: ds_ctrl.OperationListSecret}, + Path: "/resourcegroups/testrg/providers/applications.datastores/mongodatabases/mongo/listsecrets", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: v1.OperationList}, + Path: "/providers/applications.datastores/rediscaches", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.RedisCachesResourceType, Method: ds_ctrl.OperationListSecret}, + Path: "/resourcegroups/testrg/providers/applications.datastores/rediscaches/redis/listsecrets", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: v1.OperationList}, + Path: "/providers/applications.datastores/sqldatabases", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: portableresources.SqlDatabasesResourceType, Method: ds_ctrl.OperationListSecret}, + Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql/listsecrets", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGetOperationStatuses}, + Path: "/providers/applications.messaging/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGetOperationResult}, + Path: "/providers/applications.messaging/locations/global/operationresults/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, + { + OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGetOperationStatuses}, + Path: "/providers/applications.dapr/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGetOperationResult}, + Path: "/providers/applications.dapr/locations/global/operationresults/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, +} + +func TestHandlers(t *testing.T) { + mctrl := gomock.NewController(t) + defer mctrl.Finish() + + mockSP := dataprovider.NewMockDataStorageProvider(mctrl) + mockSC := store.NewMockStorageClient(mctrl) + + mockSC.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.Object{}, nil).AnyTimes() + mockSC.EXPECT().Save(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + mockSP.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Return(store.StorageClient(mockSC), nil).AnyTimes() + + t.Run("UCP", func(t *testing.T) { + // Test handlers for UCP resources. + rpctest.AssertRouters(t, handlerTests, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { + r := chi.NewRouter() + return r, AddRoutes(ctx, r, false, ctrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}) + }) + }) + + t.Run("Azure", func(t *testing.T) { + // Add azure specific handlers. + azureHandlerTests := append(handlerTests, []rpctest.HandlerTestSpec{ + { + OperationType: v1.OperationType{Type: "Applications.Messaging/providers", Method: v1.OperationGet}, + Path: "/providers/applications.messaging/operations", + Method: http.MethodGet, + WithoutRootScope: true, + SkipOperationTypeValidation: true, + }, + { + OperationType: v1.OperationType{Type: "Applications.Dapr/providers", Method: v1.OperationGet}, + Path: "/providers/applications.dapr/operations", + Method: http.MethodGet, + WithoutRootScope: true, + SkipOperationTypeValidation: true, + }, + { + OperationType: v1.OperationType{Type: "Applications.Datastores/providers", Method: v1.OperationGet}, + Path: "/providers/applications.datastores/operations", + Method: http.MethodGet, + WithoutRootScope: true, + SkipOperationTypeValidation: true, + }, + }...) + + // Test handlers for Azure resources + rpctest.AssertRouters(t, azureHandlerTests, "", "/subscriptions/00000000-0000-0000-0000-000000000000", func(ctx context.Context) (chi.Router, error) { + r := chi.NewRouter() + return r, AddRoutes(ctx, r, true, ctrl.Options{PathBase: "", DataProvider: mockSP}) + }) + }) +} diff --git a/pkg/linkrp/frontend/service.go b/pkg/portableresources/frontend/service.go similarity index 90% rename from pkg/linkrp/frontend/service.go rename to pkg/portableresources/frontend/service.go index 0507098b0c..02acd3ff33 100644 --- a/pkg/linkrp/frontend/service.go +++ b/pkg/portableresources/frontend/service.go @@ -21,11 +21,10 @@ import ( "fmt" "github.com/go-chi/chi/v5" + ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/frontend/server" "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/linkrp/frontend/handler" - - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" + "github.com/project-radius/radius/pkg/portableresources/frontend/handler" ) type Service struct { @@ -37,14 +36,14 @@ func NewService(options hostoptions.HostOptions) *Service { return &Service{ server.Service{ Options: options, - ProviderName: handler.LinkProviderNamespace, + ProviderName: handler.PortableResourcesNamespace, }, } } -// Name returns the namespace of the link provider. +// Name returns the namespace of the portable resource provider. func (s *Service) Name() string { - return handler.LinkProviderNamespace + return handler.PortableResourcesNamespace } // Run sets up the server and starts it, returning an error if any. diff --git a/pkg/linkrp/handlers/util.go b/pkg/portableresources/handlers/util.go similarity index 100% rename from pkg/linkrp/handlers/util.go rename to pkg/portableresources/handlers/util.go diff --git a/pkg/linkrp/handlers/util_test.go b/pkg/portableresources/handlers/util_test.go similarity index 81% rename from pkg/linkrp/handlers/util_test.go rename to pkg/portableresources/handlers/util_test.go index 210eb0479d..3d5f85485c 100644 --- a/pkg/linkrp/handlers/util_test.go +++ b/pkg/portableresources/handlers/util_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -32,16 +32,16 @@ import ( func Test_CheckDaprResourceNameUniqueness_NotFound(t *testing.T) { client := k8sutil.NewFakeKubeClient(nil) - err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", linkrp.DaprStateStoresResourceType) + err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", portableresources.DaprStateStoresResourceType) require.NoError(t, err) } func Test_CheckDaprResourceNameUniqueness_SameRadiusResource(t *testing.T) { - labels := kubernetes.MakeDescriptiveDaprLabels("test-app", "test-resource", linkrp.DaprStateStoresResourceType) + labels := kubernetes.MakeDescriptiveDaprLabels("test-app", "test-resource", portableresources.DaprStateStoresResourceType) existing := createUnstructuredComponent("test-component", "default", labels) client := k8sutil.NewFakeKubeClient(nil, existing) - err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", linkrp.DaprStateStoresResourceType) + err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", portableresources.DaprStateStoresResourceType) require.NoError(t, err) } @@ -49,27 +49,27 @@ func Test_CheckDaprResourceNameUniqueness_NoLabels(t *testing.T) { existing := createUnstructuredComponent("test-component", "default", nil) client := k8sutil.NewFakeKubeClient(nil, existing) - err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", linkrp.DaprStateStoresResourceType) + err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", portableresources.DaprStateStoresResourceType) require.Error(t, err) require.Equal(t, fmt.Sprintf(daprConflictFmt, "test-component"), err.Error()) } func Test_CheckDaprResourceNameUniqueness_DifferentResourceNames(t *testing.T) { - labels := kubernetes.MakeDescriptiveDaprLabels("test-app", "different-resource", linkrp.DaprStateStoresResourceType) + labels := kubernetes.MakeDescriptiveDaprLabels("test-app", "different-resource", portableresources.DaprStateStoresResourceType) existing := createUnstructuredComponent("test-component", "default", labels) client := k8sutil.NewFakeKubeClient(nil, existing) - err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", linkrp.DaprStateStoresResourceType) + err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", portableresources.DaprStateStoresResourceType) require.Error(t, err) require.Equal(t, fmt.Sprintf(daprConflictFmt, "test-component"), err.Error()) } func Test_CheckDaprResourceNameUniqueness_DifferentResourceTypes(t *testing.T) { - labels := kubernetes.MakeDescriptiveDaprLabels("test-app", "test-resource", linkrp.DaprPubSubBrokersResourceType) + labels := kubernetes.MakeDescriptiveDaprLabels("test-app", "test-resource", portableresources.DaprPubSubBrokersResourceType) existing := createUnstructuredComponent("test-component", "default", labels) client := k8sutil.NewFakeKubeClient(nil, existing) - err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", linkrp.DaprStateStoresResourceType) + err := CheckDaprResourceNameUniqueness(context.Background(), client, "test-component", "default", "test-resource", portableresources.DaprStateStoresResourceType) require.Error(t, err) require.Equal(t, fmt.Sprintf(daprConflictFmt, "test-component"), err.Error()) } diff --git a/pkg/linkrp/processors/doc.go b/pkg/portableresources/processors/doc.go similarity index 94% rename from pkg/linkrp/processors/doc.go rename to pkg/portableresources/processors/doc.go index 33f9f7aa74..92b0d9406b 100644 --- a/pkg/linkrp/processors/doc.go +++ b/pkg/portableresources/processors/doc.go @@ -17,7 +17,7 @@ limitations under the License. // processors contains the shared logic and interfaces for implementing a resource processor. // // Resource processors are responsible for processing the results of recipe execution or any -// other change to the lifecycle of a link resource. +// other change to the lifecycle of a portable resource. // // For example a mongo processor might take the results of executing a recipe and compute // and store the connection string as part of the resource data model. diff --git a/pkg/linkrp/processors/mock_resourceclient.go b/pkg/portableresources/processors/mock_resourceclient.go similarity index 93% rename from pkg/linkrp/processors/mock_resourceclient.go rename to pkg/portableresources/processors/mock_resourceclient.go index c32279b625..080855ee59 100644 --- a/pkg/linkrp/processors/mock_resourceclient.go +++ b/pkg/portableresources/processors/mock_resourceclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/linkrp/processors (interfaces: ResourceClient) +// Source: github.com/project-radius/radius/pkg/portableresources/processors (interfaces: ResourceClient) // Package processors is a generated GoMock package. package processors diff --git a/pkg/linkrp/processors/resourceclient.go b/pkg/portableresources/processors/resourceclient.go similarity index 100% rename from pkg/linkrp/processors/resourceclient.go rename to pkg/portableresources/processors/resourceclient.go diff --git a/pkg/linkrp/processors/resourceclient_test.go b/pkg/portableresources/processors/resourceclient_test.go similarity index 100% rename from pkg/linkrp/processors/resourceclient_test.go rename to pkg/portableresources/processors/resourceclient_test.go diff --git a/pkg/linkrp/processors/types.go b/pkg/portableresources/processors/types.go similarity index 92% rename from pkg/linkrp/processors/types.go rename to pkg/portableresources/processors/types.go index 8a21eef0dd..f96bfb18f4 100644 --- a/pkg/linkrp/processors/types.go +++ b/pkg/portableresources/processors/types.go @@ -25,7 +25,7 @@ import ( ) // ResourceProcessor is responsible for processing the results of recipe execution or any -// other change to the lifecycle of a link resource. Each resource processor supports a single +// other change to the lifecycle of a portable resource. Each resource processor supports a single // Radius resource type (eg: RedisCache). type ResourceProcessor[P interface { *T @@ -55,7 +55,7 @@ func (e *ValidationError) Error() string { return e.Message } -//go:generate mockgen -destination=./mock_resourceclient.go -package=processors -self_package github.com/project-radius/radius/pkg/linkrp/processors github.com/project-radius/radius/pkg/linkrp/processors ResourceClient +//go:generate mockgen -destination=./mock_resourceclient.go -package=processors -self_package github.com/project-radius/radius/pkg/portableresources/processors github.com/project-radius/radius/pkg/portableresources/processors ResourceClient // ResourceClient is a client used by resource processors for interacting with UCP resources. type ResourceClient interface { diff --git a/pkg/linkrp/processors/util.go b/pkg/portableresources/processors/util.go similarity index 92% rename from pkg/linkrp/processors/util.go rename to pkg/portableresources/processors/util.go index 3ea2bac722..3ff7477690 100644 --- a/pkg/linkrp/processors/util.go +++ b/pkg/portableresources/processors/util.go @@ -19,7 +19,7 @@ package processors import ( "fmt" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -29,7 +29,7 @@ import ( // GetOutputResourcesFromResourcesField parses a slice of resource references and converts each resource into an OutputResource. // It returns a slice of output resources and an error if any of the resource references are invalid. This should be used for // processing the '.properties.resources' field of a resource. -func GetOutputResourcesFromResourcesField(field []*linkrp.ResourceReference) ([]rpv1.OutputResource, error) { +func GetOutputResourcesFromResourcesField(field []*portableresources.ResourceReference) ([]rpv1.OutputResource, error) { results := []rpv1.OutputResource{} for _, resource := range field { id, err := resources.ParseResource(resource.ID) diff --git a/pkg/linkrp/processors/util_test.go b/pkg/portableresources/processors/util_test.go similarity index 94% rename from pkg/linkrp/processors/util_test.go rename to pkg/portableresources/processors/util_test.go index 65be5d935a..f17643a2d9 100644 --- a/pkg/linkrp/processors/util_test.go +++ b/pkg/portableresources/processors/util_test.go @@ -19,7 +19,7 @@ package processors import ( "testing" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -28,7 +28,7 @@ import ( ) func Test_GetOutputResourcesFromResourcesField(t *testing.T) { - resourcesField := []*linkrp.ResourceReference{ + resourcesField := []*portableresources.ResourceReference{ {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Cache/redis/test-resource1"}, {ID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Cache/redis/test-resource2"}, } @@ -52,7 +52,7 @@ func Test_GetOutputResourcesFromResourcesField(t *testing.T) { } func Test_GetOutputResourceFromResourceID_Invalid(t *testing.T) { - resourcesField := []*linkrp.ResourceReference{ + resourcesField := []*portableresources.ResourceReference{ {ID: "/////asdf////"}, } diff --git a/pkg/linkrp/processors/validator.go b/pkg/portableresources/processors/validator.go similarity index 98% rename from pkg/linkrp/processors/validator.go rename to pkg/portableresources/processors/validator.go index 623e74c1ba..906e26397a 100644 --- a/pkg/linkrp/processors/validator.go +++ b/pkg/portableresources/processors/validator.go @@ -21,7 +21,7 @@ import ( "reflect" "strings" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) @@ -40,7 +40,7 @@ const ( // - Extract connection values and connection secrets from the recipe output // - Apply values and secrets from the recipe output to the resource data model. type Validator struct { - resourcesField *[]*linkrp.ResourceReference + resourcesField *[]*portableresources.ResourceReference fields []func(output *recipes.RecipeOutput) string computedFields []func(output *recipes.RecipeOutput) string @@ -71,7 +71,7 @@ func NewValidator(connectionValues *map[string]any, connectionSecrets *map[strin } // AddResourceField registers a field containing a resource ID with the validator. -func (v *Validator) AddResourcesField(ref *[]*linkrp.ResourceReference) { +func (v *Validator) AddResourcesField(ref *[]*portableresources.ResourceReference) { v.resourcesField = ref } diff --git a/pkg/linkrp/processors/validator_test.go b/pkg/portableresources/processors/validator_test.go similarity index 98% rename from pkg/linkrp/processors/validator_test.go rename to pkg/portableresources/processors/validator_test.go index 52224eae08..880af110ca 100644 --- a/pkg/linkrp/processors/validator_test.go +++ b/pkg/portableresources/processors/validator_test.go @@ -19,7 +19,7 @@ package processors import ( "testing" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/project-radius/radius/pkg/recipes" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -91,7 +91,7 @@ func Test_Validator_SetAndValidate_OutputResources(t *testing.T) { values := map[string]any{} secrets := map[string]rpv1.SecretValueReference{} - var resources *[]*linkrp.ResourceReference + var resources *[]*portableresources.ResourceReference v := NewValidator(&values, &secrets, &outputResources) v.AddResourcesField(resources) @@ -106,7 +106,7 @@ func Test_Validator_SetAndValidate_OutputResources(t *testing.T) { values := map[string]any{} secrets := map[string]rpv1.SecretValueReference{} - resources := []*linkrp.ResourceReference{} + resources := []*portableresources.ResourceReference{} v := NewValidator(&values, &secrets, &outputResources) v.AddResourcesField(&resources) @@ -133,7 +133,7 @@ func Test_Validator_SetAndValidate_OutputResources(t *testing.T) { values := map[string]any{} secrets := map[string]rpv1.SecretValueReference{} - resources := []*linkrp.ResourceReference{{ID: "////invalid//////"}} + resources := []*portableresources.ResourceReference{{ID: "////invalid//////"}} v := NewValidator(&values, &secrets, &outputResources) v.AddResourcesField(&resources) @@ -167,7 +167,7 @@ func Test_Validator_SetAndValidate_OutputResources(t *testing.T) { values := map[string]any{} secrets := map[string]rpv1.SecretValueReference{} - resourcesField := []*linkrp.ResourceReference{ + resourcesField := []*portableresources.ResourceReference{ { ID: "/planes/aws/aws/accounts/1234/regions/us-west-1/providers/AWS.Kinesis/Stream/my-stream1", }, diff --git a/pkg/linkrp/renderers/dapr/generic.go b/pkg/portableresources/renderers/dapr/generic.go similarity index 100% rename from pkg/linkrp/renderers/dapr/generic.go rename to pkg/portableresources/renderers/dapr/generic.go diff --git a/pkg/linkrp/renderers/types.go b/pkg/portableresources/renderers/types.go similarity index 100% rename from pkg/linkrp/renderers/types.go rename to pkg/portableresources/renderers/types.go diff --git a/pkg/linkrp/types.go b/pkg/portableresources/types.go similarity index 66% rename from pkg/linkrp/types.go rename to pkg/portableresources/types.go index 7190518ded..26c8f7d6e7 100644 --- a/pkg/linkrp/types.go +++ b/pkg/portableresources/types.go @@ -14,7 +14,27 @@ See the License for the specific language governing permissions and limitations under the License. */ -package linkrp +package portableresources + +import ( + "strings" +) + +const ( + DaprPubSubBrokersResourceType = "Applications.Dapr/pubSubBrokers" + DaprSecretStoresResourceType = "Applications.Dapr/secretStores" + DaprStateStoresResourceType = "Applications.Dapr/stateStores" + RabbitMQQueuesResourceType = "Applications.Messaging/rabbitMQQueues" + MongoDatabasesResourceType = "Applications.Datastores/mongoDatabases" + RedisCachesResourceType = "Applications.Datastores/redisCaches" + SqlDatabasesResourceType = "Applications.Datastores/sqlDatabases" + ExtendersResourceType = "Applications.Core/extenders" + + // ResourceProvisioningRecipe is the scenario when Radius manages the lifecycle of the resource through a Recipe + ResourceProvisioningRecipe ResourceProvisioning = "recipe" + // ResourceProvisiongManual is the scenario wher the user manages the resource and provides the values + ResourceProvisioningManual ResourceProvisioning = "manual" +) type RecipeData struct { RecipeProperties @@ -44,15 +64,15 @@ type LinkRecipe struct { } // ResourceReference represents a reference to a resource that was deployed by the user -// and specified as part of a link resource. +// and specified as part of a portable resource. // // This type should be used in datamodels for the '.properties.resources' field. type ResourceReference struct { ID string `json:"id"` } -// RecipeContext Recipe template authors can leverage the RecipeContext parameter to access Link properties to -// generate name and properties that are unique for the Link calling the recipe. +// RecipeContext Recipe template authors can leverage the RecipeContext parameter to access portable resource properties to +// generate name and properties that are unique for the resource calling the recipe. type RecipeContext struct { Resource Resource `json:"resource,omitempty"` Application ResourceInfo `json:"application,omitempty"` @@ -77,41 +97,34 @@ type Runtime struct { Kubernetes Kubernetes `json:"kubernetes,omitempty"` } +// ResourceProvisioning specifies how the resource should be managed +type ResourceProvisioning string + type Kubernetes struct { - // Namespace is set to the applicationNamespace when the Link is application-scoped, and set to the environmentNamespace when the Link is environment scoped + // Namespace is set to the applicationNamespace when the portable resource is application-scoped, and set to the environmentNamespace when it is environment scoped Namespace string `json:"namespace"` // EnvironmentNamespace is set to environment namespace. EnvironmentNamespace string `json:"environmentNamespace"` } -const ( - DaprPubSubBrokersResourceType = "Applications.Link/daprPubSubBrokers" - DaprSecretStoresResourceType = "Applications.Link/daprSecretStores" - DaprStateStoresResourceType = "Applications.Link/daprStateStores" - ExtendersResourceType = "Applications.Link/extenders" - MongoDatabasesResourceType = "Applications.Link/mongoDatabases" - RabbitMQMessageQueuesResourceType = "Applications.Link/rabbitMQMessageQueues" - RedisCachesResourceType = "Applications.Link/redisCaches" - SqlDatabasesResourceType = "Applications.Link/sqlDatabases" - /* The following are new temporary resource type names. These values will replace the above resource type names after - testing for the new namespaces is completed. (https://github.com/project-radius/radius/issues/3499) - */ - N_DaprPubSubBrokersResourceType = "Applications.Dapr/pubSubBrokers" - N_DaprSecretStoresResourceType = "Applications.Dapr/secretStores" - N_DaprStateStoresResourceType = "Applications.Dapr/stateStores" - N_RabbitMQQueuesResourceType = "Applications.Messaging/rabbitMQQueues" - N_MongoDatabasesResourceType = "Applications.Datastores/mongoDatabases" - N_RedisCachesResourceType = "Applications.Datastores/redisCaches" - N_SqlDatabasesResourceType = "Applications.Datastores/sqlDatabases" - N_ExtendersResourceType = "Applications.Core/extenders" -) - -// ResourceProvisioning specifies how the resource should be managed -type ResourceProvisioning string - -const ( - // ResourceProvisioningRecipe is the scenario when Radius manages the lifecycle of the resource through a Recipe - ResourceProvisioningRecipe ResourceProvisioning = "recipe" - // ResourceProvisiongManual is the scenario wher the user manages the resource and provides the values - ResourceProvisioningManual ResourceProvisioning = "manual" -) +// IsValidPortableResourceType checks if the provided resource type is a valid portable resource type. +// Returns true if the resource type is valid, false otherwise. +func IsValidPortableResourceType(resourceType string) bool { + portableResourceTypes := []string{ + DaprPubSubBrokersResourceType, + DaprSecretStoresResourceType, + DaprStateStoresResourceType, + RabbitMQQueuesResourceType, + MongoDatabasesResourceType, + RedisCachesResourceType, + SqlDatabasesResourceType, + ExtendersResourceType, + } + for _, s := range portableResourceTypes { + if strings.EqualFold(s, resourceType) { + return true + } + } + + return false +} diff --git a/pkg/linkrp/datamodel/converter/test_util.go b/pkg/portableresources/types_test.go similarity index 58% rename from pkg/linkrp/datamodel/converter/test_util.go rename to pkg/portableresources/types_test.go index 3c99654ed3..1a1a0b65ce 100644 --- a/pkg/linkrp/datamodel/converter/test_util.go +++ b/pkg/portableresources/types_test.go @@ -14,16 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -package converter +package portableresources import ( - "os" + "testing" + + "github.com/stretchr/testify/require" ) -func loadTestData(testfile string) []byte { - d, err := os.ReadFile(testfile) - if err != nil { - return nil - } - return d +func TestValidPortableResourceType(t *testing.T) { + isValid := IsValidPortableResourceType("Applications.Datastores/mongoDatabases") + require.Equal(t, true, isValid) +} + +func TestInvalidPortableResourceType(t *testing.T) { + isValid := IsValidPortableResourceType("Applications.Dapr/pubSubBroker") + require.Equal(t, false, isValid) } diff --git a/pkg/recipes/configloader/environment_test.go b/pkg/recipes/configloader/environment_test.go index 60a2be8f17..3292eef9fa 100644 --- a/pkg/recipes/configloader/environment_test.go +++ b/pkg/recipes/configloader/environment_test.go @@ -34,8 +34,8 @@ const ( appResourceId = "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/app0" azureScope = "/subscriptions/test-sub/resourceGroups/testRG" awsScope = "/planes/aws/aws/accounts/000/regions/cool-region" - mongoResourceID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0" - redisID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/redisCaches/redis-0" + mongoResourceID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0" + redisID = "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/redisCaches/redis-0" recipeName = "cosmosDB" terraformRecipe = "terraform-cosmosDB" @@ -221,7 +221,7 @@ func TestGetRecipeDefinition(t *testing.T) { }, }, Recipes: map[string]map[string]model.RecipePropertiesClassification{ - "Applications.Link/mongoDatabases": { + "Applications.Datastores/mongoDatabases": { recipeName: &model.BicepRecipeProperties{ TemplateKind: to.Ptr(recipes.TemplateKindBicep), TemplatePath: to.Ptr("radiusdev.azurecr.io/recipes/mongodatabases/azure:1.0"), @@ -264,7 +264,7 @@ func TestGetRecipeDefinition(t *testing.T) { expected := recipes.EnvironmentDefinition{ Name: recipeName, Driver: recipes.TemplateKindBicep, - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", TemplatePath: "radiusdev.azurecr.io/recipes/mongodatabases/azure:1.0", Parameters: map[string]any{ "foo": "bar", @@ -279,7 +279,7 @@ func TestGetRecipeDefinition(t *testing.T) { expected := recipes.EnvironmentDefinition{ Name: terraformRecipe, Driver: recipes.TemplateKindTerraform, - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", } diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index 313d07e51d..d1a2eeff06 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -27,9 +27,9 @@ import ( deployments "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/go-logr/logr" - "github.com/project-radius/radius/pkg/linkrp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" "github.com/project-radius/radius/pkg/metrics" + "github.com/project-radius/radius/pkg/portableresources/datamodel" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/recipecontext" "github.com/project-radius/radius/pkg/rp/util" diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index d87e2db2de..143f62f611 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -25,7 +25,7 @@ import ( gomock "github.com/golang/mock/gomock" v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" corerp_datamodel "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/linkrp/processors" + "github.com/project-radius/radius/pkg/portableresources/processors" "github.com/project-radius/radius/pkg/recipes" "github.com/project-radius/radius/pkg/recipes/recipecontext" rpv1 "github.com/project-radius/radius/pkg/rp/v1" @@ -85,10 +85,10 @@ func Test_CreateRecipeParameters_WithContextParameter(t *testing.T) { recipeContext := recipecontext.Context{ Resource: recipecontext.Resource{ ResourceInfo: recipecontext.ResourceInfo{ - ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "Applications.Link/mongoDatabases", + Type: "Applications.Datastores/mongoDatabases", }, Application: recipecontext.ResourceInfo{ ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", @@ -133,10 +133,10 @@ func Test_CreateRecipeParameters_EmptyResourceParameters(t *testing.T) { recipeContext := recipecontext.Context{ Resource: recipecontext.Resource{ ResourceInfo: recipecontext.ResourceInfo{ - ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "Applications.Link/mongoDatabases", + Type: "Applications.Datastores/mongoDatabases", }, Application: recipecontext.ResourceInfo{ ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", @@ -185,10 +185,10 @@ func Test_CreateRecipeParameters_ResourceAndEnvParameters(t *testing.T) { recipeContext := recipecontext.Context{ Resource: recipecontext.Resource{ ResourceInfo: recipecontext.ResourceInfo{ - ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "Applications.Link/mongoDatabases", + Type: "Applications.Datastores/mongoDatabases", }, Application: recipecontext.ResourceInfo{ ID: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", @@ -228,7 +228,7 @@ func Test_createDeploymentID(t *testing.T) { expected, err := resources.ParseResource("/planes/radius/local/resourceGroups/cool-group/providers/Microsoft.Resources/deployments/test-deployment") require.NoError(t, err) - actual, err := createDeploymentID("/planes/radius/local/resourceGroups/cool-group/providers/Applications.Link/mongoDatabases/test-db", "test-deployment") + actual, err := createDeploymentID("/planes/radius/local/resourceGroups/cool-group/providers/Applications.Datastores/mongoDatabases/test-db", "test-deployment") require.NoError(t, err) require.Equal(t, expected, actual) } diff --git a/pkg/recipes/driver/terraform_test.go b/pkg/recipes/driver/terraform_test.go index 41ddbb1d9f..274812b723 100644 --- a/pkg/recipes/driver/terraform_test.go +++ b/pkg/recipes/driver/terraform_test.go @@ -58,7 +58,7 @@ func buildTestInputs() (recipes.Configuration, recipes.ResourceMetadata, recipes Name: "redis-azure", ApplicationID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/applications/app1", EnvironmentID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/environments/env1", - ResourceID: "/planes/radius/local/resourceGroups/test-rg/providers/applications.link/rediscaches/test-redis-recipe", + ResourceID: "/planes/radius/local/resourceGroups/test-rg/providers/applications.datastores/rediscaches/test-redis-recipe", Parameters: map[string]any{ "redis_cache_name": "redis-test", }, @@ -67,7 +67,7 @@ func buildTestInputs() (recipes.Configuration, recipes.ResourceMetadata, recipes envRecipe := recipes.EnvironmentDefinition{ Driver: recipes.TemplateKindBicep, TemplatePath: "Azure/redis/azurerm", - ResourceType: "Applications.Link/redisCaches", + ResourceType: "Applications.Datastores/redisCaches", } return envConfig, recipeMetadata, envRecipe diff --git a/pkg/recipes/engine/engine_test.go b/pkg/recipes/engine/engine_test.go index 24b293ac32..2718c41277 100644 --- a/pkg/recipes/engine/engine_test.go +++ b/pkg/recipes/engine/engine_test.go @@ -87,7 +87,7 @@ func Test_Engine_Execute_Success(t *testing.T) { recipeDefinition := &recipes.EnvironmentDefinition{ Driver: recipes.TemplateKindBicep, TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } ctx := testcontext.New(t) engine, configLoader, driver := setup(t) @@ -145,7 +145,7 @@ func Test_Engine_Execute_Failure(t *testing.T) { recipeDefinition := &recipes.EnvironmentDefinition{ Driver: recipes.TemplateKindBicep, TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } ctx := testcontext.New(t) engine, configLoader, driver := setup(t) @@ -215,7 +215,7 @@ func Test_Engine_Terraform_Success(t *testing.T) { Driver: recipes.TemplateKindTerraform, TemplatePath: "Azure/redis/azurerm", TemplateVersion: "1.1.0", - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } ctx := testcontext.New(t) engine, configLoader, driver := setup(t) @@ -252,7 +252,7 @@ func Test_Engine_InvalidDriver(t *testing.T) { recipeDefinition := &recipes.EnvironmentDefinition{ Driver: "invalid", TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } recipeMetadata := recipes.ResourceMetadata{ @@ -317,7 +317,7 @@ func Test_Engine_Load_Error(t *testing.T) { recipeDefinition := &recipes.EnvironmentDefinition{ Driver: recipes.TemplateKindBicep, TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } configLoader.EXPECT(). LoadRecipe(ctx, &recipeMetadata). @@ -456,7 +456,7 @@ func getDeleteInputs() (recipes.ResourceMetadata, recipes.EnvironmentDefinition, Name: "mongo-azure", ApplicationID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/applications/app1", EnvironmentID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/environments/env1", - ResourceID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/test-db", + ResourceID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/test-db", Parameters: map[string]any{ "resourceName": "resource1", }, @@ -465,7 +465,7 @@ func getDeleteInputs() (recipes.ResourceMetadata, recipes.EnvironmentDefinition, recipeDefinition := recipes.EnvironmentDefinition{ Driver: recipes.TemplateKindBicep, TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/basic/mongodatabases/azure:1.0", - ResourceType: "Applications.Link/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } outputResources := []rpv1.OutputResource{ diff --git a/pkg/recipes/recipecontext/context_test.go b/pkg/recipes/recipecontext/context_test.go index 46aa81fa9a..610c9d6b1d 100644 --- a/pkg/recipes/recipecontext/context_test.go +++ b/pkg/recipes/recipecontext/context_test.go @@ -27,7 +27,7 @@ import ( func TestNewContext(t *testing.T) { testMetadata := &recipes.ResourceMetadata{ - ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", EnvironmentID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/environments/env0", ApplicationID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", } @@ -60,10 +60,10 @@ func TestNewContext(t *testing.T) { out: &Context{ Resource: Resource{ ResourceInfo: ResourceInfo{ - ID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "applications.link/mongodatabases", + Type: "applications.datastores/mongodatabases", }, Application: ResourceInfo{ Name: "testApplication", @@ -110,10 +110,10 @@ func TestNewContext(t *testing.T) { out: &Context{ Resource: Resource{ ResourceInfo: ResourceInfo{ - ID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "applications.link/mongodatabases", + Type: "applications.datastores/mongodatabases", }, Application: ResourceInfo{ Name: "testApplication", @@ -150,10 +150,10 @@ func TestNewContext(t *testing.T) { out: &Context{ Resource: Resource{ ResourceInfo: ResourceInfo{ - ID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "applications.link/mongodatabases", + Type: "applications.datastores/mongodatabases", }, Application: ResourceInfo{ Name: "testApplication", @@ -220,7 +220,7 @@ func TestNewContext_failures(t *testing.T) { { name: "invalid env id", metadata: &recipes.ResourceMetadata{ - ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", EnvironmentID: "invalid-env", ApplicationID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", }, @@ -230,7 +230,7 @@ func TestNewContext_failures(t *testing.T) { { name: "invalid app id", metadata: &recipes.ResourceMetadata{ - ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", EnvironmentID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/environments/env0", ApplicationID: "invalid-app", }, @@ -240,7 +240,7 @@ func TestNewContext_failures(t *testing.T) { { name: "invalid azure scope", metadata: &recipes.ResourceMetadata{ - ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", EnvironmentID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/environments/env0", ApplicationID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", }, @@ -265,7 +265,7 @@ func TestNewContext_failures(t *testing.T) { { name: "invalid aws scope", metadata: &recipes.ResourceMetadata{ - ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ResourceID: "/planes/radius/local/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", EnvironmentID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/environments/env0", ApplicationID: "/planes/radius/local/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", }, diff --git a/pkg/recipes/recipecontext/types.go b/pkg/recipes/recipecontext/types.go index ed051bc6f5..823bd6b041 100644 --- a/pkg/recipes/recipecontext/types.go +++ b/pkg/recipes/recipecontext/types.go @@ -25,9 +25,9 @@ const ( RecipeContextParamKey = "context" ) -// Context represents the context information which accesses Link properties. Recipe template authors -// can leverage the RecipeContext parameter to access Link properties to generate name and properties -// that are unique for the Link calling the recipe. +// Context represents the context information which accesses portable resource properties. Recipe template authors +// can leverage the RecipeContext parameter to access portable resource properties to generate name and properties +// that are unique for the portable resource calling the recipe. type Context struct { // Resource represents the resource information of the deploying recipe resource. Resource Resource `json:"resource,omitempty"` diff --git a/pkg/recipes/terraform/config/config_test.go b/pkg/recipes/terraform/config/config_test.go index 6cf072feed..e4566907ba 100644 --- a/pkg/recipes/terraform/config/config_test.go +++ b/pkg/recipes/terraform/config/config_test.go @@ -69,10 +69,10 @@ func getTestRecipeContext() *recipecontext.Context { return &recipecontext.Context{ Resource: recipecontext.Resource{ ResourceInfo: recipecontext.ResourceInfo{ - ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", + ID: "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", Name: "mongo0", }, - Type: "applications.link/mongodatabases", + Type: "applications.datastores/mongodatabases", }, Application: recipecontext.ResourceInfo{ Name: "testApplication", diff --git a/pkg/recipes/terraform/config/testdata/main-all.tf.json b/pkg/recipes/terraform/config/testdata/main-all.tf.json index 9a9dfbb069..bf8750972b 100644 --- a/pkg/recipes/terraform/config/testdata/main-all.tf.json +++ b/pkg/recipes/terraform/config/testdata/main-all.tf.json @@ -13,8 +13,8 @@ "context": { "resource": { "name": "mongo0", - "id": "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", - "type": "applications.link/mongodatabases" + "id": "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", + "type": "applications.datastores/mongodatabases" }, "application": { "name": "testApplication", diff --git a/pkg/recipes/terraform/config/testdata/main-noparams.tf.json b/pkg/recipes/terraform/config/testdata/main-noparams.tf.json index db8378f73a..5a051f97aa 100644 --- a/pkg/recipes/terraform/config/testdata/main-noparams.tf.json +++ b/pkg/recipes/terraform/config/testdata/main-noparams.tf.json @@ -13,8 +13,8 @@ "context": { "resource": { "name": "mongo0", - "id": "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", - "type": "applications.link/mongodatabases" + "id": "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", + "type": "applications.datastores/mongodatabases" }, "application": { "name": "testApplication", diff --git a/pkg/recipes/terraform/config/testdata/main-noresourceparam.tf.json b/pkg/recipes/terraform/config/testdata/main-noresourceparam.tf.json index e29a625a49..9069bfcd54 100644 --- a/pkg/recipes/terraform/config/testdata/main-noresourceparam.tf.json +++ b/pkg/recipes/terraform/config/testdata/main-noresourceparam.tf.json @@ -13,8 +13,8 @@ "context": { "resource": { "name": "mongo0", - "id": "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.link/mongodatabases/mongo0", - "type": "applications.link/mongodatabases" + "id": "/subscriptions/testSub/resourceGroups/testGroup/providers/applications.datastores/mongodatabases/mongo0", + "type": "applications.datastores/mongodatabases" }, "application": { "name": "testApplication", diff --git a/pkg/recipes/types.go b/pkg/recipes/types.go index 446a5943fc..045b2654ea 100644 --- a/pkg/recipes/types.go +++ b/pkg/recipes/types.go @@ -39,7 +39,7 @@ type RuntimeConfiguration struct { // KubernetesRuntime represents application and environment namespaces. type KubernetesRuntime struct { - // Namespace is set to the application namespace when the Link is application-scoped, and set to the environment namespace when the Link is environment scoped + // Namespace is set to the application namespace when the portable resource is application-scoped, and set to the environment namespace when it is environment scoped Namespace string `json:"namespace,omitempty"` // EnvironmentNamespace is set to environment namespace. EnvironmentNamespace string `json:"environmentNamespace"` @@ -51,7 +51,7 @@ type EnvironmentDefinition struct { Name string // Driver represents the kind of infrastructure language used to define recipe. Driver string - // ResourceType represents the type of the link this recipe can be consumed by. + // ResourceType represents the type of the portable resource this recipe can be consumed by. ResourceType string // Parameters represents key/value pairs to pass into the recipe template for every resource using this recipe. Specified during recipe registration to environment. Can be overridden by the radius resource consuming this recipe. Parameters map[string]any @@ -61,13 +61,13 @@ type EnvironmentDefinition struct { TemplateVersion string } -// ResourceMetadata represents recipe details provided while creating a Link resource. +// ResourceMetadata represents recipe details provided while creating a portable resource. type ResourceMetadata struct { // Name represents the name of the recipe within the environment Name string - // ApplicationID represents fully qualified resource ID for the application that the link is consumed by + // ApplicationID represents fully qualified resource ID for the application that the portable resource is consumed by ApplicationID string - // EnvironmentID represents fully qualified resource ID for the environment that the link is linked to + // EnvironmentID represents fully qualified resource ID for the environment that the portable resource is linked to EnvironmentID string // ResourceID represents fully qualified resource ID for the resource the recipe is deploying ResourceID string diff --git a/pkg/rp/frontend/validator.go b/pkg/rp/frontend/validator.go index 36015d5482..6b6b17839b 100644 --- a/pkg/rp/frontend/validator.go +++ b/pkg/rp/frontend/validator.go @@ -22,7 +22,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" + "github.com/project-radius/radius/pkg/daprrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" ) diff --git a/pkg/rp/frontend/validator_test.go b/pkg/rp/frontend/validator_test.go index a298d8bbe2..83d7500305 100644 --- a/pkg/rp/frontend/validator_test.go +++ b/pkg/rp/frontend/validator_test.go @@ -23,7 +23,7 @@ import ( v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/armrpc/frontend/controller" "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/linkrp/datamodel" + "github.com/project-radius/radius/pkg/daprrp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/require" diff --git a/pkg/ucp/resources/id_test.go b/pkg/ucp/resources/id_test.go index a4d016fd51..2ee5a36696 100644 --- a/pkg/ucp/resources/id_test.go +++ b/pkg/ucp/resources/id_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/project-radius/radius/pkg/azure/azresources" - "github.com/project-radius/radius/pkg/linkrp" + "github.com/project-radius/radius/pkg/portableresources" "github.com/stretchr/testify/require" ) @@ -774,11 +774,11 @@ func Test_Truncate_ReturnsSelfForTopLevelExtension(t *testing.T) { } func Test_Truncate_WithCustomAction(t *testing.T) { - id, err := Parse("/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0/listSecrets") + id, err := Parse("/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0/listSecrets") require.NoError(t, err) truncated := id.Truncate() - require.Equal(t, "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", truncated.id) + require.Equal(t, "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", truncated.id) } func Test_IdParsing_WithNoTypeSegments(t *testing.T) { @@ -1003,98 +1003,98 @@ func Test_ParseByMethod(t *testing.T) { }{ { desc: "ucp-post-with-custom-action", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0/listSecrets", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0/listSecrets", method: http.MethodPost, err: false, - eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "ucp-get", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodGet, err: false, - eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "ucp-list", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases", method: http.MethodGet, err: false, - eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "ucp-put", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodPut, err: false, - eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "ucp-patch", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodPatch, err: false, - eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "ucp-delete", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodDelete, err: false, - eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "arm-post-with-custom-action", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0/listSecrets", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0/listSecrets", method: http.MethodPost, err: false, - eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "arm-get", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodGet, err: false, - eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "arm-list", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases", method: http.MethodGet, err: false, - eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "arm-put", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodPut, err: false, - eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "arm-patch", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodPatch, err: false, - eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, { desc: "arm-delete", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", method: http.MethodDelete, err: false, - eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - eRType: linkrp.MongoDatabasesResourceType, + eID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + eRType: portableresources.MongoDatabasesResourceType, }, } @@ -1139,9 +1139,9 @@ func Test_Type(t *testing.T) { expected: ResourceGroupType, }, { - desc: "LinkRP resource", - id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - expected: "Applications.Link/mongoDatabases", + desc: "Datasource RP resource", + id: "/planes/radius/local/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + expected: "Applications.Datastores/mongoDatabases", }, { desc: "AWS resource", @@ -1150,8 +1150,8 @@ func Test_Type(t *testing.T) { }, { desc: "Azure resource", - id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Link/mongoDatabases/mongo-database-0", - expected: "Applications.Link/mongoDatabases", + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Applications.Datastores/mongoDatabases/mongo-database-0", + expected: "Applications.Datastores/mongoDatabases", }, } for _, tt := range values { diff --git a/pkg/ucp/resources/radius/radius.go b/pkg/ucp/resources/radius/radius.go index 0ec81f2939..9af9788e66 100644 --- a/pkg/ucp/resources/radius/radius.go +++ b/pkg/ucp/resources/radius/radius.go @@ -27,12 +27,13 @@ const ( // NamespaceApplicationsCore defines the namespace for the Radius Applications.Core resource provider. NamespaceApplicationsCore = "Applications.Core" - // NamespaceApplicationsLink defines the namespace for the Radius Applications.Link resource provider. - NamespaceApplicationsLink = "Applications.Link" + // NamespaceApplicationsDatastores defines the namespace for the Radius Applications.Datastores resource provider. NamespaceApplicationsDatastores = "Applications.Datastores" + // NamespaceApplicationsDapr defines the namespace for the Radius Applications.Dapr resource provider. NamespaceApplicationsDapr = "Applications.Dapr" + // NamespaceApplicationsMessaging defines the namespace for the Radius Applications.Messaging resource provider. NamespaceApplicationsMessaging = "Applications.Messaging" ) diff --git a/pkg/ucp/resources/radius/radius_test.go b/pkg/ucp/resources/radius/radius_test.go index b3521118b5..dabfacf932 100644 --- a/pkg/ucp/resources/radius/radius_test.go +++ b/pkg/ucp/resources/radius/radius_test.go @@ -34,7 +34,7 @@ func Test_IsRadiusResource(t *testing.T) { expected: true, }, { - testID: resources.MustParse("/planes/radius/local/resourceGroups/r1/providers/Applications.Link/mongoDatabases/test-mongo"), + testID: resources.MustParse("/planes/radius/local/resourceGroups/r1/providers/Applications.Datastores/mongoDatabases/test-mongo"), expected: true, }, { diff --git a/pkg/ucp/util/normalize_test.go b/pkg/ucp/util/normalize_test.go index 2848a69945..1de19355d7 100644 --- a/pkg/ucp/util/normalize_test.go +++ b/pkg/ucp/util/normalize_test.go @@ -29,7 +29,7 @@ func TestNormalizeString(t *testing.T) { }{ {"applications.core/environments", "applicationscore-environments"}, {"applications.core/provider", "applicationscore-provider"}, - {"applications.link/provider", "applicationslink-provider"}, + {"applications.dapr/provider", "applicationsdapr-provider"}, } for _, tc := range testrt { diff --git a/pkg/validator/loader.go b/pkg/validator/loader.go index d90bf6a5c3..e421452247 100644 --- a/pkg/validator/loader.go +++ b/pkg/validator/loader.go @@ -57,7 +57,7 @@ func (l *Loader) SupportedVersions(resourceType string) []string { return versions } - // using the openapi key here as all the link resource app models are defines as part of openapi.json. + // using the openapi key here as all the portable resource app models are defines as part of openapi.json. if versions, ok := l.supportedVersions[getOpenapiKey(resourceType)]; ok { return versions } @@ -72,7 +72,7 @@ func (l *Loader) GetValidator(resourceType, version string) (Validator, bool) { return &v, true } - // using the openapi key here as all the link resource app models are defines as part of openapi.json. + // using the openapi key here as all the portable resource app models are defines as part of openapi.json. v, ok = l.validators[getValidatorKey(getOpenapiKey(resourceType), version)] if ok { return &v, true @@ -174,7 +174,7 @@ func getValidatorKey(resourceType, version string) string { return strings.ToLower(resourceType + "-" + version) } -// getOpenapiKey returns Applications.Link/openapi or Applications.Core/openapi based on the resource type. +// getOpenapiKey returns /openapi based on the resource type. func getOpenapiKey(resourceType string) string { s := strings.Split(resourceType, "/") return s[0] + "/openapi" diff --git a/swagger/doc.go b/swagger/doc.go index 62a1b9ede9..276098a4ea 100644 --- a/swagger/doc.go +++ b/swagger/doc.go @@ -23,12 +23,12 @@ the REST APIs of Radius resource providers. We use OpenAPI Spec v2 as a source of truth to: 1. Validate the incoming request (/pkg/validator) - 2. Generate Go resource models via autorest (/pkg/corerp/api, /pkg/linkrp/api) and + 2. Generate Go resource models via autorest (/pkg/corerp/api, /pkg/datastores/api, /pkg/dapr/api, /pkg/messaging/api) and 3. Generate Bicep types. OpenAPI specification files must be stored in the structured directory: - specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview + specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview ------------ ---------------------- ------- ------------------------- Product Name RP Namespace preview API version or diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json index 8fa30b4e24..1f2ba81c85 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_CreateOrUpdate.json @@ -18,7 +18,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" @@ -60,7 +60,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json index cf12255d83..43070c4772 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetEnv0.json @@ -29,7 +29,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json index 9cc8e2155c..1e5300771d 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json @@ -10,7 +10,7 @@ "responses": { "200": { "body": { - "linkType": "Applications.Link/mongoDatabases", + "linkType": "Applications.Datastores/mongoDatabases", "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", "parameters": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json index 33606a3b17..639bf67f6b 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_List.json @@ -30,7 +30,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" @@ -40,7 +40,7 @@ "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/mongo" } }, - "Applications.Link/redisCaches":{ + "Applications.Datastores/redisCaches":{ "redis-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/rediscache" @@ -109,7 +109,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" } diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json index b34faeafaf..a12a1ad8e2 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_PatchEnv0.json @@ -18,7 +18,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" @@ -47,7 +47,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index 7ea7d77991..891fb7fe19 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -946,7 +946,7 @@ { "name": "extenderName", "in": "path", - "description": "The name of the ExtenderResource link resource", + "description": "The name of the ExtenderResource portable resource", "required": true, "type": "string", "maxLength": 63, @@ -989,7 +989,7 @@ { "name": "extenderName", "in": "path", - "description": "The name of the ExtenderResource link resource", + "description": "The name of the ExtenderResource portable resource", "required": true, "type": "string", "maxLength": 63, @@ -1061,7 +1061,7 @@ { "name": "extenderName", "in": "path", - "description": "The name of the ExtenderResource link resource", + "description": "The name of the ExtenderResource portable resource", "required": true, "type": "string", "maxLength": 63, @@ -1131,7 +1131,7 @@ { "name": "extenderName", "in": "path", - "description": "The name of the ExtenderResource link resource", + "description": "The name of the ExtenderResource portable resource", "required": true, "type": "string", "maxLength": 63, @@ -1194,7 +1194,7 @@ { "name": "extenderName", "in": "path", - "description": "The name of the ExtenderResource link resource", + "description": "The name of the ExtenderResource portable resource", "required": true, "type": "string", "maxLength": 63, @@ -3395,7 +3395,7 @@ }, "ExtenderProperties": { "type": "object", - "description": "ExtenderResource link properties", + "description": "ExtenderResource portable resource properties", "properties": { "environment": { "type": "string", @@ -3422,7 +3422,7 @@ }, "recipe": { "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the extender link" + "description": "The recipe used to automatically deploy underlying infrastructure for the extender portable resource" }, "resourceProvisioning": { "$ref": "#/definitions/ResourceProvisioning", @@ -3442,7 +3442,7 @@ }, "ExtenderResource": { "type": "object", - "description": "ExtenderResource link", + "description": "ExtenderResource portable resource", "properties": { "properties": { "$ref": "#/definitions/ExtenderProperties", @@ -3517,7 +3517,7 @@ }, "recipe": { "$ref": "#/definitions/RecipeUpdate", - "description": "The recipe used to automatically deploy underlying infrastructure for the extender link" + "description": "The recipe used to automatically deploy underlying infrastructure for the extender portable resource" }, "resourceProvisioning": { "$ref": "#/definitions/ResourceProvisioning", @@ -4453,7 +4453,7 @@ "properties": { "linkType": { "type": "string", - "description": "Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases'" + "description": "Type of the link this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases'" }, "name": { "type": "string", diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersDelete.json deleted file mode 100644 index 4e11215d4b..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprPubSubBrokerName": "daprpubsub0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersGet.json deleted file mode 100644 index 5f0af81249..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersGet.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "daprPubSubBrokerName": "daprpub.sub0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprpub.sub0", - "name": "daprpub.sub0", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersList.json deleted file mode 100644 index 2e1ace3a05..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersList.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "parameters": { - "rootScope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub0", - "name": "daprPubSub0", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub1", - "name": "daprPubSub1", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "pubsub.kafka", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub2", - "name": "daprPubSub2", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersListByRootScope.json deleted file mode 100644 index f378bd7ee6..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersListByRootScope.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub0", - "name": "daprPubSub0", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/daprPubSubBrokers/daprPubSub1", - "name": "daprPubSub1", - "type": "Applications.Link/daprPubSubBrokers", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "pubsub.kafka", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/daprPubSubBrokers?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPut.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPut.json deleted file mode 100644 index 4e71c31975..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPut.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprPubSubBrokerName": "daprpubsub0", - "api-version": "2022-03-15-privatepreview", - "DaprPubSubBrokerParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub0", - "name": "daprPubSub0", - "type": "Applications.Link/daprPubSubBrokers", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub1", - "name": "daprPubSub1", - "type": "Applications.Link/daprPubSubBrokers", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.ServiceBus/namespaces/testQueue" - } - ], - "type": "pubsub.azure.servicebus", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPutWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPutWithRecipe.json deleted file mode 100644 index d9872b4fc4..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprPubSubBrokersPutWithRecipe.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprPubSubBrokerName": "daprpubsub0", - "api-version": "2022-03-15-privatepreview", - "DaprPubSubBrokerParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub0", - "name": "daprPubSub0", - "type": "Applications.Link/daprPubSubBrokers", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "recipe", - "type": "pubsub.azure.servicebus", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprPubSubBrokers/daprPubSub1", - "name": "daprPubSub1", - "type": "Applications.Link/daprPubSubBrokers", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "recipe", - "type": "pubsub.azure.servicebus", - "recipe": { - "name": "pubsub-test", - "parameters": { - "port": 6081 - } - } - } - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresDelete.json deleted file mode 100644 index c05de28c3c..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresDelete.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprSecretStoreName": "daprsecretstore0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresGet.json deleted file mode 100644 index bd2b645675..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresGet.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "daprSecretStoreName": "daprsecretstore0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Link/daprSecretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresList.json deleted file mode 100644 index 26574f5f3b..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresList.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Link/daprSecretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore1", - "name": "daprSecretStore1", - "type": "Applications.Link/daprSecretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresListByRootScope.json deleted file mode 100644 index 04091b8b57..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresListByRootScope.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Link/daprSecretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore1", - "name": "daprSecretStore1", - "type": "Applications.Link/daprSecretStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/daprSecretStores?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresPut.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresPut.json deleted file mode 100644 index 448efed7cb..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprSecretStoresPut.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprSecretStoreName": "daprsecretstore0", - "api-version": "2022-03-15-privatepreview", - "DaprSecretStoreParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore0", - "name": "daprSecretStore0", - "type": "Applications.Link/daprSecretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "kind": "generic", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprSecretStores/daprSecretStore1", - "name": "daprSecretStore1", - "type": "Applications.Link/daprSecretStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "secretstores.hashicorp.vault", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresDelete.json deleted file mode 100644 index b1d39394d8..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprStateStoreName": "daprstatestore0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresGet.json deleted file mode 100644 index 3450b5fb4b..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresGet.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview", - "daprStateStoreName": "daprstatestore0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresList.json deleted file mode 100644 index 04eb1b5885..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresList.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable"} - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore1", - "name": "daprStateStore1", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable"} - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore2", - "name": "daprStateStore2", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore3", - "name": "daprStateStore3", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "recipe-test" - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresListByRootScope.json deleted file mode 100644 index 3a2dc7e6a3..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresListByRootScope.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase"} - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/daprStateStores/daprStateStore1", - "name": "daprStateStore1", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase"} - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore2", - "name": "daprStateStore2", - "type": "Applications.Link/daprStateStores", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/daprStateStores?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPut.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPut.json deleted file mode 100644 index 3e0ae0f135..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPut.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprStateStoreName": "daprstatestore0", - "api-version": "2022-03-15-privatepreview", - "DaprStateStoreParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "mode": "resource", - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "kind": "state.sqlserver", - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable"} - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore1", - "name": "daprStateStore1", - "type": "Applications.Link/daprStateStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Storage/storageAccounts/tableServices/tables/testTable"} - ], - "type": "state.zookeeper", - "version": "v1", - "metadata": { - "foo": "bar" - }, - "resourceProvisioning": "manual" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPutWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPutWithRecipe.json deleted file mode 100644 index 9c6f14d5b9..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/DaprStateStoresPutWithRecipe.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "daprStateStoreName": "daprstatestore0", - "api-version": "2022-03-15-privatepreview", - "DaprStateStoreParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "recipe-test" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore0", - "name": "daprStateStore0", - "type": "Applications.Link/daprStateStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "kind": "state.sqlserver", - "recipe": { - "name": "recipe-test" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/daprStateStores/daprStateStore1", - "name": "daprStateStore1", - "type": "Applications.Link/daprStateStores", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "mode": "recipe", - "recipe": { - "name": "recipe-test" - } - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json deleted file mode 100644 index 67c09ee3ea..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "extenderName": "extender0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersGet.json deleted file mode 100644 index 621e5709ae..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersGet.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview", - "extenderName": "extender0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersList.json deleted file mode 100644 index 49e1381f3f..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersList.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json deleted file mode 100644 index 0c54b9e4ba..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListByRootScope.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/extenders?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json deleted file mode 100644 index 56abae506a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersListSecrets.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "testGroup", - "api-version": "2022-03-15-privatepreview", - "extenderName": "extender0" - }, - "responses": { - "200": { - "body": { - "accountSid": "sid", - "authToken:": "token" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPut.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPut.json deleted file mode 100644 index 1b2adaf31a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPut.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "extenderName": "extender0", - "api-version": "2022-03-15-privatepreview", - "ExtenderParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender1", - "name": "extender1", - "type": "Applications.Link/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "fromNumber": "222-222-2222", - "secrets": { - "accountSid": "sid", - "authToken:": "token" - }, - "resourceProvisioning": "manual" - } - } - } - } -} - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json deleted file mode 100644 index dd2e7caa16..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/ExtendersPutWithRecipe.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "extenderName": "extender0", - "api-version": "2022-03-15-privatepreview", - "ExtenderParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "s3" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender0", - "name": "extender0", - "type": "Applications.Link/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "s3" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/extenders/extender1", - "name": "extender1", - "type": "Applications.Link/extenders", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "s3" - } - } - } - } - } -} - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json deleted file mode 100644 index 46a6c0bff2..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesDelete.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "mongoDatabaseName": "mongo0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json deleted file mode 100644 index 74a8055467..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesGet.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "mongoDatabaseName": "mongo0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning":"manual", - "resources": [ - {"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"} - ], - "database": "mongo0", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255 - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json deleted file mode 100644 index e8bc669634..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesList.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "resources": [ - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"} - ], - "database": "mongo0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo1", - "name": "mongo1", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "mongo0", - "secrets": { - "username": "testUser", - "password": "testPassword", - "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/mongoDatabases/mongo1", - "name": "mongo1", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json deleted file mode 100644 index c0bc5ce59a..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListByRootScope.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}], - "database": "mongo0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/mongoDatabases/mongo1", - "name": "mongo1", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "mongo0", - "secrets": { - "username": "testUser", - "password": "testPassword", - "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/mongoDatabases/mongo1", - "name": "mongo1", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/mongoDatabases?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json deleted file mode 100644 index b01ba95aec..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesListSecrets.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "mongoDatabaseName": "mongo0" - }, - "responses": { - "200": { - "body": { - "username": "testUser", - "password": "testPassword", - "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json deleted file mode 100644 index 8c1516b880..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutRecipe.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "mongoDatabaseName": "mongo0", - "api-version": "2022-03-15-privatepreview", - "MongoDatabaseParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo1", - "name": "mongo1", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "cosmosdb", - "parameters":{ - "foo":"bar" - } - } - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json deleted file mode 100644 index c4de8b52e5..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/MongoDatabasesPutValues.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "mongoDatabaseName": "mongo0", - "api-version": "2022-03-15-privatepreview", - "MongoDatabaseParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning":"manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "secrets": { - "username": "testUser", - "password": "testPassword", - "connectionString": "mongodb://testUser:testPassword@testAccount1.mongo.cosmos.azure.com:10255" - }, - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.DocumentDB/databaseAccounts/testAccount/mongodbDatabases/db"}] - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo0", - "name": "mongo0", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning":"manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "mongo0" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/mongoDatabases/mongo1", - "name": "mongo1", - "type": "Applications.Link/mongoDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning":"manual", - "host": "testAccount1.mongo.cosmos.azure.com", - "port": 10255, - "database": "mongo1" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/OperationsList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/OperationsList.json deleted file mode 100644 index f5a5bff1f8..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/OperationsList.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "parameters": { - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "name": "Applications.Link/operations/read", - "isDataAction": false, - "display": { - "provider": "Applications.Link", - "resource": "Operations", - "operation": "Get operations", - "description": "Gets the list of Operations" - } - }, - { - "name": "Applications.Link/mongoDatabases/read", - "isDataAction": false, - "display": { - "provider": "Applications.Link", - "resource": "mongoDatabases", - "operation": "Get/List mongoDatabases", - "description": "Gets/Lists mongo database link(s)" - } - }, - { - "name": "Applications.Link/mongoDatabases/write", - "isDataAction": false, - "display": { - "provider": "Applications.Link", - "resource": "mongoDatabases", - "operation": "Create/Update mongoDatabases", - "description": "Creates or updates a mongo database link" - } - }, - { - "name": "Applications.Link/mongoDatabases/delete", - "isDataAction": false, - "display": { - "provider": "Applications.Link", - "resource": "mongoDatabases", - "operation": "Delete mongoDatabases", - "description": "Deletes a mongo database link" - } - }, - { - "name": "Applications.Link/register/action", - "isDataAction": false, - "display": { - "provider": "Applications.Link", - "resource": "Applications.Link", - "operation": "Register 'Applications.Link' resource provider", - "description": "Registers the 'Applications.Link' resource provider with a subscription" - } - }, - { - "name": "Applications.Link/unregister/action", - "isDataAction": false, - "display": { - "provider": "Applications.Link", - "resource": "Applications.Link", - "operation": "Unregister 'Applications.Link' resource provider", - "description": "Unregisters the 'Applications.Link' resource provider with a subscription" - } - } - ] - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesDelete.json deleted file mode 100644 index d4951bcf32..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "rabbitMQMessageQueueName": "rabbitmq0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesGet.json deleted file mode 100644 index 3c91597618..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesGet.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "rabbitMQMessageQueueName": "rabbitmq0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesList.json deleted file mode 100644 index 8201de777d..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesList.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq1", - "name": "rabbitmq1", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListByRootScope.json deleted file mode 100644 index abacb89868..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListByRootScope.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq1", - "name": "rabbitmq1", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/rabbitMQMessageQueues?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListSecrets.json deleted file mode 100644 index 5a329dbcdf..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesListSecrets.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "testGroup", - "api-version": "2022-03-15-privatepreview", - "rabbitMQMessageQueueName": "rabbitmq0" - }, - "responses": { - "200": { - "body": { - "connectionString": "connection://string" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesPut.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesPut.json deleted file mode 100644 index d92b63188e..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RabbitMQMessageQueuesPut.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "rabbitMQMessageQueueName": "rabbitmq0", - "api-version": "2022-03-15-privatepreview", - "RabbitMQMessageQueueParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq0", - "name": "rabbitmq0", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/rabbitMQMessageQueues/rabbitmq1", - "name": "rabbitmq1", - "type": "Applications.Link/rabbitMQMessageQueues", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "queue": "rabbitmq0", - "secrets": { - "connectionString": "connection://string" - } - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json deleted file mode 100644 index 62e9b296b4..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "redisCacheName": "redis0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json deleted file mode 100644 index 2d190a157e..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesGet.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "redisCacheName": "redis0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning":"manual", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache"}], - "host": "myrediscache.redis.cache.windows.net", - "port":6380, - "username": "username" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesList.json deleted file mode 100644 index 5d364cb289..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesList.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache"}], - "resourceProvisioning":"manual", - "host": "myrediscache.redis.cache.windows.net", - "port":6380, - "username": "username" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis1", - "name": "redis1", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "resourceProvisioning":"manual", - "host":"myrediscache.redis.cache.windows.net", - "port":6380, - "username": "username" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json deleted file mode 100644 index 454526560e..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListByRootScope.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache"}], - "host":"myrediscache.redis.cache.windows.net", - "port":6380 - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/redisCaches/redis1", - "name": "redis1", - "type": "Applications.Link/redisCaches", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "resourceProvisioning": "manual", - "host":"myrediscache.redis.cache.windows.net", - "port":6380, - "username": "username" - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/redisCaches?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json deleted file mode 100644 index 223cf35a41..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesListSecrets.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "testGroup", - "api-version": "2022-03-15-privatepreview", - "redisCacheName": "redis0" - }, - "responses": { - "200": { - "body": { - "connectionString": "myrediscache.redis.cache.windows.net:6380", - "password": "testPassword" - } - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json deleted file mode 100644 index 11d94052e4..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutRecipe.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "redisCacheName": "redis0", - "api-version": "2022-03-15-privatepreview", - "RedisCacheParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis1", - "name": "redis1", - "type": "Applications.Link/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "recipe": { - "name": "redis", - "parameters": { - "port": 2334 - } - } - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json deleted file mode 100644 index 96e0d7ac5f..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutResource.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "redisCacheName": "redis0", - "api-version": "2022-03-15-privatepreview", - "RedisCacheParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache"}], - "host": "myrediscache.redis.cache.windows.net", - "port":6380 - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache"}], - "host": "myrediscache.redis.cache.windows.net", - "port":6380 - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis1", - "name": "redis1", - "type": "Applications.Link/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "resources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache"}], - "host": "myrediscache.redis.cache.windows.net", - "port": 6380 - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json deleted file mode 100644 index 5cc56836d7..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/RedisCachesPutValues.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "redisCacheName": "redis0", - "api-version": "2022-03-15-privatepreview", - "RedisCacheParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host":"myrediscache.redis.cache.windows.net", - "port":6380, - "secrets": { - "password": "testPassword", - "connectionString": "test-connection-string" - } - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis0", - "name": "redis0", - "type": "Applications.Link/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host":"myrediscache.redis.cache.windows.net", - "port":6380, - "username": "username" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/redisCaches/redis1", - "name": "redis1", - "type": "Applications.Link/redisCaches", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resourceProvisioning": "manual", - "host":"myrediscache.redis.cache.windows.net", - "port":6380, - "username": "username" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json deleted file mode 100644 index c73e910e4d..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesDelete.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "sqlDatabaseName": "sql0", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json deleted file mode 100644 index d8f66ca63c..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesGet.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview", - "sqlDatabaseName": "sql0" - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources":[ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database":"sql-database", - "server":"test-server", - "resourceProvisioning": "manual" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json deleted file mode 100644 index 1d0b1564f8..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesList.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources":[ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database":"testDatabase", - "server":"testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql1", - "name": "sql1", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql2", - "name": "sql2", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json deleted file mode 100644 index 498f97fffe..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesListByRootScope.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resources":[ - { - "id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase" - } - ], - "database":"sql-database", - "server":"test-server", - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup1/providers/Applications.Link/sqlDatabases/sql1", - "name": "sql1", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "database": "testDatabase", - "server": "testAccount1.sql.cosmos.azure.com", - "resourceProvisioning": "manual" - } - }, - { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql2", - "name": "sql2", - "type": "Applications.Link/sqlDatabases", - "location": "global", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env1", - "recipe": { - "name": "sqldb", - "parameters":{ - "foo":"bar" - } - } - } - } - ], - "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Link/sqlDatabases?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json deleted file mode 100644 index 11b97d11e4..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/examples/SQLDatabasesPut.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "parameters": { - "rootScope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", - "sqlDatabaseName": "sql0", - "api-version": "2022-03-15-privatepreview", - "SQLDatabaseParameters": { - "location": "West US", - "properties": { - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", - "mode":"resource" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql0", - "name": "sql0", - "type": "Applications.Link/sqlDatabases", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", - "mode":"resource" - } - } - }, - "201": { - "body": { - "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Link/sqlDatabases/sql1", - "name": "sql1", - "type": "Applications.Link/sqlDatabases", - "location": "West US", - "properties": { - "provisioningState": "Succeeded", - "application": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", - "environment": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Core/environments/env0", - "resource": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Microsoft.Sql/servers/testServer/databases/testDatabase", - "mode":"resource" - } - } - } - } - } - \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/extenders.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/extenders.json deleted file mode 100644 index 9402612d40..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/extenders.json +++ /dev/null @@ -1,385 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Link Management APIs", - "description": "REST APIs for Applications.Link/extenders", - "version": "2022-03-15-privatepreview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow.", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/{rootScope}/providers/Applications.Link/extenders": { - "get": { - "description": "Lists information about all extender resources in the given root scope", - "operationId": "Extenders_ListByRootScope", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersListByRootScope": { - "$ref": "./examples/ExtendersListByRootScope.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "openapi.json#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "List of Extender resources", - "schema": { - "$ref": "#/definitions/ExtenderList" - } - }, - "default": { - "description": "Error response describing the reason for operation failure", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "deprecated": false, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/extenders/{extenderName}": { - "get": { - "description": "Retrieves information about a extender resource", - "operationId": "Extenders_Get", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersGet": { - "$ref": "./examples/ExtendersGet.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "openapi.json#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - } - ], - "responses": { - "200": { - "description": "Extender resource", - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "default": { - "description": "Error response describing the reason for operation failure", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "description": "Creates or updates a Extender resource", - "operationId": "Extenders_CreateOrUpdate", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersPut": { - "$ref": "./examples/ExtendersPut.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "openapi.json#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - }, - { - "name": "ExtenderParameters", - "description": "extender create parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - } - ], - "responses": { - "200": { - "description": "The request was successful; response contains the extender resource", - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "201": { - "description": "The request was successful, resource will be updated asynchronously", - "schema": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "default": { - "description": "Error response describing the reason for operation failure", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "description": "Deletes an existing extender resource", - "operationId": "Extenders_Delete", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersDelete": { - "$ref": "./examples/ExtendersDelete.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "openapi.json#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - } - ], - "responses": { - "200": { - "description": "The Extender link was successfully deleted." - }, - "202": { - "description": "The Extender link will be deleted asynchronously." - }, - "204": { - "description": "The Extender link does not exist." - }, - "default": { - "description": "Error response describing the reason for operation failure", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/extenders/{extenderName}/listSecrets": { - "post": { - "description": "Lists secrets values for the specified Extender resource", - "operationId": "Extenders_listSecrets", - "produces": [ - "application/json" - ], - "x-ms-examples": { - "ExtendersGet": { - "$ref": "./examples/ExtendersListSecrets.json" - } - }, - "tags": [ - "Extenders" - ], - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "openapi.json#/parameters/RootScopeParam" - }, - { - "$ref": "#/parameters/ExtenderNameParameter" - } - ], - "responses": { - "200": { - "description": "Extender secrets", - "schema": { - "$ref": "#/definitions/ExtenderListSecretsResult" - } - }, - "default": { - "description": "Error response describing the reason for operation failure", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "Recipe": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the recipe within the environment to use" - }, - "parameters": { - "$ref": "openapi.json#/definitions/Parameters", - "description": "Key/value parameters to pass into the recipe at deployment" - } - }, - "description": "The recipe used to automatically deploy underlying infrastructure for a link", - "required": [ - "name" - ] - }, - "ResourceProvisioning": { - "type": "string", - "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", - "enum": [ - "recipe", - "manual" - ], - "x-ms-enum": { - "name": "ResourceProvisioning", - "modelAsString": true - } - }, - "ExtenderList": { - "description": "Object that includes an array of Extender and a possible link for next set", - "type": "object", - "properties": { - "value": { - "description": "List of Extender resources", - "type": "array", - "items": { - "$ref": "#/definitions/ExtenderResource" - } - }, - "nextLink": { - "description": "The link used to fetch the next page of Extender list.", - "type": "string" - } - } - }, - "ExtenderResource": { - "description": "Extender link", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ], - "required": [ - "properties" - ], - "properties": { - "systemData": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/systemData" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/ExtenderProperties" - } - } - }, - "ExtenderListSecretsResult": { - "description": "The secret values for the given Extender resource", - "$ref": "#/definitions/ExtenderSecrets" - }, - "ExtenderSecrets": { - "description": "The secret values for the given Extender resource", - "additionalProperties": true, - "properties": {} - }, - "ExtenderProperties": { - "description": "Extender link properties", - "type": "object", - "allOf": [ - { - "$ref": "openapi.json#/definitions/BasicResourceProperties" - } - ], - "additionalProperties": true, - "properties": { - "provisioningState": { - "readOnly": true, - "$ref": "openapi.json#/definitions/ProvisioningState", - "description": "Provisioning state of the extender link at the time the operation was called" - }, - "secrets": { - "additionalProperties": true, - "$ref": "#/definitions/ExtenderSecrets" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Extender link" - } - }, - "required": [ - "environment" - ] - } - }, - "parameters": { - "ExtenderNameParameter": { - "description": "The name of the Extender link resource", - "name": "extenderName", - "in": "path", - "required": true, - "type": "string", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method" - } - } -} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/openapi.json deleted file mode 100644 index 42eb546b25..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/openapi.json +++ /dev/null @@ -1,2462 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Link Management APIs", - "version": "2022-03-15-privatepreview", - "description": "REST APIs for Applications.Link DaprPubSubBroker Resource", - "x-cadl-generated": [ - { - "emitter": "@azure-tools/cadl-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "tags": [ - { - "name": "MongoDatabases" - }, - { - "name": "Operations" - }, - { - "name": "SqlDatabases" - }, - { - "name": "RedisCaches" - }, - { - "name": "RabbitMQMessageQueues" - }, - { - "name": "DaprSecretStore" - }, - { - "name": "DaprStateStore" - }, - { - "name": "DaprPubSubBroker" - } - ], - "paths": { - "/{rootScope}/providers/Applications.Link/daprPubSubBrokers": { - "get": { - "tags": [ - "DaprPubSubBroker" - ], - "operationId": "DaprPubSubBroker_ListByRootScope", - "description": "Lists information about all DaprPubSubBrokerResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprPubSubBrokerResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/daprPubSubBrokers/{daprPubSubBrokerName}": { - "get": { - "tags": [ - "DaprPubSubBroker" - ], - "operationId": "DaprPubSubBroker_Get", - "description": "Retrieves information about a DaprPubSubBrokerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprPubSubBrokerName", - "in": "path", - "required": true, - "description": "DaprPubSubBroker name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprPubSubBrokerResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "DaprPubSubBroker" - ], - "operationId": "DaprPubSubBroker_CreateOrUpdate", - "description": "Creates or updates a DaprPubSubBrokerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprPubSubBrokerName", - "in": "path", - "required": true, - "description": "DaprPubSubBroker name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/DaprPubSubBrokerResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprPubSubBrokerResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/DaprPubSubBrokerResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "DaprPubSubBroker" - ], - "operationId": "DaprPubSubBroker_Delete", - "description": "Deletes an existing DaprPubSubBrokerResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprPubSubBrokerName", - "in": "path", - "required": true, - "description": "DaprPubSubBroker name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/{rootScope}/providers/Applications.Link/daprSecretStores": { - "get": { - "tags": [ - "DaprSecretStore" - ], - "operationId": "DaprSecretStore_ListByRootScope", - "description": "Lists information about all DaprSecretStoreResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprSecretStoreResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/daprSecretStores/{daprSecretStoreName}": { - "get": { - "tags": [ - "DaprSecretStore" - ], - "operationId": "DaprSecretStore_Get", - "description": "Retrieves information about a DaprSecretStoreResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprSecretStoreName", - "in": "path", - "required": true, - "description": "DaprSecretStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprSecretStoreResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "DaprSecretStore" - ], - "operationId": "DaprSecretStore_CreateOrUpdate", - "description": "Creates or updates a DaprSecretStoreResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprSecretStoreName", - "in": "path", - "required": true, - "description": "DaprSecretStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/DaprSecretStoreResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprSecretStoreResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/DaprSecretStoreResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "DaprSecretStore" - ], - "operationId": "DaprSecretStore_Delete", - "description": "Deletes an existing DaprSecretStoreResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprSecretStoreName", - "in": "path", - "required": true, - "description": "DaprSecretStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/daprStateStores": { - "get": { - "tags": [ - "DaprStateStore" - ], - "operationId": "DaprStateStore_ListByRootScope", - "description": "Lists information about all DaprStateStoreResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprStateStoreResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/daprStateStores/{daprStateStoreName}": { - "get": { - "tags": [ - "DaprStateStore" - ], - "operationId": "DaprStateStore_Get", - "description": "Retrieves information about a DaprStateStoreResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprStateStoreName", - "in": "path", - "required": true, - "description": "DaprStateStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprStateStoreResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "DaprStateStore" - ], - "operationId": "DaprStateStore_CreateOrUpdate", - "description": "Creates or updates a DaprStateStoreResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprStateStoreName", - "in": "path", - "required": true, - "description": "DaprStateStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/DaprStateStoreResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/DaprStateStoreResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/DaprStateStoreResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "DaprStateStore" - ], - "operationId": "DaprStateStore_Delete", - "description": "Deletes an existing DaprStateStoreResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "daprStateStoreName", - "in": "path", - "required": true, - "description": "DaprStateStore name", - "pattern": "^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/{rootScope}/providers/Applications.Link/mongoDatabases": { - "get": { - "tags": [ - "MongoDatabases" - ], - "operationId": "MongoDatabases_ListByRootScope", - "description": "Lists information about all MongoDatabaseResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/MongoDatabaseResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}": { - "get": { - "tags": [ - "MongoDatabases" - ], - "operationId": "MongoDatabases_Get", - "description": "Retrieves information about a MongoDatabaseResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "mongoDatabaseName", - "in": "path", - "required": true, - "description": "The name of the MongoDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/MongoDatabaseResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "MongoDatabases" - ], - "operationId": "MongoDatabases_CreateOrUpdate", - "description": "Creates or updates a MongoDatabaseResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "mongoDatabaseName", - "in": "path", - "required": true, - "description": "The name of the MongoDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/MongoDatabaseResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/MongoDatabaseResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/MongoDatabaseResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "MongoDatabases" - ], - "operationId": "MongoDatabases_Delete", - "description": "Deletes an existing MongoDatabaseResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "mongoDatabaseName", - "in": "path", - "required": true, - "description": "The name of the MongoDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - } - }, - "/{rootScope}/providers/Applications.Link/mongoDatabases/{mongoDatabaseName}/listSecrets": { - "post": { - "operationId": "MongoDatabases_ListSecrets", - "description": "Lists secrets values for the specified MongoDatabase resource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "mongoDatabaseName", - "in": "path", - "required": true, - "description": "The name of the MongoDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/MongoDatabaseListSecretsResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues": { - "get": { - "tags": [ - "RabbitMQMessageQueues" - ], - "operationId": "RabbitMqMessageQueues_ListByRootScope", - "description": "Lists information about all RabbitMQMessageQueueResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQMessageQueueResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}": { - "get": { - "tags": [ - "RabbitMQMessageQueues" - ], - "operationId": "RabbitMqMessageQueues_Get", - "description": "Retrieves information about a RabbitMQMessageQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "rabbitMQMessageQueueName", - "in": "path", - "required": true, - "description": "The name of the RabbitMQMessageQueue link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQMessageQueueResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "RabbitMQMessageQueues" - ], - "operationId": "RabbitMqMessageQueues_CreateOrUpdate", - "description": "Creates or updates a RabbitMQMessageQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "rabbitMQMessageQueueName", - "in": "path", - "required": true, - "description": "The name of the RabbitMQMessageQueue link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/RabbitMQMessageQueueResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQMessageQueueResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/RabbitMQMessageQueueResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "RabbitMQMessageQueues" - ], - "operationId": "RabbitMqMessageQueues_Delete", - "description": "Deletes an existing RabbitMQMessageQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "rabbitMQMessageQueueName", - "in": "path", - "required": true, - "description": "The name of the RabbitMQMessageQueue link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/rabbitMQMessageQueues/{rabbitMQMessageQueueName}/listSecrets": { - "post": { - "operationId": "RabbitMqMessageQueues_ListSecrets", - "description": "Lists secrets values for the specified RabbitMQMessageQueue resource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "rabbitMQMessageQueueName", - "in": "path", - "required": true, - "description": "The name of the RabbitMQMessageQueue link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQListSecretsResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/redisCaches": { - "get": { - "tags": [ - "RedisCaches" - ], - "operationId": "RedisCaches_ListByRootScope", - "description": "Lists information about all RedisCacheResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RedisCacheResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}": { - "get": { - "tags": [ - "RedisCaches" - ], - "operationId": "RedisCaches_Get", - "description": "Retrieves information about a RedisCacheResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "redisCacheName", - "in": "path", - "required": true, - "description": "The name of the RedisCache link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RedisCacheResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "RedisCaches" - ], - "operationId": "RedisCaches_CreateOrUpdate", - "description": "Creates or updates a RedisCacheResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "redisCacheName", - "in": "path", - "required": true, - "description": "The name of the RedisCache link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/RedisCacheResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RedisCacheResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/RedisCacheResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "RedisCaches" - ], - "operationId": "RedisCaches_Delete", - "description": "Deletes an existing RedisCacheResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "redisCacheName", - "in": "path", - "required": true, - "description": "The name of the RedisCache link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/redisCaches/{redisCacheName}/listSecrets": { - "post": { - "operationId": "RedisCaches_ListSecrets", - "description": "Lists secrets values for the specified RedisCache resource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "redisCacheName", - "in": "path", - "required": true, - "description": "The name of the RedisCache link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RedisCacheListSecretsResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/sqlDatabases": { - "get": { - "tags": [ - "SqlDatabases" - ], - "operationId": "SqlDatabases_ListByRootScope", - "description": "Lists information about all SqlDatabaseResources in the given root scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/SqlDatabaseResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}": { - "get": { - "tags": [ - "SqlDatabases" - ], - "operationId": "SqlDatabases_Get", - "description": "Retrieves information about a SqlDatabaseResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "sqlDatabaseName", - "in": "path", - "required": true, - "description": "The name of the SqlDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/SqlDatabaseResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "tags": [ - "SqlDatabases" - ], - "operationId": "SqlDatabases_CreateOrUpdate", - "description": "Creates or updates a SqlDatabaseResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "sqlDatabaseName", - "in": "path", - "required": true, - "description": "The name of the SqlDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - }, - { - "name": "resource", - "in": "body", - "required": true, - "description": "Resource create parameters.", - "schema": { - "$ref": "#/definitions/SqlDatabaseResource" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/SqlDatabaseResource" - } - }, - "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, - "schema": { - "$ref": "#/definitions/SqlDatabaseResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "delete": { - "tags": [ - "SqlDatabases" - ], - "operationId": "SqlDatabases_Delete", - "description": "Deletes an existing SqlDatabaseResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "sqlDatabaseName", - "in": "path", - "required": true, - "description": "The name of the SqlDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/{rootScope}/providers/Applications.Link/sqlDatabases/{sqlDatabaseName}/listSecrets": { - "post": { - "operationId": "SqlDatabases_ListSecrets", - "description": "Lists secrets values for the specified SqlDatabase resource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParam" - }, - { - "name": "sqlDatabaseName", - "in": "path", - "required": true, - "description": "The name of the SqlDatabase link resource", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", - "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/SqlDatabaseListSecretsResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Applications.Link/operations": { - "get": { - "tags": [ - "Operations" - ], - "operationId": "Operations_List", - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "Application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the link is consumed by" - }, - "BasicDaprResourceProperties": { - "type": "object", - "properties": { - "componentName": { - "type": "string", - "description": "The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.", - "readOnly": true - } - }, - "description": "Basic properties of a Dapr component object.", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "BasicResourceProperties": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the link is linked to" - }, - "application": { - "$ref": "#/definitions/Application", - "description": "Fully qualified resource ID for the application that the link is consumed by" - } - }, - "description": "Basic properties of a Radius resource.", - "required": [ - "environment" - ] - }, - "DaprPubSubBrokerProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the daprPubSubBroker resource at the time the operation was called", - "readOnly": true - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "metadata": { - "$ref": "#/definitions/object", - "description": "Metadata for the daprPubSubBroker resource. This should match the values specified in Dapr component spec" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the daprPubSubBroker link" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "A collection of references to resources associated with the daprPubSubBroker" - }, - "type": { - "type": "string", - "description": "DaprPubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format." - }, - "version": { - "type": "string", - "description": "Dapr component version" - } - }, - "description": "DaprPubSubBroker link properties", - "allOf": [ - { - "$ref": "#/definitions/BasicDaprResourceProperties" - } - ] - }, - "DaprPubSubBrokerResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/DaprPubSubBrokerProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "DaprPubSubBroker link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "DaprPubSubBrokerResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/DaprPubSubBrokerResource" - }, - "x-cadl-name": "DaprPubSubBrokerResource[]", - "description": "The DaprPubSubBrokerResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a DaprPubSubBrokerResource list operation.", - "required": [ - "value" - ] - }, - "DaprSecretStoreProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the dapr secret store link at the time the operation was called", - "readOnly": true - }, - "type": { - "type": "string", - "description": "Dapr Secret Store type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/" - }, - "version": { - "type": "string", - "description": "Dapr component version" - }, - "metadata": { - "$ref": "#/definitions/object", - "description": "Metadata for the Secret Store resource. This should match the values specified in Dapr component spec" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the daprSecretStore link" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - } - }, - "description": "DaprSecretStore link properties", - "allOf": [ - { - "$ref": "#/definitions/BasicDaprResourceProperties" - } - ] - }, - "DaprSecretStoreResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/DaprSecretStoreProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "DaprSecretStore link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "DaprSecretStoreResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/DaprSecretStoreResource" - }, - "x-cadl-name": "DaprSecretStoreResource[]", - "description": "The DaprSecretStoreResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a DaprSecretStoreResource list operation.", - "required": [ - "value" - ] - }, - "DaprStateStoreProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the DaprStateStore link at the time the operation was called", - "readOnly": true - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "metadata": { - "$ref": "#/definitions/object", - "description": "Metadata for the state store resource. This should match the values specified in Dapr component spec" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the daprStateStore link" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "A collection of references to resources associated with the state store" - }, - "type": { - "type": "string", - "description": "Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format." - }, - "version": { - "type": "string", - "description": "Dapr component version" - } - }, - "description": "DaprStateStore link properties", - "allOf": [ - { - "$ref": "#/definitions/BasicDaprResourceProperties" - } - ] - }, - "DaprStateStoreResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/DaprStateStoreProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "DaprStateStore link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "DaprStateStoreResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/DaprStateStoreResource" - }, - "x-cadl-name": "DaprStateStoreResource[]", - "description": "The DaprStateStoreResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a DaprStateStoreResource list operation.", - "required": [ - "value" - ] - }, - "MongoDatabaseListSecretsResult": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "Password to use when connecting to the target Mongo database" - }, - "connectionString": { - "type": "string", - "description": "Connection string used to connect to the target Mongo database" - } - }, - "description": "The secret values for the given MongoDatabase resource" - }, - "MongoDatabaseProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the mongo database link at the time the operation was called", - "readOnly": true - }, - "secrets": { - "$ref": "#/definitions/MongoDatabaseSecrets", - "description": "Secret values provided for the resource" - }, - "host": { - "type": "string", - "description": "Host name of the target Mongo database" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "Port value of the target Mongo database" - }, - "database": { - "type": "string", - "description": "Database name of the target Mongo database" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the MongoDB link" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the MongoDB resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "username": { - "type": "string", - "description": "Username to use when connecting to the target Mongo database" - } - }, - "description": "MongoDatabase link properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "MongoDatabaseResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/MongoDatabaseProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "MongoDatabase link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "MongoDatabaseResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/MongoDatabaseResource" - }, - "x-cadl-name": "MongoDatabaseResource[]", - "description": "The MongoDatabaseResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a MongoDatabaseResource list operation.", - "required": [ - "value" - ] - }, - "MongoDatabaseSecrets": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "Password to use when connecting to the target Mongo database" - }, - "connectionString": { - "type": "string", - "description": "Connection string used to connect to the target Mongo database" - } - }, - "description": "The secret values for the given MongoDatabase resource" - }, - "OutputResource": { - "type": "object", - "properties": {}, - "description": "Properties of an output resource." - }, - "Parameters": { - "type": "object", - "properties": {}, - "description": "Key/value parameters to pass into the recipe at deployment" - }, - "ProvisioningState": { - "type": "string", - "description": "Provisioning state of the link at the time the operation was called", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true - } - }, - "RabbitMQListSecretsResult": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "The password used to connect to the RabbitMQ instance" - }, - "uri": { - "type": "string", - "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" - } - }, - "description": "The secret values for the given RabbitMQMessageQueue resource" - }, - "RabbitMQMessageQueueProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the rabbitMQ message queue link at the time the operation was called", - "readOnly": true - }, - "secrets": { - "$ref": "#/definitions/RabbitMQSecrets", - "description": "Secrets provided by resources," - }, - "queue": { - "type": "string", - "description": "The name of the queue" - }, - "host": { - "type": "string", - "description": "The hostname of the RabbitMQ instance" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port of the RabbitMQ instance. Defaults to 5672" - }, - "vHost": { - "type": "string", - "description": "The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost." - }, - "username": { - "type": "string", - "description": "The username to use when connecting to the RabbitMQ instance" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the rabbitMQ resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the rabbitMQ link" - }, - "tls": { - "type": "boolean", - "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" - } - }, - "description": "RabbitMQMessageQueue link properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "RabbitMQMessageQueueResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/RabbitMQMessageQueueProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "RabbitMQMessageQueue link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "RabbitMQMessageQueueResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/RabbitMQMessageQueueResource" - }, - "x-cadl-name": "RabbitMQMessageQueueResource[]", - "description": "The RabbitMQMessageQueueResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a RabbitMQMessageQueueResource list operation.", - "required": [ - "value" - ] - }, - "RabbitMQSecrets": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "The password used to connect to the RabbitMQ instance" - }, - "uri": { - "type": "string", - "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" - } - }, - "description": "The secret values for the given RabbitMQMessageQueue resource" - }, - "Recipe": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the recipe within the environment to use" - }, - "parameters": { - "$ref": "#/definitions/Parameters", - "description": "Key/value parameters to pass into the recipe at deployment" - } - }, - "description": "The recipe used to automatically deploy underlying infrastructure for a link", - "required": [ - "name" - ] - }, - "RedisCacheListSecretsResult": { - "type": "object", - "properties": { - "connectionString": { - "type": "string", - "description": "The connection string used to connect to the Redis cache" - }, - "password": { - "type": "string", - "description": "The password for this Redis cache instance" - }, - "url": { - "type": "string", - "description": "The URL used to connect to the Redis cache" - } - }, - "description": "The secret values for the given RedisCache resource" - }, - "RedisCacheProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the redis cache link at the time the operation was called", - "readOnly": true - }, - "secrets": { - "$ref": "#/definitions/RedisCacheSecrets", - "description": "Secrets provided by resource" - }, - "host": { - "type": "string", - "description": "The host name of the target Redis cache" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port value of the target Redis cache" - }, - "username": { - "type": "string", - "description": "The username for Redis cache" - }, - "tls": { - "type": "boolean", - "description": "Specifies whether to enable SSL connections to the Redis cache" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the Redis caches link" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the Redis resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - } - }, - "description": "RedisCache link properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "RedisCacheResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/RedisCacheProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "RedisCache link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "RedisCacheResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/RedisCacheResource" - }, - "x-cadl-name": "RedisCacheResource[]", - "description": "The RedisCacheResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a RedisCacheResource list operation.", - "required": [ - "value" - ] - }, - "RedisCacheSecrets": { - "type": "object", - "properties": { - "connectionString": { - "type": "string", - "description": "The connection string used to connect to the Redis cache" - }, - "password": { - "type": "string", - "description": "The password for this Redis cache instance" - }, - "url": { - "type": "string", - "description": "The URL used to connect to the Redis cache" - } - }, - "description": "The secret values for the given RedisCache resource" - }, - "ResourceProvisioning": { - "type": "string", - "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", - "enum": [ - "recipe", - "manual" - ], - "x-ms-enum": { - "name": "ResourceProvisioning", - "modelAsString": true - } - }, - "ResourceReference": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Resource id of an existing resource" - } - }, - "description": "Describes a reference to an existing resource", - "required": [ - "id" - ] - }, - "ResourceStatus": { - "type": "object", - "properties": { - "outputResources": { - "type": "array", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [], - "x-cadl-name": "OutputResource[]", - "description": "Properties of an output resource" - } - }, - "description": "Status of a resource." - }, - "SqlDatabaseListSecretsResult": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "Password to use when connecting to the target Sql database" - }, - "connectionString": { - "type": "string", - "description": "Connection string used to connect to the target Sql database" - } - }, - "description": "The secret values for the given SqlDatabase resource" - }, - "SqlDatabaseProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the Sql database link at the time the operation was called", - "readOnly": true - }, - "database": { - "type": "string", - "description": "The name of the Sql database." - }, - "server": { - "type": "string", - "description": "The fully qualified domain name of the Sql database." - }, - "port": { - "type": "integer", - "format": "int32", - "description": "Port value of the target Sql database" - }, - "username": { - "type": "string", - "description": "Username to use when connecting to the target Sql database" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the sqldatabases link" - }, - "resources": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceReference" - }, - "x-cadl-name": "ResourceReference[]", - "description": "List of the resource IDs that support the SqlDatabase resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - }, - "secrets": { - "$ref": "#/definitions/SqlDatabaseSecrets", - "description": "Secret values provided for the resource" - } - }, - "description": "SqlDatabase properties", - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } - ] - }, - "SqlDatabaseResource": { - "type": "object", - "properties": { - "properties": { - "$ref": "#/definitions/SqlDatabaseProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "description": "SqlDatabase link", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "SqlDatabaseResourceListResult": { - "type": "object", - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/SqlDatabaseResource" - }, - "x-cadl-name": "SqlDatabaseResource[]", - "description": "The SqlDatabaseResource items on this page" - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" - } - }, - "description": "The response of a SqlDatabaseResource list operation.", - "required": [ - "value" - ] - }, - "SqlDatabaseSecrets": { - "type": "object", - "properties": { - "password": { - "type": "string", - "description": "Password to use when connecting to the target Sql database" - }, - "connectionString": { - "type": "string", - "description": "Connection string used to connect to the target Sql database" - } - }, - "description": "The secret values for the given SqlDatabase resource" - }, - "object": { - "type": "object", - "properties": {} - } - }, - "parameters": { - "RootScopeParam": { - "name": "rootScope", - "in": "path", - "required": true, - "description": "The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", - "minLength": 1, - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true, - "type": "string" - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json new file mode 100644 index 0000000000..4b6cf1b500 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_CreateOrUpdate", + "title": "Create or Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2022-08-19-preview", + "TestAsyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json new file mode 100644 index 0000000000..dc4fd265ef --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "TestAsyncResources_Delete", + "title": "Delete a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2022-08-19-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json new file mode 100644 index 0000000000..8c4f351bc3 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "TestAsyncResources_Get", + "title": "Get a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2022-08-19-preview" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json new file mode 100644 index 0000000000..bb7f6f5eff --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources by resourcegroup", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2022-08-19-preview&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json new file mode 100644 index 0000000000..37e52d2155 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2022-08-19-preview&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json new file mode 100644 index 0000000000..e23e021d59 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_Update", + "title": "Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2022-08-19-preview", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json new file mode 100644 index 0000000000..0479c3f953 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json @@ -0,0 +1,744 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test.Resource Resource Management APIs", + "version": "2022-08-19-preview", + "description": "REST APIs for Test.Resource", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "TestAsyncResources" + } + ], + "paths": { + "/{rootScope}/providers/Test.Resource/testAsyncResources": { + "get": { + "operationId": "TestAsyncResources_ListByScope", + "tags": [ + "TestAsyncResources" + ], + "description": "List TestAsyncResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestAsyncResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List TestAsyncResource resources by resourcegroup": { + "$ref": "./examples/TestAsyncResource_List.json" + }, + "List TestAsyncResource resources at root scope": { + "$ref": "./examples/TestAsyncResource_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Test.Resource/testAsyncResources/{testAsyncResourceName}": { + "get": { + "operationId": "TestAsyncResources_Get", + "tags": [ + "TestAsyncResources" + ], + "description": "Get a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a TestAsyncResource resource": { + "$ref": "./examples/TestAsyncResource_Get.json" + } + } + }, + "put": { + "operationId": "TestAsyncResources_CreateOrUpdate", + "tags": [ + "TestAsyncResources" + ], + "description": "Create a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'TestAsyncResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "201": { + "description": "Resource 'TestAsyncResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update TestAsyncResource resources": { + "$ref": "./examples/TestAsyncResource_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "TestAsyncResources_Update", + "tags": [ + "TestAsyncResources" + ], + "description": "Update a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/TestAsyncResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update TestAsyncResource resources": { + "$ref": "./examples/TestAsyncResource_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "TestAsyncResources_Delete", + "tags": [ + "TestAsyncResources" + ], + "description": "Delete a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a TestAsyncResource resource": { + "$ref": "./examples/TestAsyncResource_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/providers/Test.Resource/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "EnvironmentCompute": { + "type": "object", + "description": "Represents backing compute resource", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { + "type": "object", + "description": "IdentitySettings is the external identity setting.", + "properties": { + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" + }, + "oidcIssuer": { + "type": "string", + "description": "The URI for your compute platform's OIDC issuer" + }, + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" + } + }, + "required": [ + "kind" + ] + }, + "KubernetesCompute": { + "type": "object", + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, + "OutputResource": { + "type": "object", + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } + }, + "ProvisioningState": { + "type": "string", + "description": "Provisioning state of the portable resource at the time the operation was called", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Provisioning", + "Updating", + "Deleting", + "Accepted" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true + }, + "ResourceStatus": { + "type": "object", + "description": "Status of a resource.", + "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, + "outputResources": { + "type": "array", + "description": "Properties of an output resource", + "items": { + "$ref": "#/definitions/OutputResource" + }, + "x-ms-identifiers": [] + } + } + }, + "TestAsyncResource": { + "type": "object", + "description": "The TestAsyncResource which implements asynchornous API.", + "properties": { + "properties": { + "$ref": "#/definitions/TestAsyncResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "TestAsyncResourceListResult": { + "type": "object", + "description": "The response of a TestAsyncResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The TestAsyncResource items on this page", + "items": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "TestAsyncResourceProperties": { + "type": "object", + "description": "TestAsyncResource properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "property1": { + "type": "string", + "description": "The property1 of TestASyncResource" + } + }, + "required": [ + "application", + "property1" + ] + }, + "TestAsyncResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the TestAsyncResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/TestAsyncResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "TestAsyncResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the TestAsyncResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "property1": { + "type": "string", + "description": "The property1 of TestASyncResource" + } + } + }, + "TestSyncResource": { + "type": "object", + "description": "The TestSyncResource type.", + "properties": { + "properties": { + "$ref": "#/definitions/TestSyncResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "TestSyncResourceProperties": { + "type": "object", + "description": "TestSyncResource properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "property1": { + "type": "string", + "description": "The property1 of TestSyncResource" + } + }, + "required": [ + "application", + "property1" + ] + }, + "Versions": { + "type": "string", + "description": "Supported API versions for the Test.Resource resource provider.", + "enum": [ + "2022-08-19-preview", + "2023-08-19" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_08_19_preview", + "value": "2022-08-19-preview", + "description": "2022-08-19-preview" + }, + { + "name": "v2023_08_19", + "value": "2023-08-19", + "description": "2023-08-19" + } + ] + } + } + }, + "parameters": { + "RootScopeParameter": { + "name": "rootScope", + "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json new file mode 100644 index 0000000000..ab9354729d --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_CreateOrUpdate", + "title": "Create or Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestAsyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json new file mode 100644 index 0000000000..bf27a5e050 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "TestAsyncResources_Delete", + "title": "Delete a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json new file mode 100644 index 0000000000..be851ac706 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "TestAsyncResources_Get", + "title": "Get a TestAsyncResource resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testAsyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json new file mode 100644 index 0000000000..a3b3f205ed --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources by resourcegroup", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json new file mode 100644 index 0000000000..07fde44c99 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestAsyncResources_ListByScope", + "title": "List TestAsyncResource resources at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json new file mode 100644 index 0000000000..2c1ff5c348 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestAsyncResources_Update", + "title": "Update TestAsyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testAsyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json new file mode 100644 index 0000000000..d449d53a12 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestSyncResources_CreateOrUpdate", + "title": "Create or Update TestSyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json new file mode 100644 index 0000000000..a3b3d18932 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json @@ -0,0 +1,22 @@ +{ + "operationId": "TestSyncResources_Get", + "title": "Get a TestSyncResources resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json new file mode 100644 index 0000000000..2738f17a34 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestSyncResources_ListByScope", + "title": "List TestSyncResource resources by resourcegroup", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2023-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testSyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json new file mode 100644 index 0000000000..78a0e58803 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json @@ -0,0 +1,35 @@ +{ + "operationId": "TestSyncResources_ListByScope", + "title": "List TestSyncResource resources at root scope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2023-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource1", + "name": "resource1", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" + } + } + ], + "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testSyncResources?api-version=2023-08-19&$skiptoken=X'12345'" + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json new file mode 100644 index 0000000000..f710358466 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json @@ -0,0 +1,30 @@ +{ + "operationId": "TestSyncResources_Update", + "title": "Update TestSyncResource resources", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "testSyncResourceName": "resource0", + "api-version": "2023-08-19", + "TestSyncResource": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", + "name": "resource0", + "type": "Test.Resource/testSyncResources", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", + "property1": "test" + } + } + } + } +} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json new file mode 100644 index 0000000000..0cd70b56f6 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json @@ -0,0 +1,1038 @@ +{ + "swagger": "2.0", + "info": { + "title": "Test.Resource Resource Management APIs", + "version": "2023-08-19", + "description": "REST APIs for Test.Resource", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "TestSyncResources" + }, + { + "name": "TestAsyncResources" + } + ], + "paths": { + "/{rootScope}/providers/Test.Resource/testAsyncResources": { + "get": { + "operationId": "TestAsyncResources_ListByScope", + "tags": [ + "TestAsyncResources" + ], + "description": "List TestAsyncResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestAsyncResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List TestAsyncResource resources by resourcegroup": { + "$ref": "./examples/TestAsyncResource_List.json" + }, + "List TestAsyncResource resources at root scope": { + "$ref": "./examples/TestAsyncResource_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Test.Resource/testAsyncResources/{testAsyncResourceName}": { + "get": { + "operationId": "TestAsyncResources_Get", + "tags": [ + "TestAsyncResources" + ], + "description": "Get a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a TestAsyncResource resource": { + "$ref": "./examples/TestAsyncResource_Get.json" + } + } + }, + "put": { + "operationId": "TestAsyncResources_CreateOrUpdate", + "tags": [ + "TestAsyncResources" + ], + "description": "Create a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'TestAsyncResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "201": { + "description": "Resource 'TestAsyncResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + }, + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update TestAsyncResource resources": { + "$ref": "./examples/TestAsyncResource_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "TestAsyncResources_Update", + "tags": [ + "TestAsyncResources" + ], + "description": "Update a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/TestAsyncResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update TestAsyncResource resources": { + "$ref": "./examples/TestAsyncResource_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "TestAsyncResources_Delete", + "tags": [ + "TestAsyncResources" + ], + "description": "Delete a TestAsyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testAsyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete a TestAsyncResource resource": { + "$ref": "./examples/TestAsyncResource_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + }, + "/{rootScope}/providers/Test.Resource/testSyncResources": { + "get": { + "operationId": "TestSyncResources_ListByScope", + "tags": [ + "TestSyncResources" + ], + "description": "List TestSyncResource resources by Scope", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestSyncResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List TestSyncResource resources by resourcegroup": { + "$ref": "./examples/TestSyncResource_List.json" + }, + "List TestSyncResource resources at root scope": { + "$ref": "./examples/TestSyncResource_ListByScope.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{rootScope}/providers/Test.Resource/testSyncResources/{testSyncResourceName}": { + "get": { + "operationId": "TestSyncResources_Get", + "tags": [ + "TestSyncResources" + ], + "description": "Get a TestSyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testSyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestSyncResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get a TestSyncResources resource": { + "$ref": "./examples/TestSyncResource_Get.json" + } + } + }, + "put": { + "operationId": "TestSyncResources_CreateOrUpdate", + "tags": [ + "TestSyncResources" + ], + "description": "Create a TestSyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testSyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "resource", + "in": "body", + "description": "Resource create parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/TestSyncResource" + } + } + ], + "responses": { + "200": { + "description": "Resource 'TestSyncResource' update operation succeeded", + "schema": { + "$ref": "#/definitions/TestSyncResource" + } + }, + "201": { + "description": "Resource 'TestSyncResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/TestSyncResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update TestSyncResource resources": { + "$ref": "./examples/TestSyncResource_CreateOrUpdate.json" + } + } + }, + "patch": { + "operationId": "TestSyncResources_Update", + "tags": [ + "TestSyncResources" + ], + "description": "Update a TestSyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testSyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/TestSyncResourceUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/TestSyncResource" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Update TestSyncResource resources": { + "$ref": "./examples/TestSyncResource_Update.json" + } + } + }, + "delete": { + "operationId": "TestSyncResources_Delete", + "tags": [ + "TestSyncResources" + ], + "description": "Delete a TestSyncResource", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/RootScopeParameter" + }, + { + "name": "testSyncResourceName", + "in": "path", + "description": "The name of TestSyncResource", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Test.Resource/operations": { + "get": { + "operationId": "Operations_List", + "tags": [ + "Operations" + ], + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "EnvironmentCompute": { + "type": "object", + "description": "Represents backing compute resource", + "properties": { + "kind": { + "type": "string", + "description": "Discriminator property for EnvironmentCompute." + }, + "resourceId": { + "type": "string", + "description": "The resource id of the compute resource for application environment." + }, + "identity": { + "$ref": "#/definitions/IdentitySettings", + "description": "Configuration for supported external identity providers" + } + }, + "discriminator": "kind", + "required": [ + "kind" + ] + }, + "IdentitySettingKind": { + "type": "string", + "description": "IdentitySettingKind is the kind of supported external identity setting", + "enum": [ + "undefined", + "azure.com.workload" + ], + "x-ms-enum": { + "name": "IdentitySettingKind", + "modelAsString": true, + "values": [ + { + "name": "undefined", + "value": "undefined", + "description": "undefined identity" + }, + { + "name": "azure.com.workload", + "value": "azure.com.workload", + "description": "azure ad workload identity" + } + ] + } + }, + "IdentitySettings": { + "type": "object", + "description": "IdentitySettings is the external identity setting.", + "properties": { + "kind": { + "$ref": "#/definitions/IdentitySettingKind", + "description": "kind of identity setting" + }, + "oidcIssuer": { + "type": "string", + "description": "The URI for your compute platform's OIDC issuer" + }, + "resource": { + "type": "string", + "description": "The resource ID of the provisioned identity" + } + }, + "required": [ + "kind" + ] + }, + "KubernetesCompute": { + "type": "object", + "description": "The Kubernetes compute configuration", + "properties": { + "namespace": { + "type": "string", + "description": "The namespace to use for the environment." + } + }, + "required": [ + "namespace" + ], + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCompute" + } + ], + "x-ms-discriminator-value": "kubernetes" + }, + "OutputResource": { + "type": "object", + "description": "Properties of an output resource.", + "properties": { + "localId": { + "type": "string", + "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." + }, + "id": { + "type": "string", + "description": "The UCP resource ID of the underlying resource." + }, + "radiusManaged": { + "type": "boolean", + "description": "Determines whether Radius manages the lifecycle of the underlying resource." + } + } + }, + "ProvisioningState": { + "type": "string", + "description": "Provisioning state of the portable resource at the time the operation was called", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Provisioning", + "Updating", + "Deleting", + "Accepted" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true + }, + "ResourceStatus": { + "type": "object", + "description": "Status of a resource.", + "properties": { + "compute": { + "$ref": "#/definitions/EnvironmentCompute", + "description": "The compute resource associated with the resource." + }, + "outputResources": { + "type": "array", + "description": "Properties of an output resource", + "items": { + "$ref": "#/definitions/OutputResource" + }, + "x-ms-identifiers": [] + } + } + }, + "TestAsyncResource": { + "type": "object", + "description": "The TestAsyncResource which implements asynchornous API.", + "properties": { + "properties": { + "$ref": "#/definitions/TestAsyncResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "TestAsyncResourceListResult": { + "type": "object", + "description": "The response of a TestAsyncResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The TestAsyncResource items on this page", + "items": { + "$ref": "#/definitions/TestAsyncResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "TestAsyncResourceProperties": { + "type": "object", + "description": "TestAsyncResource properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "property1": { + "type": "string", + "description": "The property1 of TestASyncResource" + } + }, + "required": [ + "application", + "property1" + ] + }, + "TestAsyncResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the TestAsyncResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/TestAsyncResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "TestAsyncResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the TestAsyncResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "property1": { + "type": "string", + "description": "The property1 of TestASyncResource" + } + } + }, + "TestSyncResource": { + "type": "object", + "description": "The TestSyncResource type.", + "properties": { + "properties": { + "$ref": "#/definitions/TestSyncResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "TestSyncResourceListResult": { + "type": "object", + "description": "The response of a TestSyncResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The TestSyncResource items on this page", + "items": { + "$ref": "#/definitions/TestSyncResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "TestSyncResourceProperties": { + "type": "object", + "description": "TestSyncResource properties", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, + "status": { + "$ref": "#/definitions/ResourceStatus", + "description": "Status of a resource.", + "readOnly": true + }, + "property1": { + "type": "string", + "description": "The property1 of TestSyncResource" + } + }, + "required": [ + "application", + "property1" + ] + }, + "TestSyncResourceUpdate": { + "type": "object", + "description": "The type used for update operations of the TestSyncResource.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "$ref": "#/definitions/TestSyncResourceUpdateProperties", + "x-ms-client-flatten": true + } + } + }, + "TestSyncResourceUpdateProperties": { + "type": "object", + "description": "The updatable properties of the TestSyncResource.", + "properties": { + "environment": { + "type": "string", + "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" + }, + "application": { + "type": "string", + "description": "Fully qualified resource ID for the application that the portable resource is consumed by" + }, + "property1": { + "type": "string", + "description": "The property1 of TestSyncResource" + } + } + }, + "Versions": { + "type": "string", + "description": "Supported API versions for the Test.Resource resource provider.", + "enum": [ + "2022-08-19-preview", + "2023-08-19" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_08_19_preview", + "value": "2022-08-19-preview", + "description": "2022-08-19-preview" + }, + { + "name": "v2023_08_19", + "value": "2023-08-19", + "description": "2023-08-19" + } + ] + } + } + }, + "parameters": { + "RootScopeParameter": { + "name": "rootScope", + "in": "path", + "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "client", + "x-ms-skip-url-encoding": true + } + } +} diff --git a/swagger/specification/applications/resource-manager/readme.csharp.md b/swagger/specification/applications/resource-manager/readme.csharp.md index 7f44ef028b..fdb375793f 100644 --- a/swagger/specification/applications/resource-manager/readme.csharp.md +++ b/swagger/specification/applications/resource-manager/readme.csharp.md @@ -71,14 +71,6 @@ input-file: - Applications.Core/preview/2022-03-15-privatepreview/openapi.json ``` -### Tag: package-link-2022-03-15-privatepreview -``` yaml $(tag) == 'package-link-2022-03-15-privatepreview' -output-folder: $(csharp-sdks-folder)/applications/management/2022-03-15-privatepreview/link/src/Generated -input-file: -- Applications.Link/preview/2022-03-15-privatepreview/openapi.json -- Applications.Link/preview/2022-03-15-privatepreview/extenders.json -``` - ### Tag: package-dapr-2022-03-15-privatepreview ``` yaml $(tag) == 'package-dapr-2022-03-15-privatepreview' output-folder: $(csharp-sdks-folder)/applications/management/2022-03-15-privatepreview/dapr/src/Generated diff --git a/swagger/specification/applications/resource-manager/readme.md b/swagger/specification/applications/resource-manager/readme.md index a601808c9c..d84c42f28e 100644 --- a/swagger/specification/applications/resource-manager/readme.md +++ b/swagger/specification/applications/resource-manager/readme.md @@ -45,16 +45,6 @@ These settings apply only when `--tag=package-core-2022-03-15-privatepreview` is input-file: - Applications.Core/preview/2022-03-15-privatepreview/openapi.json ``` - -### Tag: package-link-2022-03-15-privatepreview - -These settings apply only when `--tag=package-link-2022-03-15-privatepreview` is specified on the command line. - -``` yaml $(tag) == 'package-link-2022-03-15-privatepreview' -input-file: - - Applications.Link/preview/2022-03-15-privatepreview/openapi.json - - Applications.Link/preview/2022-03-15-privatepreview/extenders.json -``` ### Tag: package-dapr-2022-03-15-privatepreview These settings apply only when `--tag=package-dapr-2022-03-15-privatepreview` is specified on the command line. diff --git a/swagger/specification/applications/resource-manager/readme.python.md b/swagger/specification/applications/resource-manager/readme.python.md index 538f7762a8..85acb122c3 100644 --- a/swagger/specification/applications/resource-manager/readme.python.md +++ b/swagger/specification/applications/resource-manager/readme.python.md @@ -35,19 +35,6 @@ python: output-folder: $(python-sdks-folder)/applications/azure-mgmt-applications/azure/mgmt/applications/core/v2022_03_15_privatepreview ``` -### Tag: package-link-2022-03-15-privatepreview and python - -These settings apply only when `--tag=package-link-2022-03-15-privatepreview --python` is specified on the command line. -Please also specify `--python-sdks-folder=`. - -``` yaml $(tag) == 'package-link-2022-03-15-privatepreview' -namespace: azure.mgmt.applications.link.v2022_03_15_privatepreview -output-folder: $(python-sdks-folder)/applications/azure-mgmt-applications/azure/mgmt/applications/link/v2022_03_15_privatepreview -python: - namespace: azure.mgmt.applications.link.v2022_03_15_privatepreview - output-folder: $(python-sdks-folder)/applications/azure-mgmt-applications/azure/mgmt/applications/link/v2022_03_15_privatepreview -``` - ### Python multi-api Generate all API versions currently shipped for this package diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json index a72c5cac66..4968b7a07a 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json @@ -13,7 +13,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Dapr": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json index e0a301e0d6..9ca0b8af54 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json @@ -13,7 +13,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Dapr": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443", "Microsoft.Resources": "http://bicep-de.radius-system:6443" }, diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json index ced82b43bb..95df2fa484 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json @@ -14,7 +14,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Dapr": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/swagger/specs.go b/swagger/specs.go index 0b6244a856..5b3a80ea5c 100644 --- a/swagger/specs.go +++ b/swagger/specs.go @@ -28,7 +28,6 @@ var ( //go:embed specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/*.json //go:embed specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/*.json //go:embed specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/*.json - //go:embed specification/applications/resource-manager/Applications.Link/preview/2022-03-15-privatepreview/*.json //go:embed specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json //go:embed specification/common-types/resource-management/v2/types.json //go:embed specification/common-types/resource-management/v3/types.json diff --git a/test/functional/datastoresrp/resources/mongodb_test.go b/test/functional/datastoresrp/resources/mongodb_test.go index e4f46b9bd2..63989f7e8b 100644 --- a/test/functional/datastoresrp/resources/mongodb_test.go +++ b/test/functional/datastoresrp/resources/mongodb_test.go @@ -125,9 +125,9 @@ func Test_MongoDB_Recipe(t *testing.T) { } // Test_MongoDB_Recipe_Parameters validates the creation of a mongoDB from recipe with parameters passed by operator while linking recipe -// and developer while creating the mongoDatabase link. +// and developer while creating the mongoDatabase resource. // If the same parameters are set by the developer and the operator then the developer parameters are applied in to resolve conflicts. -// Container uses the mongoDB link to connect to the mongoDB resource +// Container uses the mongoDB resource to connect to the mongoDB resource func Test_MongoDB_RecipeParameters(t *testing.T) { t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/project-radius/radius/issues/5929") @@ -181,8 +181,8 @@ func Test_MongoDB_RecipeParameters(t *testing.T) { } // Test_MongoDB_Recipe_ContextParameter validates creation of a mongoDB from -// a default recipe using the context parameter generated and set by linkRP, -// and container using the mongoDB link to connect to the underlying mongoDB resource. +// a default recipe using the context parameter generated and set by DatastoresRP, +// and container using the mongoDatabases portable resource to connect to the underlying mongoDB resource. func Test_MongoDB_Recipe_ContextParameter(t *testing.T) { t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/project-radius/radius/issues/5929") diff --git a/test/functional/datastoresrp/resources/sql_test.go b/test/functional/datastoresrp/resources/sql_test.go index 17855c7039..442852aec9 100644 --- a/test/functional/datastoresrp/resources/sql_test.go +++ b/test/functional/datastoresrp/resources/sql_test.go @@ -83,7 +83,7 @@ func Test_SQLDatabase_Manual(t *testing.T) { // Test_SQLDatabase_Recipe validates: // the creation of a sql database from recipe -// container using the sql database link to connect to the sql database resource +// container using the sqlDatabases portable resource to connect to the sql database resource func Test_SQLDatabase_Recipe(t *testing.T) { template := "testdata/datastoresrp-resources-sqldb-recipe.bicep" name := "dsrp-resources-sqldb-recipe" diff --git a/test/functional/samples/testdata/tutorial-environment.bicep b/test/functional/samples/testdata/tutorial-environment.bicep index 421e8adf92..a0ef81ed28 100644 --- a/test/functional/samples/testdata/tutorial-environment.bicep +++ b/test/functional/samples/testdata/tutorial-environment.bicep @@ -12,7 +12,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { namespace: 'tutorial' } recipes: { - 'Applications.Link/redisCaches': { + 'Applications.Datastores/redisCaches': { default: { templateKind: 'bicep' templatePath: '${registry}/test/functional/shared/recipes/redis-recipe-value-backed:${version}' diff --git a/test/functional/samples/tutorial_test.go b/test/functional/samples/tutorial_test.go index 4afb1ae2a8..9cf0b949e9 100644 --- a/test/functional/samples/tutorial_test.go +++ b/test/functional/samples/tutorial_test.go @@ -52,6 +52,10 @@ var samplesRepoAbsPath, samplesRepoEnvVarSet = os.LookupEnv("RADIUS_SAMPLES_REPO // You can set the variables used by vscode codelens (e.g. 'debug test', 'run test') using 'go.testEnvVars' in vscode settings.json // Ex: export PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH=/home/uname/src/samples func Test_FirstApplicationSample(t *testing.T) { + // TODO: Remove the following statement + // LJ: Skipping this test to test pipeline for this PR: https://github.com/project-radius/radius/pull/6130 + t.Skipf("Temporary: Skip samples test execution, samples repo still contains Applications.Links resources, which is deprecated in this PR") + if !samplesRepoEnvVarSet { t.Skipf("Skip samples test execution, to enable you must set env var PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH to the absolute path of the project-radius/samples repository") } @@ -85,7 +89,7 @@ func Test_FirstApplicationSample(t *testing.T) { }, { Name: "db", - Type: validation.O_RedisCachesResource, + Type: validation.RedisCachesResource, }, }, }, diff --git a/test/functional/shared/cli/cli_test.go b/test/functional/shared/cli/cli_test.go index eeba2f5e64..ec7b1e631f 100644 --- a/test/functional/shared/cli/cli_test.go +++ b/test/functional/shared/cli/cli_test.go @@ -61,7 +61,7 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { recipeName := "recipeName" recipeTemplate := "testpublicrecipe.azurecr.io/bicep/modules/testTemplate:v1" templateKind := "bicep" - linkType := "Applications.Link/mongoDatabases" + linkType := "Applications.Datastores/mongoDatabases" file := "testdata/corerp-redis-recipe.bicep" target := fmt.Sprintf("br:radiusdev.azurecr.io/test-bicep-recipes/redis-recipe:%s", generateUniqueTag()) @@ -88,7 +88,7 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { t.Run("Validate rad recipe show", func(t *testing.T) { showRecipeName := "mongodbtest" showRecipeTemplate := "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0" - showRecipeLinkType := "Applications.Link/mongoDatabases" + showRecipeLinkType := "Applications.Datastores/mongoDatabases" output, err := cli.RecipeRegister(ctx, envName, showRecipeName, templateKind, showRecipeTemplate, showRecipeLinkType) require.NoError(t, err) require.Contains(t, output, "Successfully linked recipe") diff --git a/test/functional/shared/cli/testdata/corerp-resources-recipe-env.bicep b/test/functional/shared/cli/testdata/corerp-resources-recipe-env.bicep index 0941974cf0..e2560b472e 100644 --- a/test/functional/shared/cli/testdata/corerp-resources-recipe-env.bicep +++ b/test/functional/shared/cli/testdata/corerp-resources-recipe-env.bicep @@ -13,7 +13,7 @@ resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { namespace: 'corerp-resources-recipe-env' } recipes: { - 'Applications.Link/mongoDatabases':{ + 'Applications.Datastores/mongoDatabases':{ recipe1: { templateKind: 'bicep' templatePath: 'testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1' diff --git a/test/functional/shared/resources/dapr_component_name_conflict_test.go b/test/functional/shared/resources/dapr_component_name_conflict_test.go deleted file mode 100644 index 107bbfbdb7..0000000000 --- a/test/functional/shared/resources/dapr_component_name_conflict_test.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "testing" - - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_DaprComponentNameConflict(t *testing.T) { - template := "testdata/corerp-resources-dapr-component-name-conflict.bicep" - name := "corerp-resources-dcnc-old" - - validate := step.ValidateSingleDetail("DeploymentFailed", step.DeploymentErrorDetail{ - Code: "ResourceDeploymentFailure", - Details: []step.DeploymentErrorDetail{ - { - Code: v1.CodeInternal, - MessageContains: "the Dapr component name '\"dapr-component-old\"' is already in use by another resource. Dapr component and resource names must be unique across all Dapr types (eg: StateStores, PubSubBrokers, SecretStores, etc.). Please select a new name and try again", - }, - }, - }) - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployErrorExecutor(template, validate), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-dapr-component-name-conflict", - Type: validation.ApplicationsResource, - }, - }, - }, - SkipObjectValidation: true, - SkipKubernetesOutputResourceValidation: true, - }, - }) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - - test.Test(t) -} diff --git a/test/functional/shared/resources/dapr_pubsub_test.go b/test/functional/shared/resources/dapr_pubsub_test.go deleted file mode 100644 index 2c4525aa43..0000000000 --- a/test/functional/shared/resources/dapr_pubsub_test.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "fmt" - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_DaprPubSubBroker_Manual(t *testing.T) { - template := "testdata/corerp-resources-dapr-pubsub-broker-manual.bicep" - name := "dpsb-mnl-app-old" - appNamespace := "default-dpsb-mnl-app-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), fmt.Sprintf("namespace=%s", appNamespace)), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "dpsb-mnl-app-old", - Type: validation.ApplicationsResource, - }, - { - Name: "dpsb-mnl-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "dpsb-mnl-old", - Type: validation.O_DaprPubSubBrokersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "dpsb-mnl-app-ctnr-old"), - validation.NewK8sPodForResource(name, "dpsb-mnl-redis-old").ValidateLabels(false), - validation.NewK8sServiceForResource(name, "dpsb-mnl-redis-old").ValidateLabels(false), - }, - }, - }, - }, - }) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - test.Test(t) -} - -func Test_DaprPubSubBroker_Recipe(t *testing.T) { - template := "testdata/corerp-resources-dapr-pubsub-broker-recipe.bicep" - name := "dpsb-recipe-app-old" - appNamespace := "dpsb-recipe-env-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "dpsb-recipe-env-old", - Type: validation.EnvironmentsResource, - }, - { - Name: "dpsb-recipe-app-old", - Type: validation.ApplicationsResource, - App: name, - }, - { - Name: "dpsb-recipe-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "dpsb-recipe-old", - Type: validation.O_DaprPubSubBrokersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "dpsb-recipe-app-ctnr-old").ValidateLabels(false), - }, - }, - }, - }, - }) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - test.Test(t) -} diff --git a/test/functional/shared/resources/dapr_secretstore_test.go b/test/functional/shared/resources/dapr_secretstore_test.go deleted file mode 100644 index 6e5430ed51..0000000000 --- a/test/functional/shared/resources/dapr_secretstore_test.go +++ /dev/null @@ -1,106 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_DaprSecretStore_Manual_Generic(t *testing.T) { - template := "testdata/corerp-resources-dapr-secretstore-manual.bicep" - name := "corerp-resources-dssm-old" - appNamespace := "default-corerp-resources-dssm-old" - - test := shared.NewRPTest(t, appNamespace, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "gnrc-scs-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "gnrc-scs-manual-old", - Type: validation.O_DaprSecretStoresResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "gnrc-scs-ctnr-old"), - }, - }, - }, - }, - }, shared.K8sSecretResource(appNamespace, "mysecret", "", "fakekey", []byte("fakevalue"))) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - - test.Test(t) -} - -func Test_DaprSecretStore_Recipe(t *testing.T) { - template := "testdata/corerp-resources-dapr-secretstore-recipe.bicep" - name := "corerp-resources-dssr-old" - appNamespace := "corerp-resources-dssr-old" - - test := shared.NewRPTest(t, appNamespace, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "gnrc-scs-ctnr-recipe-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "gnrc-scs-recipe-old", - Type: validation.O_DaprSecretStoresResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "gnrc-scs-ctnr-recipe-old").ValidateLabels(false), - }, - }, - }, - }, - }, shared.K8sSecretResource(appNamespace, "mysecret", "", "fakekey", []byte("fakevalue"))) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - - test.Test(t) -} diff --git a/test/functional/shared/resources/dapr_serviceinvocation_test.go b/test/functional/shared/resources/dapr_serviceinvocation_test.go deleted file mode 100644 index 73b582d87e..0000000000 --- a/test/functional/shared/resources/dapr_serviceinvocation_test.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_DaprServiceInvocation(t *testing.T) { - template := "testdata/corerp-resources-dapr-serviceinvocation.bicep" - name := "dapr-si-old" - appNamespace := "default-dapr-si-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "dapr-frontend-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "dapr-backend-old", - Type: validation.ContainersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "dapr-frontend-old"), - validation.NewK8sPodForResource(name, "dapr-backend-old"), - }, - }, - }, - }, - }) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - - test.Test(t) -} diff --git a/test/functional/shared/resources/dapr_statestore_test.go b/test/functional/shared/resources/dapr_statestore_test.go deleted file mode 100644 index 255f17ab6b..0000000000 --- a/test/functional/shared/resources/dapr_statestore_test.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "fmt" - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_DaprStateStore_Manual(t *testing.T) { - template := "testdata/corerp-resources-dapr-statestore-manual.bicep" - name := "corerp-resources-dsstm-old" - appNamespace := "default-corerp-resources-dsstm-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), fmt.Sprintf("namespace=%s", appNamespace)), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-dsstm-old", - Type: validation.ApplicationsResource, - }, - { - Name: "dapr-sts-manual-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "dapr-sts-manual-old", - Type: validation.O_DaprStateStoresResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "dapr-sts-manual-ctnr-old"), - - // Deployed as supporting resources using Kubernetes Bicep extensibility. - validation.NewK8sPodForResource(name, "dapr-sts-manual-redis-old").ValidateLabels(false), - validation.NewK8sServiceForResource(name, "dapr-sts-manual-redis-old").ValidateLabels(false), - }, - }, - }, - }, - }) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - test.Test(t) -} - -func Test_DaprStateStore_Recipe(t *testing.T) { - template := "testdata/corerp-resources-dapr-statestore-recipe.bicep" - name := "corerp-rs-dapr-sts-recipe-old" - appNamespace := "corerp-env-recipes-env-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-env-recipes-env-old", - Type: validation.EnvironmentsResource, - }, - { - Name: "corerp-rs-dapr-sts-recipe-old", - Type: validation.ApplicationsResource, - App: name, - }, - { - Name: "dapr-sts-recipe-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "dapr-sts-recipe-old", - Type: validation.O_DaprStateStoresResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "dapr-sts-recipe-ctnr-old").ValidateLabels(false), - }, - }, - }, - }, - }) - test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} - test.Test(t) -} diff --git a/test/functional/shared/resources/linkrp_extender_test.go b/test/functional/shared/resources/linkrp_extender_test.go deleted file mode 100644 index 2077c4188d..0000000000 --- a/test/functional/shared/resources/linkrp_extender_test.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "fmt" - "testing" - - "os" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_LinkRP_Extender_Manual(t *testing.T) { - template := "testdata/linkrp-resources-extender.bicep" - name := "linkrp-resources-extender" - appNamespace := "default-linkrp-resources-extender" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "extr-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "extr-twilio-old", - Type: validation.O_ExtendersResource, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "extr-ctnr-old"), - }, - }, - }, - }, - }) - - test.Test(t) -} - -func Test_LinkRP_Extender_Recipe(t *testing.T) { - template := "testdata/linkrp-resources-extender-recipe.bicep" - name := "linkrp-resources-extender-recipe" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "linkrp-resources-extender-recipe-env", - Type: validation.EnvironmentsResource, - }, - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "extender-recipe-old", - Type: validation.O_ExtendersResource, - App: name, - }, - }, - }, - SkipObjectValidation: true, - }, - }) - - test.Test(t) -} - -func Test_LinkRP_Extender_RecipeAWS(t *testing.T) { - awsAccountID := os.Getenv("AWS_ACCOUNT_ID") - awsRegion := os.Getenv("AWS_REGION") - // Error the test if the required environment variables are not set - // for running locally set the environment variables - if awsAccountID == "" || awsRegion == "" { - t.Error("This test needs the env variables AWS_ACCOUNT_ID and AWS_REGION to be set") - } - - template := "testdata/linkrp-resources-extender-aws-s3-recipe.bicep" - name := "linkrp-resources-extenders-aws-s3-recipe" - appName := "linkrp-resources-extenders-aws-s3-recipe-app" - bucketName := generateS3BucketName() - bucketID := fmt.Sprintf("/planes/aws/aws/accounts/%s/regions/%s/providers/AWS.S3/Bucket/%s", awsAccountID, awsRegion, bucketName) - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor( - template, - fmt.Sprintf("bucketName=%s", bucketName), - functional.GetAWSAccountId(), - functional.GetAWSRegion(), - functional.GetBicepRecipeRegistry(), - functional.GetBicepRecipeVersion(), - ), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "linkrp-resources-extenders-aws-s3-recipe-env", - Type: validation.EnvironmentsResource, - }, - { - Name: "linkrp-resources-extenders-aws-s3-recipe-app", - Type: validation.ApplicationsResource, - }, - { - Name: "linkrp-resources-extenders-aws-s3-recipe", - Type: validation.O_ExtendersResource, - App: appName, - OutputResources: []validation.OutputResourceResponse{ - { - ID: bucketID, - }, - }, - }, - }, - }, - AWSResources: &validation.AWSResourceSet{ - Resources: []validation.AWSResource{ - { - Name: bucketName, - Type: validation.AWSS3BucketResourceType, - Identifier: bucketName, - Properties: map[string]any{ - "BucketName": bucketName, - }, - SkipDeletion: true, // will be deleted by the recipe - }, - }, - }, - SkipObjectValidation: true, - }, - }) - - test.Test(t) -} diff --git a/test/functional/shared/resources/microsoftsql_test.go b/test/functional/shared/resources/microsoftsql_test.go deleted file mode 100644 index 603b34868e..0000000000 --- a/test/functional/shared/resources/microsoftsql_test.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "os" - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_MicrosoftSQL(t *testing.T) { - template := "testdata/corerp-resources-microsoft-sql.bicep" - name := "corerp-resources-microsoft-sql" - - var adminUsername, adminPassword string - - if os.Getenv("AZURE_MSSQL_RESOURCE_ID") == "" { - t.Error("AZURE_MSSQL_RESOURCE_ID environment variable must be set to run this test.") - } - if os.Getenv("AZURE_MSSQL_DATABASE") == "" || os.Getenv("AZURE_MSSQL_SERVER") == "" { - t.Error("AZURE_MSSQL_DATABASE and AZURE_MSSQL_SERVER environment variable must be set to run this test.") - } - if os.Getenv("AZURE_MSSQL_USERNAME") != "" && os.Getenv("AZURE_MSSQL_PASSWORD") != "" { - adminUsername = "adminUsername=" + os.Getenv("AZURE_MSSQL_USERNAME") - adminPassword = "adminPassword=" + os.Getenv("AZURE_MSSQL_PASSWORD") - } else { - t.Error("AZURE_MSSQL_USERNAME and AZURE_MSSQL_PASSWORD environment variable must be set to run this test.") - } - mssqlresourceid := "mssqlresourceid=" + os.Getenv("AZURE_MSSQL_RESOURCE_ID") - sqlDatabse := "database=" + os.Getenv("AZURE_MSSQL_DATABASE") - sqlServer := "server=" + os.Getenv("AZURE_MSSQL_SERVER") - appNamespace := "default-corerp-resources-microsoft-sql" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), mssqlresourceid, adminUsername, adminPassword, sqlDatabse, sqlServer), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "mssql-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "mssql-app-ctnr-old"), - }, - }, - }, - }, - }) - - test.Test(t) -} - -// Test_SQLDatabase_Recipe validates: -// the creation of a sql database from recipe -// container using the sql database link to connect to the sql database resource -func Test_SQLDatabase_Recipe(t *testing.T) { - template := "testdata/corerp-resources-sqldb-recipe.bicep" - name := "corerp-resources-sqldb-recipe" - appNamespace := "corerp-resources-sqldb-recipe-app" - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-env-sql-recipe-env", - Type: validation.EnvironmentsResource, - }, - { - Name: "corerp-resources-sqldb-recipe", - Type: validation.ApplicationsResource, - App: name, - }, - { - Name: "sql-recipe-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "sql-recipe-app-ctnr").ValidateLabels(false), - validation.NewK8sPodForResource(name, "sql-recipe-resource").ValidateLabels(false), - }, - }, - }, - }, - }) - - test.Test(t) -} diff --git a/test/functional/shared/resources/mongodb_test.go b/test/functional/shared/resources/mongodb_test.go deleted file mode 100644 index fe8dc5c7e9..0000000000 --- a/test/functional/shared/resources/mongodb_test.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "os" - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -// Opt-out case for manual resource provisioning -func Test_MongoDB_ManualProvisioning(t *testing.T) { - template := "testdata/corerp-resources-mongodb-manual-provisioning.bicep" - name := "corerp-resources-mongodb-mp" - appNamespace := "default-ccorerp-resources-mp" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "mdb-us-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "mdb-us-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "mdb-us-rte-old", - Type: validation.HttpRoutesResource, - App: name, - }, - { - Name: "mdb-us-db-old", - Type: validation.O_MongoDatabasesResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "mdb-us-app-ctnr-old").ValidateLabels(false), - validation.NewK8sPodForResource(name, "mdb-us-ctnr-old").ValidateLabels(false), - validation.NewK8sServiceForResource(name, "mdb-us-rte-old").ValidateLabels(false), - }, - }, - }, - }, - }) - - test.Test(t) -} - -// Test_MongoDB_Recipe validates: -// the creation of a mongoDB from a recipe that uses an Azure resource -func Test_MongoDB_Recipe(t *testing.T) { - template := "testdata/corerp-resources-mongodb-recipe.bicep" - name := "corerp-resources-mongodb-recipe" - appNamespace := "corerp-resources-mongodb-recipe-app" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-mongodb-recipe-env", - Type: validation.EnvironmentsResource, - }, - { - Name: "corerp-resources-mongodb-recipe", - Type: validation.ApplicationsResource, - App: name, - }, - { - Name: "mongodb-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "mongodb-db-old", - Type: validation.O_MongoDatabasesResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "mongodb-app-ctnr-old").ValidateLabels(false), - }, - }, - }, - }, - }) - - test.Test(t) -} - -// Test_MongoDB_Recipe_Parameters validates the creation of a mongoDB from recipe with parameters passed by operator while linking recipe -// and developer while creating the mongoDatabase link. -// If the same parameters are set by the developer and the operator then the developer parameters are applied in to resolve conflicts. -// Container uses the mongoDB link to connect to the mongoDB resource -func Test_MongoDB_RecipeParameters(t *testing.T) { - t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/project-radius/radius/issues/5929") - - template := "testdata/corerp-resources-mongodb-recipe-parameters.bicep" - name := "corerp-resources-mongodb-recipe-parameters" - appNamespace := "corerp-resources-mongodb-recipe-param-app" - rg := os.Getenv("INTEGRATION_TEST_RESOURCE_GROUP_NAME") - // Error the test if INTEGRATION_TEST_RESOURCE_GROUP_NAME is not set - // for running locally set the INTEGRATION_TEST_RESOURCE_GROUP_NAME with the test resourceGroup - if rg == "" { - t.Error("This test needs the env variable INTEGRATION_TEST_RESOURCE_GROUP_NAME to be set") - } - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-env-recipe-parameters-env", - Type: validation.EnvironmentsResource, - }, - { - Name: name, - Type: validation.ApplicationsResource, - App: name, - }, - { - Name: "mdb-param-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "mdb-recipe-param-db-old", - Type: validation.O_MongoDatabasesResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "mdb-param-ctnr-old").ValidateLabels(false), - }, - }, - }, - }, - }) - - test.Test(t) -} - -// Test_MongoDB_Recipe_ContextParameter validates creation of a mongoDB from -// a default recipe using the context parameter generated and set by linkRP, -// and container using the mongoDB link to connect to the underlying mongoDB resource. -func Test_MongoDB_Recipe_ContextParameter(t *testing.T) { - t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/project-radius/radius/issues/5929") - - template := "testdata/corerp-resources-mongodb-recipe-context.bicep" - name := "corerp-resources-mongodb-recipe-context" - appNamespace := "corerp-resources-mongodb-recipe-context-app" - rg := os.Getenv("INTEGRATION_TEST_RESOURCE_GROUP_NAME") - // Error the test if INTEGRATION_TEST_RESOURCE_GROUP_NAME is not set - // for running locally set the INTEGRATION_TEST_RESOURCE_GROUP_NAME with the test resourceGroup - if rg == "" { - t.Error("This test needs the env variable INTEGRATION_TEST_RESOURCE_GROUP_NAME to be set") - } - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-env-recipes-context-env", - Type: validation.EnvironmentsResource, - }, - { - Name: name, - Type: validation.ApplicationsResource, - App: name, - }, - { - Name: "mdb-ctx-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "mdb-ctx-old", - Type: validation.O_MongoDatabasesResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "mdb-ctx-ctnr-old").ValidateLabels(false), - }, - }, - }, - }, - }) - - test.Test(t) -} diff --git a/test/functional/shared/resources/rabbitmq_test.go b/test/functional/shared/resources/rabbitmq_test.go deleted file mode 100644 index 7c5284fdcc..0000000000 --- a/test/functional/shared/resources/rabbitmq_test.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_RabbitMQ_Manual(t *testing.T) { - template := "testdata/corerp-resources-rabbitmq.bicep" - name := "corerp-resources-rabbitmq-old" - appNamespace := "default-corerp-resources-rabbitmq-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), "password=guest"), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "rmq-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "rmq-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "rmq-rte-old", - Type: validation.HttpRoutesResource, - App: name, - }, - { - Name: "rmq-rmq-old", - Type: validation.O_RabbitMQMessageQueuesResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "rmq-app-ctnr-old"), - validation.NewK8sPodForResource(name, "rmq-ctnr-old"), - validation.NewK8sServiceForResource(name, "rmq-rte-old"), - }, - }, - }, - }, - }) - - test.Test(t) -} - -func Test_RabbitMQ_Recipe(t *testing.T) { - template := "testdata/corerp-resources-rabbitmq-recipe.bicep" - name := "corerp-resources-rabbitmq-recipe-old" - appNamespace := "default-corerp-resources-rabbitmq-recipe-old" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage(), "password=guest", functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-environment-rabbitmq-recipe-env-old", - Type: validation.EnvironmentsResource, - }, - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "rmq-recipe-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "rmq-recipe-app-ctnr-old").ValidateLabels(false), - validation.NewK8sPodForResource(name, "rmq-recipe-resource-old").ValidateLabels(false), - }, - }, - }, - }, - }) - - test.Test(t) -} diff --git a/test/functional/shared/resources/redis_test.go b/test/functional/shared/resources/redis_test.go deleted file mode 100644 index e299d462cb..0000000000 --- a/test/functional/shared/resources/redis_test.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_RedisManualProvisioning(t *testing.T) { - template := "testdata/corerp-resources-redis-manualprovisioning.bicep" - name := "corerp-resources-redis-mp" - appNamespace := "default-corerp-resources-redis-mp" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "rds-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "rds-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "rds-rte-old", - Type: validation.HttpRoutesResource, - App: name, - }, - { - Name: "rds-rds-old", - Type: validation.O_RedisCachesResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "rds-app-ctnr-old"), - validation.NewK8sPodForResource(name, "rds-ctnr-old"), - validation.NewK8sServiceForResource(name, "rds-rte-old"), - }, - }, - }, - }, - }) - - test.Test(t) -} - -func Test_RedisRecipe(t *testing.T) { - template := "testdata/corerp-resources-redis-recipe.bicep" - name := "corerp-resources-redis-recipe" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-environment-recipe-env", - Type: validation.EnvironmentsResource, - }, - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "rds-recipe-old", - Type: validation.O_RedisCachesResource, - App: name, - }, - }, - }, - SkipObjectValidation: true, - }, - }) - - test.Test(t) -} - -func Test_RedisDefaultRecipe(t *testing.T) { - template := "testdata/corerp-resources-redis-default-recipe.bicep" - name := "corerp-resources-redis-default-recipe" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetBicepRecipeRegistry(), functional.GetBicepRecipeVersion()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: "corerp-resources-environment-default-recipe-env", - Type: validation.EnvironmentsResource, - }, - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "rds-default-recipe-old", - Type: validation.O_RedisCachesResource, - App: name, - }, - }, - }, - SkipObjectValidation: true, - }, - }) - - test.Test(t) -} diff --git a/test/functional/shared/resources/secretstore_test.go b/test/functional/shared/resources/secretstore_test.go deleted file mode 100644 index 9231a622a1..0000000000 --- a/test/functional/shared/resources/secretstore_test.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "context" - "testing" - - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" - "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func Test_SecretStore_CreateSecret(t *testing.T) { - template := "testdata/corerp-resources-secretstore-new.bicep" - appName := "corerp-resources-secretstore" - appNamespace := "corerp-resources-secretstore-app" - - test := shared.NewRPTest(t, appNamespace, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, "@testdata/parameters/test-tls-cert.parameters.json"), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: appName, - Type: validation.ApplicationsResource, - }, - { - Name: "appcert", - Type: validation.SecretStoresResource, - App: appName, - }, - { - Name: "appsecret", - Type: validation.SecretStoresResource, - App: appName, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sSecretForResource(appName, "appcert"), - validation.NewK8sSecretForResource(appName, "appsecret"), - }, - }, - }, - PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { - secret, err := test.Options.K8sClient.CoreV1().Secrets(appNamespace).Get(ctx, "appcert", metav1.GetOptions{}) - require.NoError(t, err) - - for _, key := range []string{"tls.key", "tls.crt"} { - _, ok := secret.Data[key] - require.True(t, ok) - } - - secret, err = test.Options.K8sClient.CoreV1().Secrets(appNamespace).Get(ctx, "appsecret", metav1.GetOptions{}) - require.NoError(t, err) - - for _, key := range []string{"servicePrincipalPassword", "appId", "tenantId"} { - _, ok := secret.Data[key] - require.True(t, ok) - } - }, - }, - }) - - test.Test(t) -} - -func Test_SecretStore_ReferenceSecret(t *testing.T) { - template := "testdata/corerp-resources-secretstore-ref.bicep" - appName := "corerp-resources-secretstore-ref" - appNamespace := "corerp-resources-secretstore-ref" - - secret := shared.K8sSecretResource("default", "secret-app-existing-secret", "kubernetes.io/tls", "tls.crt", "fakecertval", "tls.key", "fakekeyval") - - test := shared.NewRPTest(t, appNamespace, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: appName, - Type: validation.ApplicationsResource, - }, - { - Name: "existing-appcert", - Type: validation.SecretStoresResource, - App: appName, - }, - }, - }, - SkipObjectValidation: true, - }, - }, secret) - - test.Test(t) -} diff --git a/test/functional/shared/resources/sql_test.go b/test/functional/shared/resources/sql_test.go deleted file mode 100644 index 8eaa4d1216..0000000000 --- a/test/functional/shared/resources/sql_test.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package resource_test - -import ( - "runtime" - "testing" - - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" -) - -func Test_SQL(t *testing.T) { - // https://github.com/microsoft/mssql-docker/issues/668 - if runtime.GOARCH == "arm64" { - t.Skip("skipping Test_SQL, unsupported architecture") - } - template := "testdata/corerp-resources-sql.bicep" - name := "corerp-resources-sql" - appNamespace := "default-corerp-resources-sql" - - test := shared.NewRPTest(t, name, []shared.TestStep{ - { - Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "sql-app-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - { - Name: "sql-db-old", - Type: validation.O_SQLDatabasesResource, - App: name, - }, - { - Name: "sql-rte-old", - Type: validation.HttpRoutesResource, - App: name, - }, - { - Name: "sql-ctnr-old", - Type: validation.ContainersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "sql-app-ctnr-old"), - validation.NewK8sPodForResource(name, "sql-ctnr-old"), - validation.NewK8sServiceForResource(name, "sql-rte-old"), - }, - }, - }, - }, - }) - - test.Test(t) -} diff --git a/test/functional/shared/resources/testdata/containers/corerp-resources-friendly-container-version-1.bicep b/test/functional/shared/resources/testdata/containers/corerp-resources-friendly-container-version-1.bicep index 7ae908c36a..dfd90e4c4f 100644 --- a/test/functional/shared/resources/testdata/containers/corerp-resources-friendly-container-version-1.bicep +++ b/test/functional/shared/resources/testdata/containers/corerp-resources-friendly-container-version-1.bicep @@ -61,7 +61,7 @@ resource redisRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { } } -resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = { +resource redis 'Applications.Datastores/redisCaches@2022-03-15-privatepreview' = { name: 'friendly-rds-rds' location: 'global' properties: { diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-component-name-conflict.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-component-name-conflict.bicep deleted file mode 100644 index a753d4c1ed..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-component-name-conflict.bicep +++ /dev/null @@ -1,43 +0,0 @@ -import radius as radius - -param environment string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-dcnc-old' - location: 'global' - properties: { - environment: environment - } -} - -// Dapr Component #1 -resource pubsub 'Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview' = { - name: 'dapr-component-old' - location: 'global' - properties: { - environment: environment - application: app.id - resourceProvisioning: 'manual' - type: 'pubsub.azure.servicebus' - version: 'v1' - metadata: { - name: 'example' - } - } -} - -// Dapr Component #2 -resource secretstore 'Applications.Link/daprSecretStores@2022-03-15-privatepreview' = { - name: 'dapr-component-old' - location: 'global' - properties: { - environment: environment - application: app.id - resourceProvisioning: 'manual' - type: 'secretstores.kubernetes' - metadata: { - vaultName: 'test' - } - version: 'v1' - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-manual.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-manual.bicep deleted file mode 100644 index d6ceb56610..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-manual.bicep +++ /dev/null @@ -1,64 +0,0 @@ -import radius as radius - -param magpieimage string -param environment string -param namespace string = 'default' - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'dpsb-mnl-app-old' - properties: { - environment: environment - } -} - -resource myapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'dpsb-mnl-app-ctnr-old' - properties: { - application: app.id - connections: { - daprpubsub: { - source: pubsubBroker.id - } - } - container: { - image: magpieimage - readinessProbe: { - kind: 'httpGet' - containerPort: 3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'dpsb-mnl-app-ctnr-old' - appPort: 3000 - } - ] - } -} - -module redis 'modules/redis-selfhost.bicep' = { - name: 'dpsb-mnl-redis-old-deployment' - params: { - name: 'dpsb-mnl-redis-old' - namespace: namespace - application: app.name - } -} - - -resource pubsubBroker 'Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview' = { - name: 'dpsb-mnl-old' - properties: { - application: app.id - environment: environment - resourceProvisioning: 'manual' - type: 'pubsub.redis' - metadata: { - redisHost: '${redis.outputs.host}:${redis.outputs.port}' - redisPassword: '' - } - version: 'v1' - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-recipe.bicep deleted file mode 100644 index 65ee52cd57..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-pubsub-broker-recipe.bicep +++ /dev/null @@ -1,72 +0,0 @@ -import radius as radius - -param magpieimage string -param registry string -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'dpsb-recipe-env-old' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'dpsb-recipe-env-old' - } - recipes: { - 'Applications.Link/daprPubSubBrokers': { - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/dapr-pubsub-broker:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'dpsb-recipe-app-old' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'dpsb-recipe-app-old' - } - ] - } -} - -resource myapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'dpsb-recipe-app-ctnr-old' - properties: { - application: app.id - connections: { - daprpubsub: { - source: pubsubBroker.id - } - } - container: { - image: magpieimage - readinessProbe: { - kind: 'httpGet' - containerPort: 3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'dpsb-recipe-app-ctnr-old' - appPort: 3000 - } - ] - } -} - -resource pubsubBroker 'Applications.Link/daprPubSubBrokers@2022-03-15-privatepreview' = { - name: 'dpsb-recipe-old' - properties: { - application: app.id - environment: env.id - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-manual.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-manual.bicep deleted file mode 100644 index e3cd924c1d..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-manual.bicep +++ /dev/null @@ -1,57 +0,0 @@ -import radius as radius - -param magpieimage string - -param environment string - -param location string = resourceGroup().location - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-dssm-old' - location: location - properties: { - environment: environment - } -} - -resource myapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'gnrc-scs-ctnr-old' - properties: { - application: app.id - connections: { - daprsecretstore: { - source: secretstore.id - } - } - container: { - image: magpieimage - readinessProbe:{ - kind:'httpGet' - containerPort:3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'gnrc-ss-ctnr-old' - appPort: 3000 - } - ] - } -} - -resource secretstore 'Applications.Link/daprSecretStores@2022-03-15-privatepreview' = { - name: 'gnrc-scs-manual-old' - location: location - properties: { - environment: environment - application: app.id - resourceProvisioning: 'manual' - type: 'secretstores.kubernetes' - metadata: { - vaultName: 'test' - } - version: 'v1' - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-recipe.bicep deleted file mode 100644 index ab2f020fc2..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-secretstore-recipe.bicep +++ /dev/null @@ -1,76 +0,0 @@ -import radius as radius - -param magpieimage string - -param location string = resourceGroup().location -param registry string -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-dssr-env-old' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-dssr-env-old' - } - recipes: { - 'Applications.Link/daprSecretStores': { - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/dapr-secret-store:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-dssr-old' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-dssr-old' - } - ] - } -} - -resource myapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'gnrc-scs-ctnr-recipe-old' - location: location - properties: { - application: app.id - connections: { - daprsecretstore: { - source: secretstore.id - } - } - container: { - image: magpieimage - readinessProbe: { - kind: 'httpGet' - containerPort: 3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'gnrc-ss-ctnr-recipe-old' - appPort: 3000 - } - ] - } -} - -resource secretstore 'Applications.Link/daprSecretStores@2022-03-15-privatepreview' = { - name: 'gnrc-scs-recipe-old' - location: location - properties: { - environment: env.id - application: app.id - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-serviceinvocation.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-serviceinvocation.bicep deleted file mode 100644 index af208f7ae3..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-serviceinvocation.bicep +++ /dev/null @@ -1,68 +0,0 @@ -import radius as radius - -param location string = resourceGroup().location -param environment string -param magpieimage string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'dapr-si-old' - location: location - properties: { - environment: environment - } -} - -resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'dapr-frontend-old' - location: location - properties: { - application: app.id - container: { - image: magpieimage - env: { - // Used by magpie to communicate with the backend. - CONNECTION_DAPRHTTPROUTE_APPID: 'backend-old' - } - readinessProbe:{ - kind:'httpGet' - containerPort:3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'frontend-old' - } - ] - } -} - -resource backend 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'dapr-backend-old' - location: location - properties: { - application: app.id - container: { - image: magpieimage - ports: { - orders: { - containerPort: 3000 - } - } - readinessProbe:{ - kind:'httpGet' - containerPort:3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'backend-old' - appPort: 3000 - } - ] - } -} - diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-manual.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-manual.bicep deleted file mode 100644 index 7c173bd5d1..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-manual.bicep +++ /dev/null @@ -1,65 +0,0 @@ -import radius as radius - -param magpieimage string -param environment string -param namespace string = 'default' - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-dsstm-old' - properties: { - environment: environment - } -} - -resource myapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'dapr-sts-manual-ctnr-old' - properties: { - application: app.id - connections: { - daprstatestore: { - source: statestore.id - } - } - container: { - image: magpieimage - readinessProbe: { - kind: 'httpGet' - containerPort: 3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'gnrc-sts-ctnr-old' - appPort: 3000 - } - ] - } -} - - -module redis 'modules/redis-selfhost.bicep' = { - name: 'dapr-sts-manual-redis-old-deployment' - params: { - name: 'dapr-sts-manual-redis-old' - namespace: namespace - application: app.name - } -} - - -resource statestore 'Applications.Link/daprStateStores@2022-03-15-privatepreview' = { - name: 'dapr-sts-manual-old' - properties: { - application: app.id - environment: environment - resourceProvisioning: 'manual' - type: 'state.redis' - metadata: { - redisHost: '${redis.outputs.host}:${redis.outputs.port}' - redisPassword: '' - } - version: 'v1' - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-recipe.bicep deleted file mode 100644 index c53837af77..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-dapr-statestore-recipe.bicep +++ /dev/null @@ -1,72 +0,0 @@ -import radius as radius - -param magpieimage string -param registry string -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-env-recipes-env-old' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-env-recipes-env-old' - } - recipes: { - 'Applications.Link/daprStateStores': { - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/dapr-state-store:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-rs-dapr-sts-recipe-old' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-rs-dapr-sts-recipe-old' - } - ] - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'dapr-sts-recipe-ctnr-old' - properties: { - application: app.id - connections: { - daprstatestore: { - source: statestore.id - } - } - container: { - image: magpieimage - readinessProbe: { - kind: 'httpGet' - containerPort: 3000 - path: '/healthz' - } - } - extensions: [ - { - kind: 'daprSidecar' - appId: 'dapr-sts-recipe-ctnr-old' - appPort: 3000 - } - ] - } -} - -resource statestore 'Applications.Link/daprStateStores@2022-03-15-privatepreview' = { - name: 'dapr-sts-recipe-old' - properties: { - application: app.id - environment: env.id - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-microsoft-sql.bicep b/test/functional/shared/resources/testdata/corerp-resources-microsoft-sql.bicep deleted file mode 100644 index 48e3bbaf20..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-microsoft-sql.bicep +++ /dev/null @@ -1,80 +0,0 @@ -import radius as radius - -@description('Specifies the location for resources.') -param location string = 'East US' - -@description('Specifies the image for the container resource.') -param magpieImage string - -@description('Specifies the port for the container resource.') -param magpiePort int = 3000 - -@description('Specifies the environment for resources.') -param environment string = 'test' - -@description('Specifies the SQL username.') -param adminUsername string - -@description('Specifies the SQL password.') -@secure() -param adminPassword string - -param mssqlresourceid string - -param database string - -param server string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-microsoft-sql' - location: location - properties: { - environment: environment - } -} - -resource sqlapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mssql-app-ctnr-old' - location: location - properties: { - application: app.id - connections: { - sql: { - source: db.id - } - } - container: { - image: magpieImage - env: { - CONNECTION_SQL_CONNECTIONSTRING: db.connectionString() - } - readinessProbe: { - kind: 'httpGet' - containerPort: magpiePort - path: '/healthz' - } - } - } -} - -resource db 'Applications.Link/sqlDatabases@2022-03-15-privatepreview' = { - name: 'mssql-db-old' - location: location - properties: { - application: app.id - environment: environment - resourceProvisioning: 'manual' - resources:[ - { - id:mssqlresourceid - } - ] - database: database - server: server - port:1433 - username: adminUsername - secrets: { - password: adminPassword - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-mongodb-manual-provisioning.bicep b/test/functional/shared/resources/testdata/corerp-resources-mongodb-manual-provisioning.bicep deleted file mode 100644 index cf244df971..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-mongodb-manual-provisioning.bicep +++ /dev/null @@ -1,88 +0,0 @@ -import radius as radius - -@description('Admin username for the Mongo database. Default is "admin"') -param username string = 'admin' - -@description('Admin password for the Mongo database') -@secure() -param password string = newGuid() - -param environment string - -param magpieimage string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-mongodb-mp' - location: 'global' - properties: { - environment: environment - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mdb-us-app-ctnr-old' - location: 'global' - properties: { - application: app.id - connections: { - mongodb: { - source: mongo.id - } - } - container: { - image: magpieimage - } - } -} - - -// https://hub.docker.com/_/mongo/ -resource mongoContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mdb-us-ctnr-old' - location: 'global' - properties: { - application: app.id - container: { - image: 'mongo:4.2' - env: { - DBCONNECTION: mongo.connectionString() - MONGO_INITDB_ROOT_USERNAME: username - MONGO_INITDB_ROOT_PASSWORD: password - } - ports: { - mongo: { - containerPort: 27017 - provides: mongoRoute.id - } - } - } - connections: {} - } -} - -resource mongoRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'mdb-us-rte-old' - location: 'global' - properties: { - application: app.id - port: 27017 - } -} - -resource mongo 'Applications.Link/mongoDatabases@2022-03-15-privatepreview' = { - name: 'mdb-us-db-old' - location: 'global' - properties: { - application: app.id - environment: environment - resourceProvisioning: 'manual' - host: mongoRoute.properties.hostname - port: mongoRoute.properties.port - database: 'mongodb-o-${app.name}' - username: username - secrets: { - connectionString: 'mongodb://${username}:${password}@${mongoRoute.properties.hostname}:${mongoRoute.properties.port}/mongodb-o-${app.name}' - password: password - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-context.bicep b/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-context.bicep deleted file mode 100644 index 6f42ad2c04..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-context.bicep +++ /dev/null @@ -1,83 +0,0 @@ -import radius as radius - -param rg string = resourceGroup().name - -param sub string = subscription().subscriptionId - -param registry string - -param version string - -param magpieimage string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-env-recipes-context-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-env-recipes-context-env' - } - providers: { - azure: { - scope: '/subscriptions/${sub}/resourceGroups/${rg}' - } - } - recipes: { - 'Applications.Link/mongoDatabases':{ - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/mongodb-recipe-context:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-mongodb-recipe-context' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-mongodb-recipe-context-app' - } - ] - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mdb-ctx-ctnr-old' - location: 'global' - properties: { - application: app.id - connections: { - mongodb: { - source: recipedb.id - } - } - container: { - image: magpieimage - env: { - DBCONNECTION: recipedb.connectionString() - } - readinessProbe:{ - kind:'httpGet' - containerPort:3000 - path: '/healthz' - } - } - } -} - -resource recipedb 'Applications.Link/mongoDatabases@2022-03-15-privatepreview' = { - name: 'mdb-ctx-old' - location: 'global' - properties: { - application: app.id - environment: env.id - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-parameters.bicep b/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-parameters.bicep deleted file mode 100644 index 3ec630ede8..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe-parameters.bicep +++ /dev/null @@ -1,93 +0,0 @@ -import radius as radius - -param rg string = resourceGroup().name - -param sub string = subscription().subscriptionId - -param registry string - -param version string - -param magpieimage string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-env-recipe-parameters-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-env-recipe-parameters-env' - } - providers: { - azure: { - scope: '/subscriptions/${sub}/resourceGroups/${rg}' - } - } - recipes: { - 'Applications.Link/mongoDatabases' :{ - mongodb: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/mongodb-recipe-parameter:${version}' - parameters: { - documentdbName: 'acnt-operator-o-${rg}' - mongodbName: 'mdb-operator-o-${rg}' - } - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-rs-mongodb-recipe-parameters-old' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-rs-mongodb-recipe-param-app-old' - } - ] - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mdb-param-ctnr-old' - location: 'global' - properties: { - application: app.id - connections: { - mongodb: { - source: recipedb.id - } - } - container: { - image: magpieimage - env: { - DBCONNECTION: recipedb.connectionString() - } - readinessProbe:{ - kind:'httpGet' - containerPort:3000 - path: '/healthz' - } - } - } -} - -resource recipedb 'Applications.Link/mongoDatabases@2022-03-15-privatepreview' = { - name: 'mdb-recipe-param-db-old' - location: 'global' - properties: { - application: app.id - environment: env.id - recipe: { - name: 'mongodb' - parameters: { - documentdbName: 'acnt-developer-o-${rg}' - } - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe.bicep deleted file mode 100644 index 450465f2c5..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-mongodb-recipe.bicep +++ /dev/null @@ -1,86 +0,0 @@ -import radius as radius - -param rg string = resourceGroup().name - -param sub string = subscription().subscriptionId - -param registry string - -param version string - -param magpieimage string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-mongodb-recipe-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-mongodb-recipe-env' - } - providers: { - azure: { - scope: '/subscriptions/${sub}/resourceGroups/${rg}' - } - } - recipes: { - 'Applications.Link/mongoDatabases':{ - mongoazure: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/mongodb-recipe-kubernetes:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-mongodb-recipe' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-mongodb-recipe-app' - } - ] - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'mongodb-app-ctnr-old' - location: 'global' - properties: { - application: app.id - connections: { - mongodb: { - source: recipedb.id - } - } - container: { - image: magpieimage - env: { - DBCONNECTION: recipedb.connectionString() - } - readinessProbe:{ - kind:'httpGet' - containerPort:3000 - path: '/healthz' - } - } - } -} - -resource recipedb 'Applications.Link/mongoDatabases@2022-03-15-privatepreview' = { - name: 'mongodb-db-old' - location: 'global' - properties: { - application: app.id - environment: env.id - recipe: { - name: 'mongoazure' - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-rabbitmq-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-rabbitmq-recipe.bicep deleted file mode 100644 index c1f6280f8b..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-rabbitmq-recipe.bicep +++ /dev/null @@ -1,85 +0,0 @@ -import radius as radius - -@description('Specifies the location for resources.') -param location string = 'global' - -@description('Specifies the image for the container resource.') -param magpieImage string - -@description('Specifies the port for the container resource.') -param magpiePort int = 3000 - -@description('Specifies the RabbitMQ password.') -@secure() -param password string - -param registry string - -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-environment-rabbitmq-recipe-env-old' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-environment-rabbitmq-recipe-env-old' - } - recipes: { - 'Applications.Link/rabbitMQMessageQueues': { - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/rabbitmq-recipe:${version}' - parameters: { - password: password - } - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-rabbitmq-recipe-old' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-rabbitmq-default-recipe-app-old' - } - ] - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'rmq-recipe-app-ctnr-old' - location: location - properties: { - application: app.id - container: { - image: magpieImage - readinessProbe: { - kind: 'httpGet' - containerPort: magpiePort - path: '/healthz' - } - } - connections: { - rabbitmq: { - source: rabbitmq.id - } - } - } -} - -resource rabbitmq 'Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview' = { - name: 'rmq-recipe-resource-old' - location: location - properties: { - application: app.id - environment: env.id - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-rabbitmq.bicep b/test/functional/shared/resources/testdata/corerp-resources-rabbitmq.bicep deleted file mode 100644 index fee5908957..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-rabbitmq.bicep +++ /dev/null @@ -1,98 +0,0 @@ -import radius as radius - -@description('Specifies the location for resources.') -param location string = 'global' - -@description('Specifies the image for the container resource.') -param magpieImage string - -@description('Specifies the port for the container resource.') -param magpiePort int = 3000 - -@description('Specifies the environment for resources.') -param environment string = 'test' - -@description('Specifies the image for the RabbitMQ container resource.') -param rabbitmqImage string = 'rabbitmq:3.10' - -@description('Specifies the port for the container resource.') -param rabbitmqPort int = 5672 - -@description('Specifies the RabbitMQ username.') -param username string = 'guest' - -@description('Specifies the RabbitMQ password.') -@secure() -param password string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-rabbitmq-old' - location: location - properties: { - environment: environment - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'rmq-app-ctnr-old' - location: location - properties: { - application: app.id - container: { - image: magpieImage - readinessProbe: { - kind: 'httpGet' - containerPort: magpiePort - path: '/healthz' - } - } - connections: { - rabbitmq: { - source: rabbitmq.id - } - } - } -} - -resource rabbitmqContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'rmq-ctnr-old' - location: location - properties: { - application: app.id - container: { - image: rabbitmqImage - ports: { - rabbitmq: { - containerPort: rabbitmqPort - provides: rabbitmqRoute.id - } - } - } - } -} - -resource rabbitmqRoute 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = { - name: 'rmq-rte-old' - location: location - properties: { - application: app.id - port: rabbitmqPort - } -} - -resource rabbitmq 'Applications.Link/rabbitMQMessageQueues@2022-03-15-privatepreview' = { - name: 'rmq-rmq-old' - location: location - properties: { - application: app.id - environment: environment - resourceProvisioning: 'manual' - queue: 'queue' - host: rabbitmqRoute.properties.hostname - port:rabbitmqRoute.properties.port - username:username - secrets: { - password: password - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-redis-default-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-redis-default-recipe.bicep deleted file mode 100644 index 2e278a4e60..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-redis-default-recipe.bicep +++ /dev/null @@ -1,55 +0,0 @@ -import radius as radius - -param scope string = resourceGroup().id - -param registry string - -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-environment-default-recipe-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-environment-default-recipe-env' - } - providers: { - azure: { - scope: scope - } - } - recipes: { - 'Applications.Link/redisCaches': { - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/redis-recipe-value-backed:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-redis-default-recipe' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-redis-default-recipe-app' - } - ] - } -} - -resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = { - name: 'rds-default-recipe-old' - location: 'global' - properties: { - environment: env.id - application: app.id - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-redis-manualprovisioning.bicep b/test/functional/shared/resources/testdata/corerp-resources-redis-manualprovisioning.bicep deleted file mode 100644 index 5c3833678f..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-redis-manualprovisioning.bicep +++ /dev/null @@ -1,78 +0,0 @@ -import radius as radius - -param magpieimage string -param environment string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-redis-mp' - location: 'global' - properties:{ - environment: environment - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'rds-app-ctnr-old' - location: 'global' - properties: { - application: app.id - container: { - image: magpieimage - env: { - DBCONNECTION: redis.connectionString() - } - readinessProbe:{ - kind: 'httpGet' - containerPort: 3000 - path: '/healthz' - } - } - connections: { - redis: { - source: redis.id - } - } - } -} - -resource redisContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'rds-ctnr-old' - location: 'global' - properties: { - application: app.id - container: { - image: 'redis:6.2' - ports: { - redis: { - containerPort: 6379 - provides: redisRoute.id - } - } - } - connections: {} - } -} - -resource redisRoute 'Applications.Core/httproutes@2022-03-15-privatepreview' = { - name: 'rds-rte-old' - location: 'global' - properties: { - application: app.id - } -} - -resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = { - name: 'rds-rds-old' - location: 'global' - properties: { - environment: environment - application: app.id - resourceProvisioning: 'manual' - host: redisRoute.properties.hostname - port: redisRoute.properties.port - secrets: { - connectionString: '${redisRoute.properties.hostname}:${redisRoute.properties.port}' - password: '' - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-redis-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-redis-recipe.bicep deleted file mode 100644 index df508da14b..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-redis-recipe.bicep +++ /dev/null @@ -1,58 +0,0 @@ -import radius as radius - -param scope string = resourceGroup().id - -param registry string - -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-environment-recipe-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-environment-recipe-env' - } - providers: { - azure: { - scope: scope - } - } - recipes: { - 'Applications.Link/redisCaches':{ - rediscache: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/redis-recipe-value-backed:${version}' - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-redis-recipe' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-redis-recipe-app' - } - ] - } -} - -resource redis 'Applications.Link/redisCaches@2022-03-15-privatepreview' = { - name: 'rds-recipe-old' - location: 'global' - properties: { - environment: env.id - application: app.id - recipe: { - name: 'rediscache' - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-secretstore-new.bicep b/test/functional/shared/resources/testdata/corerp-resources-secretstore-new.bicep deleted file mode 100644 index be58c12e26..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-secretstore-new.bicep +++ /dev/null @@ -1,64 +0,0 @@ -import radius as radius - -@description('Specifies the location for resources.') -param location string = 'global' - -@description('Specifies the environment for resources.') -param environment string - -@description('Specifies tls cert secret values.') -@secure() -param tlscrt string -@secure() -param tlskey string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-secretstore' - location: location - properties: { - environment: environment - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-secretstore-app' - } - ] - } -} - -// Create new certificate type appcert secret. -resource appCert 'Applications.Core/secretStores@2022-03-15-privatepreview' = { - name: 'appcert' - properties:{ - application: app.id - type: 'certificate' - data: { - 'tls.key': { - value: tlskey - } - 'tls.crt': { - value: tlscrt - } - } - } -} - -// Create new generic type appSecret. -resource appSecret 'Applications.Core/secretStores@2022-03-15-privatepreview' = { - name: 'appsecret' - properties:{ - application: app.id - data: { - servicePrincipalPassword: { - value: '10000000-1000-1000-0000-000000000000' - } - appId: { - value: '00000000-0000-0000-0000-000000000001' - } - tenantId: { - encoding: 'raw' - value: '00000000-0000-0000-0000-000000000002' - } - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-secretstore-ref.bicep b/test/functional/shared/resources/testdata/corerp-resources-secretstore-ref.bicep deleted file mode 100644 index 13462a2a81..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-secretstore-ref.bicep +++ /dev/null @@ -1,35 +0,0 @@ -import radius as radius - -@description('Specifies the location for resources.') -param location string = 'global' - -@description('Specifies the environment for resources.') -param environment string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-secretstore-ref' - location: location - properties: { - environment: environment - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-secretstore-ref' - } - ] - } -} - -// Reference the existing `secret-app-existing-secret` secret. -resource existingAppCert 'Applications.Core/secretStores@2022-03-15-privatepreview' = { - name: 'existing-appcert' - properties:{ - application: app.id - type: 'certificate' - data: { - 'tls.crt': {} - 'tls.key': {} - } - resource: 'default/secret-app-existing-secret' - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-sql.bicep b/test/functional/shared/resources/testdata/corerp-resources-sql.bicep deleted file mode 100644 index ab20aa935a..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-sql.bicep +++ /dev/null @@ -1,106 +0,0 @@ -import radius as radius - -@description('Specifies the location for resources.') -param location string = 'global' - -@description('Specifies the image for the container resource.') -param magpieImage string - -@description('Specifies the port for the container resource.') -param magpiePort int = 3000 - -@description('Specifies the environment for resources.') -param environment string = 'test' - -@description('Specifies the image for the sql container resource.') -param sqlImage string = 'mcr.microsoft.com/mssql/server:2019-latest' - -@description('Specifies the port for the container resource.') -param sqlPort int = 1433 - -@description('Specifies the SQL username.') -param username string = 'sa' - -@description('Specifies the SQL password.') -@secure() -param password string = newGuid() - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-sql' - location: location - properties: { - environment: environment - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-app-ctnr-old' - location: location - properties: { - application: app.id - connections: { - sql: { - source: db.id - } - } - container: { - image: magpieImage - env: { - CONNECTION_SQL_CONNECTIONSTRING: db.connectionString() - } - readinessProbe: { - kind: 'httpGet' - containerPort: magpiePort - path: '/healthz' - } - } - } -} - -resource db 'Applications.Link/sqlDatabases@2022-03-15-privatepreview' = { - name: 'sql-db-old' - location: location - properties: { - application: app.id - environment: environment - server: sqlRoute.properties.hostname - database: 'master' - resourceProvisioning: 'manual' - port: sqlRoute.properties.port - username: username - secrets:{ - password: password - } - } -} - -resource sqlRoute 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = { - name: 'sql-rte-old' - location: location - properties: { - application: app.id - port: sqlPort - } -} - -resource sqlContainer 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-ctnr-old' - location: location - properties: { - application: app.id - container: { - image: sqlImage - env: { - ACCEPT_EULA: 'Y' - MSSQL_PID: 'Developer' - MSSQL_SA_PASSWORD: password - } - ports: { - sql: { - containerPort: sqlPort - provides: sqlRoute.id - } - } - } - } -} diff --git a/test/functional/shared/resources/testdata/corerp-resources-sqldb-recipe.bicep b/test/functional/shared/resources/testdata/corerp-resources-sqldb-recipe.bicep deleted file mode 100644 index c92036c882..0000000000 --- a/test/functional/shared/resources/testdata/corerp-resources-sqldb-recipe.bicep +++ /dev/null @@ -1,91 +0,0 @@ -import radius as radius -@description('Specifies the location for resources.') -param location string = 'global' - -@description('Specifies the image for the container resource.') -param magpieImage string - -@description('Specifies the port for the container resource.') -param magpiePort int = 3000 - -@description('Specifies the SQL username.') -param username string = 'sa' - -@description('Specifies the SQL password.') -@secure() -param password string = newGuid() - -param registry string - -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'corerp-resources-env-sql-recipe-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'corerp-resources-env-sql-recipe-env' - } - recipes: { - 'Applications.Link/sqlDatabases': { - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/sqldb-recipe:${version}' - parameters: { - username: username - password: password - } - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'corerp-resources-sqldb-recipe' - location: location - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'corerp-resources-sqldb-recipe-app' - } - ] - } -} - -resource webapp 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'sql-recipe-app-ctnr-old' - location: location - properties: { - application: app.id - connections: { - sql: { - source: db.id - } - } - container: { - image: magpieImage - env: { - CONNECTION_SQL_CONNECTIONSTRING: db.connectionString() - } - readinessProbe: { - kind: 'httpGet' - containerPort: magpiePort - path: '/healthz' - } - } - } -} - -resource db 'Applications.Link/sqlDatabases@2022-03-15-privatepreview' = { - name: 'sql-db-recipe-old' - location: location - properties: { - application: app.id - environment: env.id - } -} diff --git a/test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep b/test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep deleted file mode 100644 index da581e8ffd..0000000000 --- a/test/functional/shared/resources/testdata/linkrp-resources-extender-aws-s3-recipe.bicep +++ /dev/null @@ -1,63 +0,0 @@ -import radius as rad - -param bucketName string -param awsAccountId string -param awsRegion string -param registry string -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'linkrp-resources-extenders-aws-s3-recipe-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'linkrp-resources-extenders-aws-s3-recipe-env' - } - providers: { - aws: { - scope: '/planes/aws/aws/accounts/${awsAccountId}/regions/${awsRegion}' - } - } - recipes: { - 'Applications.Link/extenders': { - s3: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/extenders-aws-s3-recipe:${version}' - parameters: { - bucketName: bucketName - } - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'linkrp-resources-extenders-aws-s3-recipe-app' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'linkrp-resources-extenders-aws-s3-recipe-app' - } - ] - } -} - -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { - name: 'linkrp-resources-extenders-aws-s3-recipe' - properties: { - environment: env.id - application: app.id - recipe: { - name: 's3' - parameters: { - bucketName: bucketName - } - } - } -} diff --git a/test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep b/test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep deleted file mode 100644 index fc0ffce9cb..0000000000 --- a/test/functional/shared/resources/testdata/linkrp-resources-extender-recipe.bicep +++ /dev/null @@ -1,50 +0,0 @@ -import radius as radius - -param registry string - -param version string - -resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { - name: 'linkrp-resources-extender-recipe-env' - location: 'global' - properties: { - compute: { - kind: 'kubernetes' - resourceId: 'self' - namespace: 'linkrp-resources-extender-recipe-env' - } - recipes: { - 'Applications.Link/extenders':{ - default: { - templateKind: 'bicep' - templatePath: '${registry}/test/functional/shared/recipes/extender-recipe:${version}' - parameters: { - containerImage: '${registry}/magpiego:${version}' - } - } - } - } - } -} - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'linkrp-resources-extender-recipe' - location: 'global' - properties: { - environment: env.id - extensions: [ - { - kind: 'kubernetesNamespace' - namespace: 'linkrp-resources-extender-recipe-app' - } - ] - } -} - -resource extender 'Applications.Link/extenders@2022-03-15-privatepreview' = { - name: 'extender-recipe-old' - properties: { - environment: env.id - application: app.id - } -} diff --git a/test/functional/shared/resources/testdata/linkrp-resources-extender.bicep b/test/functional/shared/resources/testdata/linkrp-resources-extender.bicep deleted file mode 100644 index 3fd635779d..0000000000 --- a/test/functional/shared/resources/testdata/linkrp-resources-extender.bicep +++ /dev/null @@ -1,42 +0,0 @@ -import radius as radius - -param magpieimage string -param environment string - -resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { - name: 'linkrp-resources-extender' - location: 'global' - properties: { - environment: environment - } -} - -resource twilio 'Applications.Link/extenders@2022-03-15-privatepreview' = { - name: 'extr-twilio-old' - properties: { - environment: environment - fromNumber: '222-222-2222' - secrets: { - accountSid: 'sid' - authToken: 'token' - } - resourceProvisioning: 'manual' - } -} - -resource container 'Applications.Core/containers@2022-03-15-privatepreview' = { - name: 'extr-ctnr-old' - location: 'global' - properties: { - application: app.id - container: { - image: magpieimage - env: { - TWILIO_NUMBER: twilio.properties.fromNumber - TWILIO_SID: twilio.secrets('accountSid') - TWILIO_ACCOUNT: twilio.secrets('authToken') - } - } - connections: {} - } -} diff --git a/test/validation/shared.go b/test/validation/shared.go index 4b3452b78f..a031bffd4c 100644 --- a/test/validation/shared.go +++ b/test/validation/shared.go @@ -40,16 +40,6 @@ const ( VolumesResource = "applications.core/volumes" SecretStoresResource = "applications.core/secretStores" - O_MongoDatabasesResource = "applications.link/mongoDatabases" - O_RabbitMQMessageQueuesResource = "applications.link/rabbitMQMessageQueues" - O_RedisCachesResource = "applications.link/redisCaches" - O_SQLDatabasesResource = "applications.link/sqlDatabases" - O_DaprPubSubBrokersResource = "applications.link/daprPubSubBrokers" - O_DaprSecretStoresResource = "applications.link/daprSecretStores" - O_DaprStateStoresResource = "applications.link/daprStateStores" - O_ExtendersResource = "applications.link/extenders" - - // New resources after splitting LinkRP namespace RabbitMQQueuesResource = "applications.messaging/rabbitMQQueues" DaprPubSubBrokersResource = "applications.dapr/pubSubBrokers" DaprSecretStoresResource = "applications.dapr/secretStores" diff --git a/typespec/Applications.Core/environments.tsp b/typespec/Applications.Core/environments.tsp index 6cc1691cbc..0c7a2a7c8f 100644 --- a/typespec/Applications.Core/environments.tsp +++ b/typespec/Applications.Core/environments.tsp @@ -114,7 +114,7 @@ model TerraformRecipeProperties extends RecipeProperties { @doc("Represents the request body of the getmetadata action.") model RecipeGetMetadata { - @doc("Type of the link this recipe can be consumed by. For example: 'Applications.Link/mongoDatabases'") + @doc("Type of the link this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases'") linkType: string; @doc("The name of the recipe registered to the environment") diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json index 8fa30b4e24..1f2ba81c85 100644 --- a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_CreateOrUpdate.json @@ -18,7 +18,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" @@ -60,7 +60,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json index cf12255d83..43070c4772 100644 --- a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetEnv0.json @@ -29,7 +29,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json index 9cc8e2155c..1e5300771d 100644 --- a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json @@ -10,7 +10,7 @@ "responses": { "200": { "body": { - "linkType": "Applications.Link/mongoDatabases", + "linkType": "Applications.Datastores/mongoDatabases", "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", "parameters": { diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json index 33606a3b17..639bf67f6b 100644 --- a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_List.json @@ -30,7 +30,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" @@ -40,7 +40,7 @@ "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/mongo" } }, - "Applications.Link/redisCaches":{ + "Applications.Datastores/redisCaches":{ "redis-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/rediscache" @@ -109,7 +109,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" } diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json index b34faeafaf..a12a1ad8e2 100644 --- a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_PatchEnv0.json @@ -18,7 +18,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" @@ -47,7 +47,7 @@ } }, "recipes": { - "Applications.Link/mongoDatabases":{ + "Applications.Datastores/mongoDatabases":{ "cosmos-recipe": { "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb" diff --git a/typespec/Applications.Core/extenders.tsp b/typespec/Applications.Core/extenders.tsp index e29e6268e1..8ed9111e86 100644 --- a/typespec/Applications.Core/extenders.tsp +++ b/typespec/Applications.Core/extenders.tsp @@ -38,10 +38,10 @@ namespace Applications.Core; @doc("Response for list secrets API call") model ExtenderListSecretResponse {} -@doc("ExtenderResource link") +@doc("ExtenderResource portable resource") model ExtenderResource is TrackedResource { @path - @doc("The name of the ExtenderResource link resource") + @doc("The name of the ExtenderResource portable resource") @key("extenderName") @segment("extenders") name: ResourceNameString; @@ -51,14 +51,14 @@ model ExtenderResource is TrackedResource { // we need to extend `Record`. // Reference: https://github.com/Azure/typespec-azure/blob/main/packages/typespec-autorest/test/additional-properties.test.ts #suppress "@azure-tools/typespec-azure-core/bad-record-type" -@doc("ExtenderResource link properties") +@doc("ExtenderResource portable resource properties") model ExtenderProperties extends Record { ...EnvironmentScopedResource; @doc("The secrets for referenced resource") secrets?: {}; - @doc("The recipe used to automatically deploy underlying infrastructure for the extender link") + @doc("The recipe used to automatically deploy underlying infrastructure for the extender portable resource") recipe?: Recipe; @doc("Specifies how the underlying service/resource is provisioned and managed.") From 87375163e9da0926327f7a58c050aff1221c084e Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Wed, 30 Aug 2023 12:07:20 -0700 Subject: [PATCH 28/57] Use Hosted Pool (#6169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is to switch back to GitHub hosted pool, except for functional tests. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 3a5ccf6 ### Summary 🏃‍♂️📦🚀 This pull request changes the runners for all the GitHub Actions workflows in the project-radius/radius repository from self-hosted to `ubuntu-latest`. This is done to improve the scalability and reliability of the workflows and to consolidate the asset-related jobs in the `assets.yaml` workflow. > _We changed our workflows to use `ubuntu-latest`_ > _Instead of self-hosted runners that were not the best_ > _We consolidated assets in one place_ > _And simplified the build and test phase_ > _Now our Radius project is more robust and fast_ ### Walkthrough * Changed the runner for all asset-related jobs in the `assets.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners and align with other workflows that use the same artifacts ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-00a0a8796a7a2792320b21eb714e8c84d26558f81f398285cc7840324eed2cf7L28-R28), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L60-R60), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L217-R217), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L266-R266), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L315-R315), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L356-R356), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L395-R395), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L479-R479)) * Changed the runner for the `build` and `test` jobs in the `e2e-test-azure.yaml` workflow to `ubuntu-latest` to align with the `assets.yaml` workflow and use the artifacts from that workflow instead of building them separately ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-4f62b287c879d688a637961bed711c48e0809bd32559ec524e5d7aa911cc0bd1L89-R89), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-4f62b287c879d688a637961bed711c48e0809bd32559ec524e5d7aa911cc0bd1L275-R275)) * Changed the runner for the `build`, `tests`, and `report` jobs in the `functional-test.yaml` workflow to `ubuntu-latest` to align with the `assets.yaml` workflow and use the artifacts from that workflow instead of building them separately ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL81-R81), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL295-R295), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL569-R569)) * Changed the runner for the `customer` job in the `issues.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-fe198ee6d6945e09ccefa6351febac68b4b18f3ebc3503e720a8c7fee65ea5c7L10-R10)) * Changed the runner for the `linter_check` job in the `lint.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-4b122024a3a28ded65da76a2f1bface1f3a27328374438d1298d25585fe0603bL33-R33)) * Changed the runner for the `update-types` job in the `publish-bicep.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-5dda38c017a17c459b16104779239cf891ceac425018e4b63263f4c7d773e061L26-R26)) * Changed the runner for the `delete-artifacts` job in the `purge-artifacts.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-c53ef57b4d3b16c254fa6283c1dd7f01ff63989d138a42008277903de32241a2L13-R13)) * Changed the runner for the `purge_azure_resources` job in the `purge-test-resources.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-9270fafc31ef4b50d35d1295e9f99f96013853c295c29c92c387492f62cd570dL42-R42)) * Changed the runner for the `radius-bot` job in the `radius-bot.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-c70ecfd035a4650c141a6b69858c30ad9a9f261099f3c891b6bd44f7021ba9ceL10-R10)) * Changed the runner for the `generate_release_note` and `release` jobs in the `release.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL37-R37), [link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL122-R122)) * Changed the runner for the `build` job in the `validate-bicep.yaml` workflow to `ubuntu-latest` to reduce the dependency on self-hosted runners ([link](https://github.com/project-radius/radius/pull/6169/files?diff=unified&w=0#diff-4f41a75886a1a479805bae1b7fb335479735aa7740e02b9e5c19992ead18f73eL32-R32)) --- .github/workflows/assets.yaml | 2 +- .github/workflows/build.yaml | 14 +++++++------- .github/workflows/e2e-test-azure.yaml | 4 ++-- .github/workflows/functional-test.yaml | 2 +- .github/workflows/issues.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/publish-bicep.yaml | 2 +- .github/workflows/purge-artifacts.yaml | 2 +- .github/workflows/purge-test-resources.yaml | 2 +- .github/workflows/radius-bot.yaml | 2 +- .github/workflows/release.yaml | 4 ++-- .github/workflows/validate-bicep.yaml | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/assets.yaml b/.github/workflows/assets.yaml index 9ee7c2e48e..3033fa0272 100644 --- a/.github/workflows/assets.yaml +++ b/.github/workflows/assets.yaml @@ -25,7 +25,7 @@ on: jobs: publish: name: Assets - runs-on: [self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e84f5bde58..e99e2cda62 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -57,7 +57,7 @@ env: jobs: build: name: Build ${{ matrix.target_os }}_${{ matrix.target_arch }} binaries - runs-on: [self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest env: GOOS: ${{ matrix.target_os }} GOARCH: ${{ matrix.target_arch }} @@ -214,7 +214,7 @@ jobs: # TODO_LAUNCH: Remove 'image' job when we opensource the repo - https://github.com/project-radius/radius/issues/5892 images: name: Container image build - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v3 @@ -263,7 +263,7 @@ jobs: # publish_image is building and publishing images to GHCR. publish_images: name: Build and publish container images - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v3 @@ -312,7 +312,7 @@ jobs: helm: name: Helm chart build needs: ['images', 'publish_images'] - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest env: ARTIFACT_DIR: ./dist/Charts HELM_PACKAGE_DIR: helm @@ -353,7 +353,7 @@ jobs: publish_release: name: Publish rad CLI binaries needs: [ 'build' ] - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout @@ -392,7 +392,7 @@ jobs: publish: name: Publish rad CLI binaries needs: [ 'build' ] - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest if: (github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/tags/v') # upload on push to main or tag steps: - name: Checkout @@ -476,7 +476,7 @@ jobs: name: Delete artifacts needs: [ 'build', 'publish' ] if: ${{ always() && !contains(needs.build.result, 'failure') }} - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Delete release artifacts uses: geekyeggo/delete-artifact@v1 diff --git a/.github/workflows/e2e-test-azure.yaml b/.github/workflows/e2e-test-azure.yaml index f35b7a5784..bab559610b 100644 --- a/.github/workflows/e2e-test-azure.yaml +++ b/.github/workflows/e2e-test-azure.yaml @@ -86,7 +86,7 @@ env: jobs: build: name: Build Radius for test - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest outputs: SKIP_BUILD: ${{ steps.skip-build.outputs.SKIP_BUILD }} REL_VERSION: ${{ steps.gen-id.outputs.REL_VERSION }} @@ -272,7 +272,7 @@ jobs: tests: name: Run functional tests needs: build - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest env: SKIP_BUILD: ${{ needs.build.outputs.SKIP_BUILD }} UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }} diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index f7e6987275..2a6c592d53 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -566,7 +566,7 @@ jobs: report-failure: name: Report test failure needs: [build, tests] - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] if: failure() && github.event_name == 'schedule' steps: - name: Create failure issue for failing scheduled run diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml index 8ece916762..42b434cf48 100644 --- a/.github/workflows/issues.yaml +++ b/.github/workflows/issues.yaml @@ -7,7 +7,7 @@ on: jobs: customer: name: Add a label if Issue created by customer - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT }} steps: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c0765f0f60..e0e12820ee 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -30,7 +30,7 @@ concurrency: jobs: linter_check: name: Lint - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest timeout-minutes: 30 env: GOVER: '^1.21' diff --git a/.github/workflows/publish-bicep.yaml b/.github/workflows/publish-bicep.yaml index 2903285379..371bdb5094 100644 --- a/.github/workflows/publish-bicep.yaml +++ b/.github/workflows/publish-bicep.yaml @@ -23,7 +23,7 @@ on: jobs: update-types: name: Update Bicep extensibility provider types - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest timeout-minutes: 10 env: GOVER: '^1.21' diff --git a/.github/workflows/purge-artifacts.yaml b/.github/workflows/purge-artifacts.yaml index fd1993e11a..765740b1a4 100644 --- a/.github/workflows/purge-artifacts.yaml +++ b/.github/workflows/purge-artifacts.yaml @@ -10,7 +10,7 @@ on: jobs: delete-artifacts: - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - uses: kolpav/purge-artifacts-action@v1 with: diff --git a/.github/workflows/purge-test-resources.yaml b/.github/workflows/purge-test-resources.yaml index 1e8815d22a..80737749fe 100644 --- a/.github/workflows/purge-test-resources.yaml +++ b/.github/workflows/purge-test-resources.yaml @@ -39,7 +39,7 @@ jobs: token: ${{ secrets.GH_RAD_CI_BOT_PAT }} purge_azure_resources: name: Azure resources clean-ups - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Setup Azure CLI run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash diff --git a/.github/workflows/radius-bot.yaml b/.github/workflows/radius-bot.yaml index 58d82cfc01..1a591aacde 100644 --- a/.github/workflows/radius-bot.yaml +++ b/.github/workflows/radius-bot.yaml @@ -7,7 +7,7 @@ on: jobs: radius-bot: name: Run Radius Bot script - runs-on: [self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v3 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d2826776e9..f0c8710ae1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,7 +34,7 @@ env: jobs: generate_release_note: name: Generate release note from template - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest if: github.event_name == 'pull_request' env: RELNOTE_FOUND: false @@ -119,7 +119,7 @@ jobs: release: name: Create a new Radius release if: github.event_name == 'push' - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Checkout project-radius/radius@main uses: actions/checkout@v3 diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index f5505f4fb8..015b4194df 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -29,7 +29,7 @@ concurrency: jobs: build: name: Validate Bicep Code - runs-on: [self-hosted,1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest steps: - name: Check out repo uses: actions/checkout@v3 From ba287e14c8add2699b84564640e83b434fd7c4c3 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Wed, 30 Aug 2023 12:39:01 -0700 Subject: [PATCH 29/57] Use basemanifest in Container resource to create k8s resources (#6154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is to use base manifest in container resource when renderer creates k8s resources. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 7879ae4 ### Summary 🚀🐳🛠️ This pull request adds support for customizing the Kubernetes objects generated by the container resource renderer with a base manifest. It also updates the test application and the test cases to use the new feature. It introduces new functions and types in the `kubeutil` package for parsing and merging Kubernetes manifests. It adds a new function for creating a federated identity service account for Azure integration. It updates the base image of the Dockerfile for the test application. > _To render containers with ease_ > _We added a base manifest, please_ > _With `kubeutil` we merge_ > _And `ObjectManifest` we search_ > _And test with `/envvars` and `magpiego`_ ### Walkthrough * Add a new function `MakeFederatedIdentityK8sServiceAccount` to create a ServiceAccount with Azure Workload Identity annotations in `pkg/corerp/renderers/container/azure/identity.go` ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-901a92f8517371b86a8148aa840dbca987300619ae93d6db5380a90d4db3e773R199-R222)) * Add a new type `ObjectManifest` and a new function `MergePatchObject` to the `kubeutil` package for parsing and merging Kubernetes objects and manifests in `pkg/kubeutil/manifest.go` and `pkg/kubeutil/patch.go` ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL26-R41), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL45-R60), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-07b4bd3df2677b15c416471a4d6aee1c68bb02638e785072821228aa807562deR1-R46)) * Modify the `Render` function in `pkg/corerp/renderers/container/render.go` to support the base manifest feature for the container resource type, using the `kubeutil` package to parse and merge the base manifest with the generated Kubernetes objects ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R43), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L165-R179), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L229-R241), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L255-R267), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R275-R289)) * Modify the `makeDeployment` and `makeService` functions in `pkg/corerp/renderers/container/render.go` to use the `kubeutil` package to merge the base manifest with the generated deployment and service objects, and to integrate with Azure Workload Identity ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L274-R301), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L291-R318), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L309-R354), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L536-R590), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R686-R693)) * Add a new constant `LocalIDConfigMap` to the `v1` package for the config map resource type in `pkg/rp/v1/local_ids.go` ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-71389e75b61fab5b8bd5a2a20a74b445ee3c613dd1d8bb86d586aa8b0d2f5789R76)) * Modify the `PostStepVerify` function in `test/functional/shared/resources/container_runtimes_test.go` to use the Kubernetes client to get and log the generated Kubernetes objects from the base manifest ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-ea9a079edf277b4770c4a91c1c9413b69b0a5a7dc32bfba16aa2020ee2f52143R20), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-ea9a079edf277b4770c4a91c1c9413b69b0a5a7dc32bfba16aa2020ee2f52143R27-R28), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-ea9a079edf277b4770c4a91c1c9413b69b0a5a7dc32bfba16aa2020ee2f52143R59-R87)) * Modify the base manifest file `test/functional/shared/resources/testdata/manifest/basemanifest.yaml` to customize the deployment and service objects, and to add some additional objects such as a service account, secrets and a config map ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-a0286cbde5a044bab5c4aa8c56b820af427ebe58f229dadb60415db1af96d866R7-R8), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-a0286cbde5a044bab5c4aa8c56b820af427ebe58f229dadb60415db1af96d866L17-R42), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-a0286cbde5a044bab5c4aa8c56b820af427ebe58f229dadb60415db1af96d866R48-R49), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-a0286cbde5a044bab5c4aa8c56b820af427ebe58f229dadb60415db1af96d866L32-R92)) * Modify the Dockerfile and the server code of the magpiego test application in `test/magpiego/Dockerfile` and `test/magpiego/server.go` to use the latest Go version and to add a new endpoint for serving the environment variables ([link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-332ab34760a2c30a7e52233090f11cfa0d462a647f4d4e621c71b70e6b5a415aL3-R3), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-357d489e771b244af25a7557623a603ba247252a8b0653339f4f4e66510d3ecbR8-R9), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-357d489e771b244af25a7557623a603ba247252a8b0653339f4f4e66510d3ecbR20), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-357d489e771b244af25a7557623a603ba247252a8b0653339f4f4e66510d3ecbR79), [link](https://github.com/project-radius/radius/pull/6154/files?diff=unified&w=0#diff-357d489e771b244af25a7557623a603ba247252a8b0653339f4f4e66510d3ecbR120-R136)) --- .../controller/containers/validator.go | 25 +- .../controller/containers/validator_test.go | 130 ++--- .../renderers/container/azure/identity.go | 44 +- .../container/azure/identity_test.go | 31 +- pkg/corerp/renderers/container/manifest.go | 218 +++++++++ .../renderers/container/manifest_test.go | 462 ++++++++++++++++++ pkg/corerp/renderers/container/render.go | 190 +++---- pkg/corerp/renderers/container/render_test.go | 25 +- pkg/corerp/renderers/gateway/render.go | 8 +- pkg/corerp/renderers/httproute/render.go | 4 +- pkg/corerp/renderers/kubernetesmetadata.go | 10 +- .../renderers/kubernetesmetadata/render.go | 4 +- pkg/kubeutil/manifest.go | 28 +- pkg/kubeutil/manifest_test.go | 10 + pkg/kubeutil/types.go | 34 ++ pkg/rp/kube/kubernetesmetadata.go | 13 +- pkg/rp/kube/kubernetesmetadata_test.go | 3 +- pkg/rp/v1/{local_ids.go => localids.go} | 17 +- pkg/rp/v1/localids_test.go | 28 ++ pkg/rp/v1/outputresource.go | 10 + pkg/rp/v1/outputresource_test.go | 9 + .../resources/container_runtimes_test.go | 89 ++++ ...resources-container-manifest-sidecar.bicep | 52 ++ .../testdata/manifest/basemanifest.yaml | 72 ++- .../resources/testdata/manifest/sidecar.yaml | 22 + test/k8sutil/fakeresources.go | 99 ++++ 26 files changed, 1345 insertions(+), 292 deletions(-) create mode 100644 pkg/corerp/renderers/container/manifest.go create mode 100644 pkg/corerp/renderers/container/manifest_test.go create mode 100644 pkg/kubeutil/types.go rename pkg/rp/v1/{local_ids.go => localids.go} (92%) create mode 100644 pkg/rp/v1/localids_test.go create mode 100644 test/functional/shared/resources/testdata/corerp-resources-container-manifest-sidecar.bicep create mode 100644 test/functional/shared/resources/testdata/manifest/sidecar.yaml create mode 100644 test/k8sutil/fakeresources.go diff --git a/pkg/corerp/frontend/controller/containers/validator.go b/pkg/corerp/frontend/controller/containers/validator.go index ec59831c79..229bee6b28 100644 --- a/pkg/corerp/frontend/controller/containers/validator.go +++ b/pkg/corerp/frontend/controller/containers/validator.go @@ -117,7 +117,7 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou } switch k { - case "apps/v1/deployment": + case kubeutil.DeploymentV1: if len(resources) != 1 { errDetails = append(errDetails, errMultipleResources("Deployment", len(resources))) } @@ -126,7 +126,7 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou errDetails = append(errDetails, errUnmatchedName(deployment, newResource.Name)) } - case "core/v1/service": + case kubeutil.ServiceV1: if len(resources) != 1 { errDetails = append(errDetails, errMultipleResources("Service", len(resources))) } @@ -135,7 +135,7 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou errDetails = append(errDetails, errUnmatchedName(srv, newResource.Name)) } - case "core/v1/serviceaccount": + case kubeutil.ServiceAccountV1: if len(resources) != 1 { errDetails = append(errDetails, errMultipleResources("ServiceAccount", len(resources))) } @@ -144,9 +144,24 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou errDetails = append(errDetails, errUnmatchedName(sa, newResource.Name)) } + deployment := resourceMap.GetFirst(kubeutil.DeploymentV1) + if deployment == nil { + // skip if there is no deployment. + continue + } + + podSA := deployment.(*appv1.Deployment).Spec.Template.Spec.ServiceAccountName + if podSA != sa.Name { + errDetails = append(errDetails, v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: "$.properties.runtimes.kubernetes.base", + Message: fmt.Sprintf("ServiceAccount name %s in PodSpec does not match the name %s in ServiceAccount.", podSA, sa.Name), + }) + } + // No limitations for ConfigMap and Secret resources. - case "core/v1/configmap": - case "core/v1/secret": + case kubeutil.SecretV1: + case kubeutil.ConfigMapV1: default: errDetails = append(errDetails, v1.ErrorDetails{ diff --git a/pkg/corerp/frontend/controller/containers/validator_test.go b/pkg/corerp/frontend/controller/containers/validator_test.go index b068343faa..19abdd6ab8 100644 --- a/pkg/corerp/frontend/controller/containers/validator_test.go +++ b/pkg/corerp/frontend/controller/containers/validator_test.go @@ -26,88 +26,14 @@ import ( "github.com/project-radius/radius/pkg/armrpc/rest" "github.com/project-radius/radius/pkg/corerp/datamodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/test/k8sutil" "github.com/stretchr/testify/require" ) -const fakeDeploymentTemplate = ` -apiVersion: apps/v1 -kind: Deployment -metadata: - name: %s - %s - labels: - app: magpie -spec: - replicas: 3 - selector: - matchLabels: - app: magpie - template: - metadata: - labels: - app: magpie - spec: - containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 -` - -const fakeServiceTemplate = ` -apiVersion: v1 -kind: Service -metadata: - name: %s - %s -spec: - selector: - app.kubernetes.io/name: magpie - ports: - - protocol: TCP - port: 80 - targetPort: 9376 -` - -const fakeServiceAccountTemplate = ` -apiVersion: v1 -kind: ServiceAccount -metadata: - name: %s - labels: - app.kubernetes.io/name: magpie - app.kubernetes.io/part-of: radius -` - -const yamlSeparater = "\n---\n" - -const fakeSecretTemplate = ` -apiVersion: v1 -kind: Secret -metadata: - name: %s -type: Opaque -stringData: - username: admin - password: password -` - -const fakeConfigMapTemplate = ` -apiVersion: v1 -kind: ConfigMap -metadata: - name: %s - labels: - app.kubernetes.io/name: magpie - app.kubernetes.io/part-of: radius -data: - appsettings.Production.json: config -` - func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { - fakeDeployment := fmt.Sprintf(fakeDeploymentTemplate, "magpie", "") - fakeService := fmt.Sprintf(fakeServiceTemplate, "magpie", "") - fakeServiceAccount := fmt.Sprintf(fakeServiceAccountTemplate, "magpie") + fakeDeployment := fmt.Sprintf(k8sutil.FakeDeploymentTemplate, "magpie", "", "magpie") + fakeService := fmt.Sprintf(k8sutil.FakeServiceTemplate, "magpie", "") + fakeServiceAccount := fmt.Sprintf(k8sutil.FakeServiceAccountTemplate, "magpie") requestTests := []struct { desc string @@ -177,7 +103,7 @@ func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { Properties: datamodel.ContainerProperties{ Runtimes: &datamodel.RuntimeProperties{ Kubernetes: &datamodel.KubernetesRuntime{ - Base: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, yamlSeparater), + Base: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, k8sutil.YAMLSeparater), }, }, }, @@ -191,7 +117,7 @@ func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { Properties: datamodel.ContainerProperties{ Runtimes: &datamodel.RuntimeProperties{ Kubernetes: &datamodel.KubernetesRuntime{ - Base: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, yamlSeparater), + Base: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, k8sutil.YAMLSeparater), }, }, }, @@ -266,12 +192,12 @@ func TestValidateAndMutateRequest_IdentityProperty(t *testing.T) { } func TestValidateManifest(t *testing.T) { - fakeDeployment := fmt.Sprintf(fakeDeploymentTemplate, "magpie", "") - fakeService := fmt.Sprintf(fakeServiceTemplate, "magpie", "") - fakeServiceAccount := fmt.Sprintf(fakeServiceAccountTemplate, "magpie") - fakeSecret := fmt.Sprintf(fakeSecretTemplate, "magpie") - fakeConfigMap := fmt.Sprintf(fakeConfigMapTemplate, "magpie") - fakeServiceWithNamespace := fmt.Sprintf(fakeServiceTemplate, "magpie", "namespace: app-scoped") + fakeDeployment := fmt.Sprintf(k8sutil.FakeDeploymentTemplate, "magpie", "", "magpie") + fakeService := fmt.Sprintf(k8sutil.FakeServiceTemplate, "magpie", "") + fakeServiceAccount := fmt.Sprintf(k8sutil.FakeServiceAccountTemplate, "magpie") + fakeSecret := fmt.Sprintf(k8sutil.FakeSecretTemplate, "magpie") + fakeConfigMap := fmt.Sprintf(k8sutil.FakeSecretTemplate, "magpie") + fakeServiceWithNamespace := fmt.Sprintf(k8sutil.FakeServiceTemplate, "magpie", "namespace: app-scoped") validResource := &datamodel.ContainerResource{ BaseResource: v1.BaseResource{ @@ -290,25 +216,25 @@ func TestValidateManifest(t *testing.T) { }{ { name: "valid manifest with deployments/services/serviceaccounts", - manifest: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount}, k8sutil.YAMLSeparater), resource: validResource, err: nil, }, { name: "valid manifest with deployments/services/secrets/configmaps", - manifest: strings.Join([]string{fakeDeployment, fakeService, fakeSecret, fakeSecret}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeSecret, fakeSecret}, k8sutil.YAMLSeparater), resource: validResource, err: nil, }, { name: "valid manifest with multiple secrets and multiple configmaps", - manifest: strings.Join([]string{fakeDeployment, fakeService, fakeSecret, fakeSecret, fakeSecret, fakeConfigMap, fakeConfigMap}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeSecret, fakeSecret, fakeSecret, fakeConfigMap, fakeConfigMap}, k8sutil.YAMLSeparater), resource: validResource, err: nil, }, { name: "invalid manifest with multiple deployments", - manifest: strings.Join([]string{fakeDeployment, fakeDeployment}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeDeployment}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -325,7 +251,7 @@ func TestValidateManifest(t *testing.T) { }, { name: "invalid manifest with multiple services", - manifest: strings.Join([]string{fakeDeployment, fakeService, fakeService}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeService}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -342,7 +268,7 @@ func TestValidateManifest(t *testing.T) { }, { name: "invalid manifest with multiple serviceaccounts", - manifest: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount, fakeServiceAccount}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount, fakeServiceAccount}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -359,7 +285,7 @@ func TestValidateManifest(t *testing.T) { }, { name: "invalid manifest with resource including namespace", - manifest: strings.Join([]string{fakeDeployment, fakeServiceWithNamespace, fakeServiceAccount}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeServiceWithNamespace, fakeServiceAccount}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -376,7 +302,7 @@ func TestValidateManifest(t *testing.T) { }, { name: "invalid manifest with unmatched deployment name", - manifest: strings.Join([]string{fmt.Sprintf(fakeDeploymentTemplate, "pie", ""), fakeService, fakeServiceAccount}, yamlSeparater), + manifest: strings.Join([]string{fmt.Sprintf(k8sutil.FakeDeploymentTemplate, "pie", "", "magpie"), fakeService, fakeServiceAccount}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -393,7 +319,7 @@ func TestValidateManifest(t *testing.T) { }, { name: "invalid manifest with unmatched service name", - manifest: strings.Join([]string{fakeDeployment, fmt.Sprintf(fakeServiceTemplate, "pie", ""), fakeServiceAccount}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fmt.Sprintf(k8sutil.FakeServiceTemplate, "pie", ""), fakeServiceAccount}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -410,7 +336,7 @@ func TestValidateManifest(t *testing.T) { }, { name: "invalid manifest with unmatched serviceaccount name", - manifest: strings.Join([]string{fakeDeployment, fakeService, fmt.Sprintf(fakeServiceAccountTemplate, "pie")}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fmt.Sprintf(k8sutil.FakeServiceAccountTemplate, "pie")}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -422,12 +348,17 @@ func TestValidateManifest(t *testing.T) { Target: manifestTargetProperty, Message: "ServiceAccount name pie in manifest does not match resource name magpie.", }, + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "ServiceAccount name magpie in PodSpec does not match the name pie in ServiceAccount.", + }, }, }, }, { name: "invalid manifest with multiple errors", - manifest: strings.Join([]string{fakeDeployment, fakeService, fakeService, fmt.Sprintf(fakeServiceAccountTemplate, "pie")}, yamlSeparater), + manifest: strings.Join([]string{fakeDeployment, fakeService, fakeService, fmt.Sprintf(k8sutil.FakeServiceAccountTemplate, "pie")}, k8sutil.YAMLSeparater), resource: validResource, err: v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -444,6 +375,11 @@ func TestValidateManifest(t *testing.T) { Target: manifestTargetProperty, Message: "ServiceAccount name pie in manifest does not match resource name magpie.", }, + { + Code: v1.CodeInvalidRequestContent, + Target: manifestTargetProperty, + Message: "ServiceAccount name magpie in PodSpec does not match the name pie in ServiceAccount.", + }, }, }, }, diff --git a/pkg/corerp/renderers/container/azure/identity.go b/pkg/corerp/renderers/container/azure/identity.go index dda00ff60f..f57dc5fd32 100644 --- a/pkg/corerp/renderers/container/azure/identity.go +++ b/pkg/corerp/renderers/container/azure/identity.go @@ -24,14 +24,12 @@ import ( "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/handlers" "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/ucp/resources" resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -80,7 +78,7 @@ func MakeRoleAssignments(azResourceID string, roleNames []string) ([]rpv1.Output outputResources := []rpv1.OutputResource{} for _, roleName := range roleNames { roleAssignment := rpv1.OutputResource{ - LocalID: rpv1.GenerateLocalIDForRoleAssignment(azResourceID, roleName), + LocalID: rpv1.NewLocalID(rpv1.LocalIDRoleAssignmentPrefix, azResourceID, roleName), CreateResource: &rpv1.Resource{ Data: map[string]string{ handlers.RoleNameKey: roleName, @@ -141,14 +139,20 @@ func TransformFederatedIdentitySA(ctx context.Context, options *handlers.PutOpti return err } - sa.Annotations[azureWorkloadIdentityClientID] = clientID - sa.Annotations[azureWorkloadIdentityTenantID] = tenantID + if clientID != "" && tenantID != "" { + sa.Annotations[azureWorkloadIdentityClientID] = clientID + sa.Annotations[azureWorkloadIdentityTenantID] = tenantID + } return nil } func extractIdentityInfo(options *handlers.PutOptions) (clientID string, tenantID string, err error) { - mi := options.DependencyProperties[rpv1.LocalIDUserAssignedManagedIdentity] + mi, ok := options.DependencyProperties[rpv1.LocalIDUserAssignedManagedIdentity] + if !ok { + return "", "", nil + } + if mi == nil { err = errors.New("cannot find LocalIDUserAssignedManagedIdentity") return @@ -168,30 +172,14 @@ func extractIdentityInfo(options *handlers.PutOptions) (clientID string, tenantI return } -// MakeFederatedIdentitySA creates a ServiceAccount with descriptive labels and placeholder annotations for Azure Workload +// SetWorkloadIdentityServiceAccount creates a ServiceAccount with descriptive labels and placeholder annotations for Azure Workload // Identity, and returns an OutputResource with the ServiceAccount and a dependency on the FederatedIdentity. -func MakeFederatedIdentitySA(appName, name, namespace string, resource *datamodel.ContainerResource) *rpv1.OutputResource { - labels := kubernetes.MakeDescriptiveLabels(appName, resource.Name, resource.Type) - labels[AzureWorkloadIdentityUseKey] = "true" - - sa := &corev1.ServiceAccount{ - TypeMeta: metav1.TypeMeta{ - Kind: "ServiceAccount", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: kubernetes.NormalizeResourceName(name), - Namespace: namespace, - Labels: labels, - Annotations: map[string]string{ - // ResourceTransformer transforms these values before deploying resource. - azureWorkloadIdentityClientID: "placeholder", - azureWorkloadIdentityTenantID: "placeholder", - }, - }, - } +func SetWorkloadIdentityServiceAccount(base *corev1.ServiceAccount) *rpv1.OutputResource { + base.ObjectMeta.Labels[AzureWorkloadIdentityUseKey] = "true" + base.ObjectMeta.Annotations[azureWorkloadIdentityClientID] = "placeholder" + base.ObjectMeta.Annotations[azureWorkloadIdentityTenantID] = "placeholder" - or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDServiceAccount, sa, sa.ObjectMeta) + or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDServiceAccount, base, base.ObjectMeta) or.CreateResource.Dependencies = []string{rpv1.LocalIDFederatedIdentity} return &or diff --git a/pkg/corerp/renderers/container/azure/identity_test.go b/pkg/corerp/renderers/container/azure/identity_test.go index ca2a38dd3f..c540068f94 100644 --- a/pkg/corerp/renderers/container/azure/identity_test.go +++ b/pkg/corerp/renderers/container/azure/identity_test.go @@ -21,7 +21,6 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" "github.com/project-radius/radius/pkg/corerp/datamodel" "github.com/project-radius/radius/pkg/corerp/handlers" "github.com/project-radius/radius/pkg/corerp/renderers" @@ -31,6 +30,7 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -103,15 +103,20 @@ func TestMakeRoleAssignments(t *testing.T) { }, or[1].CreateResource.Data) } -func TestMakeFederatedIdentitySA(t *testing.T) { - fi := MakeFederatedIdentitySA("app", "sa", "default", &datamodel.ContainerResource{ - BaseResource: v1.BaseResource{ - TrackedResource: v1.TrackedResource{ - Name: "test-cntr", - Type: "applications.core/containers", - }, +func TestSetWorkloadIdentityServiceAccount(t *testing.T) { + base := &corev1.ServiceAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "ServiceAccount", + APIVersion: "v1", }, - }) + ObjectMeta: metav1.ObjectMeta{ + Name: "test-cntr", + Labels: map[string]string{}, + Annotations: map[string]string{}, + }, + } + + fi := SetWorkloadIdentityServiceAccount(base) putOptions := &handlers.PutOptions{ Resource: fi, @@ -149,7 +154,7 @@ func TestTransformFederatedIdentitySA_Validation(t *testing.T) { { desc: "missing user managed identity", resource: &corev1.ServiceAccount{}, - err: errors.New("cannot find LocalIDUserAssignedManagedIdentity"), + err: nil, }, { desc: "missing client ID", @@ -180,7 +185,11 @@ func TestTransformFederatedIdentitySA_Validation(t *testing.T) { DependencyProperties: tc.dep, }) - require.ErrorContains(t, err, tc.err.Error()) + if tc.err != nil { + require.EqualError(t, err, tc.err.Error()) + } else { + require.NoError(t, err) + } }) } } diff --git a/pkg/corerp/renderers/container/manifest.go b/pkg/corerp/renderers/container/manifest.go new file mode 100644 index 0000000000..f31f29b384 --- /dev/null +++ b/pkg/corerp/renderers/container/manifest.go @@ -0,0 +1,218 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package container + +import ( + "context" + "errors" + "fmt" + "strings" + + "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/project-radius/radius/pkg/corerp/renderers" + "github.com/project-radius/radius/pkg/kubernetes" + "github.com/project-radius/radius/pkg/kubeutil" + rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/pkg/ucp/ucplog" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" +) + +var errDeploymentNotFound = errors.New("deployment resource must be in outputResources") + +// fetchBaseManifest fetches the base manifest from the container resource. +func fetchBaseManifest(r *datamodel.ContainerResource) (kubeutil.ObjectManifest, error) { + baseManifest := kubeutil.ObjectManifest{} + runtimes := r.Properties.Runtimes + var err error + + if runtimes != nil && runtimes.Kubernetes != nil && runtimes.Kubernetes.Base != "" { + baseManifest, err = kubeutil.ParseManifest([]byte(runtimes.Kubernetes.Base)) + if err != nil { + return nil, err + } + } + + return baseManifest, nil +} + +// getDeploymentBase returns the deployment resource based on the given base manifest. +// If the container has a base manifest, get the deployment resource from the base manifest. +// Otherwise, populate default resources. +func getDeploymentBase(manifest kubeutil.ObjectManifest, appName string, r *datamodel.ContainerResource, options *renderers.RenderOptions) *appsv1.Deployment { + name := kubernetes.NormalizeResourceName(r.Name) + + defaultDeployment := &appsv1.Deployment{ + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + Spec: appsv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{}, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{}, + Annotations: map[string]string{}, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: name, + }, + }, + }, + }, + }, + } + + if resource := manifest.GetFirst(kubeutil.DeploymentV1); resource != nil { + defaultDeployment = resource.(*appsv1.Deployment) + } + + defaultDeployment.ObjectMeta = getObjectMeta(defaultDeployment.ObjectMeta, appName, r.Name, r.ResourceTypeName(), *options) + if defaultDeployment.Spec.Selector == nil { + defaultDeployment.Spec.Selector = &metav1.LabelSelector{} + } + + podTemplate := &defaultDeployment.Spec.Template + if podTemplate.ObjectMeta.Labels == nil { + podTemplate.ObjectMeta.Labels = map[string]string{} + } + + if podTemplate.ObjectMeta.Annotations == nil { + podTemplate.ObjectMeta.Annotations = map[string]string{} + } + + if len(podTemplate.Spec.Containers) == 0 { + podTemplate.Spec.Containers = []corev1.Container{} + } + + found := false + for _, container := range podTemplate.Spec.Containers { + if strings.EqualFold(container.Name, name) { + found = true + break + } + } + if !found { + podTemplate.Spec.Containers = append(podTemplate.Spec.Containers, corev1.Container{Name: name}) + } + + return defaultDeployment +} + +// getServiceBase returns the service resource based on the given base manifest. +// If the service has a base manifest, get the service resource from the base manifest. +// Otherwise, populate default resources. +func getServiceBase(manifest kubeutil.ObjectManifest, appName string, r *datamodel.ContainerResource, options *renderers.RenderOptions) *corev1.Service { + defaultService := &corev1.Service{ + TypeMeta: metav1.TypeMeta{ + Kind: "Service", + APIVersion: "v1", + }, + Spec: corev1.ServiceSpec{ + Selector: map[string]string{}, + Type: corev1.ServiceTypeClusterIP, + }, + } + if resource := manifest.GetFirst(kubeutil.ServiceV1); resource != nil { + defaultService = resource.(*corev1.Service) + } + defaultService.ObjectMeta = getObjectMeta(defaultService.ObjectMeta, appName, r.Name, r.ResourceTypeName(), *options) + return defaultService +} + +// getServiceAccountBase returns the service account resource based on the given base manifest. +// If the service account has a base manifest, get the service account resource from the base manifest. +// Otherwise, populate default resources. +func getServiceAccountBase(manifest kubeutil.ObjectManifest, appName string, r *datamodel.ContainerResource, options *renderers.RenderOptions) *corev1.ServiceAccount { + defaultAccount := &corev1.ServiceAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "ServiceAccount", + APIVersion: "v1", + }, + } + + if resource := manifest.GetFirst(kubeutil.ServiceAccountV1); resource != nil { + defaultAccount = resource.(*corev1.ServiceAccount) + } + + defaultAccount.ObjectMeta = getObjectMeta(defaultAccount.ObjectMeta, appName, r.Name, r.ResourceTypeName(), *options) + + return defaultAccount +} + +func getObjectMeta(metaObj metav1.ObjectMeta, appName, resourceName, resourceType string, options renderers.RenderOptions) metav1.ObjectMeta { + return metav1.ObjectMeta{ + Name: kubernetes.NormalizeResourceName(resourceName), + Namespace: options.Environment.Namespace, + Labels: labels.Merge(metaObj.Labels, renderers.GetLabels(options, appName, resourceName, resourceType)), + Annotations: labels.Merge(metaObj.Annotations, renderers.GetAnnotations(options)), + } +} + +// populateAllBaseResources populates all remaining resources from manifest into outputResources. +// These resources must be deployed before Deployment resource by adding them as a dependency. +func populateAllBaseResources(ctx context.Context, base kubeutil.ObjectManifest, outputResources []rpv1.OutputResource, options renderers.RenderOptions) []rpv1.OutputResource { + logger := ucplog.FromContextOrDiscard(ctx) + + // Find deployment resource from outputResources to add base manifest resources as a dependency. + var deploymentResource *rpv1.Resource + for _, r := range outputResources { + if r.LocalID == rpv1.LocalIDDeployment { + deploymentResource = r.CreateResource + break + } + } + + // This should not happen because deployment resource is created in the first place. + if deploymentResource == nil { + panic(errDeploymentNotFound) + } + + // Populate the remaining objects in base manifest into outputResources. + // These resources must be deployed before Deployment resource by adding them as a dependency. + for k, resources := range base { + localIDPrefix := "" + + switch k { + case kubeutil.SecretV1: + localIDPrefix = rpv1.LocalIDSecret + case kubeutil.ConfigMapV1: + localIDPrefix = rpv1.LocalIDConfigMap + + default: + continue + } + + for _, resource := range resources { + objMeta := resource.(metav1.ObjectMetaAccessor).GetObjectMeta().(*metav1.ObjectMeta) + objMeta.Namespace = options.Environment.Namespace + logger.Info(fmt.Sprintf("Adding base manifest resource, kind: %s, name: %s", k, objMeta.Name)) + + localID := rpv1.NewLocalID(localIDPrefix, objMeta.Name) + o := rpv1.NewKubernetesOutputResource(localID, resource, *objMeta) + deploymentResource.Dependencies = append(deploymentResource.Dependencies, localID) + outputResources = append(outputResources, o) + } + } + + return outputResources +} diff --git a/pkg/corerp/renderers/container/manifest_test.go b/pkg/corerp/renderers/container/manifest_test.go new file mode 100644 index 0000000000..7db5946bee --- /dev/null +++ b/pkg/corerp/renderers/container/manifest_test.go @@ -0,0 +1,462 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package container + +import ( + "fmt" + "strings" + "testing" + + v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/project-radius/radius/pkg/corerp/renderers" + "github.com/project-radius/radius/pkg/kubeutil" + rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/project-radius/radius/test/k8sutil" + "github.com/project-radius/radius/test/testcontext" + + "github.com/stretchr/testify/require" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +var ( + testResource = &datamodel.ContainerResource{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + ID: "/subscriptions/test-sub-id/resourceGroups/test-group/providers/Applications.Core/containers/test-container", + Name: "test-container", + Type: "Applications.Core/containers", + }, + }, + } + testOptions = &renderers.RenderOptions{Environment: renderers.EnvironmentOptions{Namespace: "test-ns"}} +) + +func TestFetchBaseManifest(t *testing.T) { + manifestTests := []struct { + name string + resource *datamodel.ContainerResource + }{ + { + name: "valid manifest", + resource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: fmt.Sprintf(k8sutil.FakeDeploymentTemplate, "magpie", "", "magpie"), + }, + }, + }, + }, + }, + { + name: "nil runtime", + resource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: nil, + }, + }, + }, + { + name: "nil runtime.kubernetes", + resource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: nil, + }, + }, + }, + { + name: "empty runtime.kubernetes.base", + resource: &datamodel.ContainerResource{ + Properties: datamodel.ContainerProperties{ + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Base: "", + }, + }, + }, + }, + }, + } + + for _, tc := range manifestTests { + t.Run(tc.name, func(t *testing.T) { + obj, err := fetchBaseManifest(tc.resource) + require.NoError(t, err) + require.NotNil(t, obj) + }) + } + +} + +func TestGetDeploymentBase(t *testing.T) { + deploymentTests := []struct { + name string + manifest kubeutil.ObjectManifest + expected *appsv1.Deployment + }{ + { + name: "without base manifest", + manifest: kubeutil.ObjectManifest{}, + expected: &appsv1.Deployment{ + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Namespace: "test-ns", + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "radius-rp", + "app.kubernetes.io/name": "test-container", + "app.kubernetes.io/part-of": "test", + "radius.dev/application": "test", + "radius.dev/resource": "test-container", + "radius.dev/resource-type": "applications.core-containers", + }, + Annotations: map[string]string{}, + }, + Spec: appsv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{}, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{}, + Annotations: map[string]string{}, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "test-container", + }, + }, + }, + }, + }, + }, + }, + { + name: "with base manifest", + manifest: kubeutil.ObjectManifest{ + kubeutil.DeploymentV1: []runtime.Object{ + &appsv1.Deployment{ + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Labels: map[string]string{ + "label0": "value0", + }, + Annotations: map[string]string{ + "annotation0": "value0", + }, + }, + Spec: appsv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{}, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{}, + Annotations: map[string]string{}, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "sidecar", + }, + }, + }, + }, + }, + }, + }, + }, + expected: &appsv1.Deployment{ + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Namespace: "test-ns", + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "radius-rp", + "app.kubernetes.io/name": "test-container", + "app.kubernetes.io/part-of": "test", + "label0": "value0", + "radius.dev/application": "test", + "radius.dev/resource": "test-container", + "radius.dev/resource-type": "applications.core-containers", + }, + Annotations: map[string]string{ + "annotation0": "value0", + }, + }, + Spec: appsv1.DeploymentSpec{ + Selector: &metav1.LabelSelector{}, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{}, + Annotations: map[string]string{}, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "sidecar", + }, + { + Name: "test-container", + }, + }, + }, + }, + }, + }, + }, + } + + for _, tc := range deploymentTests { + t.Run(tc.name, func(t *testing.T) { + deploy := getDeploymentBase(tc.manifest, "test", testResource, testOptions) + require.Equal(t, tc.expected, deploy) + }) + } +} + +func TestGetServiceBase(t *testing.T) { + serviceTests := []struct { + name string + manifest kubeutil.ObjectManifest + expected *corev1.Service + }{ + { + name: "without base manifest", + manifest: kubeutil.ObjectManifest{}, + expected: &corev1.Service{ + TypeMeta: metav1.TypeMeta{ + Kind: "Service", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Namespace: "test-ns", + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "radius-rp", + "app.kubernetes.io/name": "test-container", + "app.kubernetes.io/part-of": "test", + "radius.dev/application": "test", + "radius.dev/resource": "test-container", + "radius.dev/resource-type": "applications.core-containers", + }, + Annotations: map[string]string{}, + }, + Spec: corev1.ServiceSpec{ + Selector: map[string]string{}, + Type: corev1.ServiceTypeClusterIP, + }, + }, + }, + { + name: "with base manifest", + manifest: kubeutil.ObjectManifest{ + kubeutil.ServiceV1: []runtime.Object{ + &corev1.Service{ + TypeMeta: metav1.TypeMeta{ + Kind: "Service", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Labels: map[string]string{ + "label0": "value0", + }, + Annotations: map[string]string{ + "annotation0": "value0", + }, + }, + Spec: corev1.ServiceSpec{ + Selector: map[string]string{}, + }, + }, + }, + }, + expected: &corev1.Service{ + TypeMeta: metav1.TypeMeta{ + Kind: "Service", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Namespace: "test-ns", + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "radius-rp", + "app.kubernetes.io/name": "test-container", + "app.kubernetes.io/part-of": "test", + "label0": "value0", + "radius.dev/application": "test", + "radius.dev/resource": "test-container", + "radius.dev/resource-type": "applications.core-containers", + }, + Annotations: map[string]string{ + "annotation0": "value0", + }, + }, + Spec: corev1.ServiceSpec{ + Selector: map[string]string{}, + }, + }, + }, + } + + for _, tc := range serviceTests { + t.Run(tc.name, func(t *testing.T) { + deploy := getServiceBase(tc.manifest, "test", testResource, testOptions) + require.Equal(t, tc.expected, deploy) + }) + } +} + +func TestGetServiceAccountBase(t *testing.T) { + accountTests := []struct { + name string + manifest kubeutil.ObjectManifest + expected *corev1.ServiceAccount + }{ + { + name: "without base manifest", + manifest: kubeutil.ObjectManifest{}, + expected: &corev1.ServiceAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "ServiceAccount", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Namespace: "test-ns", + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "radius-rp", + "app.kubernetes.io/name": "test-container", + "app.kubernetes.io/part-of": "test", + "radius.dev/application": "test", + "radius.dev/resource": "test-container", + "radius.dev/resource-type": "applications.core-containers", + }, + Annotations: map[string]string{}, + }, + }, + }, + { + name: "with base manifest", + manifest: kubeutil.ObjectManifest{ + kubeutil.ServiceAccountV1: []runtime.Object{ + &corev1.ServiceAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "ServiceAccount", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Labels: map[string]string{ + "label0": "value0", + }, + Annotations: map[string]string{ + "annotation0": "value0", + }, + }, + }, + }, + }, + expected: &corev1.ServiceAccount{ + TypeMeta: metav1.TypeMeta{ + Kind: "ServiceAccount", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-container", + Namespace: "test-ns", + Labels: map[string]string{ + "app.kubernetes.io/managed-by": "radius-rp", + "app.kubernetes.io/name": "test-container", + "app.kubernetes.io/part-of": "test", + "label0": "value0", + "radius.dev/application": "test", + "radius.dev/resource": "test-container", + "radius.dev/resource-type": "applications.core-containers", + }, + Annotations: map[string]string{ + "annotation0": "value0", + }, + }, + }, + }, + } + + for _, tc := range accountTests { + t.Run(tc.name, func(t *testing.T) { + deploy := getServiceAccountBase(tc.manifest, "test", testResource, testOptions) + require.Equal(t, tc.expected, deploy) + }) + } +} + +func TestPopulateAllBaseResources(t *testing.T) { + fakeDeployment := fmt.Sprintf(k8sutil.FakeDeploymentTemplate, "magpie", "", "magpie") + + ctx := testcontext.New(t) + + t.Run("deployment resource is not in outputResources", func(t *testing.T) { + manifest, err := kubeutil.ParseManifest([]byte(fakeDeployment)) + require.NoError(t, err) + outputResources := []rpv1.OutputResource{} + require.Panics(t, func() { + populateAllBaseResources(ctx, manifest, outputResources, *testOptions) + }) + }) + + t.Run("populate secret and configmap into outputResource", func(t *testing.T) { + fakeService := fmt.Sprintf(k8sutil.FakeServiceTemplate, "magpie", "") + fakeServiceAccount := fmt.Sprintf(k8sutil.FakeServiceAccountTemplate, "magpie") + fakeSecret0 := fmt.Sprintf(k8sutil.FakeSecretTemplate, "secret0") + fakeSecret1 := fmt.Sprintf(k8sutil.FakeSecretTemplate, "secret1") + fakeConfigMap0 := fmt.Sprintf(k8sutil.FakeConfigMapTemplate, "configmap0") + fakeConfigMap1 := fmt.Sprintf(k8sutil.FakeConfigMapTemplate, "configmap1") + + baseString := strings.Join([]string{fakeDeployment, fakeService, fakeServiceAccount, fakeSecret0, fakeConfigMap0, fakeSecret1, fakeConfigMap1}, k8sutil.YAMLSeparater) + manifest, err := kubeutil.ParseManifest([]byte(baseString)) + require.NoError(t, err) + + outputResources := []rpv1.OutputResource{ + { + LocalID: rpv1.LocalIDDeployment, + CreateResource: &rpv1.Resource{}, + }, + } + + newOutput := populateAllBaseResources(ctx, manifest, outputResources, *testOptions) + require.Len(t, newOutput, 5) + outLocalIDs := []string{} + for _, o := range newOutput { + outLocalIDs = append(outLocalIDs, o.LocalID) + } + require.ElementsMatch(t, []string{"Deployment", "Secret-dtl+8w==", "Secret-ddl9YA==", "ConfigMap-6BU8tQ==", "ConfigMap-5xU7Ig=="}, outLocalIDs) + require.Len(t, outputResources[0].CreateResource.Dependencies, 4) + require.ElementsMatch(t, []string{"Secret-dtl+8w==", "Secret-ddl9YA==", "ConfigMap-6BU8tQ==", "ConfigMap-5xU7Ig=="}, outputResources[0].CreateResource.Dependencies) + }) +} diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index bebd058ae6..6498df63cd 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -27,7 +27,6 @@ import ( "strconv" "strings" - appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -40,6 +39,7 @@ import ( azrenderer "github.com/project-radius/radius/pkg/corerp/renderers/container/azure" azvolrenderer "github.com/project-radius/radius/pkg/corerp/renderers/volume/azure" "github.com/project-radius/radius/pkg/kubernetes" + "github.com/project-radius/radius/pkg/kubeutil" "github.com/project-radius/radius/pkg/resourcemodel" rpv1 "github.com/project-radius/radius/pkg/rp/v1" "github.com/project-radius/radius/pkg/to" @@ -59,11 +59,6 @@ const ( AzureKeyVaultSecretsUserRole = "Key Vault Secrets User" AzureKeyVaultCryptoUserRole = "Key Vault Crypto User" - - defaultServiceAccountName = "default" - httpScheme = "http" - httpsScheme = "https" - httpsPort = 443 ) // GetSupportedKinds returns a list of supported volume kinds. @@ -162,15 +157,20 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options if !ok { return renderers.RendererOutput{}, v1.ErrInvalidModelConversion } + properties := resource.Properties + appId, err := resources.ParseResource(properties.Application) + if err != nil { + return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid application id: %s ", err.Error())) + } + // this flag is used to indicate whether or not this resource needs a service to be generated. // this flag is triggered when a container has an exposed port(s), but no 'provides' field. var needsServiceGeneration = false // check if connections are valid for _, connection := range properties.Connections { - // if source is a URL, it is valid (example: 'http://containerx:3000'). if isURL(connection.Source) { continue @@ -196,11 +196,6 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options } } - appId, err := resources.ParseResource(properties.Application) - if err != nil { - return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid application id: %s ", err.Error())) - } - outputResources := []rpv1.OutputResource{} dependencies := options.Dependencies @@ -223,10 +218,16 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options outputResources = append(outputResources, roles...) } + // If the container has a base manifest, deserialize base manifest and validation should be done by frontend controller. + baseManifest, err := fetchBaseManifest(resource) + if err != nil { + return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid base manifest: %s", err.Error())) + } + computedValues := map[string]rpv1.ComputedValueReference{} // Create the deployment as the primary workload - deploymentResources, secretData, err := r.makeDeployment(ctx, appId.Name(), options, computedValues, resource, roles) + deploymentResources, secretData, err := r.makeDeployment(ctx, baseManifest, appId.Name(), options, computedValues, resource, roles) if err != nil { return renderers.RendererOutput{}, err } @@ -252,7 +253,8 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options } // if a container has an exposed port, then we need to create a service for it. - serviceResource, err := r.makeService(resource, options, ctx, containerPorts) + basesrv := getServiceBase(baseManifest, appId.Name(), resource, &options) + serviceResource, err := r.makeService(basesrv, resource, options, ctx, containerPorts) if err != nil { return renderers.RendererOutput{}, err } @@ -260,6 +262,9 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options outputResources = append(outputResources, serviceResource) } + // Populate the remaining resources from the base manifest. + outputResources = populateAllBaseResources(ctx, baseManifest, outputResources, options) + return renderers.RendererOutput{ Resources: outputResources, ComputedValues: computedValues, @@ -271,56 +276,73 @@ type containerPorts struct { names []string } -func (r Renderer) makeService(resource *datamodel.ContainerResource, options renderers.RenderOptions, ctx context.Context, containerPorts containerPorts) (rpv1.OutputResource, error) { +func (r Renderer) makeService(base *corev1.Service, resource *datamodel.ContainerResource, options renderers.RenderOptions, ctx context.Context, containerPorts containerPorts) (rpv1.OutputResource, error) { appId, err := resources.ParseResource(resource.Properties.Application) if err != nil { return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid application id: %s. id: %s", err.Error(), resource.Properties.Application)) } - // create the ports that will be exposed by the service. - ports := []corev1.ServicePort{} + // Ensure that we don't have any duplicate ports. +SKIPINSERT: for i, port := range containerPorts.values { - ports = append(ports, corev1.ServicePort{ + newPort := corev1.ServicePort{ Name: containerPorts.names[i], Port: port, TargetPort: intstr.FromInt(int(containerPorts.values[i])), Protocol: corev1.ProtocolTCP, - }) - } + } - service := &corev1.Service{ - TypeMeta: metav1.TypeMeta{ - Kind: "Service", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: kubernetes.NormalizeResourceName(resource.Name), - Namespace: options.Environment.Namespace, - Labels: renderers.GetLabels(ctx, options, appId.Name(), resource.Name, resource.ResourceTypeName()), - Annotations: renderers.GetAnnotations(ctx, options), - }, - Spec: corev1.ServiceSpec{ - Selector: kubernetes.MakeSelectorLabels(appId.Name(), resource.Name), - Type: corev1.ServiceTypeClusterIP, - Ports: ports, - }, + // Skip to add new port. Instead, upsert port if it already exists. + for j, p := range base.Spec.Ports { + if strings.EqualFold(p.Name, newPort.Name) || p.Port == newPort.Port || p.TargetPort.IntVal == newPort.TargetPort.IntVal { + base.Spec.Ports[j] = newPort + continue SKIPINSERT + } + } + + // Add new port if it doesn't exist. + base.Spec.Ports = append(base.Spec.Ports, newPort) } - return rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, service, service.ObjectMeta), nil + base.Spec.Selector = kubernetes.MakeSelectorLabels(appId.Name(), resource.Name) + base.Spec.Type = corev1.ServiceTypeClusterIP + + return rpv1.NewKubernetesOutputResource(rpv1.LocalIDService, base, base.ObjectMeta), nil } -func (r Renderer) makeDeployment(ctx context.Context, applicationName string, options renderers.RenderOptions, computedValues map[string]rpv1.ComputedValueReference, resource *datamodel.ContainerResource, roles []rpv1.OutputResource) ([]rpv1.OutputResource, map[string][]byte, error) { +func (r Renderer) makeDeployment( + ctx context.Context, + manifest kubeutil.ObjectManifest, + applicationName string, + options renderers.RenderOptions, + computedValues map[string]rpv1.ComputedValueReference, + resource *datamodel.ContainerResource, + roles []rpv1.OutputResource) ([]rpv1.OutputResource, map[string][]byte, error) { // Keep track of the set of routes, we will need these to generate labels later routes := []struct { Name string Type string }{} + // If the container requires azure role, it needs to configure workload identity (aka federated identity). identityRequired := len(roles) > 0 dependencies := options.Dependencies properties := resource.Properties + normalizedName := kubernetes.NormalizeResourceName(resource.Name) + + deployment := getDeploymentBase(manifest, applicationName, resource, &options) + podSpec := &deployment.Spec.Template.Spec + + container := &podSpec.Containers[0] + for i, c := range podSpec.Containers { + if strings.EqualFold(c.Name, normalizedName) { + container = &podSpec.Containers[i] + break + } + } + ports := []corev1.ContainerPort{} for _, port := range properties.Container.Ports { if provides := port.Provides; provides != "" { @@ -354,16 +376,11 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op } } - container := corev1.Container{ - Name: kubernetes.NormalizeResourceName(resource.Name), - Image: properties.Container.Image, - Ports: ports, - Env: []corev1.EnvVar{}, - VolumeMounts: []corev1.VolumeMount{}, - Command: properties.Container.Command, - Args: properties.Container.Args, - WorkingDir: properties.Container.WorkingDir, - } + container.Image = properties.Container.Image + container.Ports = append(container.Ports, ports...) + container.Command = properties.Container.Command + container.Args = properties.Container.Args + container.WorkingDir = properties.Container.WorkingDir // If the user has specified an image pull policy, use it. Else, we will use Kubernetes default. if properties.Container.ImagePullPolicy != "" { @@ -402,20 +419,16 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op } outputResources := []rpv1.OutputResource{} - deps := []string{} podLabels := kubernetes.MakeDescriptiveLabels(applicationName, resource.Name, resource.ResourceTypeName()) - // This is the default service account name. If a volume is associated with federated identity, new service account - // will be created and set for container pods. - serviceAccountName := defaultServiceAccountName - // Add volumes volumes := []corev1.Volume{} // Create Kubernetes resource name scoped in Kubernetes namespace - kubeIdentityName := kubernetes.NormalizeResourceName(resource.Name) + kubeIdentityName := normalizedName + podSpec.ServiceAccountName = normalizedName // Create Azure resource name for managed/federated identity-scoped in resource group specified by Environment resource. // To avoid the naming conflicts, we add the application name prefix to resource name. @@ -520,6 +533,7 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op podLabels = labels.Merge(routeLabels, podLabels) } + serviceAccountBase := getServiceAccountBase(manifest, applicationName, resource, &options) // In order to enable per-container identity, it creates user-assigned managed identity, federated identity, and service account. if identityRequired { // 1. Create Per-Container managed identity. @@ -530,22 +544,20 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op outputResources = append(outputResources, *managedIdentity) // 2. Create Per-container federated identity resource. - serviceAccountName = kubeIdentityName - fedIdentity, err := azrenderer.MakeFederatedIdentity(serviceAccountName, &options.Environment) + fedIdentity, err := azrenderer.MakeFederatedIdentity(kubeIdentityName, &options.Environment) if err != nil { return []rpv1.OutputResource{}, nil, err } outputResources = append(outputResources, *fedIdentity) // 3. Create Per-container service account. - saAccount := azrenderer.MakeFederatedIdentitySA(applicationName, serviceAccountName, options.Environment.Namespace, resource) + saAccount := azrenderer.SetWorkloadIdentityServiceAccount(serviceAccountBase) outputResources = append(outputResources, *saAccount) + deps = append(deps, rpv1.LocalIDServiceAccount) // This is required to enable workload identity. podLabels[azrenderer.AzureWorkloadIdentityUseKey] = "true" - deps = append(deps, rpv1.LocalIDServiceAccount) - // 4. Add RBAC resources to the dependencies. for _, role := range roles { deps = append(deps, role.LocalID) @@ -590,6 +602,11 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op return nil }, } + } else { + // If the container doesn't require identity, we'll use the default service account + or := rpv1.NewKubernetesOutputResource(rpv1.LocalIDServiceAccount, serviceAccountBase, serviceAccountBase.ObjectMeta) + outputResources = append(outputResources, or) + deps = append(deps, rpv1.LocalIDServiceAccount) } // Create the role and role bindings for SA. @@ -597,45 +614,28 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op outputResources = append(outputResources, *role) deps = append(deps, rpv1.LocalIDKubernetesRole) - roleBinding := makeRBACRoleBinding(applicationName, kubeIdentityName, serviceAccountName, options.Environment.Namespace, resource) + roleBinding := makeRBACRoleBinding(applicationName, kubeIdentityName, podSpec.ServiceAccountName, options.Environment.Namespace, resource) outputResources = append(outputResources, *roleBinding) deps = append(deps, rpv1.LocalIDKubernetesRoleBinding) - deployment := appsv1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "Deployment", - APIVersion: "apps/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: kubernetes.NormalizeResourceName(resource.Name), - Namespace: options.Environment.Namespace, - Labels: kubernetes.MakeDescriptiveLabels(applicationName, resource.Name, resource.ResourceTypeName()), - }, - Spec: appsv1.DeploymentSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: kubernetes.MakeSelectorLabels(applicationName, resource.Name), - }, - Template: corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Labels: podLabels, - Annotations: map[string]string{}, - }, - Spec: corev1.PodSpec{ - // See: https://github.com/kubernetes/kubernetes/issues/92226 and - // https://github.com/project-radius/radius/issues/3002 - // - // Service links are a flawed and Kubernetes-only feature that we don't - // want to leak into Radius containers. - EnableServiceLinks: to.Ptr(false), - - ServiceAccountName: serviceAccountName, - Containers: []corev1.Container{container}, - Volumes: volumes, - }, - }, - }, + deployment.Spec.Template.ObjectMeta = metav1.ObjectMeta{ + Labels: podLabels, + Annotations: map[string]string{}, + } + + deployment.Spec.Selector = &metav1.LabelSelector{ + MatchLabels: kubernetes.MakeSelectorLabels(applicationName, resource.Name), } + podSpec.Volumes = append(podSpec.Volumes, volumes...) + + // See: https://github.com/kubernetes/kubernetes/issues/92226 and + // https://github.com/project-radius/radius/issues/3002 + // + // Service links are a flawed and Kubernetes-only feature that we don't + // want to leak into Radius containers. + podSpec.EnableServiceLinks = to.Ptr(false) + // If we have a secret to reference we need to ensure that the deployment will trigger a new revision // when the secret changes. Normally referencing an environment variable from a secret will **NOT** cause // a new revision when the secret changes. @@ -651,7 +651,7 @@ func (r Renderer) makeDeployment(ctx context.Context, applicationName string, op deps = append(deps, rpv1.LocalIDSecret) } - deploymentOutput := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, &deployment, deployment.ObjectMeta) + deploymentOutput := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) deploymentOutput.CreateResource.Dependencies = deps outputResources = append(outputResources, deploymentOutput) @@ -889,7 +889,7 @@ func (r Renderer) makeRoleAssignmentsForResource(ctx context.Context, connection outputResources := []rpv1.OutputResource{} for _, roleName := range roleNames { - localID := rpv1.GenerateLocalIDForRoleAssignment(armResourceIdentifier, roleName) + localID := rpv1.NewLocalID(rpv1.LocalIDRoleAssignmentPrefix, armResourceIdentifier, roleName) roleAssignment := rpv1.OutputResource{ LocalID: localID, diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index dc6017d260..d22ba3385b 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -296,7 +296,7 @@ func Test_Render_Basic(t *testing.T) { require.NotNil(t, deployment) expected := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) - expected.CreateResource.Dependencies = []string{rpv1.LocalIDKubernetesRole, rpv1.LocalIDKubernetesRoleBinding} + expected.CreateResource.Dependencies = []string{rpv1.LocalIDServiceAccount, rpv1.LocalIDKubernetesRole, rpv1.LocalIDKubernetesRoleBinding} require.Equal(t, outputResource, expected) // Only real thing to verify here is the image and the labels @@ -330,7 +330,7 @@ func Test_Render_Basic(t *testing.T) { require.Equal(t, expectedEnv, container.Env) }) - require.Len(t, output.Resources, 3) + require.Len(t, output.Resources, 4) } func Test_Render_WithCommandArgsWorkingDir(t *testing.T) { @@ -367,7 +367,7 @@ func Test_Render_WithCommandArgsWorkingDir(t *testing.T) { require.NotNil(t, deployment) expected := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) - expected.CreateResource.Dependencies = []string{rpv1.LocalIDKubernetesRole, rpv1.LocalIDKubernetesRoleBinding} + expected.CreateResource.Dependencies = []string{rpv1.LocalIDServiceAccount, rpv1.LocalIDKubernetesRole, rpv1.LocalIDKubernetesRoleBinding} require.Equal(t, outputResource, expected) // Only real thing to verify here is the image and the labels @@ -392,7 +392,7 @@ func Test_Render_WithCommandArgsWorkingDir(t *testing.T) { require.Equal(t, expectedEnv, container.Env) }) - require.Len(t, output.Resources, 3) + require.Len(t, output.Resources, 4) } func Test_Render_PortWithoutRoute(t *testing.T) { @@ -437,7 +437,7 @@ func Test_Render_PortWithoutRoute(t *testing.T) { require.Equal(t, expected, port) }) - require.Len(t, output.Resources, 4) + require.Len(t, output.Resources, 5) } func Test_Render_PortConnectedToRoute(t *testing.T) { @@ -493,7 +493,7 @@ func Test_Render_PortConnectedToRoute(t *testing.T) { } require.Equal(t, expected, port) }) - require.Len(t, output.Resources, 3) + require.Len(t, output.Resources, 4) } func Test_Render_Connections(t *testing.T) { @@ -594,7 +594,7 @@ func Test_Render_Connections(t *testing.T) { require.Equal(t, "ComputedValue1", string(secret.Data["CONNECTION_A_COMPUTEDKEY1"])) require.Equal(t, "82", string(secret.Data["CONNECTION_A_COMPUTEDKEY2"])) }) - require.Len(t, output.Resources, 4) + require.Len(t, output.Resources, 5) } func Test_RenderConnections_DisableDefaultEnvVars(t *testing.T) { @@ -641,8 +641,7 @@ func Test_RenderConnections_DisableDefaultEnvVars(t *testing.T) { require.Equal(t, properties.Container.Image, container.Image) require.Empty(t, container.ImagePullPolicy) - expectedEnv := []corev1.EnvVar{} - require.Equal(t, expectedEnv, container.Env) + require.Nil(t, container.Env) } // This test is testing that we hash the connection data and include it in the output. We don't care about the content @@ -768,7 +767,7 @@ func Test_Render_ConnectionWithRoleAssignment(t *testing.T) { require.Equal(t, 2, len(matches)) expected := []rpv1.OutputResource{ { - LocalID: rpv1.GenerateLocalIDForRoleAssignment(makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole1"), + LocalID: rpv1.NewLocalID(rpv1.LocalIDRoleAssignmentPrefix, makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole1"), CreateResource: &rpv1.Resource{ ResourceType: resourcemodel.ResourceType{ Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, @@ -782,7 +781,7 @@ func Test_Render_ConnectionWithRoleAssignment(t *testing.T) { }, }, { - LocalID: rpv1.GenerateLocalIDForRoleAssignment(makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole2"), + LocalID: rpv1.NewLocalID(rpv1.LocalIDRoleAssignmentPrefix, makeAzureResourceID(t, "SomeProvider/TargetResourceType", "TargetResource").String(), "TestRole2"), CreateResource: &rpv1.Resource{ ResourceType: resourcemodel.ResourceType{ Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, @@ -896,7 +895,7 @@ func Test_Render_AzureConnection(t *testing.T) { expected := []rpv1.OutputResource{ { - LocalID: rpv1.GenerateLocalIDForRoleAssignment(testARMID, expectedRole), + LocalID: rpv1.NewLocalID(rpv1.LocalIDRoleAssignmentPrefix, testARMID, expectedRole), CreateResource: &rpv1.Resource{ ResourceType: resourcemodel.ResourceType{ Type: resources_azure.ResourceTypeAuthorizationRoleAssignment, @@ -1542,7 +1541,7 @@ func Test_DNS_Service_Generation(t *testing.T) { output, err := renderer.Render(ctx, resource, renderOptionsEnvAndAppKubeMetadata()) require.NoError(t, err) - require.Len(t, output.Resources, 4) + require.Len(t, output.Resources, 5) require.Empty(t, output.SecretValues) expectedServicePort := corev1.ServicePort{ diff --git a/pkg/corerp/renderers/gateway/render.go b/pkg/corerp/renderers/gateway/render.go index b9464696cb..1073f45ba2 100644 --- a/pkg/corerp/renderers/gateway/render.go +++ b/pkg/corerp/renderers/gateway/render.go @@ -277,8 +277,8 @@ func MakeGateway(ctx context.Context, options renderers.RenderOptions, gateway * ObjectMeta: metav1.ObjectMeta{ Name: kubernetes.NormalizeResourceName(resourceName), Namespace: options.Environment.Namespace, - Labels: renderers.GetLabels(ctx, options, applicationName, resourceName, gateway.ResourceTypeName()), - Annotations: renderers.GetAnnotations(ctx, options), + Labels: renderers.GetLabels(options, applicationName, resourceName, gateway.ResourceTypeName()), + Annotations: renderers.GetAnnotations(options), }, Spec: contourv1.HTTPProxySpec{ VirtualHost: virtualHost, @@ -368,8 +368,8 @@ func MakeHttpRoutes(ctx context.Context, options renderers.RenderOptions, resour ObjectMeta: metav1.ObjectMeta{ Name: routeResourceName, Namespace: options.Environment.Namespace, - Labels: renderers.GetLabels(ctx, options, applicationName, routeName, resource.ResourceTypeName()), - Annotations: renderers.GetAnnotations(ctx, options), + Labels: renderers.GetLabels(options, applicationName, routeName, resource.ResourceTypeName()), + Annotations: renderers.GetAnnotations(options), }, Spec: contourv1.HTTPProxySpec{ Routes: []contourv1.Route{ diff --git a/pkg/corerp/renderers/httproute/render.go b/pkg/corerp/renderers/httproute/render.go index 41fb9315f8..4122a6f08a 100644 --- a/pkg/corerp/renderers/httproute/render.go +++ b/pkg/corerp/renderers/httproute/render.go @@ -99,8 +99,8 @@ func (r *Renderer) makeService(ctx context.Context, route *datamodel.HTTPRoute, ObjectMeta: metav1.ObjectMeta{ Name: kubernetes.NormalizeResourceName(route.Name), Namespace: options.Environment.Namespace, - Labels: renderers.GetLabels(ctx, options, appId.Name(), route.Name, route.ResourceTypeName()), - Annotations: renderers.GetAnnotations(ctx, options), + Labels: renderers.GetLabels(options, appId.Name(), route.Name, route.ResourceTypeName()), + Annotations: renderers.GetAnnotations(options), }, Spec: corev1.ServiceSpec{ Selector: kubernetes.MakeRouteSelectorLabels(appId.Name(), resourceTypeSuffix, route.Name), diff --git a/pkg/corerp/renderers/kubernetesmetadata.go b/pkg/corerp/renderers/kubernetesmetadata.go index 4a6f8878c3..16b9c0be29 100644 --- a/pkg/corerp/renderers/kubernetesmetadata.go +++ b/pkg/corerp/renderers/kubernetesmetadata.go @@ -17,15 +17,13 @@ limitations under the License. package renderers import ( - "context" - "github.com/project-radius/radius/pkg/kubernetes" "github.com/project-radius/radius/pkg/rp/kube" ) // GetLabels merges cumulative label values from Environment, Application, Container and InputExt kubernetes metadata and // returns a map of labels. -func GetLabels(ctx context.Context, options RenderOptions, applicationName string, resourceName string, resourceTypeName string) map[string]string { +func GetLabels(options RenderOptions, applicationName string, resourceName string, resourceTypeName string) map[string]string { // Create KubernetesMetadata struct to merge labels lblMap := kube.Metadata{ ObjectMetadata: kubernetes.MakeDescriptiveLabels(applicationName, resourceName, resourceTypeName), @@ -42,7 +40,7 @@ func GetLabels(ctx context.Context, options RenderOptions, applicationName strin // Merge cumulative label values from Env->App->Container->InputExt kubernetes metadata. In case of collisions, Env->App->Container->InputExt // values are merged in that order. Spec labels are not updated. - if metaLabels, _ := lblMap.Merge(ctx); len(metaLabels) > 0 { + if metaLabels, _ := lblMap.Merge(); len(metaLabels) > 0 { return metaLabels } @@ -50,7 +48,7 @@ func GetLabels(ctx context.Context, options RenderOptions, applicationName strin } // GetAnnotations returns the merged annotations from Environment and Application KubernetesMetadata. -func GetAnnotations(ctx context.Context, options RenderOptions) map[string]string { +func GetAnnotations(options RenderOptions) map[string]string { // Create KubernetesMetadata struct to merge annotations annMap := kube.Metadata{} envOpts := &options.Environment @@ -65,7 +63,7 @@ func GetAnnotations(ctx context.Context, options RenderOptions) map[string]strin // Merge cumulative annotations values from Env->App->Container->InputExt kubernetes metadata. In case of collisions, rightmost entity wins // Spec annotations are not updated. - if metaAnnotations, _ := annMap.Merge(ctx); len(metaAnnotations) > 0 { + if metaAnnotations, _ := annMap.Merge(); len(metaAnnotations) > 0 { return metaAnnotations } diff --git a/pkg/corerp/renderers/kubernetesmetadata/render.go b/pkg/corerp/renderers/kubernetesmetadata/render.go index f773bc53c7..034f6e2fef 100644 --- a/pkg/corerp/renderers/kubernetesmetadata/render.go +++ b/pkg/corerp/renderers/kubernetesmetadata/render.go @@ -107,7 +107,7 @@ func processAnnotations(ctx context.Context, options renderers.RenderOptions, de } // Merge cumulative annotation values from Env->App->Container->InputExt kubernetes metadata. In case of collisions, rightmost entity wins - metaAnnotations, specAnnotations := ann.Merge(ctx) + metaAnnotations, specAnnotations := ann.Merge() setAnnotations(dep, metaAnnotations, specAnnotations) } @@ -134,7 +134,7 @@ func processLabels(ctx context.Context, options renderers.RenderOptions, dep *ap } // Merge cumulative label values from Env->App->Container->InputExt kubernetes metadata. In case of collisions, rightmost entity wins - metaLabels, specLabels := lbl.Merge(ctx) + metaLabels, specLabels := lbl.Merge() setLabels(dep, metaLabels, specLabels) } diff --git a/pkg/kubeutil/manifest.go b/pkg/kubeutil/manifest.go index 73e63182ca..4a05cfc6fa 100644 --- a/pkg/kubeutil/manifest.go +++ b/pkg/kubeutil/manifest.go @@ -23,11 +23,33 @@ import ( "strings" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/yaml" scheme "k8s.io/client-go/kubernetes/scheme" ) +// ObjectManifest is a map of runtime.Object slice where the key is in the format of "group/version/kind". +type ObjectManifest map[string][]runtime.Object + +// Get returns a runtime.Object slice for the given key. +func (m ObjectManifest) Get(key string) []runtime.Object { + obj, ok := m[key] + if ok { + return obj + } else { + return []runtime.Object{} + } +} + +// GetFirst returns the first runtime.Object for the given key. +func (m ObjectManifest) GetFirst(key string) runtime.Object { + obj, ok := m[key] + if ok { + return obj[0] + } else { + return nil + } +} + // GetObjectKey returns a object key that uniquely identifies the given Kubernetes object. // The returned key is in the format of "group/version/kind". func GetObjectKey(obj runtime.Object) string { @@ -42,11 +64,11 @@ func GetObjectKey(obj runtime.Object) string { // ParseManifest parses the given manifest and returns a map of runtime.Object slice where // the key is in the format of "group/version/kind". // It returns an error if the given manifest is invalid. -func ParseManifest(data []byte) (map[string][]runtime.Object, error) { +func ParseManifest(data []byte) (ObjectManifest, error) { decoder := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(data), 4096) deser := scheme.Codecs.UniversalDeserializer() - objects := map[string][]runtime.Object{} + objects := ObjectManifest{} for { ext := runtime.RawExtension{} if err := decoder.Decode(&ext); err != nil { diff --git a/pkg/kubeutil/manifest_test.go b/pkg/kubeutil/manifest_test.go index c1ddcf95c5..b1a7942c97 100644 --- a/pkg/kubeutil/manifest_test.go +++ b/pkg/kubeutil/manifest_test.go @@ -163,3 +163,13 @@ func TestParseManifest(t *testing.T) { }) } } + +func TestObjectManifest(t *testing.T) { + base, err := ParseManifest([]byte(validManifestWithSecrets)) + + require.NoError(t, err) + require.Len(t, base.Get("apps/v1/deployment"), 1) + require.Len(t, base.Get("core/v1/configmap"), 0) + require.Equal(t, base.GetFirst("apps/v1/deployment").GetObjectKind().GroupVersionKind().Kind, "Deployment") + require.Nil(t, base.GetFirst("core/v1/configmap")) +} diff --git a/pkg/kubeutil/types.go b/pkg/kubeutil/types.go new file mode 100644 index 0000000000..799998800b --- /dev/null +++ b/pkg/kubeutil/types.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubeutil + +const ( + // DeploymentV1 represents V1 Deployment Kubernetes resource type. + DeploymentV1 = "apps/v1/deployment" + + // DaemonSetV1 represents V1 DaemonSet Kubernetes resource type. + ServiceV1 = "core/v1/service" + + // ServiceAccountV1 represents V1 ServiceAccount Kubernetes resource type. + ServiceAccountV1 = "core/v1/serviceaccount" + + // SecretV1 represents V1 Secret Kubernetes resource type. + SecretV1 = "core/v1/secret" + + // ConfigMapV1 represents V1 ConfigMap Kubernetes resource type. + ConfigMapV1 = "core/v1/configmap" +) diff --git a/pkg/rp/kube/kubernetesmetadata.go b/pkg/rp/kube/kubernetesmetadata.go index 9c324d1ca8..fb6f0254cd 100644 --- a/pkg/rp/kube/kubernetesmetadata.go +++ b/pkg/rp/kube/kubernetesmetadata.go @@ -17,11 +17,9 @@ limitations under the License. package kube import ( - "context" "strings" "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/ucp/ucplog" "k8s.io/apimachinery/pkg/labels" ) @@ -39,7 +37,7 @@ type Metadata struct { // More info: // ObjectMeta: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // Spec: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status -func (km *Metadata) Merge(ctx context.Context) (map[string]string, map[string]string) { +func (km *Metadata) Merge() (map[string]string, map[string]string) { mergedDataMap := map[string]string{} if km.EnvData != nil { @@ -51,8 +49,8 @@ func (km *Metadata) Merge(ctx context.Context) (map[string]string, map[string]st } // Reject custom user entries that may affect Radius reserved keys. - mergedDataMap = rejectReservedEntries(ctx, mergedDataMap) - km.Input = rejectReservedEntries(ctx, km.Input) + mergedDataMap = rejectReservedEntries(mergedDataMap) + km.Input = rejectReservedEntries(km.Input) // Cumulative Env+App Labels (mergeMap) is now merged with new input map. Existing metaLabels and specLabels are subsequently merged with the result map. mergedDataMap = labels.Merge(mergedDataMap, km.Input) @@ -63,12 +61,9 @@ func (km *Metadata) Merge(ctx context.Context) (map[string]string, map[string]st } // rejectReservedEntries rejects custom user entries that would affect Radius reserved keys -func rejectReservedEntries(ctx context.Context, inputMap map[string]string) map[string]string { - logger := ucplog.FromContextOrDiscard(ctx) - +func rejectReservedEntries(inputMap map[string]string) map[string]string { for k := range inputMap { if strings.HasPrefix(k, kubernetes.RadiusDevPrefix) { - logger.Info("User provided label/annotation key starts with 'radius.dev/' and is not being applied", "key", k) delete(inputMap, k) } } diff --git a/pkg/rp/kube/kubernetesmetadata_test.go b/pkg/rp/kube/kubernetesmetadata_test.go index f11c984bda..42b6dccdaf 100644 --- a/pkg/rp/kube/kubernetesmetadata_test.go +++ b/pkg/rp/kube/kubernetesmetadata_test.go @@ -17,7 +17,6 @@ limitations under the License. package kube import ( - "context" "testing" "github.com/stretchr/testify/require" @@ -80,7 +79,7 @@ func Test_Render_WithEnvironment_KubernetesMetadata(t *testing.T) { } // Testing for cascading, overriding, and reserved keys - metaMap, specMap := input.Merge(context.Background()) + metaMap, specMap := input.Merge() // Verify require.Equal(t, metaMap, expectedMetadataMap) diff --git a/pkg/rp/v1/local_ids.go b/pkg/rp/v1/localids.go similarity index 92% rename from pkg/rp/v1/local_ids.go rename to pkg/rp/v1/localids.go index 1095d799af..67e7d06344 100644 --- a/pkg/rp/v1/local_ids.go +++ b/pkg/rp/v1/localids.go @@ -73,6 +73,7 @@ const ( LocalIDRedisService = "KubernetesRedisService" LocalIDScrapedSecret = "KubernetesScrapedSecret" LocalIDSecret = "Secret" + LocalIDConfigMap = "ConfigMap" LocalIDSecretProviderClass = "SecretProviderClass" LocalIDServiceAccount = "ServiceAccount" LocalIDKubernetesRole = "KubernetesRole" @@ -81,6 +82,7 @@ const ( LocalIDStatefulSet = "StatefulSet" LocalIDUserAssignedManagedIdentity = "UserAssignedManagedIdentity" LocalIDFederatedIdentity = "FederatedIdentity" + LocalIDRoleAssignmentPrefix = "RoleAssignment" // Obsolete when we remove AppModelV1 LocalIDRoleAssignmentKVKeys = "RoleAssignment-KVKeys" @@ -88,24 +90,21 @@ const ( LocalIDKeyVaultSecret = "KeyVaultSecret" ) -// GenerateLocalIDForRoleAssignment generates a unique string based on the input parameters id and roleName -// -// using a stable hashing algorithm. +// NewLocalID generates a unique string based on the input parameter ids using a stable hashing algorithm. // // Most LocalIDs are a 1:1 mapping with Radius resource. This is a little tricky for role assignments // because we need to key them on the resource ID of the target resource X the role being assigned. // For example if the user switches their keyvault 'a' for a different instance 'b' we want to delete // the original role assignments and create new ones. -func GenerateLocalIDForRoleAssignment(id string, roleName string) string { - base := "RoleAssignment-" - +func NewLocalID(prefix string, ids ...string) string { // The technique here uses a stable hashing algorithm with 32 bits of entropy. These values // only need to be unique within a *single* Radius resource. h := fnv.New32a() - _, _ = h.Write([]byte(id)) - _, _ = h.Write([]byte(roleName)) + for _, id := range ids { + _, _ = h.Write([]byte(id)) + } hash := [4]byte{} binary.BigEndian.PutUint32(hash[:], h.Sum32()) - return base + base64.StdEncoding.EncodeToString(hash[:]) + return prefix + "-" + base64.StdEncoding.EncodeToString(hash[:]) } diff --git a/pkg/rp/v1/localids_test.go b/pkg/rp/v1/localids_test.go new file mode 100644 index 0000000000..e55c245433 --- /dev/null +++ b/pkg/rp/v1/localids_test.go @@ -0,0 +1,28 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestNewLocalID(t *testing.T) { + require.Equal(t, "foo-drd9Gg==", NewLocalID("foo", "bar")) + require.Equal(t, "foo-6WF5Aw==", NewLocalID("foo", "bar", "baz")) +} diff --git a/pkg/rp/v1/outputresource.go b/pkg/rp/v1/outputresource.go index 7fdf238966..0223f93052 100644 --- a/pkg/rp/v1/outputresource.go +++ b/pkg/rp/v1/outputresource.go @@ -54,6 +54,16 @@ type Resource struct { Dependencies []string } +// ExistDependency checks if the given id is in the Dependencies of the Resource and returns true if it is, false otherwise. +func (r Resource) ExistDependency(localID string) bool { + for _, dependency := range r.Dependencies { + if dependency == localID { + return true + } + } + return false +} + // GetResourceType returns the ResourceType of the OutputResource. func (or OutputResource) GetResourceType() resourcemodel.ResourceType { // There are two possible states: diff --git a/pkg/rp/v1/outputresource_test.go b/pkg/rp/v1/outputresource_test.go index 99c67275ea..061092141b 100644 --- a/pkg/rp/v1/outputresource_test.go +++ b/pkg/rp/v1/outputresource_test.go @@ -32,6 +32,15 @@ func TestGetDependencies(t *testing.T) { require.Equal(t, []string{LocalIDUserAssignedManagedIdentity, LocalIDRoleAssignmentKVKeys}, dependencies) } +func TestExistDependency(t *testing.T) { + testResource := &Resource{ + Dependencies: []string{LocalIDSecret}, + } + + require.True(t, testResource.ExistDependency(LocalIDSecret)) + require.False(t, testResource.ExistDependency(LocalIDDeployment)) +} + func TestGetDependencies_MissingLocalID(t *testing.T) { testResource1 := OutputResource{} diff --git a/test/functional/shared/resources/container_runtimes_test.go b/test/functional/shared/resources/container_runtimes_test.go index 556438df6b..1003bbb03a 100644 --- a/test/functional/shared/resources/container_runtimes_test.go +++ b/test/functional/shared/resources/container_runtimes_test.go @@ -17,14 +17,25 @@ limitations under the License. package resource_test import ( + "context" "testing" "github.com/project-radius/radius/test/functional" "github.com/project-radius/radius/test/functional/shared" "github.com/project-radius/radius/test/step" "github.com/project-radius/radius/test/validation" + + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +/* +Test_Container_YAMLManifest tests the scenario where the base manifest yaml (./testdata/manifest/basemanifest.yaml) +has Deployment, Service, ServiceAccount, and multiple secrets and configmaps. The deployment resource in the manifest +uses environment varibles from secret and configmap and volume from secret, which are unsupported by +Applications.Core/containers resource. This enables Radius to render kubernetes resources unsupported by containers +resource. +*/ func Test_Container_YAMLManifest(t *testing.T) { template := "testdata/corerp-resources-container-manifest.bicep" name := "corerp-resources-container-manifest" @@ -53,6 +64,84 @@ func Test_Container_YAMLManifest(t *testing.T) { }, }, }, + PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { + deploy, err := test.Options.K8sClient.AppsV1().Deployments(appNamespace).Get(ctx, "ctnr-manifest", metav1.GetOptions{}) + require.NoError(t, err) + require.Equal(t, "base-manifest-test", deploy.ObjectMeta.Annotations["source"]) + require.ElementsMatch(t, + []string{"TEST_SECRET_KEY", "TEST_CONFIGMAP_KEY"}, + []string{ + deploy.Spec.Template.Spec.Containers[0].Env[0].Name, + deploy.Spec.Template.Spec.Containers[0].Env[1].Name, + }) + + srv, err := test.Options.K8sClient.CoreV1().Services(appNamespace).Get(ctx, "ctnr-manifest", metav1.GetOptions{}) + require.NoError(t, err) + require.Equal(t, "base-manifest-test", srv.ObjectMeta.Annotations["source"]) + + sa, err := test.Options.K8sClient.CoreV1().ServiceAccounts(appNamespace).Get(ctx, "ctnr-manifest", metav1.GetOptions{}) + require.NoError(t, err) + require.Equal(t, "base-manifest-test", sa.ObjectMeta.Annotations["source"]) + + for _, name := range []string{"ctnr-manifest-secret0", "ctnr-manifest-secret1"} { + _, err := test.Options.K8sClient.CoreV1().Secrets(appNamespace).Get(ctx, name, metav1.GetOptions{}) + require.NoError(t, err) + } + + _, err = test.Options.K8sClient.CoreV1().ConfigMaps(appNamespace).Get(ctx, "ctnr-manifest-config", metav1.GetOptions{}) + require.NoError(t, err) + }, + }, + }) + + test.Test(t) +} + +/* +Test_Container_YAMLManifest_SideCar tests the scenario where the base manifest yaml (./testdata/manifest/sidecar.yaml) +has the fluentbit sidecar. Radius injects the application container described in container resource into the given +base deployment. With this, user can add multiple sidecars to their final deployment with application container. +*/ +func Test_Container_YAMLManifest_SideCar(t *testing.T) { + template := "testdata/corerp-resources-container-manifest-sidecar.bicep" + name := "corerp-resources-container-sidecar" + appNamespace := "corerp-resources-container-sidecar" + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: "ctnr-sidecar", + Type: validation.ContainersResource, + App: name, + }, + }, + }, + K8sObjects: &validation.K8sObjectSet{ + Namespaces: map[string][]validation.K8sObject{ + appNamespace: { + validation.NewK8sPodForResource(name, "ctnr-sidecar"), + }, + }, + }, + PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { + deploy, err := test.Options.K8sClient.AppsV1().Deployments(appNamespace).Get(ctx, "ctnr-sidecar", metav1.GetOptions{}) + require.NoError(t, err) + + require.Len(t, deploy.Spec.Template.Spec.Containers, 2) + + // Ensure that Pod includes sidecar. + require.ElementsMatch(t, []string{"ctnr-sidecar", "log-collector"}, []string{ + deploy.Spec.Template.Spec.Containers[0].Name, + deploy.Spec.Template.Spec.Containers[1].Name, + }) + }, }, }) diff --git a/test/functional/shared/resources/testdata/corerp-resources-container-manifest-sidecar.bicep b/test/functional/shared/resources/testdata/corerp-resources-container-manifest-sidecar.bicep new file mode 100644 index 0000000000..8f9fbac81e --- /dev/null +++ b/test/functional/shared/resources/testdata/corerp-resources-container-manifest-sidecar.bicep @@ -0,0 +1,52 @@ +import radius as radius + +@description('Specifies the location for resources.') +param location string = 'global' + +@description('Specifies the image of the container resource.') +param magpieimage string + +@description('Specifies the port of the container resource.') +param port int = 3000 + +@description('Specifies the environment for resources.') +param environment string + +var manifest = loadTextContent('manifest/sidecar.yaml') + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'corerp-resources-container-sidecar' + location: location + properties: { + environment: environment + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: 'corerp-resources-container-sidecar' + } + ] + } +} + +resource container 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ctnr-sidecar' + location: location + properties: { + application: app.id + container: { + image: magpieimage + ports: { + web: { + containerPort: port + } + } + } + connections: {} + runtimes: { + kubernetes: { + base: manifest + } + } + } +} + diff --git a/test/functional/shared/resources/testdata/manifest/basemanifest.yaml b/test/functional/shared/resources/testdata/manifest/basemanifest.yaml index 2428c5bd0c..1ef37562b9 100644 --- a/test/functional/shared/resources/testdata/manifest/basemanifest.yaml +++ b/test/functional/shared/resources/testdata/manifest/basemanifest.yaml @@ -4,6 +4,8 @@ metadata: name: ctnr-manifest labels: app: ctnr-manifest + annotations: + source: base-manifest-test spec: replicas: 3 selector: @@ -14,20 +16,78 @@ spec: labels: app: ctnr-manifest spec: + serviceAccountName: ctnr-manifest + volumes: + - name: secret-vol + secret: + secretName: ctnr-manifest-secret0 containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 + - name: ctnr-manifest + ports: + - containerPort: 80 + protocol: TCP + volumeMounts: + - name: secret-vol + readOnly: true + mountPath: /etc/secret-vol + env: + - name: TEST_SECRET_KEY + valueFrom: + secretKeyRef: + name: ctnr-manifest-secret1 + key: secret1 + - name: TEST_CONFIGMAP_KEY + valueFrom: + configMapKeyRef: + name: ctnr-manifest-config + key: TEST_CONFIGMAP --- apiVersion: v1 kind: Service metadata: name: ctnr-manifest + annotations: + source: base-manifest-test spec: selector: app.kubernetes.io/name: ctnr-manifest ports: - protocol: TCP - port: 80 - targetPort: 9376 \ No newline at end of file + port: 3000 + targetPort: 3000 +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: ctnr-manifest + annotations: + source: base-manifest-test +--- +apiVersion: v1 +kind: Secret +metadata: + name: ctnr-manifest-secret0 + annotations: + source: base-manifest-test +type: Opaque +stringData: + 'secret0': test-secret-0 +--- +apiVersion: v1 +kind: Secret +metadata: + name: ctnr-manifest-secret1 + annotations: + source: base-manifest-test +type: Opaque +stringData: + 'secret1': test-secret-1 +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: ctnr-manifest-config + annotations: + source: base-manifest-test +data: + TEST_CONFIGMAP: test-configmap diff --git a/test/functional/shared/resources/testdata/manifest/sidecar.yaml b/test/functional/shared/resources/testdata/manifest/sidecar.yaml new file mode 100644 index 0000000000..ead07a339e --- /dev/null +++ b/test/functional/shared/resources/testdata/manifest/sidecar.yaml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ctnr-sidecar + labels: + app: ctnr-sidecar + annotations: + source: base-manifest-test +spec: + replicas: 1 + selector: + matchLabels: + app: ctnr-sidecar + template: + metadata: + labels: + app: ctnr-sidecar + spec: + containers: + - name: log-collector + # TODO: change it to ghcr.io/project-radius/fluent-bit:2.1.8 + image: radiusdev.azurecr.io/fluent/fluent-bit:2.1.8 diff --git a/test/k8sutil/fakeresources.go b/test/k8sutil/fakeresources.go new file mode 100644 index 0000000000..5369263007 --- /dev/null +++ b/test/k8sutil/fakeresources.go @@ -0,0 +1,99 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package k8sutil + +// YAMLSeparater is the separater for fake YAML. +const YAMLSeparater = "\n---\n" + +// FakeDeploymentTemplate is the template for fake deployment. +const FakeDeploymentTemplate = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: %s + %s + labels: + app: magpie +spec: + replicas: 3 + selector: + matchLabels: + app: magpie + template: + metadata: + labels: + app: magpie + spec: + serviceAccountName: %s + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +` + +// FakeServiceTemplate is the template for fake service. +const FakeServiceTemplate = ` +apiVersion: v1 +kind: Service +metadata: + name: %s + %s +spec: + selector: + app.kubernetes.io/name: magpie + ports: + - protocol: TCP + port: 80 + targetPort: 9376 +` + +// FakeServiceAccountTemplate is the template for fake service account. +const FakeServiceAccountTemplate = ` +apiVersion: v1 +kind: ServiceAccount +metadata: + name: %s + labels: + app.kubernetes.io/name: magpie + app.kubernetes.io/part-of: radius +` + +// FakeSecretTemplate is the template for fake secret. +const FakeSecretTemplate = ` +apiVersion: v1 +kind: Secret +metadata: + name: %s +type: Opaque +stringData: + username: admin + password: password +` + +// FakeConfigMapTemplate is the template for fake config map. +const FakeConfigMapTemplate = ` +apiVersion: v1 +kind: ConfigMap +metadata: + name: %s + labels: + app.kubernetes.io/name: magpie + app.kubernetes.io/part-of: radius +data: + appsettings.Production.json: config +` From e90aefebfbf2914780927a1d2c17136d5db0ffc3 Mon Sep 17 00:00:00 2001 From: nithyatsu <98416062+nithyatsu@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:00:56 -0700 Subject: [PATCH 30/57] rename project-radius to radius-project (#6178) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Changes related to moving our project from project-radius to radius-project ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at ac0fb54 ### Summary 🔧🔄🚀 The code updated the GitHub organization name from `project-radius` to `radius-project` in various files and workflows. This is to reflect the renaming of the organization and to ensure consistency, compatibility, and accuracy of the links, references, and resources related to the project. > _Sing, O Muse, of the mighty `radius-project`, born from the ashes of `project-radius`_ > _How they changed their glorious name in every file and folder, with skill and diligence_ > _Like the god Hephaestus, who forged new weapons for the Olympians, after the Titan war_ > _They updated their workflows, tasks, and docs, to shine with new splendor, and reach afar_ ### Walkthrough * Rename GitHub organization from `project-radius` to `radius-project` in various files ([link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-3d36a1bf06148bc6ba1ce2ed3d19de32ea708d955fed212c0d27c536f0bd4da7L9-R9), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-9d887d247a893b8a1ed2c8a4494bac7f065055680845f116ad7b6c1cd7324295L9-R9), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-b94c0e124b5b65fb6fa8785928c5331547c124a96ecc225f93df9445a29a5109L67-R67), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L45-R45), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L52-R52), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L129-R129), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L214-R214), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L321-R321), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L391-R391), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d54d69dbb27e75dae25cb4b2384310cb57707e419377cf572d5cb0ecc1f16877L21-R21), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL54-R56), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL320-R320), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL475-R475), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-fe198ee6d6945e09ccefa6351febac68b4b18f3ebc3503e720a8c7fee65ea5c7L19-R20), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-5dda38c017a17c459b16104779239cf891ceac425018e4b63263f4c7d773e061L77-R95), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-5dda38c017a17c459b16104779239cf891ceac425018e4b63263f4c7d773e061L109-R109), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-69250281a3f8b6ed9c93d9d9d8d92aa49e2105c37fe83fd22168ec5ab85250bdL21-R26), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-69250281a3f8b6ed9c93d9d9d8d92aa49e2105c37fe83fd22168ec5ab85250bdL40-R40), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-9270fafc31ef4b50d35d1295e9f99f96013853c295c29c92c387492f62cd570dL38-R38), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL42-R42), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL113-R113), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL124-R148), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL174-R186), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-4f41a75886a1a479805bae1b7fb335479735aa7740e02b9e5c19992ead18f73eL41-R42), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-4f41a75886a1a479805bae1b7fb335479735aa7740e02b9e5c19992ead18f73eL48-R49), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-7d76d7533653c23b753fc7ce638cf64bdb5e419927d276af836d3a03fdf1745aL10-R10), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-7d76d7533653c23b753fc7ce638cf64bdb5e419927d276af836d3a03fdf1745aL26-R26), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-267abdbaab3ee4a767a1905f07cb0033220b32d4a8c035502fe24dad37ee2e03L17-R17), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-e5017862a52d1de76ba232f290f53785637620580359895b37c593f181afc6c1L19-R19), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-607e82dd7ce2736355a7703fb1a4a832dddb294c3683c4b51a5118218e379712L89-R89), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-667f05aa16f6dfd1d55d0ca1392411a09981560434524889a6dfe768679673fcL28-R41), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055L10-R10), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055L17-R17), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055L24-R24), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055L31-R31), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-b60c6a93e9f74ee52e71bf33781c2870b8395c8c5a34f00f61305343cb8d8447L5-L4), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L30-R30), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L40-R40), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L50-R50), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L60-R70)) * Update TODO comments that link to issues about open-sourcing the repo, moving the recipe to GHCR, and re-enabling the test-ucp-spec-examples target ([link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L45-R45), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L129-R129), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L214-R214), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-d0777657fa3fd81d23aaf7273e58aee453b04e67882517900c56daeef9b3e4c1L391-R391), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL475-R475), [link](https://github.com/project-radius/radius/pull/6178/files?diff=unified&w=0#diff-607e82dd7ce2736355a7703fb1a4a832dddb294c3683c4b51a5118218e379712L89-R89)) --------- Co-authored-by: Young Bu Park --- .github/CODEOWNERS | 2 +- .github/runners/runner-deployment.yaml | 2 +- .github/scripts/radius-bot.js | 2 +- .github/workflows/build.yaml | 12 +- .github/workflows/docs.yaml | 2 +- .github/workflows/functional-test.yaml | 8 +- .github/workflows/issues.yaml | 4 +- .github/workflows/publish-bicep.yaml | 14 +- .github/workflows/publish-docs.yaml | 6 +- .github/workflows/purge-test-resources.yaml | 2 +- .github/workflows/release.yaml | 28 +-- .github/workflows/validate-bicep.yaml | 8 +- .vscode/tasks.json | 4 +- CONTRIBUTING.md | 8 +- GOVERNANCE.md | 2 +- README.md | 20 +- build/build.mk | 2 +- build/docker.mk | 2 +- build/test.mk | 2 +- cmd/applications-rp/main.go | 28 +-- cmd/docgen/main.go | 2 +- cmd/rad/cmd/bicepDelete.go | 4 +- cmd/rad/cmd/bicepDownload.go | 6 +- cmd/rad/cmd/debuglogs.go | 8 +- cmd/rad/cmd/resourceExpose.go | 10 +- cmd/rad/cmd/resourceLogs.go | 8 +- cmd/rad/cmd/root.go | 104 +++++------ cmd/rad/cmd/version.go | 6 +- cmd/rad/main.go | 2 +- cmd/ucpd/cmd/root.go | 10 +- cmd/ucpd/main.go | 2 +- deploy/Chart/Chart.yaml | 4 +- deploy/Chart/templates/rp/configmaps.yaml | 4 +- deploy/Chart/templates/ucp/configmaps.yaml | 2 +- deploy/install.sh | 2 +- docs/README.md | 2 +- .../contributing-code-building/README.md | 2 +- .../contributing-code-cli/README.md | 4 +- .../running-controlplane-locally.md | 4 +- .../first-commit-05-running-tests/index.md | 34 ++-- .../first-commit-07-creating-a-pr/index.md | 6 +- .../contributing-code-prerequisites/README.md | 2 +- .../README.md | 2 +- .../contributing-code-tests/tests-logging.md | 2 +- .../tests-naming-conventions.md | 2 +- .../writing-functional-tests.md | 2 +- .../contributing-issues/README.md | 4 +- .../contributing-pull-requests/README.md | 6 +- .../contributing-releases/README.md | 12 +- docs/contributing/how-to.md | 6 +- docs/release-notes/README.md | 4 +- docs/release-notes/v0.22.0.md | 166 ++++++++--------- docs/release-notes/v0.23.0.md | 122 ++++++------ docs/release-notes/v0.24.0.md | 176 +++++++++--------- go.mod | 2 +- pkg/armrpc/api/v1/armrequestcontext.go | 4 +- pkg/armrpc/api/v1/armrequestcontext_test.go | 2 +- pkg/armrpc/api/v1/types_test.go | 2 +- .../asyncoperation/controller/controller.go | 6 +- .../asyncoperation/controller/request.go | 4 +- .../asyncoperation/controller/request_test.go | 6 +- .../asyncoperation/controller/result.go | 2 +- .../statusmanager/mock_statusmanager.go | 6 +- .../asyncoperation/statusmanager/status.go | 2 +- .../statusmanager/statusmanager.go | 16 +- .../statusmanager/statusmanager_test.go | 10 +- pkg/armrpc/asyncoperation/worker/registry.go | 6 +- .../asyncoperation/worker/registry_test.go | 8 +- pkg/armrpc/asyncoperation/worker/service.go | 16 +- pkg/armrpc/asyncoperation/worker/worker.go | 20 +- .../worker/worker_runoperation_test.go | 18 +- .../asyncoperation/worker/worker_test.go | 4 +- pkg/armrpc/authentication/certvalidator.go | 6 +- .../authentication/certvalidator_test.go | 2 +- pkg/armrpc/frontend/controller/controller.go | 12 +- .../frontend/controller/controller_test.go | 2 +- pkg/armrpc/frontend/controller/operation.go | 12 +- pkg/armrpc/frontend/controller/util.go | 2 +- pkg/armrpc/frontend/controller/util_test.go | 2 +- .../createorupdatesubscription.go | 8 +- .../createorupdatesubscription_test.go | 10 +- .../defaultoperation/defaultasyncdelete.go | 6 +- .../defaultasyncdelete_test.go | 12 +- .../defaultoperation/defaultasyncput.go | 6 +- .../defaultoperation/defaultasyncput_test.go | 12 +- .../defaultoperation/defaultsyncdelete.go | 8 +- .../defaultsyncdelete_test.go | 8 +- .../defaultoperation/defaultsyncput.go | 6 +- .../defaultoperation/defaultsyncput_test.go | 10 +- .../defaultoperation/getoperationresult.go | 12 +- .../getoperationresult_test.go | 12 +- .../defaultoperation/getoperationstatus.go | 10 +- .../getoperationstatus_test.go | 12 +- .../frontend/defaultoperation/getresource.go | 8 +- .../defaultoperation/getresource_test.go | 8 +- .../defaultoperation/listresources.go | 10 +- .../defaultoperation/listresources_test.go | 8 +- .../defaultoperation/resource_test.go | 16 +- pkg/armrpc/frontend/server/handler.go | 12 +- pkg/armrpc/frontend/server/handler_test.go | 10 +- pkg/armrpc/frontend/server/server.go | 10 +- pkg/armrpc/frontend/server/service.go | 14 +- pkg/armrpc/hostoptions/hostoptions.go | 18 +- pkg/armrpc/hostoptions/providerconfig.go | 16 +- pkg/armrpc/rest/results.go | 10 +- pkg/armrpc/rest/results_test.go | 8 +- pkg/armrpc/rpctest/controllers.go | 6 +- pkg/armrpc/rpctest/requests.go | 2 +- pkg/armrpc/rpctest/routers.go | 4 +- pkg/armrpc/servicecontext/middleware.go | 4 +- pkg/armrpc/servicecontext/middleware_test.go | 2 +- pkg/aws/operations/operations.go | 2 +- pkg/azure/armauth/auth.go | 6 +- pkg/azure/clientv2/customaction.go | 2 +- pkg/azure/clientv2/unfold.go | 6 +- pkg/azure/clientv2/unfold_test.go | 2 +- pkg/azure/credential/ucpcredentials.go | 4 +- pkg/azure/credential/ucpcredentials_test.go | 2 +- pkg/azure/roleassignment/roleassignment.go | 12 +- pkg/cli/aws/client.go | 2 +- pkg/cli/aws/client_mock.go | 2 +- pkg/cli/azure/client.go | 4 +- pkg/cli/azure/client_mock.go | 2 +- pkg/cli/azure/subscriptions.go | 2 +- pkg/cli/bicep/bicep.go | 2 +- pkg/cli/bicep/build.go | 2 +- pkg/cli/bicep/deployment_parameters.go | 2 +- pkg/cli/bicep/deployment_parameters_test.go | 2 +- pkg/cli/bicep/mock_bicep.go | 2 +- pkg/cli/bicep/types.go | 6 +- pkg/cli/clients/clients.go | 12 +- pkg/cli/clients/errors.go | 4 +- pkg/cli/clients/management.go | 16 +- pkg/cli/clients/mock_applicationsclient.go | 8 +- pkg/cli/clients/mock_diagnosticsclient.go | 2 +- pkg/cli/clivalidation.go | 12 +- pkg/cli/cmd/README.md | 14 +- pkg/cli/cmd/app/appswitch/switch.go | 16 +- pkg/cli/cmd/app/appswitch/switch_test.go | 12 +- pkg/cli/cmd/app/connections/compute.go | 8 +- pkg/cli/cmd/app/connections/compute_test.go | 4 +- pkg/cli/cmd/app/connections/connections.go | 18 +- .../cmd/app/connections/connections_test.go | 20 +- .../cmd/app/connections/shareddata_test.go | 2 +- pkg/cli/cmd/app/delete/delete.go | 16 +- pkg/cli/cmd/app/delete/delete_test.go | 14 +- pkg/cli/cmd/app/list/list.go | 14 +- pkg/cli/cmd/app/list/list_test.go | 18 +- pkg/cli/cmd/app/show/show.go | 18 +- pkg/cli/cmd/app/show/show_test.go | 20 +- pkg/cli/cmd/app/status/status.go | 20 +- pkg/cli/cmd/app/status/status_test.go | 24 +-- pkg/cli/cmd/bicep/publish/publish.go | 10 +- pkg/cli/cmd/bicep/publish/publish_test.go | 4 +- pkg/cli/cmd/commonflags/flags.go | 2 +- pkg/cli/cmd/credential/common/validation.go | 6 +- pkg/cli/cmd/credential/credential.go | 12 +- pkg/cli/cmd/credential/list/list.go | 16 +- pkg/cli/cmd/credential/list/list_test.go | 14 +- pkg/cli/cmd/credential/register/aws/aws.go | 24 +-- .../cmd/credential/register/aws/aws_test.go | 18 +- .../cmd/credential/register/azure/azure.go | 24 +-- .../credential/register/azure/azure_test.go | 22 +-- pkg/cli/cmd/credential/register/register.go | 8 +- pkg/cli/cmd/credential/show/show.go | 18 +- pkg/cli/cmd/credential/show/show_test.go | 16 +- .../cmd/credential/unregister/unregister.go | 14 +- .../credential/unregister/unregister_test.go | 12 +- pkg/cli/cmd/deploy/deploy.go | 26 +-- pkg/cli/cmd/deploy/deploy_test.go | 22 +-- pkg/cli/cmd/env/create/create.go | 30 +-- pkg/cli/cmd/env/create/create_test.go | 24 +-- pkg/cli/cmd/env/delete/delete.go | 14 +- pkg/cli/cmd/env/delete/delete_test.go | 14 +- pkg/cli/cmd/env/envswitch/switch.go | 18 +- pkg/cli/cmd/env/envswitch/switch_test.go | 10 +- pkg/cli/cmd/env/list/list.go | 14 +- pkg/cli/cmd/env/list/list_test.go | 18 +- pkg/cli/cmd/env/namespace/mock_namespace.go | 2 +- pkg/cli/cmd/env/namespace/namespace.go | 4 +- pkg/cli/cmd/env/show/show.go | 18 +- pkg/cli/cmd/env/show/show_test.go | 20 +- pkg/cli/cmd/env/update/update.go | 30 +-- pkg/cli/cmd/env/update/update_test.go | 22 +-- pkg/cli/cmd/group/common/validation.go | 2 +- pkg/cli/cmd/group/create/create.go | 20 +- pkg/cli/cmd/group/create/create_test.go | 12 +- pkg/cli/cmd/group/delete/delete.go | 14 +- pkg/cli/cmd/group/delete/delete_test.go | 14 +- pkg/cli/cmd/group/group.go | 12 +- pkg/cli/cmd/group/groupswitch/switch.go | 12 +- pkg/cli/cmd/group/groupswitch/switch_test.go | 16 +- pkg/cli/cmd/group/list/list.go | 14 +- pkg/cli/cmd/group/list/list_test.go | 14 +- pkg/cli/cmd/group/show/show.go | 14 +- pkg/cli/cmd/group/show/show_test.go | 16 +- pkg/cli/cmd/install/kubernetes/kubernetes.go | 10 +- .../cmd/install/kubernetes/kubernetes_test.go | 6 +- pkg/cli/cmd/radinit/application.go | 2 +- pkg/cli/cmd/radinit/application_test.go | 2 +- pkg/cli/cmd/radinit/aws.go | 6 +- pkg/cli/cmd/radinit/aws_test.go | 8 +- pkg/cli/cmd/radinit/azure.go | 6 +- pkg/cli/cmd/radinit/azure_test.go | 8 +- pkg/cli/cmd/radinit/cloud.go | 6 +- pkg/cli/cmd/radinit/cloud_test.go | 8 +- pkg/cli/cmd/radinit/cluster.go | 4 +- pkg/cli/cmd/radinit/cluster_test.go | 6 +- pkg/cli/cmd/radinit/display.go | 2 +- pkg/cli/cmd/radinit/environment.go | 6 +- pkg/cli/cmd/radinit/environment_test.go | 12 +- pkg/cli/cmd/radinit/init.go | 40 ++-- pkg/cli/cmd/radinit/init_test.go | 36 ++-- pkg/cli/cmd/radinit/mock_devrecipeclient.go | 4 +- pkg/cli/cmd/radinit/options.go | 8 +- pkg/cli/cmd/radinit/options_test.go | 12 +- pkg/cli/cmd/radinit/recipe.go | 12 +- pkg/cli/cmd/radinit/recipe_test.go | 6 +- pkg/cli/cmd/recipe/list/list.go | 18 +- pkg/cli/cmd/recipe/list/list_test.go | 26 +-- pkg/cli/cmd/recipe/register/register.go | 22 +-- pkg/cli/cmd/recipe/register/register_test.go | 22 +-- pkg/cli/cmd/recipe/show/show.go | 18 +- pkg/cli/cmd/recipe/show/show_test.go | 24 +-- pkg/cli/cmd/recipe/unregister/unregister.go | 18 +- .../cmd/recipe/unregister/unregister_test.go | 22 +-- pkg/cli/cmd/resource/delete/delete.go | 14 +- pkg/cli/cmd/resource/delete/delete_test.go | 46 ++--- pkg/cli/cmd/resource/list/list.go | 18 +- pkg/cli/cmd/resource/list/list_test.go | 20 +- pkg/cli/cmd/resource/show/show.go | 14 +- pkg/cli/cmd/resource/show/show_test.go | 14 +- pkg/cli/cmd/run/run.go | 16 +- pkg/cli/cmd/run/run_test.go | 30 +-- .../cmd/uninstall/kubernetes/kubernetes.go | 8 +- .../uninstall/kubernetes/kubernetes_test.go | 6 +- pkg/cli/cmd/utils.go | 12 +- pkg/cli/cmd/utils_test.go | 10 +- pkg/cli/cmd/workspace/create/create.go | 20 +- pkg/cli/cmd/workspace/create/create_test.go | 14 +- pkg/cli/cmd/workspace/delete/delete.go | 12 +- pkg/cli/cmd/workspace/delete/delete_test.go | 10 +- pkg/cli/cmd/workspace/list/list.go | 12 +- pkg/cli/cmd/workspace/list/list_test.go | 12 +- pkg/cli/cmd/workspace/show/show.go | 12 +- pkg/cli/cmd/workspace/show/show_test.go | 10 +- pkg/cli/cmd/workspace/switch/switch.go | 10 +- pkg/cli/cmd/workspace/switch/switch_test.go | 10 +- pkg/cli/config.go | 4 +- pkg/cli/config_test.go | 2 +- pkg/cli/connections/factory.go | 26 +-- pkg/cli/connections/mock_factory.go | 6 +- .../credential/aws_credential_management.go | 6 +- .../credential/azure_credential_management.go | 6 +- pkg/cli/credential/credential_management.go | 6 +- .../credential/credential_management_test.go | 8 +- .../mock_aws_credential_management.go | 4 +- .../mock_azure_credential_management.go | 4 +- .../mock_credentialmanagementclient.go | 4 +- pkg/cli/deploy/deploy.go | 6 +- pkg/cli/deploy/endpoints.go | 4 +- pkg/cli/deploy/mock_deploy.go | 4 +- pkg/cli/deploy/progress.go | 4 +- pkg/cli/deploy/types.go | 8 +- pkg/cli/deployment/deploy.go | 8 +- pkg/cli/deployment/deploy_test.go | 4 +- pkg/cli/deployment/diagnostics.go | 8 +- pkg/cli/framework/config.go | 8 +- pkg/cli/framework/framework.go | 24 +-- pkg/cli/framework/mock_config.go | 4 +- pkg/cli/framework/mock_framework.go | 2 +- pkg/cli/helm/cluster.go | 4 +- pkg/cli/helm/cluster_test.go | 2 +- pkg/cli/helm/contourclient.go | 4 +- pkg/cli/helm/mock_cluster.go | 2 +- pkg/cli/helm/radiusclient.go | 4 +- pkg/cli/kubernetes/kubernetes.go | 6 +- pkg/cli/kubernetes/kubernetes_test.go | 2 +- .../kubernetes/logstream/mock_logstream.go | 2 +- pkg/cli/kubernetes/logstream/stern.go | 2 +- pkg/cli/kubernetes/logstream/types.go | 2 +- pkg/cli/kubernetes/mock_kubernetes.go | 2 +- .../portforward/application_watcher.go | 2 +- .../portforward/application_watcher_test.go | 2 +- .../portforward/deployment_watcher_test.go | 2 +- pkg/cli/kubernetes/portforward/impl.go | 2 +- .../portforward/mock_portforward.go | 2 +- pkg/cli/kubernetes/portforward/pod_watcher.go | 2 +- .../portforward/pod_watcher_test.go | 2 +- pkg/cli/kubernetes/portforward/types.go | 2 +- pkg/cli/kubernetes/portforward/util.go | 2 +- pkg/cli/kubernetes/portforward/util_test.go | 2 +- pkg/cli/objectformats/objectformats.go | 2 +- pkg/cli/objectformats/objectformats_test.go | 6 +- pkg/cli/output/mock_writer.go | 2 +- pkg/cli/output/resources.go | 2 +- pkg/cli/prompt/mock_prompter.go | 4 +- pkg/cli/prompt/prompt.go | 8 +- pkg/cli/tools/binary_tools.go | 2 +- pkg/cli/tools/binary_tools_test.go | 2 +- pkg/cli/workspaces/connection.go | 4 +- pkg/cli/workspaces/types.go | 2 +- .../application_conversion.go | 8 +- .../application_conversion_test.go | 8 +- .../container_conversion.go | 8 +- .../container_conversion_test.go | 12 +- .../environment_conversion.go | 14 +- .../environment_conversion_test.go | 16 +- .../environmentrecipeproperties_conversion.go | 8 +- ...ronmentrecipeproperties_conversion_test.go | 8 +- .../extender_conversion.go | 12 +- .../extender_conversion_test.go | 14 +- .../gateway_conversion.go | 8 +- .../gateway_conversion_test.go | 10 +- .../httproute_conversion.go | 8 +- .../httproute_conversion_test.go | 10 +- .../secretstore_conversion.go | 8 +- .../secretstore_conversion_test.go | 12 +- .../api/v20220315privatepreview/util.go | 8 +- .../api/v20220315privatepreview/util_test.go | 2 +- .../volume_conversion.go | 8 +- .../volume_conversion_test.go | 10 +- .../controller/createorupdateresource.go | 20 +- .../controller/createorupdateresource_test.go | 20 +- .../backend/controller/deleteresource.go | 8 +- .../backend/controller/deleteresource_test.go | 6 +- .../backend/deployment/deploymentprocessor.go | 36 ++-- .../deployment/deploymentprocessor_test.go | 42 ++--- .../deployment/mock_deploymentprocessor.go | 10 +- pkg/corerp/backend/service.go | 40 ++-- pkg/corerp/backend/systemservice.go | 6 +- pkg/corerp/datamodel/application.go | 4 +- pkg/corerp/datamodel/container.go | 4 +- .../converter/application_converter.go | 6 +- .../converter/application_converter_test.go | 6 +- .../converter/container_converter.go | 6 +- .../converter/container_converter_test.go | 6 +- .../converter/environment_converter.go | 6 +- .../converter/environment_converter_test.go | 6 +- .../environmentrecipeproperties_converter.go | 6 +- ...ironmentrecipeproperties_converter_test.go | 6 +- .../datamodel/converter/extender_converter.go | 6 +- .../converter/extender_converter_test.go | 6 +- .../datamodel/converter/gateway_converter.go | 6 +- .../converter/gateway_converter_test.go | 6 +- .../converter/httproute_converter.go | 6 +- .../converter/httproute_converter_test.go | 6 +- .../converter/secretstore_converter.go | 6 +- .../converter/secretstore_converter_test.go | 6 +- .../datamodel/converter/volume_converter.go | 6 +- .../converter/volume_converter_test.go | 6 +- pkg/corerp/datamodel/environment.go | 4 +- pkg/corerp/datamodel/extender.go | 6 +- pkg/corerp/datamodel/gateway.go | 4 +- pkg/corerp/datamodel/httproute.go | 4 +- pkg/corerp/datamodel/linkmetadata.go | 2 +- pkg/corerp/datamodel/secretstore.go | 4 +- pkg/corerp/datamodel/volume.go | 4 +- .../controller/applications/updatefilter.go | 22 +-- .../applications/updatefilter_test.go | 18 +- .../controller/containers/validator.go | 10 +- .../controller/containers/validator_test.go | 10 +- .../environments/createorupdateenvironment.go | 12 +- .../createorupdateenvironment_test.go | 8 +- .../environments/getrecipemetadata.go | 14 +- .../environments/getrecipemetadata_test.go | 12 +- .../v20220315privatepreview_test.go | 6 +- .../extenders/listsecretsextender.go | 10 +- .../extenders/listsecretsextender_test.go | 8 +- .../extenders/v20220315privatepreview_test.go | 6 +- .../frontend/controller/gateways/validator.go | 6 +- .../controller/gateways/validator_test.go | 4 +- .../controller/secretstores/kubernetes.go | 18 +- .../secretstores/kubernetes_test.go | 18 +- .../controller/secretstores/listsecrets.go | 12 +- .../secretstores/listsecrets_test.go | 16 +- pkg/corerp/frontend/controller/util/query.go | 2 +- .../frontend/controller/volumes/validator.go | 6 +- .../controller/volumes/validator_test.go | 12 +- pkg/corerp/frontend/handler/getoperations.go | 8 +- .../frontend/handler/getoperations_test.go | 8 +- pkg/corerp/frontend/handler/routes.go | 38 ++-- pkg/corerp/frontend/handler/routes_test.go | 24 +-- pkg/corerp/frontend/service.go | 8 +- pkg/corerp/handlers/arm_handler.go | 8 +- .../handlers/azure_federatedidentity.go | 16 +- pkg/corerp/handlers/azure_roleassignment.go | 14 +- .../azure_userassigned_managedidentity.go | 16 +- pkg/corerp/handlers/kubernetes.go | 14 +- pkg/corerp/handlers/kubernetes_test.go | 12 +- pkg/corerp/handlers/mock_resource_handler.go | 2 +- pkg/corerp/handlers/resource_handler.go | 4 +- pkg/corerp/model/application_model.go | 32 ++-- pkg/corerp/model/types.go | 6 +- pkg/corerp/processors/extenders/processor.go | 6 +- .../processors/extenders/processor_test.go | 8 +- .../renderers/container/azure/fileshare.go | 6 +- .../renderers/container/azure/identity.go | 14 +- .../container/azure/identity_test.go | 12 +- .../container/azure/keyvaultvolume.go | 14 +- .../container/azure/keyvaultvolume_test.go | 14 +- pkg/corerp/renderers/container/azure/util.go | 2 +- pkg/corerp/renderers/container/manifest.go | 12 +- .../renderers/container/manifest_test.go | 14 +- pkg/corerp/renderers/container/rbac.go | 6 +- pkg/corerp/renderers/container/render.go | 30 +-- pkg/corerp/renderers/container/render_test.go | 32 ++-- pkg/corerp/renderers/container/volumes.go | 2 +- .../renderers/daprextension/renderer.go | 10 +- .../renderers/daprextension/renderer_test.go | 18 +- pkg/corerp/renderers/gateway/render.go | 14 +- pkg/corerp/renderers/gateway/render_test.go | 20 +- pkg/corerp/renderers/httproute/render.go | 12 +- pkg/corerp/renderers/httproute/render_test.go | 10 +- pkg/corerp/renderers/kubernetesmetadata.go | 4 +- .../renderers/kubernetesmetadata/render.go | 12 +- .../kubernetesmetadata/render_test.go | 14 +- pkg/corerp/renderers/manualscale/render.go | 10 +- .../renderers/manualscale/render_test.go | 12 +- pkg/corerp/renderers/mock_renderer.go | 6 +- pkg/corerp/renderers/types.go | 10 +- pkg/corerp/renderers/volume/azure/keyvault.go | 10 +- .../renderers/volume/azure/keyvault_test.go | 8 +- pkg/corerp/renderers/volume/render.go | 12 +- pkg/corerp/renderers/volume/render_test.go | 4 +- pkg/corerp/renderers/volume/types.go | 4 +- .../v20220315privatepreview/datamodel_util.go | 10 +- .../datamodel_util_test.go | 8 +- .../pubsubbroker_conversion.go | 10 +- .../pubsubbroker_conversion_test.go | 14 +- .../secretstore_conversion.go | 10 +- .../secretstore_conversion_test.go | 14 +- .../statestore_conversion.go | 10 +- .../statestore_conversion_test.go | 14 +- .../converter/pubsubbroker_converter.go | 6 +- .../converter/pubsubbroker_converter_test.go | 12 +- .../converter/secretstore_converter.go | 6 +- .../converter/secretstore_converter_test.go | 8 +- .../converter/statestore_converter.go | 6 +- .../converter/statestore_converter_test.go | 8 +- pkg/daprrp/datamodel/daprpubsubbroker.go | 8 +- pkg/daprrp/datamodel/daprsecretstore.go | 8 +- pkg/daprrp/datamodel/daprstatestore.go | 10 +- pkg/daprrp/datamodel/daprstatestore_test.go | 6 +- .../processors/pubsubbrokers/processor.go | 20 +- .../pubsubbrokers/processor_test.go | 20 +- .../processors/secretstores/processor.go | 20 +- .../processors/secretstores/processor_test.go | 20 +- .../processors/statestores/processor.go | 20 +- .../processors/statestores/processor_test.go | 20 +- .../v20220315privatepreview/datamodel_util.go | 10 +- .../datamodel_util_test.go | 8 +- .../mongodatabase_conversion.go | 10 +- .../mongodatabase_conversion_test.go | 16 +- .../rediscache_conversion.go | 10 +- .../rediscache_conversion_test.go | 14 +- .../sqldatabase_conversion.go | 10 +- .../sqldatabase_conversion_test.go | 14 +- .../converter/mongodatabase_converter.go | 6 +- .../converter/mongodatabase_converter_test.go | 8 +- .../converter/rediscache_converter.go | 6 +- .../converter/rediscache_converter_test.go | 8 +- .../converter/sqldatabase_converter.go | 6 +- .../converter/sqldatabase_converter_test.go | 8 +- pkg/datastoresrp/datamodel/mongodatabase.go | 10 +- pkg/datastoresrp/datamodel/rediscache.go | 10 +- pkg/datastoresrp/datamodel/sqldatabase.go | 8 +- .../listsecretsmongodatabase.go | 12 +- .../listsecretsmongodatabase_test.go | 12 +- .../v20220315privatepreview_test.go | 6 +- .../rediscaches/listsecretsrediscache.go | 14 +- .../rediscaches/listsecretsrediscache_test.go | 12 +- .../v20220315privatepreview_test.go | 6 +- .../sqldatabases/listsecretssqldatabase.go | 12 +- .../listsecretssqldatabase_test.go | 10 +- .../v20220315privatepreview_test.go | 6 +- .../processors/mongodatabases/processor.go | 6 +- .../mongodatabases/processor_test.go | 10 +- .../processors/rediscaches/processor.go | 6 +- .../processors/rediscaches/processor_test.go | 10 +- .../processors/sqldatabases/processor.go | 6 +- .../processors/sqldatabases/processor_test.go | 10 +- pkg/kubernetes/object.go | 4 +- pkg/kubeutil/namespace.go | 2 +- pkg/kubeutil/namespace_test.go | 2 +- .../v20220315privatepreview/datamodel_util.go | 10 +- .../datamodel_util_test.go | 8 +- .../rabbitmq_conversion.go | 10 +- .../rabbitmq_conversion_test.go | 14 +- .../datamodel/converter/rabbitmq_converter.go | 6 +- .../converter/rabbitmq_converter_test.go | 8 +- pkg/messagingrp/datamodel/rabbitmq.go | 8 +- .../rabbitmqqueues/listsecretsrabbitmq.go | 12 +- .../listsecretsrabbitmq_test.go | 10 +- .../v20220315privatepreview_test.go | 6 +- .../processors/rabbitmqqueues/processor.go | 6 +- .../rabbitmqqueues/processor_test.go | 8 +- pkg/metrics/asyncoperationmetrics.go | 6 +- pkg/metrics/recipeenginemetrics.go | 2 +- pkg/metrics/service/hostoptions.go | 4 +- pkg/metrics/service/service.go | 6 +- pkg/middleware/logger.go | 4 +- pkg/middleware/lowercaseurlpath.go | 2 +- pkg/middleware/lowercaseurlpath_test.go | 2 +- pkg/middleware/recoverer.go | 6 +- .../controller/createorupdateresource.go | 16 +- .../controller/createorupdateresource_test.go | 22 +-- .../backend/controller/deleteresource.go | 24 +-- .../backend/controller/deleteresource_test.go | 16 +- pkg/portableresources/backend/service.go | 58 +++--- .../datamodel/linkmetadata.go | 4 +- pkg/portableresources/datamodel/recipes.go | 2 +- .../frontend/handler/getoperations.go | 8 +- .../frontend/handler/getoperations_test.go | 8 +- .../frontend/handler/routes.go | 44 ++--- .../frontend/handler/routes_test.go | 16 +- pkg/portableresources/frontend/service.go | 8 +- pkg/portableresources/handlers/util.go | 2 +- pkg/portableresources/handlers/util_test.go | 6 +- .../processors/mock_resourceclient.go | 2 +- .../processors/resourceclient.go | 20 +- .../processors/resourceclient_test.go | 14 +- pkg/portableresources/processors/types.go | 6 +- pkg/portableresources/processors/util.go | 10 +- pkg/portableresources/processors/util_test.go | 10 +- pkg/portableresources/processors/validator.go | 6 +- .../processors/validator_test.go | 10 +- .../renderers/dapr/generic.go | 4 +- pkg/profiler/service/hostoptions.go | 4 +- pkg/profiler/service/service.go | 2 +- pkg/recipes/configloader/environment.go | 16 +- pkg/recipes/configloader/environment_test.go | 8 +- .../configloader/mock_config_loader.go | 4 +- pkg/recipes/configloader/types.go | 2 +- pkg/recipes/driver/bicep.go | 28 +-- pkg/recipes/driver/bicep_test.go | 22 +-- pkg/recipes/driver/mock_driver.go | 4 +- pkg/recipes/driver/terraform.go | 16 +- pkg/recipes/driver/terraform_test.go | 12 +- pkg/recipes/driver/types.go | 4 +- pkg/recipes/engine/engine.go | 10 +- pkg/recipes/engine/engine_test.go | 14 +- pkg/recipes/engine/mock_engine.go | 6 +- pkg/recipes/engine/types.go | 6 +- pkg/recipes/error.go | 2 +- pkg/recipes/error_test.go | 2 +- pkg/recipes/recipecontext/context.go | 10 +- pkg/recipes/recipecontext/context_test.go | 4 +- pkg/recipes/recipecontext/types.go | 2 +- .../terraform/config/backends/kubernetes.go | 4 +- .../config/backends/kubernetes_test.go | 2 +- .../terraform/config/backends/mock_backend.go | 4 +- .../terraform/config/backends/types.go | 4 +- pkg/recipes/terraform/config/config.go | 10 +- pkg/recipes/terraform/config/config_test.go | 12 +- pkg/recipes/terraform/config/providers/aws.go | 20 +- .../terraform/config/providers/aws_test.go | 12 +- .../terraform/config/providers/azure.go | 20 +- .../terraform/config/providers/azure_test.go | 12 +- .../terraform/config/providers/kubernetes.go | 2 +- .../config/providers/kubernetes_test.go | 2 +- .../config/providers/mock_provider.go | 4 +- .../terraform/config/providers/types.go | 8 +- pkg/recipes/terraform/execute.go | 18 +- pkg/recipes/terraform/execute_test.go | 4 +- pkg/recipes/terraform/install.go | 4 +- pkg/recipes/terraform/mock_executor.go | 2 +- pkg/recipes/terraform/module.go | 4 +- pkg/recipes/terraform/module_test.go | 2 +- pkg/recipes/terraform/types.go | 6 +- pkg/recipes/types.go | 2 +- pkg/rp/frontend/resource_test.go | 6 +- pkg/rp/frontend/validator.go | 10 +- pkg/rp/frontend/validator_test.go | 12 +- pkg/rp/kube/kubernetesmetadata.go | 2 +- pkg/rp/kube/resources.go | 12 +- pkg/rp/kube/resources_test.go | 14 +- pkg/rp/util/application.go | 6 +- pkg/rp/util/datastore.go | 8 +- pkg/rp/util/environment.go | 6 +- pkg/rp/util/registry.go | 4 +- pkg/rp/v1/outputresource.go | 8 +- pkg/rp/v1/outputresource_test.go | 4 +- pkg/rp/v1/types.go | 2 +- .../resourcedeploymentoperationsclient.go | 2 +- pkg/sdk/clients/resourcedeploymentsclient.go | 2 +- pkg/trace/util.go | 2 +- .../aws_credential_conversion.go | 4 +- .../aws_credential_conversion_test.go | 6 +- .../azure_credential_conversion.go | 6 +- .../azure_credential_conversion_test.go | 8 +- .../plane_conversion.go | 6 +- .../plane_conversion_test.go | 10 +- .../resourcegroup_conversion.go | 6 +- .../resourcegroup_conversion_test.go | 10 +- pkg/ucp/aws/cloudcontrolclient.go | 2 +- pkg/ucp/aws/cloudformationclient.go | 2 +- pkg/ucp/aws/errorhandler.go | 4 +- pkg/ucp/aws/mock_awscloudcontrolclient.go | 2 +- pkg/ucp/aws/mock_awscloudformationclient.go | 2 +- .../aws/servicecontext/awsrequestcontext.go | 4 +- .../servicecontext/awsrequestcontext_test.go | 2 +- pkg/ucp/aws/ucpcredentialprovider.go | 4 +- pkg/ucp/aws/ucpcredentialprovider_test.go | 2 +- pkg/ucp/backend/service.go | 4 +- pkg/ucp/config/ucpoptions.go | 2 +- pkg/ucp/credentials/aws.go | 10 +- pkg/ucp/credentials/azure.go | 10 +- pkg/ucp/credentials/types.go | 2 +- pkg/ucp/data/etcd.go | 4 +- pkg/ucp/datamodel/awsresource.go | 2 +- .../converter/awscredential_converter.go | 6 +- .../converter/azurecredential_converter.go | 6 +- .../datamodel/converter/plane_converter.go | 6 +- .../converter/resourcegroup_converter.go | 6 +- pkg/ucp/datamodel/credential.go | 2 +- pkg/ucp/datamodel/plane.go | 2 +- pkg/ucp/datamodel/resourcegroup.go | 2 +- pkg/ucp/dataprovider/factory.go | 12 +- .../dataprovider/mock_datastorage_provider.go | 4 +- pkg/ucp/dataprovider/options.go | 2 +- pkg/ucp/dataprovider/storageprovider.go | 4 +- pkg/ucp/dataprovider/types.go | 4 +- pkg/ucp/frontend/api/routes.go | 22 +-- pkg/ucp/frontend/api/routes_test.go | 8 +- pkg/ucp/frontend/api/server.go | 46 ++--- pkg/ucp/frontend/aws/module.go | 6 +- pkg/ucp/frontend/aws/routes.go | 30 +-- pkg/ucp/frontend/aws/routes_test.go | 16 +- pkg/ucp/frontend/azure/module.go | 4 +- pkg/ucp/frontend/azure/routes.go | 20 +- pkg/ucp/frontend/azure/routes_test.go | 16 +- .../controller/awsproxy/awsparsing.go | 12 +- .../controller/awsproxy/awsparsing_test.go | 2 +- .../controller/awsproxy/awsproxytest.go | 4 +- .../awsproxy/createorupdateawsresource.go | 16 +- .../createorupdateawsresource_test.go | 8 +- .../createorupdateawsresourcewithpost.go | 18 +- .../createorupdateawsresourcewithpost_test.go | 8 +- .../controller/awsproxy/deleteawsresource.go | 14 +- .../awsproxy/deleteawsresource_test.go | 6 +- .../awsproxy/deleteawsresourcewithpost.go | 18 +- .../deleteawsresourcewithpost_test.go | 6 +- .../awsproxy/getawsoperationresults.go | 14 +- .../awsproxy/getawsoperationresults_test.go | 8 +- .../awsproxy/getawsoperationstatuses.go | 16 +- .../awsproxy/getawsoperationstatuses_test.go | 10 +- .../controller/awsproxy/getawsresource.go | 14 +- .../awsproxy/getawsresource_test.go | 12 +- .../awsproxy/getawsresourcewithpost.go | 20 +- .../awsproxy/getawsresourcewithpost_test.go | 12 +- .../controller/awsproxy/listawsresources.go | 14 +- .../awsproxy/listawsresources_test.go | 10 +- .../aws/createorupdateawscredential.go | 14 +- .../aws/createorupdateawscredential_test.go | 18 +- .../credentials/aws/deleteawscredential.go | 20 +- .../aws/deleteawscredential_test.go | 16 +- .../azure/createorupdateazurecredential.go | 14 +- .../createorupdateazurecredential_test.go | 18 +- .../azure/deleteazurecredential.go | 18 +- .../azure/deleteazurecredential_test.go | 14 +- .../frontend/controller/credentials/utils.go | 4 +- .../controller/credentials/utils_test.go | 2 +- .../controller/kubernetes/discoverydoc.go | 6 +- .../controller/kubernetes/openapiv2doc.go | 6 +- .../controller/kubernetes/openapiv3doc.go | 6 +- .../frontend/controller/planes/listplanes.go | 14 +- .../controller/planes/listplanes_test.go | 16 +- .../controller/planes/listplanesbytype.go | 18 +- .../planes/listplanesbytype_test.go | 16 +- .../frontend/controller/planes/proxyplane.go | 18 +- .../resourcegroups/listresourcegroups.go | 16 +- .../resourcegroups/listresourcegroups_test.go | 16 +- pkg/ucp/frontend/modules/errors.go | 4 +- pkg/ucp/frontend/modules/types.go | 12 +- pkg/ucp/frontend/radius/module.go | 4 +- pkg/ucp/frontend/radius/routes.go | 20 +- pkg/ucp/frontend/radius/routes_test.go | 16 +- pkg/ucp/hosting/asyncvalue_test.go | 2 +- pkg/ucp/hosting/hosting_test.go | 2 +- pkg/ucp/hostoptions/hostoptions.go | 2 +- pkg/ucp/hostoptions/providerconfig.go | 18 +- pkg/ucp/integrationtests/aws/awstest.go | 12 +- .../aws/createresource_test.go | 4 +- .../aws/createresourcewithpost_test.go | 4 +- .../aws/deleteresource_test.go | 4 +- .../aws/deleteresourcewithpost_test.go | 4 +- .../integrationtests/aws/getresource_test.go | 4 +- .../aws/getresourcewithpost_test.go | 4 +- .../aws/listresources_test.go | 4 +- .../aws/operationresults_test.go | 4 +- .../aws/operationstatuses_test.go | 4 +- .../aws/updateresource_test.go | 4 +- .../aws/updateresourcewithpost_test.go | 4 +- pkg/ucp/integrationtests/azure/proxy_test.go | 12 +- pkg/ucp/integrationtests/handler_test.go | 4 +- pkg/ucp/integrationtests/planes/aws_test.go | 8 +- .../integrationtests/planes/planes_test.go | 4 +- .../integrationtests/planes/radius_test.go | 6 +- .../planes/validation_test.go | 10 +- pkg/ucp/integrationtests/radius/proxy_test.go | 12 +- .../resourcegroups/resourcegroups_test.go | 6 +- .../integrationtests/testserver/testserver.go | 32 ++-- pkg/ucp/proxy/arm_test.go | 4 +- pkg/ucp/proxy/policy.go | 4 +- pkg/ucp/proxy/types.go | 6 +- pkg/ucp/proxy/types_test.go | 2 +- pkg/ucp/queue/apiserver/client.go | 4 +- pkg/ucp/queue/apiserver/client_test.go | 10 +- pkg/ucp/queue/client/client.go | 4 +- pkg/ucp/queue/client/mock_client.go | 2 +- pkg/ucp/queue/inmemory/client.go | 2 +- pkg/ucp/queue/inmemory/client_test.go | 4 +- pkg/ucp/queue/inmemory/queue.go | 2 +- pkg/ucp/queue/inmemory/queue_test.go | 2 +- pkg/ucp/queue/provider/factory.go | 10 +- pkg/ucp/queue/provider/provider.go | 4 +- pkg/ucp/resources/aws/aws.go | 2 +- pkg/ucp/resources/aws/aws_test.go | 2 +- pkg/ucp/resources/azure/azure.go | 2 +- pkg/ucp/resources/id_test.go | 4 +- pkg/ucp/resources/kubernetes/kubernetes.go | 2 +- pkg/ucp/resources/radius/radius.go | 2 +- pkg/ucp/resources/radius/radius_test.go | 2 +- pkg/ucp/secret/client.go | 2 +- pkg/ucp/secret/etcd/client.go | 4 +- pkg/ucp/secret/etcd/client_test.go | 8 +- pkg/ucp/secret/kubernetes/client.go | 4 +- pkg/ucp/secret/kubernetes/client_test.go | 4 +- pkg/ucp/secret/mock_client.go | 2 +- pkg/ucp/secret/provider/factory.go | 14 +- pkg/ucp/secret/provider/options.go | 2 +- pkg/ucp/secret/provider/provider.go | 2 +- pkg/ucp/server/server.go | 40 ++-- .../store/apiserverstore/apiserverclient.go | 12 +- .../apiserverstore/apiserverclient_test.go | 14 +- pkg/ucp/store/client.go | 2 +- .../store/cosmosdb/cosmosdbstorageclient.go | 8 +- .../cosmosdb/cosmosdbstorageclient_test.go | 10 +- pkg/ucp/store/cosmosdb/options.go | 2 +- pkg/ucp/store/cosmosdb/util.go | 6 +- pkg/ucp/store/cosmosdb/util_test.go | 4 +- pkg/ucp/store/etcdstore/etcdclient.go | 8 +- pkg/ucp/store/etcdstore/etcdclient_test.go | 8 +- pkg/ucp/store/map_test.go | 2 +- pkg/ucp/store/mock_storageClient.go | 2 +- pkg/ucp/store/storeutil/id.go | 4 +- pkg/ucp/store/storeutil/id_test.go | 4 +- pkg/ucp/ucplog/log.go | 2 +- pkg/validator/apivalidator.go | 8 +- pkg/validator/apivalidator_test.go | 6 +- pkg/validator/loader.go | 2 +- pkg/validator/loader_test.go | 2 +- pkg/validator/validator.go | 6 +- pkg/validator/validator_test.go | 2 +- pkg/version/version.go | 2 +- .../dapr_component_name_conflict_test.go | 8 +- test/functional/daprrp/dapr_pubsub_test.go | 8 +- .../daprrp/dapr_secretstore_test.go | 8 +- .../daprrp/dapr_serviceinvocation_test.go | 8 +- .../functional/daprrp/dapr_statestore_test.go | 8 +- .../resources/microsoftsql_test.go | 8 +- .../datastoresrp/resources/mongodb_test.go | 12 +- .../datastoresrp/resources/redis_test.go | 8 +- .../datastoresrp/resources/sql_test.go | 8 +- .../messagingrp/resources/rabbitmq_test.go | 8 +- test/functional/samples/README.md | 2 +- test/functional/samples/tutorial_test.go | 16 +- test/functional/shared/api_test.go | 12 +- test/functional/shared/cli/cli_test.go | 24 +-- .../shared/mechanics/aws_mechanics_test.go | 6 +- .../mechanics/k8s_extensibility_test.go | 6 +- .../shared/mechanics/mechanics_test.go | 10 +- .../resources/application_environment_test.go | 6 +- .../shared/resources/application_test.go | 6 +- .../aws_multi_identifier_resource_test.go | 6 +- .../shared/resources/aws_s3_bucket_test.go | 6 +- .../resources/azure_connections_test.go | 8 +- .../resources/container_runtimes_test.go | 8 +- .../shared/resources/container_test.go | 8 +- .../resources/container_versioning_test.go | 8 +- .../shared/resources/environment_test.go | 6 +- .../shared/resources/extender_test.go | 8 +- .../shared/resources/gateway_test.go | 8 +- .../resources/kubemetadata_container_test.go | 8 +- .../resources/kubemetadata_gateway_test.go | 8 +- .../resources/kubemetadata_httproute_test.go | 8 +- .../resources/kubmetadata_cascade_test.go | 8 +- .../resources/persistent_volume_test.go | 8 +- .../shared/resources/recipe_bicep_test.go | 18 +- .../shared/resources/recipe_terraform_test.go | 12 +- .../shared/resources/recipe_test.go | 10 +- .../shared/resources/storage_test.go | 8 +- .../resources/testdata/manifest/sidecar.yaml | 2 +- test/functional/shared/rptest.go | 12 +- test/functional/shared/test.go | 20 +- test/functional/ucp/aws_credential_test.go | 2 +- test/functional/ucp/aws_test.go | 12 +- test/functional/ucp/azure_credential_test.go | 4 +- test/functional/ucp/plane_test.go | 8 +- test/functional/ucp/proxy_test.go | 8 +- test/functional/ucp/resourcegroup_test.go | 8 +- test/functional/ucp/ucptest.go | 10 +- test/magpiego/go.mod | 2 +- test/magpiego/server.go | 2 +- test/options.go | 4 +- test/radcli/cli.go | 2 +- test/radcli/shared.go | 26 +-- test/step/deployerrorexecutor.go | 6 +- test/step/deployexecutor.go | 4 +- test/step/interface.go | 2 +- test/testutil/resourcetypeutil/types.go | 2 +- test/ucp/kubeenv/testenv.go | 2 +- test/ucp/queuetest/shared.go | 4 +- test/ucp/storetest/shared.go | 8 +- test/validation/aws.go | 8 +- test/validation/k8s.go | 4 +- test/validation/shared.go | 6 +- 818 files changed, 3999 insertions(+), 3999 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4a28177984..5d41091fcc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,4 +6,4 @@ # All of the people (and only those people) from the matching rule will be notified # Default rule: anything that doesn't match a more specific rule goes here -* @project-radius/Radius-Eng +* @radius-project/Radius-Eng diff --git a/.github/runners/runner-deployment.yaml b/.github/runners/runner-deployment.yaml index edd56b8143..85a4fcf5c2 100644 --- a/.github/runners/runner-deployment.yaml +++ b/.github/runners/runner-deployment.yaml @@ -6,7 +6,7 @@ spec: replicas: 12 template: spec: - organization: project-radius + organization: radius-project dockerdWithinRunnerContainer: true image: summerwind/actions-runner-dind nodeSelector: diff --git a/.github/scripts/radius-bot.js b/.github/scripts/radius-bot.js index 56af7dfb35..bde529465a 100644 --- a/.github/scripts/radius-bot.js +++ b/.github/scripts/radius-bot.js @@ -64,7 +64,7 @@ async function cmdOkToTest(github, issue, isFromPulls, username) { } // Check if the user has permission to trigger e2e test with an issue comment - const org = 'project-radius'; + const org = 'radius-project'; console.log(`Checking team membership for: ${username}`); const isMember = await checkTeamMembership(github, org, process.env.TEAM_SLUG, username); if (!isMember) { diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e99e2cda62..f6584bc1f2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,14 +42,14 @@ env: GOTESTSUMVERSION: 1.10.0 # Use radiusdev.azurecr.io for PR build. Otherwise, use radius.azurecr.io. - # TODO_LAUNCH: Remove this variable when we opensource the repo - https://github.com/project-radius/radius/issues/5892 + # TODO_LAUNCH: Remove this variable when we opensource the repo - https://github.com/radius-project/radius/issues/5892 DOCKER_REGISTRY: ${{ github.event_name == 'pull_request' && 'radiusdev.azurecr.io' || 'radius.azurecr.io' }} # GitHub Actor for pushing images to GHCR GHCR_ACTOR: rad-ci-bot # Container registry url for GitHub container registry. - CONTAINER_REGISTRY: ${{ github.event_name == 'pull_request' && 'ghcr.io/project-radius/dev' || 'ghcr.io/project-radius/radius' }} + CONTAINER_REGISTRY: ${{ github.event_name == 'pull_request' && 'ghcr.io/radius-project/dev' || 'ghcr.io/radius-project/radius' }} # Local file path to the release binaries. RELEASE_PATH: ./release @@ -126,7 +126,7 @@ jobs: with: name: rad_cli_release path: ${{ env.RELEASE_PATH }} - # TOOD_LAUNCH: Remove this step when we opensource the repo - https://github.com/project-radius/radius/issues/5892 + # TOOD_LAUNCH: Remove this step when we opensource the repo - https://github.com/radius-project/radius/issues/5892 - name: Upload CLI binary uses: actions/upload-artifact@v3 with: @@ -211,7 +211,7 @@ jobs: # - tag the image with the PR version if the trigger was a PR # - push the image for pushes to master, or to a tag - # TODO_LAUNCH: Remove 'image' job when we opensource the repo - https://github.com/project-radius/radius/issues/5892 + # TODO_LAUNCH: Remove 'image' job when we opensource the repo - https://github.com/radius-project/radius/issues/5892 images: name: Container image build runs-on: ubuntu-latest @@ -318,7 +318,7 @@ jobs: HELM_PACKAGE_DIR: helm HELM_CHARTS_DIR: deploy/Chart OCI_REGISTRY: ghcr.io - OCI_REPOSITORY: ${{ startsWith(github.ref, 'refs/tags/v') && 'project-radius/helm-chart' || 'project-radius/dev/helm-chart' }} + OCI_REPOSITORY: ${{ startsWith(github.ref, 'refs/tags/v') && 'radius-project/helm-chart' || 'radius-project/dev/helm-chart' }} steps: - name: Checkout uses: actions/checkout@v3 @@ -388,7 +388,7 @@ jobs: --verify-tag env: GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT }} - # TODO_LAUNCH: Remove this job once we opensource - https://github.com/project-radius/radius/issues/5892 + # TODO_LAUNCH: Remove this job once we opensource - https://github.com/radius-project/radius/issues/5892 publish: name: Publish rad CLI binaries needs: [ 'build' ] diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 162655903c..b9cc404bf0 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -18,7 +18,7 @@ jobs: issue-number: ${{ github.event.pull_request.number }} body: | You are editing files which require a docs update. Please ensure you've made the appropriate changes to the docs and submitted a PR. - - Swagger changes require reference edge docs to be updated [here](https://github.com/project-radius/docs/tree/edge/docs/content/reference/resource-schema) + - Swagger changes require reference edge docs to be updated [here](https://github.com/radius-project/docs/tree/edge/docs/content/reference/resource-schema) - Make sure to create a branch and submit a PR into the edge branch instead of the default latest branch, as the swagger changes will not be available until the next release. For more information on contributing to docs please visit https://docs.radapp.dev/contributing/docs/. diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index 2a6c592d53..174ec46541 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -51,9 +51,9 @@ env: # Azure workload identity webhook chart version AZURE_WORKLOAD_IDENTITY_WEBHOOK_VER: '1.1.0' # Container registry for storing test images and recipes - CACHE_REGISTRY: ghcr.io/project-radius/dev + CACHE_REGISTRY: ghcr.io/radius-project/dev # Container registry for storing recipe artifacts - # TODO_LAUNCH: Change it to ghcr.io/project-radius/dev - https://github.com/project-radius/radius/issues/5892 + # TODO_LAUNCH: Change it to ghcr.io/radius-project/dev - https://github.com/radius-project/radius/issues/5892 BICEP_RECIPE_REGISTRY: radiusdev.azurecr.io # The radius functional test timeout FUNCTIONALTEST_TIMEOUT: 60m @@ -317,7 +317,7 @@ jobs: uses: actions/checkout@v3 if: matrix.name == 'samples' with: - repository: project-radius/samples + repository: radius-project/samples ref: refs/heads/edge token: ${{ secrets.GH_RAD_CI_BOT_PAT }} path: samples @@ -472,7 +472,7 @@ jobs: rad credential register aws \ --access-key-id ${{ secrets.FUNCTEST_AWS_ACCESS_KEY_ID }} --secret-access-key ${{ secrets.FUNCTEST_AWS_SECRET_ACCESS_KEY }} - # TODO_LAUNCH: Remove this login once we move recipe to GHCR - https://github.com/project-radius/radius/issues/5892 + # TODO_LAUNCH: Remove this login once we move recipe to GHCR - https://github.com/radius-project/radius/issues/5892 az acr login -n ${{ env.BICEP_RECIPE_REGISTRY }} - uses: marocchino/sticky-pull-request-comment@v2 if: failure() && env.PR_NUMBER != '' diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml index 42b434cf48..23d81019c7 100644 --- a/.github/workflows/issues.yaml +++ b/.github/workflows/issues.yaml @@ -16,8 +16,8 @@ jobs: ISSUE: ${{ github.event.issue.html_url }} AUTHOR: ${{ github.actor }} run: | - MEMBERS=$(gh api orgs/project-radius/teams/Radius-Preview/members | jq -r '.[] | .login') - ADMINS=$(gh api orgs/project-radius/teams/Radius-Admin/members | jq -r '.[] | .login') + MEMBERS=$(gh api orgs/radius-project/teams/Radius-Preview/members | jq -r '.[] | .login') + ADMINS=$(gh api orgs/radius-project/teams/Radius-Admin/members | jq -r '.[] | .login') for USER in $MEMBERS; do if [[ "$USER" == "$AUTHOR" ]]; then ISADMIN=false diff --git a/.github/workflows/publish-bicep.yaml b/.github/workflows/publish-bicep.yaml index 371bdb5094..60ffc2ca08 100644 --- a/.github/workflows/publish-bicep.yaml +++ b/.github/workflows/publish-bicep.yaml @@ -74,25 +74,25 @@ jobs: exit 1 - id: get_radius_commit_hash - name: Get commit hash (project-radius/radius) + name: Get commit hash (radius-project/radius) run: | echo "commit_hash_short=$(git rev-parse HEAD --short)" >> $GITHUB_OUTPUT - echo "gh_uri=https://github.com/project-radius/radius/tree/$(git rev-parse HEAD)/hack/bicep-types-radius/generated" >> $GITHUB_OUTPUT + echo "gh_uri=https://github.com/radius-project/radius/tree/$(git rev-parse HEAD)/hack/bicep-types-radius/generated" >> $GITHUB_OUTPUT - - name: Clone https://github.com/project-radius/bicep + - name: Clone https://github.com/radius-project/bicep uses: actions/checkout@v3 with: token: ${{ secrets.GH_RAD_CI_BOT_PAT }} - repository: project-radius/bicep + repository: radius-project/bicep path: workflow-temp/bicep ref: bicep-extensibility - - name: Copy generated files to project-radius/bicep repo + - name: Copy generated files to radius-project/bicep repo run: | mkdir -p workflow-temp/bicep/src/Bicep.Types.Radius/generated cp -R hack/bicep-types-radius/generated/* workflow-temp/bicep/src/Bicep.Types.Radius/generated - - name: Create Pull Request in project-radius/bicep repo + - name: Create Pull Request in radius-project/bicep repo uses: peter-evans/create-pull-request@v4 with: path: workflow-temp/bicep @@ -106,7 +106,7 @@ jobs: Update Radius extensibility provider for Bicep body: | ## Autogenerated Report - - Updates Bicep extensibility type definitions generated from [project-radius/radius](${{ steps.get_radius_commit_hash.outputs.gh_uri }}) + - Updates Bicep extensibility type definitions generated from [radius-project/radius](${{ steps.get_radius_commit_hash.outputs.gh_uri }}) commit-message: | update generated types from ${{ steps.get_radius_commit_hash.outputs.gh_uri }} labels: | diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index b6d805cdfd..6df36b7d84 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -18,12 +18,12 @@ jobs: runs-on: ubuntu-latest env: GOVER: '^1.21' - GOPRIVATE: github.com/project-radius + GOPRIVATE: github.com/radius-project steps: - name: Checkout radius repository uses: actions/checkout@v3 with: - repository: project-radius/radius + repository: radius-project/radius path: radius - name: Parse release version and set environment variables run: python radius/.github/scripts/get_release_version.py @@ -37,7 +37,7 @@ jobs: - name: Checkout docs repository uses: actions/checkout@v3 with: - repository: project-radius/docs + repository: radius-project/docs path: docs ref: ${{ env.DOCS_BRANCH }} token: ${{ secrets.GH_RAD_CI_BOT_PAT }} diff --git a/.github/workflows/purge-test-resources.yaml b/.github/workflows/purge-test-resources.yaml index 80737749fe..b5cbfe0279 100644 --- a/.github/workflows/purge-test-resources.yaml +++ b/.github/workflows/purge-test-resources.yaml @@ -35,7 +35,7 @@ jobs: image-names: dev/* cut-off: 3 days ago UTC account-type: org - org-name: project-radius + org-name: radius-project token: ${{ secrets.GH_RAD_CI_BOT_PAT }} purge_azure_resources: name: Azure resources clean-ups diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f0c8710ae1..72eae60ad5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,7 +39,7 @@ jobs: env: RELNOTE_FOUND: false steps: - - name: Checkout project-radius/radius + - name: Checkout radius-project/radius uses: actions/checkout@v3 - name: Get supported versions from versions.yaml id: get-supported-versions @@ -110,7 +110,7 @@ jobs: ## :warning: Missing release note :warning: This is the official Radius release. Create the release note by following instruction: - 1. Create ./docs/release-notes/${{ steps.get-version.outputs.release-version }}.md from [release note template](https://github.com/project-radius/radius/blob/main/docs/release-notes/template.md) + 1. Create ./docs/release-notes/${{ steps.get-version.outputs.release-version }}.md from [release note template](https://github.com/radius-project/radius/blob/main/docs/release-notes/template.md) 2. Update the each section and add the above Change logs to the end of release note. 3. Push release note changes to the PR branch. - name: Stop the workflow if release is the offical and its release note is not found. @@ -121,31 +121,31 @@ jobs: if: github.event_name == 'push' runs-on: ubuntu-latest steps: - - name: Checkout project-radius/radius@main + - name: Checkout radius-project/radius@main uses: actions/checkout@v3 with: - repository: project-radius/radius + repository: radius-project/radius ref: main token: ${{ secrets.GH_RAD_CI_BOT_PAT }} path: radius - - name: Checkout project-radius/bicep@bicep-extensibility + - name: Checkout radius-project/bicep@bicep-extensibility uses: actions/checkout@v3 with: - repository: project-radius/bicep + repository: radius-project/bicep ref: bicep-extensibility token: ${{ secrets.GH_RAD_CI_BOT_PAT }} path: bicep - - name: Checkout project-radius/deployment-engine@main + - name: Checkout radius-project/deployment-engine@main uses: actions/checkout@v3 with: - repository: project-radius/deployment-engine + repository: radius-project/deployment-engine ref: main token: ${{ secrets.GH_RAD_CI_BOT_PAT }} path: deployment-engine - - name: Checkout project-radius/recipes@main + - name: Checkout radius-project/recipes@main uses: actions/checkout@v3 with: - repository: project-radius/recipes + repository: radius-project/recipes ref: main token: ${{ secrets.GH_RAD_CI_BOT_PAT }} path: recipes @@ -171,19 +171,19 @@ jobs: echo "* Desired release tag: ${{ steps.get-version.outputs.release-version }}" >> $GITHUB_STEP_SUMMARY echo "* Desired release branch: ${{ steps.get-version.outputs.release-branch-name }}" >> $GITHUB_STEP_SUMMARY echo "* Release date: $(date)" >> $GITHUB_STEP_SUMMARY - - name: Release project-radius/radius version ${{ steps.get-version.outputs.release-version }} + - name: Release radius-project/radius version ${{ steps.get-version.outputs.release-version }} run: | ./radius/.github/scripts/release-create-tag-and-branch.sh radius ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} if: success() - - name: Release project-radius/bicep version ${{ steps.get-version.outputs.release-version }} + - name: Release radius-project/bicep version ${{ steps.get-version.outputs.release-version }} run: | ./radius/.github/scripts/release-create-tag-and-branch.sh bicep ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} if: success() - - name: Release project-radius/deployment-engine version ${{ steps.get-version.outputs.release-version }} + - name: Release radius-project/deployment-engine version ${{ steps.get-version.outputs.release-version }} run: | ./radius/.github/scripts/release-create-tag-and-branch.sh deployment-engine ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} if: success() - - name: Release project-radius/recipes version ${{ steps.get-version.outputs.release-version }} + - name: Release radius-project/recipes version ${{ steps.get-version.outputs.release-version }} run: | ./radius/.github/scripts/release-create-tag-and-branch.sh recipes ${{ steps.get-version.outputs.release-version }} ${{ steps.get-version.outputs.release-branch-name }} if: success() diff --git a/.github/workflows/validate-bicep.yaml b/.github/workflows/validate-bicep.yaml index 015b4194df..9b1d4c7681 100644 --- a/.github/workflows/validate-bicep.yaml +++ b/.github/workflows/validate-bicep.yaml @@ -38,15 +38,15 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.GH_RAD_CI_BOT_PAT }} - repository: project-radius/docs - path: temp/project-radius/docs + repository: radius-project/docs + path: temp/radius-project/docs ref: edge - name: Clone samples repo uses: actions/checkout@v3 with: token: ${{ secrets.GH_RAD_CI_BOT_PAT }} - repository: project-radius/samples - path: temp/project-radius/samples + repository: radius-project/samples + path: temp/radius-project/samples ref: edge - name: Setup Azure CLI run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 930784ca77..3778301523 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,7 +7,7 @@ "command": "bash", "args": [ "-c", - "(test -d ../deployment-engine/src && test -d ../deployment-engine/submodules/bicep-extensibility/src) || { echo >&1 \"The project-radius/deployment-engine is not cloned as a sibling to the radius repo or is missing submodules. Please clone the project-radius/deployment-engine repo next to the Radius repo and run git submodule update --init and try again.\"; exit 1; }" + "(test -d ../deployment-engine/src && test -d ../deployment-engine/submodules/bicep-extensibility/src) || { echo >&1 \"The radius-project/deployment-engine is not cloned as a sibling to the radius repo or is missing submodules. Please clone the radius-project/deployment-engine repo next to the Radius repo and run git submodule update --init and try again.\"; exit 1; }" ], "type": "shell", "options": { @@ -23,7 +23,7 @@ }, { "label": "Build Deployment Engine", - "detail": "Builds the Deployment Engine. This requires the project-radius/deployment engine repo to be cloned as a sibling to the project-radius/radius repo", + "detail": "Builds the Deployment Engine. This requires the radius-project/deployment engine repo to be cloned as a sibling to the radius-project/radius repo", "dependsOn": ["Check for Deployment Engine"], "command": "dotnet build", "type": "shell", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1ef5943ba..4e20c58262 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,25 +7,25 @@ Radius is in an early phase of development right now. We welcome feedback in the You can find our full **contributor documentation** including instructions at the following links: - [How to contribute](./docs/contributing/how-to.md) -- [See "good first issues"](https://github.com/project-radius/radius/issues?q=is:issue+is:open+label:%22good+first+issue%22) +- [See "good first issues"](https://github.com/radius-project/radius/issues?q=is:issue+is:open+label:%22good+first+issue%22) - [Install prerequisites](./docs/contributing/contributing-code/contributing-code-prerequisites/) - [Create your first commit (full walkthrough)](./contributing-code-first-commit/first-commit-00-prerequisites.md) - [Building the repo](./docs/contributing/contributing-code/contributing-code-building/) - [Understanding repo organiztion](./docs/contributing/contributing-code/contributing-code-organization/) - [Contribute to issues](./docs/contributing/contributing-issues/) - [Create pull requests](./docs/contributing/contributing-pull-requests/) -- [Contribute to documentation](https://github.com/project-radius/docs) +- [Contribute to documentation](https://github.com/radius-project/docs) ## Current status We welcome small pull request contributions from anyone (docs improvements, bug fixes, minor features.) as long as they follow a few guidelines: - For very minor changes like correcting a typo feel free to send a pull request. Otherwise ... -- Please start by [choosing an existing issue](https://github.com/project-radius/radius/issues), or [opening an issue](https://github.com/project-radius/radius/issues/new/choose) to work on. +- Please start by [choosing an existing issue](https://github.com/radius-project/radius/issues), or [opening an issue](https://github.com/radius-project/radius/issues/new/choose) to work on. - The maintainers will respond to your issue, please work with the maintainers to ensure that what you're doing is in scope for the project before writing any code. - If you have any doubt whether a contribution would be valuable, feel free to ask. ## Code of conduct This project has adopted the [Contributor Covenant](http://contributor-covenant.org/). -For more information see [CODE_OF_CONDUCT.md](https://github.com/project-radius/community/blob/main/CODE-OF-CONDUCT.md) +For more information see [CODE_OF_CONDUCT.md](https://github.com/radius-project/community/blob/main/CODE-OF-CONDUCT.md) diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 27e8523afb..67b40ec176 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -2,4 +2,4 @@ ## Code of Conduct -This project has adopted the [Contributor Covenant Code of Conduct](https://github.com/project-radius/community/blob/main/CODE-OF-CONDUCT.md). \ No newline at end of file +This project has adopted the [Contributor Covenant Code of Conduct](https://github.com/radius-project/community/blob/main/CODE-OF-CONDUCT.md). \ No newline at end of file diff --git a/README.md b/README.md index f3503a99a6..e0d0643208 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Radius is currently in an invitation-only private release and we are working har ## Quickstarts and samples -See the [Radius quickstarts](https://docs.radapp.dev/getting-started/quickstarts/) and [samples repository](https://github.com/project-radius/samples) for tutorials and code examples that can help you get started with Radius. +See the [Radius quickstarts](https://docs.radapp.dev/getting-started/quickstarts/) and [samples repository](https://github.com/radius-project/samples) for tutorials and code examples that can help you get started with Radius. ## Getting help @@ -37,7 +37,7 @@ See the [Radius quickstarts](https://docs.radapp.dev/getting-started/quickstarts ## Community -We welcome your contributions and suggestions! One of the easiest ways to contribute is to participate in Issue discussions, chat on [Discord server](https://discord.gg/SRG3ePMKNy) or the monthly [community calls](#community-calls). For more information on the community engagement, developer and contributing guidelines and more, head over to the [Radius community repo](https://github.com/project-radius/community). +We welcome your contributions and suggestions! One of the easiest ways to contribute is to participate in Issue discussions, chat on [Discord server](https://discord.gg/SRG3ePMKNy) or the monthly [community calls](#community-calls). For more information on the community engagement, developer and contributing guidelines and more, head over to the [Radius community repo](https://github.com/radius-project/community). ### Contact us @@ -47,7 +47,7 @@ Please visit our [Discord server](https://discord.gg/SRG3ePMKNy) to contact us a Every month we host a community call to showcase new features, review upcoming milestones, and engage in a Q&A. All are welcome! -📞 Visit our [community meetings](https://github.com/project-radius/community/#community-meetings) page for upcoming dates and the meeting link. +📞 Visit our [community meetings](https://github.com/radius-project/community/#community-meetings) page for upcoming dates and the meeting link. ## Contributing to Radius @@ -57,17 +57,17 @@ To contribute to Radius documentation visit [Radius documentation](https://docs. ## Repositories -[Radius](https://github.com/project-radius/radius) is the main Radius repository. It contains all of Radius code and documentation. +[Radius](https://github.com/radius-project/radius) is the main Radius repository. It contains all of Radius code and documentation. In addition, we have the below repositories. | Repo | Description | |:-----|:------------| -| [Docs](https://github.com/project-radius/docs) | This repository contains the Radius documentation source for Radius. -| [Samples](https://github.com/project-radius/samples) | This repository contains the source code for quickstarts, reference apps, and tutorials for Radius. -| [Recipes](https://github.com/project-radius/recipes) | This repo contains commonly used Recipe templates for Radius environments. -| [Website](https://github.com/project-radius/website) | This repository contains the source code for the Radius website. -| [Bicep](https://github.com/project-radius/bicep) | This repository contains source code for Bicep, which is a DSL for deploying cloud resources types. -| [AWS Bicep Types](https://github.com/project-radius/bicep-types-aws) | This repository contains the tooling for Bicep support for AWS resource types. +| [Docs](https://github.com/radius-project/docs) | This repository contains the Radius documentation source for Radius. +| [Samples](https://github.com/radius-project/samples) | This repository contains the source code for quickstarts, reference apps, and tutorials for Radius. +| [Recipes](https://github.com/radius-project/recipes) | This repo contains commonly used Recipe templates for Radius environments. +| [Website](https://github.com/radius-project/website) | This repository contains the source code for the Radius website. +| [Bicep](https://github.com/radius-project/bicep) | This repository contains source code for Bicep, which is a DSL for deploying cloud resources types. +| [AWS Bicep Types](https://github.com/radius-project/bicep-types-aws) | This repository contains the tooling for Bicep support for AWS resource types. ## Security diff --git a/build/build.mk b/build/build.mk index b8e9f12076..16f7fe77d8 100644 --- a/build/build.mk +++ b/build/build.mk @@ -14,7 +14,7 @@ # limitations under the License. # ------------------------------------------------------------ -BASE_PACKAGE_NAME := github.com/project-radius/radius +BASE_PACKAGE_NAME := github.com/radius-project/radius OUT_DIR := ./dist GOOS ?= $(shell go env GOOS) diff --git a/build/docker.mk b/build/docker.mk index 5413d2b84c..6c9a917c94 100644 --- a/build/docker.mk +++ b/build/docker.mk @@ -16,7 +16,7 @@ DOCKER_REGISTRY?=$(shell whoami) DOCKER_TAG_VERSION?=latest -IMAGE_SRC?=https://github.com/project-radius/radius +IMAGE_SRC?=https://github.com/radius-project/radius ##@ Docker Images diff --git a/build/test.mk b/build/test.mk index fa1d7c5517..e87c9ee739 100644 --- a/build/test.mk +++ b/build/test.mk @@ -86,7 +86,7 @@ oav-installed: @which oav > /dev/null || { echo "run 'npm install -g oav' to install oav"; exit 1; } @echo "$(ARROW) OK" -# TODO re-enable https://github.com/project-radius/radius/issues/5091 +# TODO re-enable https://github.com/radius-project/radius/issues/5091 .PHONY: test-ucp-spec-examples test-ucp-spec-examples: oav-installed ## Validates UCP examples conform to UCP OpenAPI Spec # @echo "$(ARROW) Testing x-ms-examples conform to ucp spec..." diff --git a/cmd/applications-rp/main.go b/cmd/applications-rp/main.go index 85f951af88..076930b086 100644 --- a/cmd/applications-rp/main.go +++ b/cmd/applications-rp/main.go @@ -25,20 +25,20 @@ import ( "os/signal" "syscall" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/corerp/backend" - "github.com/project-radius/radius/pkg/corerp/frontend" - metricsservice "github.com/project-radius/radius/pkg/metrics/service" - profilerservice "github.com/project-radius/radius/pkg/profiler/service" - "github.com/project-radius/radius/pkg/trace" - - "github.com/project-radius/radius/pkg/logging" - pr_backend "github.com/project-radius/radius/pkg/portableresources/backend" - pr_frontend "github.com/project-radius/radius/pkg/portableresources/frontend" - "github.com/project-radius/radius/pkg/ucp/data" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/corerp/backend" + "github.com/radius-project/radius/pkg/corerp/frontend" + metricsservice "github.com/radius-project/radius/pkg/metrics/service" + profilerservice "github.com/radius-project/radius/pkg/profiler/service" + "github.com/radius-project/radius/pkg/trace" + + "github.com/radius-project/radius/pkg/logging" + pr_backend "github.com/radius-project/radius/pkg/portableresources/backend" + pr_frontend "github.com/radius-project/radius/pkg/portableresources/frontend" + "github.com/radius-project/radius/pkg/ucp/data" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/ucplog" "github.com/go-logr/logr" etcdclient "go.etcd.io/etcd/client/v3" diff --git a/cmd/docgen/main.go b/cmd/docgen/main.go index b1e679d454..ed5c62dc86 100644 --- a/cmd/docgen/main.go +++ b/cmd/docgen/main.go @@ -24,7 +24,7 @@ import ( "path/filepath" "strings" - "github.com/project-radius/radius/cmd/rad/cmd" + "github.com/radius-project/radius/cmd/rad/cmd" "github.com/spf13/cobra/doc" ) diff --git a/cmd/rad/cmd/bicepDelete.go b/cmd/rad/cmd/bicepDelete.go index a5049811bd..5676f6e42e 100644 --- a/cmd/rad/cmd/bicepDelete.go +++ b/cmd/rad/cmd/bicepDelete.go @@ -17,8 +17,8 @@ limitations under the License. package cmd import ( - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/output" "github.com/spf13/cobra" ) diff --git a/cmd/rad/cmd/bicepDownload.go b/cmd/rad/cmd/bicepDownload.go index c4bf15bf88..91bbe4e433 100644 --- a/cmd/rad/cmd/bicepDownload.go +++ b/cmd/rad/cmd/bicepDownload.go @@ -19,9 +19,9 @@ package cmd import ( "fmt" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/version" "github.com/spf13/cobra" ) diff --git a/cmd/rad/cmd/debuglogs.go b/cmd/rad/cmd/debuglogs.go index 952e6ae4d1..7a296578b4 100644 --- a/cmd/rad/cmd/debuglogs.go +++ b/cmd/rad/cmd/debuglogs.go @@ -24,10 +24,10 @@ import ( "os" "path/filepath" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/kubernetes" - k8slabels "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/kubernetes" + k8slabels "github.com/radius-project/radius/pkg/kubernetes" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/cmd/rad/cmd/resourceExpose.go b/cmd/rad/cmd/resourceExpose.go index 8b101eca20..346e468547 100644 --- a/cmd/rad/cmd/resourceExpose.go +++ b/cmd/rad/cmd/resourceExpose.go @@ -22,11 +22,11 @@ import ( "strings" "github.com/agnivade/levenshtein" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" "github.com/spf13/cobra" ) diff --git a/cmd/rad/cmd/resourceLogs.go b/cmd/rad/cmd/resourceLogs.go index abeb48d987..d1be2400f3 100644 --- a/cmd/rad/cmd/resourceLogs.go +++ b/cmd/rad/cmd/resourceLogs.go @@ -24,10 +24,10 @@ import ( "os" "strings" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" "github.com/spf13/cobra" ) diff --git a/cmd/rad/cmd/root.go b/cmd/rad/cmd/root.go index 7a17c6fef6..3a2af0fdcd 100644 --- a/cmd/rad/cmd/root.go +++ b/cmd/rad/cmd/root.go @@ -24,58 +24,58 @@ import ( "strings" "github.com/acarl005/stripansi" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clierrors" - app_switch "github.com/project-radius/radius/pkg/cli/cmd/app/appswitch" - app_connections "github.com/project-radius/radius/pkg/cli/cmd/app/connections" - app_delete "github.com/project-radius/radius/pkg/cli/cmd/app/delete" - app_list "github.com/project-radius/radius/pkg/cli/cmd/app/list" - app_show "github.com/project-radius/radius/pkg/cli/cmd/app/show" - app_status "github.com/project-radius/radius/pkg/cli/cmd/app/status" - bicep_publish "github.com/project-radius/radius/pkg/cli/cmd/bicep/publish" - credential "github.com/project-radius/radius/pkg/cli/cmd/credential" - cmd_deploy "github.com/project-radius/radius/pkg/cli/cmd/deploy" - env_create "github.com/project-radius/radius/pkg/cli/cmd/env/create" - env_delete "github.com/project-radius/radius/pkg/cli/cmd/env/delete" - env_switch "github.com/project-radius/radius/pkg/cli/cmd/env/envswitch" - env_list "github.com/project-radius/radius/pkg/cli/cmd/env/list" - "github.com/project-radius/radius/pkg/cli/cmd/env/namespace" - env_show "github.com/project-radius/radius/pkg/cli/cmd/env/show" - env_update "github.com/project-radius/radius/pkg/cli/cmd/env/update" - group "github.com/project-radius/radius/pkg/cli/cmd/group" - "github.com/project-radius/radius/pkg/cli/cmd/install" - install_kubernetes "github.com/project-radius/radius/pkg/cli/cmd/install/kubernetes" - "github.com/project-radius/radius/pkg/cli/cmd/radinit" - recipe_list "github.com/project-radius/radius/pkg/cli/cmd/recipe/list" - recipe_register "github.com/project-radius/radius/pkg/cli/cmd/recipe/register" - recipe_show "github.com/project-radius/radius/pkg/cli/cmd/recipe/show" - recipe_unregister "github.com/project-radius/radius/pkg/cli/cmd/recipe/unregister" - resource_delete "github.com/project-radius/radius/pkg/cli/cmd/resource/delete" - resource_list "github.com/project-radius/radius/pkg/cli/cmd/resource/list" - resource_show "github.com/project-radius/radius/pkg/cli/cmd/resource/show" - "github.com/project-radius/radius/pkg/cli/cmd/run" - "github.com/project-radius/radius/pkg/cli/cmd/uninstall" - uninstall_kubernetes "github.com/project-radius/radius/pkg/cli/cmd/uninstall/kubernetes" - workspace_create "github.com/project-radius/radius/pkg/cli/cmd/workspace/create" - workspace_delete "github.com/project-radius/radius/pkg/cli/cmd/workspace/delete" - workspace_list "github.com/project-radius/radius/pkg/cli/cmd/workspace/list" - workspace_show "github.com/project-radius/radius/pkg/cli/cmd/workspace/show" - workspace_switch "github.com/project-radius/radius/pkg/cli/cmd/workspace/switch" - "github.com/project-radius/radius/pkg/cli/config" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/deploy" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/kubernetes/logstream" - "github.com/project-radius/radius/pkg/cli/kubernetes/portforward" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/trace" + "github.com/radius-project/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clierrors" + app_switch "github.com/radius-project/radius/pkg/cli/cmd/app/appswitch" + app_connections "github.com/radius-project/radius/pkg/cli/cmd/app/connections" + app_delete "github.com/radius-project/radius/pkg/cli/cmd/app/delete" + app_list "github.com/radius-project/radius/pkg/cli/cmd/app/list" + app_show "github.com/radius-project/radius/pkg/cli/cmd/app/show" + app_status "github.com/radius-project/radius/pkg/cli/cmd/app/status" + bicep_publish "github.com/radius-project/radius/pkg/cli/cmd/bicep/publish" + credential "github.com/radius-project/radius/pkg/cli/cmd/credential" + cmd_deploy "github.com/radius-project/radius/pkg/cli/cmd/deploy" + env_create "github.com/radius-project/radius/pkg/cli/cmd/env/create" + env_delete "github.com/radius-project/radius/pkg/cli/cmd/env/delete" + env_switch "github.com/radius-project/radius/pkg/cli/cmd/env/envswitch" + env_list "github.com/radius-project/radius/pkg/cli/cmd/env/list" + "github.com/radius-project/radius/pkg/cli/cmd/env/namespace" + env_show "github.com/radius-project/radius/pkg/cli/cmd/env/show" + env_update "github.com/radius-project/radius/pkg/cli/cmd/env/update" + group "github.com/radius-project/radius/pkg/cli/cmd/group" + "github.com/radius-project/radius/pkg/cli/cmd/install" + install_kubernetes "github.com/radius-project/radius/pkg/cli/cmd/install/kubernetes" + "github.com/radius-project/radius/pkg/cli/cmd/radinit" + recipe_list "github.com/radius-project/radius/pkg/cli/cmd/recipe/list" + recipe_register "github.com/radius-project/radius/pkg/cli/cmd/recipe/register" + recipe_show "github.com/radius-project/radius/pkg/cli/cmd/recipe/show" + recipe_unregister "github.com/radius-project/radius/pkg/cli/cmd/recipe/unregister" + resource_delete "github.com/radius-project/radius/pkg/cli/cmd/resource/delete" + resource_list "github.com/radius-project/radius/pkg/cli/cmd/resource/list" + resource_show "github.com/radius-project/radius/pkg/cli/cmd/resource/show" + "github.com/radius-project/radius/pkg/cli/cmd/run" + "github.com/radius-project/radius/pkg/cli/cmd/uninstall" + uninstall_kubernetes "github.com/radius-project/radius/pkg/cli/cmd/uninstall/kubernetes" + workspace_create "github.com/radius-project/radius/pkg/cli/cmd/workspace/create" + workspace_delete "github.com/radius-project/radius/pkg/cli/cmd/workspace/delete" + workspace_list "github.com/radius-project/radius/pkg/cli/cmd/workspace/list" + workspace_show "github.com/radius-project/radius/pkg/cli/cmd/workspace/show" + workspace_switch "github.com/radius-project/radius/pkg/cli/cmd/workspace/switch" + "github.com/radius-project/radius/pkg/cli/config" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/deploy" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/kubernetes/logstream" + "github.com/radius-project/radius/pkg/cli/kubernetes/portforward" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/trace" "go.opentelemetry.io/otel" "github.com/spf13/cobra" diff --git a/cmd/rad/cmd/version.go b/cmd/rad/cmd/version.go index c30b6e2787..3c65106290 100644 --- a/cmd/rad/cmd/version.go +++ b/cmd/rad/cmd/version.go @@ -19,9 +19,9 @@ package cmd import ( "io" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/version" "github.com/spf13/cobra" ) diff --git a/cmd/rad/main.go b/cmd/rad/main.go index eb720c0091..6669760550 100644 --- a/cmd/rad/main.go +++ b/cmd/rad/main.go @@ -19,7 +19,7 @@ package main import ( "os" - "github.com/project-radius/radius/cmd/rad/cmd" + "github.com/radius-project/radius/cmd/rad/cmd" ) func main() { diff --git a/cmd/ucpd/cmd/root.go b/cmd/ucpd/cmd/root.go index 3df2fa20e0..839a47dbdb 100644 --- a/cmd/ucpd/cmd/root.go +++ b/cmd/ucpd/cmd/root.go @@ -28,11 +28,11 @@ import ( etcdclient "go.etcd.io/etcd/client/v3" runtimelog "sigs.k8s.io/controller-runtime/pkg/log" - "github.com/project-radius/radius/pkg/trace" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/server" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/trace" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/server" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var rootCmd = &cobra.Command{ diff --git a/cmd/ucpd/main.go b/cmd/ucpd/main.go index 6338c44d50..4bf53ec973 100644 --- a/cmd/ucpd/main.go +++ b/cmd/ucpd/main.go @@ -16,7 +16,7 @@ limitations under the License. package main -import "github.com/project-radius/radius/cmd/ucpd/cmd" +import "github.com/radius-project/radius/cmd/ucpd/cmd" func main() { cmd.Execute() diff --git a/deploy/Chart/Chart.yaml b/deploy/Chart/Chart.yaml index 18ce7f3113..17861d27a1 100644 --- a/deploy/Chart/Chart.yaml +++ b/deploy/Chart/Chart.yaml @@ -7,10 +7,10 @@ version: '0.42.42-dev' appVersion: 'edge' home: https://radapp.dev sources: - - https://github.com/project-radius/radius/tree/main/deploy/Chart + - https://github.com/radius-project/radius/tree/main/deploy/Chart maintainers: - name: Radius Authors - url: https://github.com/project-radius/radius + url: https://github.com/radius-project/radius icon: https://radapp.dev/images/logo.png keywords: - radius diff --git a/deploy/Chart/templates/rp/configmaps.yaml b/deploy/Chart/templates/rp/configmaps.yaml index 16527b5c49..a66ed7437b 100644 --- a/deploy/Chart/templates/rp/configmaps.yaml +++ b/deploy/Chart/templates/rp/configmaps.yaml @@ -9,7 +9,7 @@ metadata: data: radius-self-host.yaml: |- # Radius configuration file. - # See https://github.com/project-radius/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. + # See https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. environment: name: self-hosted roleLocation: "global" @@ -55,7 +55,7 @@ data: portableresource-self-host.yaml: |- # Radius configuration file. - # See https://github.com/project-radius/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. + # See https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. environment: name: self-hosted roleLocation: "global" diff --git a/deploy/Chart/templates/ucp/configmaps.yaml b/deploy/Chart/templates/ucp/configmaps.yaml index e18e9070f1..7d9a8154cd 100644 --- a/deploy/Chart/templates/ucp/configmaps.yaml +++ b/deploy/Chart/templates/ucp/configmaps.yaml @@ -9,7 +9,7 @@ metadata: data: ucp-config.yaml: |- # Radius configuration file. - # See https://github.com/project-radius/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. + # See https://github.com/radius-project/radius/blob/main/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md for more information. storageProvider: provider: "apiserver" apiserver: diff --git a/deploy/install.sh b/deploy/install.sh index 1ee9697407..49eb60d535 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -185,7 +185,7 @@ fail_trap() { result=$? if [ "$result" != "0" ]; then echo "Failed to install Radius CLI" - echo "For support, go to https://github.com/project-radius/radius" + echo "For support, go to https://github.com/radius-project/radius" fi cleanup exit $result diff --git a/docs/README.md b/docs/README.md index c5dc472e00..92c42bd19e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Radius documentation -The documentation for Radius is at https://radapp.dev, with the source in the [project-radius/docs repo](https://github.com/project-radius/docs). +The documentation for Radius is at https://radapp.dev, with the source in the [radius-project/docs repo](https://github.com/radius-project/docs). ## Contributing to Radius diff --git a/docs/contributing/contributing-code/contributing-code-building/README.md b/docs/contributing/contributing-code/contributing-code-building/README.md index 41ae02e980..9973867b23 100644 --- a/docs/contributing/contributing-code/contributing-code-building/README.md +++ b/docs/contributing/contributing-code/contributing-code-building/README.md @@ -50,7 +50,7 @@ make generate This may take a few minutes as there are several steps. -If you encounter problems please [open an issue](https://github.com/project-radius/radius/issues/new/choose) so we can help. We're trying to make these instructions as streamlined as possible for contributors, your help in identifying problems with the tools and instructions is very much appreciated! +If you encounter problems please [open an issue](https://github.com/radius-project/radius/issues/new/choose) so we can help. We're trying to make these instructions as streamlined as possible for contributors, your help in identifying problems with the tools and instructions is very much appreciated! ## Troubleshooting and getting help diff --git a/docs/contributing/contributing-code/contributing-code-cli/README.md b/docs/contributing/contributing-code/contributing-code-cli/README.md index 244d835888..461305517e 100644 --- a/docs/contributing/contributing-code/contributing-code-cli/README.md +++ b/docs/contributing/contributing-code/contributing-code-cli/README.md @@ -41,10 +41,10 @@ Create the following script and place it on your path with a name like `dev-rad` ```sh #!/bin/sh set -eu -go run ~/github.com/project-radius/radius/cmd/rad/main.go $@ +go run ~/github.com/radius-project/radius/cmd/rad/main.go $@ ``` -Replace `~/github.com/project-radius/radius` with the path to your repository root. +Replace `~/github.com/radius-project/radius` with the path to your repository root. Run `chmod +x dev-rad` to mark it executable diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md index 00f18f91b4..2a3d61744f 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/running-controlplane-locally.md @@ -28,7 +28,7 @@ If you need to manually test APIs you can reach them at the following endpoints ## Prerequisites 1. Create a Kubernetes cluster, or set your current context to a cluster you want to use. The debug configuration will use your current cluster for storing data. -2. Clone the `project-radius/radius` and `project-radius/deployment-engine` repo next to each other. +2. Clone the `radius-project/radius` and `radius-project/deployment-engine` repo next to each other. 3. Run `git submodule update --init` in the `deployment-engine` repo 4. Install .NET 6.0 SDK - https://dotnet.microsoft.com/en-us/download/dotnet/6.0 5. Install C# VS Code extension - https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp @@ -141,7 +141,7 @@ Now you can launch the Radius locally through the VSCode menu. ### I got an error saying I need to clone the deployment engine -> The project-radius/deployment-engine is not cloned as a sibling to the radius repo. Please clone the project-radius/deployment-engine repo next to the Radius repo and try again. +> The radius-project/deployment-engine is not cloned as a sibling to the radius repo. Please clone the radius-project/deployment-engine repo next to the Radius repo and try again. You should be to successfully the following commands from the Radius repository root: diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md index c827f589d5..18f9532339 100644 --- a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-05-running-tests/index.md @@ -12,23 +12,23 @@ After tests run, you should see a big list of all of the project's packages: ```txt go test ./pkg/... -ok github.com/project-radius/radius/pkg/cli 0.250s -? github.com/project-radius/radius/pkg/azure/azcli [no test files] -? github.com/project-radius/radius/pkg/cli/azure [no test files] -? github.com/project-radius/radius/pkg/cli/bicep [no test files] -? github.com/project-radius/radius/pkg/cli/environments [no test files] -? github.com/project-radius/radius/pkg/cli/logger [no test files] -? github.com/project-radius/radius/pkg/cli/namegenerator [no test files] -? github.com/project-radius/radius/pkg/cli/prompt [no test files] -? github.com/project-radius/radius/pkg/cli/util [no test files] -? github.com/project-radius/radius/pkg/azure/radclient [no test files] -? github.com/project-radius/radius/pkg/renderers [no test files] -ok github.com/project-radius/radius/pkg/renderers/containerv1alpha3 -ok github.com/project-radius/radius/pkg/renderers/cosmosdbmongov1alpha3 -ok github.com/project-radius/radius/pkg/renderers/dapr -ok github.com/project-radius/radius/pkg/renderers/daprpubsubv1alpha3 -ok github.com/project-radius/radius/pkg/renderers/daprstatestorev1alpha3 -ok github.com/project-radius/radius/pkg/renderers/servicebusqueuev1alpha3 +ok github.com/radius-project/radius/pkg/cli 0.250s +? github.com/radius-project/radius/pkg/azure/azcli [no test files] +? github.com/radius-project/radius/pkg/cli/azure [no test files] +? github.com/radius-project/radius/pkg/cli/bicep [no test files] +? github.com/radius-project/radius/pkg/cli/environments [no test files] +? github.com/radius-project/radius/pkg/cli/logger [no test files] +? github.com/radius-project/radius/pkg/cli/namegenerator [no test files] +? github.com/radius-project/radius/pkg/cli/prompt [no test files] +? github.com/radius-project/radius/pkg/cli/util [no test files] +? github.com/radius-project/radius/pkg/azure/radclient [no test files] +? github.com/radius-project/radius/pkg/renderers [no test files] +ok github.com/radius-project/radius/pkg/renderers/containerv1alpha3 +ok github.com/radius-project/radius/pkg/renderers/cosmosdbmongov1alpha3 +ok github.com/radius-project/radius/pkg/renderers/dapr +ok github.com/radius-project/radius/pkg/renderers/daprpubsubv1alpha3 +ok github.com/radius-project/radius/pkg/renderers/daprstatestorev1alpha3 +ok github.com/radius-project/radius/pkg/renderers/servicebusqueuev1alpha3 ``` The Go test tools do not make much fanfare when all the tests pass - it just says `ok` for every package that has tests. diff --git a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md index 11afa8b04e..51d8948df1 100644 --- a/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md +++ b/docs/contributing/contributing-code/contributing-code-first-commit/first-commit-07-creating-a-pr/index.md @@ -4,7 +4,7 @@ At this point you've experienced the basic dev flow for the `rad` CLI. -It's time to pick an issue to work on! You can find a query [here](https://github.com/project-radius/radius/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). +It's time to pick an issue to work on! You can find a query [here](https://github.com/radius-project/radius/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). ## Etiquette for issues @@ -36,7 +36,7 @@ Fixes: # ``` -Here's an [example](https://github.com/project-radius/radius/commit/8e95d07a66e6aa91dfb40217318649ca43ec4bd7). +Here's an [example](https://github.com/radius-project/radius/commit/8e95d07a66e6aa91dfb40217318649ca43ec4bd7). Include a level of detail that makese sense based on the complexity of problem and solution. @@ -44,7 +44,7 @@ Include a level of detail that makese sense based on the complexity of problem a At this point, you have reviewed the forked repo workflow. -Push your changes to your forked repo and then [open a pull request](https://github.com/project-radius/radius/compare). +Push your changes to your forked repo and then [open a pull request](https://github.com/radius-project/radius/compare). If you formatted your commit message correctly then everything should be good to go. diff --git a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md index 9d4c917b5b..342206e6e2 100644 --- a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md +++ b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md @@ -53,7 +53,7 @@ You can build the main outputs using `make`: make build && make lint ``` -Running these steps will run our build and lint steps and verify that the tools are installed correctly. If you get stuck or suspect something is not working in these instructions please [open an issue](https://github.com/project-radius/radius/issues/new/choose). +Running these steps will run our build and lint steps and verify that the tools are installed correctly. If you get stuck or suspect something is not working in these instructions please [open an issue](https://github.com/radius-project/radius/issues/new/choose). ### Editor diff --git a/docs/contributing/contributing-code/contributing-code-schema-changes/README.md b/docs/contributing/contributing-code/contributing-code-schema-changes/README.md index 595ee1c1eb..caafa5826e 100644 --- a/docs/contributing/contributing-code/contributing-code-schema-changes/README.md +++ b/docs/contributing/contributing-code/contributing-code-schema-changes/README.md @@ -35,7 +35,7 @@ Creating a pull request in the radius repo that contains application model chang ## Step 2: Update docs and samples -Visit the [docs](https://github.com/project-radius/docs/) and [samples](https://github.com/project-radius/samples/) repository and open PRs with the changes to the resource(s). Some checks will fail until you begin merging PRs below. +Visit the [docs](https://github.com/radius-project/docs/) and [samples](https://github.com/radius-project/samples/) repository and open PRs with the changes to the resource(s). Some checks will fail until you begin merging PRs below. ## Step 3: Merge pull requests in order ⚠️ Make sure you have PRs open and ready to merge within the radius, bicep, docs, and samples repositories. Do not proceed until all the PRs are ready and approved. diff --git a/docs/contributing/contributing-code/contributing-code-tests/tests-logging.md b/docs/contributing/contributing-code/contributing-code-tests/tests-logging.md index ff5c9b7695..25b6899b42 100644 --- a/docs/contributing/contributing-code/contributing-code-tests/tests-logging.md +++ b/docs/contributing/contributing-code/contributing-code-tests/tests-logging.md @@ -5,7 +5,7 @@ The Radius tests redirect the Resource Provider logger output to the testing err ```go import ( ... - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" ... ) diff --git a/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md b/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md index 709a4f1bb1..a75722808c 100644 --- a/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md +++ b/docs/contributing/contributing-code/contributing-code-tests/tests-naming-conventions.md @@ -1,5 +1,5 @@ # Radius functional test naming conventions -Today, the [functional tests](https://github.com/project-radius/radius/tree/main/test/functional/shared/resources) use some abbreviations to make sure that the resource labels will not exceed 63 characters (application + resource name). Here are a list of some of the abbreviations and patterns: +Today, the [functional tests](https://github.com/radius-project/radius/tree/main/test/functional/shared/resources) use some abbreviations to make sure that the resource labels will not exceed 63 characters (application + resource name). Here are a list of some of the abbreviations and patterns: |Keyword|Abbreviation| |-|-| diff --git a/docs/contributing/contributing-code/contributing-code-tests/writing-functional-tests.md b/docs/contributing/contributing-code/contributing-code-tests/writing-functional-tests.md index 6a2c723771..31d063e40a 100644 --- a/docs/contributing/contributing-code/contributing-code-tests/writing-functional-tests.md +++ b/docs/contributing/contributing-code/contributing-code-tests/writing-functional-tests.md @@ -17,7 +17,7 @@ For example a test for deploying an Azure Service Bus resource would be in `/tes Tests should look like the following. You can actually copy-paste this to create a new test! ```go -import "github.com/project-radius/radius/test/functional/azure" +import "github.com/radius-project/radius/test/functional/azure" func Test_DescriptiveTestName(t *testing.T) { application := "unique-application-name" diff --git a/docs/contributing/contributing-issues/README.md b/docs/contributing/contributing-issues/README.md index f952bc5b5f..d5fa019f78 100644 --- a/docs/contributing/contributing-issues/README.md +++ b/docs/contributing/contributing-issues/README.md @@ -1,6 +1,6 @@ # Contributing Issues -You can open an issue using the form [here](https://github.com/project-radius/radius/issues/new/choose). This form will ask you to fill out a template based on the kind of issue you choose. Please fill out the form as this will help us respond to your issue. +You can open an issue using the form [here](https://github.com/radius-project/radius/issues/new/choose). This form will ask you to fill out a template based on the kind of issue you choose. Please fill out the form as this will help us respond to your issue. ## Tips for creating good issues @@ -14,7 +14,7 @@ You will save us (the maintainers) time if you want to use the right template. ### Focus on the repro steps -Providing clear repro steps with code samples is the best way to get a good response to your issue. [here](https://github.com/project-radius/radius/issues?q=is%3Aissue+is%3Aclosed)'s an example. +Providing clear repro steps with code samples is the best way to get a good response to your issue. [here](https://github.com/radius-project/radius/issues?q=is%3Aissue+is%3Aclosed)'s an example. Remember that another human will need to read your instructions and try to reproduce your steps to understand the issue. diff --git a/docs/contributing/contributing-pull-requests/README.md b/docs/contributing/contributing-pull-requests/README.md index 34262f8f80..694310972e 100644 --- a/docs/contributing/contributing-pull-requests/README.md +++ b/docs/contributing/contributing-pull-requests/README.md @@ -5,7 +5,7 @@ We welcome small pull request contributions from anyone (docs improvements, bug fixes, minor features.) as long as they follow a few guidelines: - For very minor changes like correcting a typo feel free to just send a pull request without any ceremony. Otherwise ... -- Please start by [choosing an existing issue](https://github.com/project-radius/radius/issues), or [opening an issue](https://github.com/project-radius/radius/issues/new/choose) to work on. +- Please start by [choosing an existing issue](https://github.com/radius-project/radius/issues), or [opening an issue](https://github.com/radius-project/radius/issues/new/choose) to work on. - The maintainers will respond to your issue, please work with the maintainers to ensure that what you're doing is in scope for the project before writing any code. - If you have any doubt whether a contribution would be valuable, feel free to ask. @@ -44,7 +44,7 @@ We use Task as a catch-all for changes that have no direct user-visible impact. Our pull-request template includes a summary from Github Copilot. This will generate a description of your changes as well as links to the most relevant files. -You can find an example [here](https://github.com/project-radius/radius/pull/5614). +You can find an example [here](https://github.com/radius-project/radius/pull/5614). ## Tips @@ -52,7 +52,7 @@ Keep reading for some tips about how to get your pull requests accepted! ## How to get help with a pull request -* Notify the Radius Core team by commenting with `@project-radius/radius-core-team ` on your pull-request. +* Notify the Radius Core team by commenting with `@radius-project/radius-core-team ` on your pull-request. * Post on Discord in the [#Forum channel](https://discord.gg/GJHN7kQrMh) to start a conversation. ## Writing a good commit message diff --git a/docs/contributing/contributing-releases/README.md b/docs/contributing/contributing-releases/README.md index a4f6a02bc9..29a1229b4a 100644 --- a/docs/contributing/contributing-releases/README.md +++ b/docs/contributing/contributing-releases/README.md @@ -20,7 +20,7 @@ If we find issues in validation, we can create additional RC releases until we f Follow the steps below to create an RC release. -1. In the project-radius/bicep repo, [bicep-extensibility branch](https://github.com/project-radius/bicep/tree/bicep-extensibility) +1. In the radius-project/bicep repo, [bicep-extensibility branch](https://github.com/radius-project/bicep/tree/bicep-extensibility) ```bash git checkout bicep-extensibility @@ -50,7 +50,7 @@ Follow the steps below to create an RC release. az storage blob directory list -c tools -d vscode-extensibility --account-name radiuspublic --output table ``` -2. In the project-radius/deployment-engine repo: +2. In the radius-project/deployment-engine repo: Create a new branch from main based off the release version called `release/0.`. For example, `release/0.21`. This branch will be used for patching/servicing. @@ -66,7 +66,7 @@ Follow the steps below to create an RC release. Verify that GitHub actions triggers a build in response to the tag, and that the build completes. This will push the Deployment Engine container to our container registry. -3. In the project-radius/radius repo: +3. In the radius-project/radius repo: Create a new branch from main based off the release version called `release/0.`. For example, `release/0.21`. This branch will be used for patching/servicing. @@ -137,7 +137,7 @@ If sample validation passes, we can start the process of creating the final rele You can find this file in the storage account under `version/stable.txt`. -1. Update the project-radius/docs repository +1. Update the radius-project/docs repository Assuming that we are using v0.21. @@ -150,10 +150,10 @@ If sample validation passes, we can start the process of creating the final rele - Change `indexName` to `radapp-dev` instead of `radapp-dev-edge` 1. In `docs/content/getting-started/install/_index.md` update the binary download links with the new version number 1. Commit and push updates to be the new `v0.21` branch you created above. - 1. Update the [latest](https://github.com/project-radius/docs/settings/environments/750240441/edit) environment to allow the new version to be deployed, and not the old version. This requires Admin/PM action and is restricted to that set of people, so ping one of the PMs to edit this value. + 1. Update the [latest](https://github.com/radius-project/docs/settings/environments/750240441/edit) environment to allow the new version to be deployed, and not the old version. This requires Admin/PM action and is restricted to that set of people, so ping one of the PMs to edit this value. 1. Verify https://radapp.dev now shows the new version. -1. Update the project-radius/samples repository to point to latest release +1. Update the radius-project/samples repository to point to latest release ``` git checkout edge diff --git a/docs/contributing/how-to.md b/docs/contributing/how-to.md index 10699b162b..306ca0dbb7 100644 --- a/docs/contributing/how-to.md +++ b/docs/contributing/how-to.md @@ -4,9 +4,9 @@ We welcome and encourage users to contribute to the Radius open-source project i * Learn how: Browse our guides for how to [install repository prerequisites](./contributing-code/contributing-code-prerequisites/), [build the code](./contributing-code/contributing-code-building/), [understand the code](./contributing-code/contributing-code-organization/), [write code for the project](./contributing-code/contributing-code-writing/), and [run tests](./contributing-code/contributing-code-tests/). This is essential knowledge for working with the repository. -* Tackle small tasks: Start by addressing small issues or tasks labeled as ["good first issues"](https://github.com/project-radius/radius/issues?q=is:issue+is:open+label:%22good+first+issue%22) This allows you to familiarize yourself with the project and make valuable contributions without a steep learning curve. +* Tackle small tasks: Start by addressing small issues or tasks labeled as ["good first issues"](https://github.com/radius-project/radius/issues?q=is:issue+is:open+label:%22good+first+issue%22) This allows you to familiarize yourself with the project and make valuable contributions without a steep learning curve. -* Take on bigger projects: Issues that are groomed and ready to be picked up are labeled as ["triaged"](https://github.com/project-radius/radius/issues?q=is%3Aissue+is%3Aopen+label%3Atriaged). +* Take on bigger projects: Issues that are groomed and ready to be picked up are labeled as ["triaged"](https://github.com/radius-project/radius/issues?q=is%3Aissue+is%3Aopen+label%3Atriaged). * Fork the project: Create a personal copy (fork) of the Radius repository on GitHub. This enables you to make changes and experiment as well as submit pull requests. @@ -16,7 +16,7 @@ We welcome and encourage users to contribute to the Radius open-source project i * Test and report bugs: Assist in testing Radius by [identifying and reporting bugs](./contributing-issues/). Detailed bug reports help us address issues promptly and enhance the software's quality. -* Improve documentation: Enhance the project's [documentation](https://github.com/project-radius/docs) by updating existing content, adding guides, or adding examples. Well-documented projects are easier to use and attract more users. +* Improve documentation: Enhance the project's [documentation](https://github.com/radius-project/docs) by updating existing content, adding guides, or adding examples. Well-documented projects are easier to use and attract more users. * Spread the word: Share your positive experiences with Radius through blog posts, talks, or social media. Promote the project to attract more users and contributors. Star the project on GitHub! diff --git a/docs/release-notes/README.md b/docs/release-notes/README.md index f78e232d61..f95a5d0363 100644 --- a/docs/release-notes/README.md +++ b/docs/release-notes/README.md @@ -1,6 +1,6 @@ # Radius release notes -This directory contains the release notes for each Radius release. The release notes are written in Markdown and are included as the body of [each Radius release](https://github.com/project-radius/radius/releases). +This directory contains the release notes for each Radius release. The release notes are written in Markdown and are included as the body of [each Radius release](https://github.com/radius-project/radius/releases). ## Release process @@ -32,7 +32,7 @@ Within the template is the `## Full changelog` section, which is a complete list To generate the release notes: -1. Visit [Generate a new release](https://github.com/project-radius/radius/releases/new) in the radius repository. +1. Visit [Generate a new release](https://github.com/radius-project/radius/releases/new) in the radius repository. - _Note that you will not be creating the release through the UI, just generating the list of merged PRs. This could be automated in the future using the [GitHub API](https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits)_ 2. Dropdown the `Choose a tag` menu and manually enter the tag for the upcoming release (_e.g. `v0.21.0`_). Keep `Target` as 'main'. 3. Dropdown the `Previous tag` menu and select the tag for the previous minor release (_e.g. `v0.20.0`_). Don't select patch or RC releases. diff --git a/docs/release-notes/v0.22.0.md b/docs/release-notes/v0.22.0.md index e2fc36c317..f5d5de4a5d 100644 --- a/docs/release-notes/v0.22.0.md +++ b/docs/release-notes/v0.22.0.md @@ -16,7 +16,7 @@ All portable resources now support Recipes. This allows operators to add their a ### Updated contribution guides -Interested in contributing to Project Radius? Check out our [updated contribution guides](https://github.com/project-radius/radius/blob/main/CONTRIBUTING.md) to learn how to get started and understand our code-base. +Interested in contributing to Project Radius? Check out our [updated contribution guides](https://github.com/radius-project/radius/blob/main/CONTRIBUTING.md) to learn how to get started and understand our code-base. ### Project Radius Discord server @@ -42,7 +42,7 @@ Thank you to the attendees of our latest community call! You can check out the r Welcome to our new contributors who have merged their first PR in this release! -* @farazmsiddiqi made their first contribution in https://github.com/project-radius/radius/pull/5647 +* @farazmsiddiqi made their first contribution in https://github.com/radius-project/radius/pull/5647 ## Upgrading to Radius v0.22.0 @@ -64,84 +64,84 @@ During our preview stage, an upgrade to Radius v0.22.0 requires a full reinstall ## Full changelog -* Add copilot docs summary to PR template by @AaronCrawfis in https://github.com/project-radius/radius/pull/5588 -* Suppress etcd logs in integration test by @rynowak in https://github.com/project-radius/radius/pull/5589 -* Update documentation for running Radius locally by @rynowak in https://github.com/project-radius/radius/pull/5596 -* Fix test failure reporting by @youngbupark in https://github.com/project-radius/radius/pull/5590 -* Copyright spacing by @vinayada1 in https://github.com/project-radius/radius/pull/5595 -* Remove location from scaffolded app by @ytimocin in https://github.com/project-radius/radius/pull/5600 -* A fresh coat of paint for rad init by @rynowak in https://github.com/project-radius/radius/pull/5587 -* Clean up CoreRP controller using default controller by @youngbupark in https://github.com/project-radius/radius/pull/5478 -* Ensure resource group is deleted by @youngbupark in https://github.com/project-radius/radius/pull/5608 -* Use UUID validator for tenant id by @rynowak in https://github.com/project-radius/radius/pull/5613 -* Make validation tolerant of intermediate states by @rynowak in https://github.com/project-radius/radius/pull/5614 -* Add recipe support for Dapr State Store by @rynowak in https://github.com/project-radius/radius/pull/5598 -* Add tests for plane-scoped API scenarios by @rynowak in https://github.com/project-radius/radius/pull/5620 -* Cleanup of the docs folder and Contributing by @rynowak in https://github.com/project-radius/radius/pull/5619 -* Fix the wrong version of container tag for Radius installation by @nithyatsu in https://github.com/project-radius/radius/pull/5628 -* Enable repository_dispatcher trigger in functional test" by @vinayada1 in https://github.com/project-radius/radius/pull/5640 -* Mask credentials in `rad init` interactive mode by @willdavsmith in https://github.com/project-radius/radius/pull/5644 -* Recipe support for Dapr Secret Store resource by @vishwahiremat in https://github.com/project-radius/radius/pull/5637 -* Recipe support for rabbitmq resource by @vishwahiremat in https://github.com/project-radius/radius/pull/5615 -* Recipe support for Sql database resource by @vishwahiremat in https://github.com/project-radius/radius/pull/5572 -* Fix formatting of how-to by @rynowak in https://github.com/project-radius/radius/pull/5650 -* Update code of conduct to contributor covenant by @AaronCrawfis in https://github.com/project-radius/radius/pull/5642 -* Set Pod resource limit for Radius containers. by @youngbupark in https://github.com/project-radius/radius/pull/5663 -* Update Security advisory to focus on Radius by @AaronCrawfis in https://github.com/project-radius/radius/pull/5667 -* Assign Radius-Eng team to the functional test failure bug by @youngbupark in https://github.com/project-radius/radius/pull/5676 -* Add Recipe support for Dapr Pub Sub Brokers by @ytimocin in https://github.com/project-radius/radius/pull/5623 -* Add AWS access keys create instruction message by @youngbupark in https://github.com/project-radius/radius/pull/5687 -* Fix development configuration by @rynowak in https://github.com/project-radius/radius/pull/5679 -* Update recipe metadata name for default recipe by @kachawla in https://github.com/project-radius/radius/pull/5635 -* Add gotestsum to functional test by @rynowak in https://github.com/project-radius/radius/pull/5691 -* User Confirmation Prompt Before rad resource delete by @farazmsiddiqi in https://github.com/project-radius/radius/pull/5647 -* MongoDB default recipe experience by @sk593 in https://github.com/project-radius/radius/pull/5555 -* Refactor helm chart by @youngbupark in https://github.com/project-radius/radius/pull/5690 -* Add support for plane-scoped list operations by @rynowak in https://github.com/project-radius/radius/pull/5680 -* Check user membership for ok-to-test comment on PR and if active, then trigger e2e tests by @vinayada1 in https://github.com/project-radius/radius/pull/5660 -* change mentions of to just by @willtsai in https://github.com/project-radius/radius/pull/5696 -* Add docs on CodeQL by @AaronCrawfis in https://github.com/project-radius/radius/pull/5662 -* Fix for updating the dapr bicep files to remove mode. by @vishwahiremat in https://github.com/project-radius/radius/pull/5688 -* Removing mode from resources that are migrated to the new process by @ytimocin in https://github.com/project-radius/radius/pull/5692 -* Updating Redis username and Mongo database properties to read/write by @sk593 in https://github.com/project-radius/radius/pull/5708 -* Fix Kubernetes POD deployment goroutine leak by @vinayada1 in https://github.com/project-radius/radius/pull/5693 -* Rename READMD.md to README.md by @AaronCrawfis in https://github.com/project-radius/radius/pull/5709 -* Fix test failure issue creation by @youngbupark in https://github.com/project-radius/radius/pull/5710 -* Fix functional test by dispatch trigger by @youngbupark in https://github.com/project-radius/radius/pull/5712 -* add /lgtm command to approve PR by @youngbupark in https://github.com/project-radius/radius/pull/5711 -* Upgrade github-action version to v6 by @youngbupark in https://github.com/project-radius/radius/pull/5715 -* Revert /lgtm command by @youngbupark in https://github.com/project-radius/radius/pull/5718 -* Fix AWS credential bug by @willdavsmith in https://github.com/project-radius/radius/pull/5639 -* Filter out APIServer Auth headers in UCP by @youngbupark in https://github.com/project-radius/radius/pull/5719 -* Add appsettings to de configmap in chart by @youngbupark in https://github.com/project-radius/radius/pull/5720 -* Fix the chart formatting and clean up charts by @youngbupark in https://github.com/project-radius/radius/pull/5723 -* Ensure cache is synced before processing by @youngbupark in https://github.com/project-radius/radius/pull/5724 -* Fix RC release version tag in chart by @youngbupark in https://github.com/project-radius/radius/pull/5727 -* Update sqlDatabases resource to store secrets and new values by @vishwahiremat in https://github.com/project-radius/radius/pull/5707 -* Fix handling of --group for rad env create by @rynowak in https://github.com/project-radius/radius/pull/5697 -* Reduce deployment resync duration and fix invalid context usage by @youngbupark in https://github.com/project-radius/radius/pull/5728 -* Fix for Datamodel conversion error by @vishwahiremat in https://github.com/project-radius/radius/pull/5732 -* Updating the release process doc by @ytimocin in https://github.com/project-radius/radius/pull/5370 -* Revert "Reduce deployment resync duration" by @youngbupark in https://github.com/project-radius/radius/pull/5741 -* Fix for validate bicep for sql-recipe by @vishwahiremat in https://github.com/project-radius/radius/pull/5743 -* Adding a fix for nil pointer issue in converter. by @vishwahiremat in https://github.com/project-radius/radius/pull/5742 -* Populate Recipe Name during conversion by @vishwahiremat in https://github.com/project-radius/radius/pull/5730 -* Update install/uninstall commands by @rynowak in https://github.com/project-radius/radius/pull/5725 -* Simplify and document CLI error handling by @rynowak in https://github.com/project-radius/radius/pull/5700 -* Use plane-scoped environment list in CLI by @rynowak in https://github.com/project-radius/radius/pull/5746 -* Increase timeout of bubbletea UI tests by @rynowak in https://github.com/project-radius/radius/pull/5748 -* Remove DaprInvokeHttpRoute by @rynowak in https://github.com/project-radius/radius/pull/5750 -* Remove some dead code by @rynowak in https://github.com/project-radius/radius/pull/5749 -* Remove uses of deployment processor by @rynowak in https://github.com/project-radius/radius/pull/5751 -* Remove deployment processor for listsecrets apis by @rynowak in https://github.com/project-radius/radius/pull/5752 -* Remove linkrp deployment processor and secretvalueclient by @rynowak in https://github.com/project-radius/radius/pull/5753 -* Add address and pathbase properties to controller options by @rynowak in https://github.com/project-radius/radius/pull/5756 -* Add recipe support to extenders by @sk593 in https://github.com/project-radius/radius/pull/5706 -* Removing `hostname` from TLS spec by @willdavsmith in https://github.com/project-radius/radius/pull/5681 -* Fixing Gateways TLS minimumProtocolVersion bug by @willdavsmith in https://github.com/project-radius/radius/pull/5683 -* Disable flaky tests by @rynowak in https://github.com/project-radius/radius/pull/5763 -* Use armrpc options and handler definition by @rynowak in https://github.com/project-radius/radius/pull/5759 -* Populate the resource id on current context - Part1 by @vinayada1 in https://github.com/project-radius/radius/pull/5761 -* Update Recipe Definition Schema by @vishwahiremat in https://github.com/project-radius/radius/pull/5735 -* Add UUID validation to `rad env update` by @AaronCrawfis in https://github.com/project-radius/radius/pull/5758 -* Fix publicEndpointOverride reference (cherry-picked) by @youngbupark in https://github.com/project-radius/radius/pull/5780 +* Add copilot docs summary to PR template by @AaronCrawfis in https://github.com/radius-project/radius/pull/5588 +* Suppress etcd logs in integration test by @rynowak in https://github.com/radius-project/radius/pull/5589 +* Update documentation for running Radius locally by @rynowak in https://github.com/radius-project/radius/pull/5596 +* Fix test failure reporting by @youngbupark in https://github.com/radius-project/radius/pull/5590 +* Copyright spacing by @vinayada1 in https://github.com/radius-project/radius/pull/5595 +* Remove location from scaffolded app by @ytimocin in https://github.com/radius-project/radius/pull/5600 +* A fresh coat of paint for rad init by @rynowak in https://github.com/radius-project/radius/pull/5587 +* Clean up CoreRP controller using default controller by @youngbupark in https://github.com/radius-project/radius/pull/5478 +* Ensure resource group is deleted by @youngbupark in https://github.com/radius-project/radius/pull/5608 +* Use UUID validator for tenant id by @rynowak in https://github.com/radius-project/radius/pull/5613 +* Make validation tolerant of intermediate states by @rynowak in https://github.com/radius-project/radius/pull/5614 +* Add recipe support for Dapr State Store by @rynowak in https://github.com/radius-project/radius/pull/5598 +* Add tests for plane-scoped API scenarios by @rynowak in https://github.com/radius-project/radius/pull/5620 +* Cleanup of the docs folder and Contributing by @rynowak in https://github.com/radius-project/radius/pull/5619 +* Fix the wrong version of container tag for Radius installation by @nithyatsu in https://github.com/radius-project/radius/pull/5628 +* Enable repository_dispatcher trigger in functional test" by @vinayada1 in https://github.com/radius-project/radius/pull/5640 +* Mask credentials in `rad init` interactive mode by @willdavsmith in https://github.com/radius-project/radius/pull/5644 +* Recipe support for Dapr Secret Store resource by @vishwahiremat in https://github.com/radius-project/radius/pull/5637 +* Recipe support for rabbitmq resource by @vishwahiremat in https://github.com/radius-project/radius/pull/5615 +* Recipe support for Sql database resource by @vishwahiremat in https://github.com/radius-project/radius/pull/5572 +* Fix formatting of how-to by @rynowak in https://github.com/radius-project/radius/pull/5650 +* Update code of conduct to contributor covenant by @AaronCrawfis in https://github.com/radius-project/radius/pull/5642 +* Set Pod resource limit for Radius containers. by @youngbupark in https://github.com/radius-project/radius/pull/5663 +* Update Security advisory to focus on Radius by @AaronCrawfis in https://github.com/radius-project/radius/pull/5667 +* Assign Radius-Eng team to the functional test failure bug by @youngbupark in https://github.com/radius-project/radius/pull/5676 +* Add Recipe support for Dapr Pub Sub Brokers by @ytimocin in https://github.com/radius-project/radius/pull/5623 +* Add AWS access keys create instruction message by @youngbupark in https://github.com/radius-project/radius/pull/5687 +* Fix development configuration by @rynowak in https://github.com/radius-project/radius/pull/5679 +* Update recipe metadata name for default recipe by @kachawla in https://github.com/radius-project/radius/pull/5635 +* Add gotestsum to functional test by @rynowak in https://github.com/radius-project/radius/pull/5691 +* User Confirmation Prompt Before rad resource delete by @farazmsiddiqi in https://github.com/radius-project/radius/pull/5647 +* MongoDB default recipe experience by @sk593 in https://github.com/radius-project/radius/pull/5555 +* Refactor helm chart by @youngbupark in https://github.com/radius-project/radius/pull/5690 +* Add support for plane-scoped list operations by @rynowak in https://github.com/radius-project/radius/pull/5680 +* Check user membership for ok-to-test comment on PR and if active, then trigger e2e tests by @vinayada1 in https://github.com/radius-project/radius/pull/5660 +* change mentions of to just by @willtsai in https://github.com/radius-project/radius/pull/5696 +* Add docs on CodeQL by @AaronCrawfis in https://github.com/radius-project/radius/pull/5662 +* Fix for updating the dapr bicep files to remove mode. by @vishwahiremat in https://github.com/radius-project/radius/pull/5688 +* Removing mode from resources that are migrated to the new process by @ytimocin in https://github.com/radius-project/radius/pull/5692 +* Updating Redis username and Mongo database properties to read/write by @sk593 in https://github.com/radius-project/radius/pull/5708 +* Fix Kubernetes POD deployment goroutine leak by @vinayada1 in https://github.com/radius-project/radius/pull/5693 +* Rename READMD.md to README.md by @AaronCrawfis in https://github.com/radius-project/radius/pull/5709 +* Fix test failure issue creation by @youngbupark in https://github.com/radius-project/radius/pull/5710 +* Fix functional test by dispatch trigger by @youngbupark in https://github.com/radius-project/radius/pull/5712 +* add /lgtm command to approve PR by @youngbupark in https://github.com/radius-project/radius/pull/5711 +* Upgrade github-action version to v6 by @youngbupark in https://github.com/radius-project/radius/pull/5715 +* Revert /lgtm command by @youngbupark in https://github.com/radius-project/radius/pull/5718 +* Fix AWS credential bug by @willdavsmith in https://github.com/radius-project/radius/pull/5639 +* Filter out APIServer Auth headers in UCP by @youngbupark in https://github.com/radius-project/radius/pull/5719 +* Add appsettings to de configmap in chart by @youngbupark in https://github.com/radius-project/radius/pull/5720 +* Fix the chart formatting and clean up charts by @youngbupark in https://github.com/radius-project/radius/pull/5723 +* Ensure cache is synced before processing by @youngbupark in https://github.com/radius-project/radius/pull/5724 +* Fix RC release version tag in chart by @youngbupark in https://github.com/radius-project/radius/pull/5727 +* Update sqlDatabases resource to store secrets and new values by @vishwahiremat in https://github.com/radius-project/radius/pull/5707 +* Fix handling of --group for rad env create by @rynowak in https://github.com/radius-project/radius/pull/5697 +* Reduce deployment resync duration and fix invalid context usage by @youngbupark in https://github.com/radius-project/radius/pull/5728 +* Fix for Datamodel conversion error by @vishwahiremat in https://github.com/radius-project/radius/pull/5732 +* Updating the release process doc by @ytimocin in https://github.com/radius-project/radius/pull/5370 +* Revert "Reduce deployment resync duration" by @youngbupark in https://github.com/radius-project/radius/pull/5741 +* Fix for validate bicep for sql-recipe by @vishwahiremat in https://github.com/radius-project/radius/pull/5743 +* Adding a fix for nil pointer issue in converter. by @vishwahiremat in https://github.com/radius-project/radius/pull/5742 +* Populate Recipe Name during conversion by @vishwahiremat in https://github.com/radius-project/radius/pull/5730 +* Update install/uninstall commands by @rynowak in https://github.com/radius-project/radius/pull/5725 +* Simplify and document CLI error handling by @rynowak in https://github.com/radius-project/radius/pull/5700 +* Use plane-scoped environment list in CLI by @rynowak in https://github.com/radius-project/radius/pull/5746 +* Increase timeout of bubbletea UI tests by @rynowak in https://github.com/radius-project/radius/pull/5748 +* Remove DaprInvokeHttpRoute by @rynowak in https://github.com/radius-project/radius/pull/5750 +* Remove some dead code by @rynowak in https://github.com/radius-project/radius/pull/5749 +* Remove uses of deployment processor by @rynowak in https://github.com/radius-project/radius/pull/5751 +* Remove deployment processor for listsecrets apis by @rynowak in https://github.com/radius-project/radius/pull/5752 +* Remove linkrp deployment processor and secretvalueclient by @rynowak in https://github.com/radius-project/radius/pull/5753 +* Add address and pathbase properties to controller options by @rynowak in https://github.com/radius-project/radius/pull/5756 +* Add recipe support to extenders by @sk593 in https://github.com/radius-project/radius/pull/5706 +* Removing `hostname` from TLS spec by @willdavsmith in https://github.com/radius-project/radius/pull/5681 +* Fixing Gateways TLS minimumProtocolVersion bug by @willdavsmith in https://github.com/radius-project/radius/pull/5683 +* Disable flaky tests by @rynowak in https://github.com/radius-project/radius/pull/5763 +* Use armrpc options and handler definition by @rynowak in https://github.com/radius-project/radius/pull/5759 +* Populate the resource id on current context - Part1 by @vinayada1 in https://github.com/radius-project/radius/pull/5761 +* Update Recipe Definition Schema by @vishwahiremat in https://github.com/radius-project/radius/pull/5735 +* Add UUID validation to `rad env update` by @AaronCrawfis in https://github.com/radius-project/radius/pull/5758 +* Fix publicEndpointOverride reference (cherry-picked) by @youngbupark in https://github.com/radius-project/radius/pull/5780 diff --git a/docs/release-notes/v0.23.0.md b/docs/release-notes/v0.23.0.md index f276d3be81..6657951517 100644 --- a/docs/release-notes/v0.23.0.md +++ b/docs/release-notes/v0.23.0.md @@ -17,7 +17,7 @@ If you're new to Radius, check out our website, [radapp.dev](https://radapp.dev) Welcome to our new contributors who have merged their first PR in this release! -* @shriraml-ms made their first contribution in https://github.com/project-radius/radius/pull/5531 +* @shriraml-ms made their first contribution in https://github.com/radius-project/radius/pull/5531 ## Upgrading to Radius v0.23.0 @@ -39,63 +39,63 @@ During our preview stage, an upgrade to Radius v0.23.0 requires a full reinstall ## Full changelog -* Update rad init prompt for AWS provider by @kachawla in https://github.com/project-radius/radius/pull/5771 -* Fix publicEndpointOverride reference by @youngbupark in https://github.com/project-radius/radius/pull/5777 -* Add remaining types to dev recipes processing by @AaronCrawfis in https://github.com/project-radius/radius/pull/5778 -* Add mongodb resource limits by @sk593 in https://github.com/project-radius/radius/pull/5789 -* Update build.yaml concurrency group to include the GitHub ref by @willdavsmith in https://github.com/project-radius/radius/pull/5779 -* Readme.md for radius repo by @nithyatsu in https://github.com/project-radius/radius/pull/5703 -* Mount directory for Terraform execution by @kachawla in https://github.com/project-radius/radius/pull/5797 -* Rename appcore-rp to applications-rp and clean up unused files. by @youngbupark in https://github.com/project-radius/radius/pull/5802 -* Update governance statement by @willtsai in https://github.com/project-radius/radius/pull/5770 -* Linkrp split namespace: messagingrp by @lakshmimsft in https://github.com/project-radius/radius/pull/5733 -* Fetch only radius-bot.js by @youngbupark in https://github.com/project-radius/radius/pull/5803 -* Make UCP routing modular by @rynowak in https://github.com/project-radius/radius/pull/5804 -* Update redis schema to include URL and SSL by @sk593 in https://github.com/project-radius/radius/pull/5791 -* Create Radius release automation by @willdavsmith in https://github.com/project-radius/radius/pull/5766 -* Release Radius v0.22.0-rc2 by @willdavsmith in https://github.com/project-radius/radius/pull/5811 -* Clean up go mods by @youngbupark in https://github.com/project-radius/radius/pull/5813 -* Add helm linter to workflow by @youngbupark in https://github.com/project-radius/radius/pull/5817 -* Update redis schema check by @sk593 in https://github.com/project-radius/radius/pull/5818 -* Cleaning up `release.yaml` by @willdavsmith in https://github.com/project-radius/radius/pull/5814 -* Update to pull request template by @rynowak in https://github.com/project-radius/radius/pull/5822 -* Streamline the test context creation by @youngbupark in https://github.com/project-radius/radius/pull/5816 -* Adding Terraform driver and integration with Terraform installation by @kachawla in https://github.com/project-radius/radius/pull/5805 -* Update old UCP tests by @rynowak in https://github.com/project-radius/radius/pull/5824 -* Release Radius v0.22.0 by @willdavsmith in https://github.com/project-radius/radius/pull/5826 -* Add AWS S3 recipe functional test by @willdavsmith in https://github.com/project-radius/radius/pull/5760 -* Add comments : Part 1 (pkg/cli/...) by @shriraml-ms in https://github.com/project-radius/radius/pull/5531 -* Add Comments: Part 3 (first of a few PRs for pkg/ucp) by @shriraml-ms in https://github.com/project-radius/radius/pull/5643 -* Add resource ID to ErrNotFound{} by @vinayada1 in https://github.com/project-radius/radius/pull/5768 -* Adding contibuting docs for app model changes by @vishwahiremat in https://github.com/project-radius/radius/pull/5773 -* Adding AWS region selection to rad init by @willdavsmith in https://github.com/project-radius/radius/pull/5815 -* Generate TF module config and integrate with init by @kachawla in https://github.com/project-radius/radius/pull/5841 -* Update contribution docs by @nithyatsu in https://github.com/project-radius/radius/pull/5721 -* Add Comments: Part 2 (pkg/arm-rpc) by @shriraml-ms in https://github.com/project-radius/radius/pull/5627 -* Migrate gorilla-mux to go-chi by @youngbupark in https://github.com/project-radius/radius/pull/5828 -* Add release notes instructions and template by @AaronCrawfis in https://github.com/project-radius/radius/pull/5847 -* Update contibuting docs for app model changes by @vishwahiremat in https://github.com/project-radius/radius/pull/5852 -* Add Comments: Part 5 (pkg/ucp/api to pkg/ucp/queue) by @shriraml-ms in https://github.com/project-radius/radius/pull/5835 -* Add Comments: Part 7 (pkg/armrpc - refinements) by @shriraml-ms in https://github.com/project-radius/radius/pull/5850 -* Fixing AWS connection URL to use Recipe output by @sk593 in https://github.com/project-radius/radius/pull/5862 -* Add Comments: Part 8 (pkg/azure) by @shriraml-ms in https://github.com/project-radius/radius/pull/5856 -* Add Comments: Part 10 (pkg/aws, pkg/version) by @shriraml-ms in https://github.com/project-radius/radius/pull/5865 -* Add Comments: Part 6 (pkg/linkrp) by @shriraml-ms in https://github.com/project-radius/radius/pull/5845 -* Link to contributing.md in the repo from readme. by @rynowak in https://github.com/project-radius/radius/pull/5870 -* Add `test-failure` label by @youngbupark in https://github.com/project-radius/radius/pull/5871 -* Add Comments: Part 11 (pkg/datastorerp) by @shriraml-ms in https://github.com/project-radius/radius/pull/5868 -* Adding Terraform Module Version to environment App Model by @vishwahiremat in https://github.com/project-radius/radius/pull/5854 -* Rename corerp functional tests to shared by @lakshmimsft in https://github.com/project-radius/radius/pull/5872 -* Reduce GC count in appcoreRP upon start up by @nithyatsu in https://github.com/project-radius/radius/pull/5855 -* Add Comments: Part 9 (pkg/ucp/resources to pkg/ucp/util) by @shriraml-ms in https://github.com/project-radius/radius/pull/5859 -* MessagingRP Functional Tests by @lakshmimsft in https://github.com/project-radius/radius/pull/5853 -* Update "dev recipes" to "local dev recipes" by @AaronCrawfis in https://github.com/project-radius/radius/pull/5879 -* Create env in current workspace if one exists by @vinayada1 in https://github.com/project-radius/radius/pull/5882 -* Move LinkRP output resource deletion logic to Bicep/Terraform drivers by @sk593 in https://github.com/project-radius/radius/pull/5875 -* Initial commit of Radius infra for Azure by @youngbupark in https://github.com/project-radius/radius/pull/5884 -* Fix for list recipes flakey unit test by @vishwahiremat in https://github.com/project-radius/radius/pull/5894 -* small improvements in aws deletion test code by @nithyatsu in https://github.com/project-radius/radius/pull/5885 -* Release v0.23.0-rc1 by @lakshmimsft in https://github.com/project-radius/radius/pull/5891 -* modify container swagger files to include port and scheme fields by @farazmsiddiqi in https://github.com/project-radius/radius/pull/5887 -* Fixes concurrency issue in build workflow by @willdavsmith in https://github.com/project-radius/radius/pull/5898 -* Initial commit of e2e test workflow on AKS with monitor by @youngbupark in https://github.com/project-radius/radius/pull/5886 +* Update rad init prompt for AWS provider by @kachawla in https://github.com/radius-project/radius/pull/5771 +* Fix publicEndpointOverride reference by @youngbupark in https://github.com/radius-project/radius/pull/5777 +* Add remaining types to dev recipes processing by @AaronCrawfis in https://github.com/radius-project/radius/pull/5778 +* Add mongodb resource limits by @sk593 in https://github.com/radius-project/radius/pull/5789 +* Update build.yaml concurrency group to include the GitHub ref by @willdavsmith in https://github.com/radius-project/radius/pull/5779 +* Readme.md for radius repo by @nithyatsu in https://github.com/radius-project/radius/pull/5703 +* Mount directory for Terraform execution by @kachawla in https://github.com/radius-project/radius/pull/5797 +* Rename appcore-rp to applications-rp and clean up unused files. by @youngbupark in https://github.com/radius-project/radius/pull/5802 +* Update governance statement by @willtsai in https://github.com/radius-project/radius/pull/5770 +* Linkrp split namespace: messagingrp by @lakshmimsft in https://github.com/radius-project/radius/pull/5733 +* Fetch only radius-bot.js by @youngbupark in https://github.com/radius-project/radius/pull/5803 +* Make UCP routing modular by @rynowak in https://github.com/radius-project/radius/pull/5804 +* Update redis schema to include URL and SSL by @sk593 in https://github.com/radius-project/radius/pull/5791 +* Create Radius release automation by @willdavsmith in https://github.com/radius-project/radius/pull/5766 +* Release Radius v0.22.0-rc2 by @willdavsmith in https://github.com/radius-project/radius/pull/5811 +* Clean up go mods by @youngbupark in https://github.com/radius-project/radius/pull/5813 +* Add helm linter to workflow by @youngbupark in https://github.com/radius-project/radius/pull/5817 +* Update redis schema check by @sk593 in https://github.com/radius-project/radius/pull/5818 +* Cleaning up `release.yaml` by @willdavsmith in https://github.com/radius-project/radius/pull/5814 +* Update to pull request template by @rynowak in https://github.com/radius-project/radius/pull/5822 +* Streamline the test context creation by @youngbupark in https://github.com/radius-project/radius/pull/5816 +* Adding Terraform driver and integration with Terraform installation by @kachawla in https://github.com/radius-project/radius/pull/5805 +* Update old UCP tests by @rynowak in https://github.com/radius-project/radius/pull/5824 +* Release Radius v0.22.0 by @willdavsmith in https://github.com/radius-project/radius/pull/5826 +* Add AWS S3 recipe functional test by @willdavsmith in https://github.com/radius-project/radius/pull/5760 +* Add comments : Part 1 (pkg/cli/...) by @shriraml-ms in https://github.com/radius-project/radius/pull/5531 +* Add Comments: Part 3 (first of a few PRs for pkg/ucp) by @shriraml-ms in https://github.com/radius-project/radius/pull/5643 +* Add resource ID to ErrNotFound{} by @vinayada1 in https://github.com/radius-project/radius/pull/5768 +* Adding contibuting docs for app model changes by @vishwahiremat in https://github.com/radius-project/radius/pull/5773 +* Adding AWS region selection to rad init by @willdavsmith in https://github.com/radius-project/radius/pull/5815 +* Generate TF module config and integrate with init by @kachawla in https://github.com/radius-project/radius/pull/5841 +* Update contribution docs by @nithyatsu in https://github.com/radius-project/radius/pull/5721 +* Add Comments: Part 2 (pkg/arm-rpc) by @shriraml-ms in https://github.com/radius-project/radius/pull/5627 +* Migrate gorilla-mux to go-chi by @youngbupark in https://github.com/radius-project/radius/pull/5828 +* Add release notes instructions and template by @AaronCrawfis in https://github.com/radius-project/radius/pull/5847 +* Update contibuting docs for app model changes by @vishwahiremat in https://github.com/radius-project/radius/pull/5852 +* Add Comments: Part 5 (pkg/ucp/api to pkg/ucp/queue) by @shriraml-ms in https://github.com/radius-project/radius/pull/5835 +* Add Comments: Part 7 (pkg/armrpc - refinements) by @shriraml-ms in https://github.com/radius-project/radius/pull/5850 +* Fixing AWS connection URL to use Recipe output by @sk593 in https://github.com/radius-project/radius/pull/5862 +* Add Comments: Part 8 (pkg/azure) by @shriraml-ms in https://github.com/radius-project/radius/pull/5856 +* Add Comments: Part 10 (pkg/aws, pkg/version) by @shriraml-ms in https://github.com/radius-project/radius/pull/5865 +* Add Comments: Part 6 (pkg/linkrp) by @shriraml-ms in https://github.com/radius-project/radius/pull/5845 +* Link to contributing.md in the repo from readme. by @rynowak in https://github.com/radius-project/radius/pull/5870 +* Add `test-failure` label by @youngbupark in https://github.com/radius-project/radius/pull/5871 +* Add Comments: Part 11 (pkg/datastorerp) by @shriraml-ms in https://github.com/radius-project/radius/pull/5868 +* Adding Terraform Module Version to environment App Model by @vishwahiremat in https://github.com/radius-project/radius/pull/5854 +* Rename corerp functional tests to shared by @lakshmimsft in https://github.com/radius-project/radius/pull/5872 +* Reduce GC count in appcoreRP upon start up by @nithyatsu in https://github.com/radius-project/radius/pull/5855 +* Add Comments: Part 9 (pkg/ucp/resources to pkg/ucp/util) by @shriraml-ms in https://github.com/radius-project/radius/pull/5859 +* MessagingRP Functional Tests by @lakshmimsft in https://github.com/radius-project/radius/pull/5853 +* Update "dev recipes" to "local dev recipes" by @AaronCrawfis in https://github.com/radius-project/radius/pull/5879 +* Create env in current workspace if one exists by @vinayada1 in https://github.com/radius-project/radius/pull/5882 +* Move LinkRP output resource deletion logic to Bicep/Terraform drivers by @sk593 in https://github.com/radius-project/radius/pull/5875 +* Initial commit of Radius infra for Azure by @youngbupark in https://github.com/radius-project/radius/pull/5884 +* Fix for list recipes flakey unit test by @vishwahiremat in https://github.com/radius-project/radius/pull/5894 +* small improvements in aws deletion test code by @nithyatsu in https://github.com/radius-project/radius/pull/5885 +* Release v0.23.0-rc1 by @lakshmimsft in https://github.com/radius-project/radius/pull/5891 +* modify container swagger files to include port and scheme fields by @farazmsiddiqi in https://github.com/radius-project/radius/pull/5887 +* Fixes concurrency issue in build workflow by @willdavsmith in https://github.com/radius-project/radius/pull/5898 +* Initial commit of e2e test workflow on AKS with monitor by @youngbupark in https://github.com/radius-project/radius/pull/5886 diff --git a/docs/release-notes/v0.24.0.md b/docs/release-notes/v0.24.0.md index bef6f3a633..d73693c1e2 100644 --- a/docs/release-notes/v0.24.0.md +++ b/docs/release-notes/v0.24.0.md @@ -48,91 +48,91 @@ During our preview stage, an upgrade to Radius v0.24.0 requires a full reinstall ## Full changelog -* Fix valid radius build window const by @youngbupark in https://github.com/project-radius/radius/pull/5901 -* Release v0.23.0 by @lakshmimsft in https://github.com/project-radius/radius/pull/5902 -* Generate Terraform Providers Config for Supported Required Providers by @kachawla in https://github.com/project-radius/radius/pull/5874 -* Remove deployments plane from Radius by @rynowak in https://github.com/project-radius/radius/pull/5821 -* Add terraform directory to gitignore by @rynowak in https://github.com/project-radius/radius/pull/5908 -* Improve table formatting for multi-line entries by @rynowak in https://github.com/project-radius/radius/pull/5899 -* Correction in docs URL by @lakshmimsft in https://github.com/project-radius/radius/pull/5905 -* Add publishing of terraform recipes for tests by @rynowak in https://github.com/project-radius/radius/pull/5909 -* Document release notes process and add 0.23.0 release notes by @AaronCrawfis in https://github.com/project-radius/radius/pull/5913 -* Skip MongoDB recipe test by @youngbupark in https://github.com/project-radius/radius/pull/5930 -* Add Comments: Part 4 (pkg/cli/cmd...) by @shriraml-ms in https://github.com/project-radius/radius/pull/5834 -* Add 'rad app connections' command by @rynowak in https://github.com/project-radius/radius/pull/5907 -* Add terraform recipes test infra by @rynowak in https://github.com/project-radius/radius/pull/5931 -* Add Comments: Part 14 (pkg/sdk, pkg/algorithm, pkg/middleware, pkg/to) by @shriraml-ms in https://github.com/project-radius/radius/pull/5927 -* Add Comments: Part 16 (pkg/metrics, pkg/trace, pkg/profiler) by @shriraml-ms in https://github.com/project-radius/radius/pull/5938 -* Add Comments: Part 13 (pkg/kube*) by @shriraml-ms in https://github.com/project-radius/radius/pull/5923 -* Use GHCR for container images by @youngbupark in https://github.com/project-radius/radius/pull/5915 -* Remove list output from rad CLI by @AaronCrawfis in https://github.com/project-radius/radius/pull/5945 -* Split Namespace: Applications.Dapr Types by @lakshmimsft in https://github.com/project-radius/radius/pull/5943 -* Update `rad run` port-forwarding logic by @willdavsmith in https://github.com/project-radius/radius/pull/5745 -* Allow functional test to set DE_IMAGE and DE_TAG by @willdavsmith in https://github.com/project-radius/radius/pull/5937 -* Cleanup todos by @vinayada1 in https://github.com/project-radius/radius/pull/5911 -* Fix undefined repo name in functional test run by @willdavsmith in https://github.com/project-radius/radius/pull/5951 -* Add az cli command for purging CDN by @youngbupark in https://github.com/project-radius/radius/pull/5955 -* Clean up sample resource groups and container images in 3 days by @youngbupark in https://github.com/project-radius/radius/pull/5957 -* Fail deployments based on pod status by @vinayada1 in https://github.com/project-radius/radius/pull/5823 -* Add Comments: Part 17 (pkg/daprrp) by @shriraml-ms in https://github.com/project-radius/radius/pull/5940 -* Upgrade all packages to resolve the security vulnerability by @youngbupark in https://github.com/project-radius/radius/pull/5960 -* Add Comments: Part 18 (pkg/messagingrp) by @shriraml-ms in https://github.com/project-radius/radius/pull/5942 -* Update the grafana dashboard to the latest by @youngbupark in https://github.com/project-radius/radius/pull/5965 -* Security vulnerability: Upgrade base container image and packages in magpiego by @youngbupark in https://github.com/project-radius/radius/pull/5966 -* Add functional test for Terraform recipes by @rynowak in https://github.com/project-radius/radius/pull/5939 -* disable pod unschedulable check by @vinayada1 in https://github.com/project-radius/radius/pull/5968 -* Skipping failing AWS tests by @willdavsmith in https://github.com/project-radius/radius/pull/5986 -* Fix DE_IMAGE and DE_TAG not being set by @willdavsmith in https://github.com/project-radius/radius/pull/5970 -* Fix rad debug-logs by @rynowak in https://github.com/project-radius/radius/pull/5989 -* Add TODO comment to enable new discovery client by @youngbupark in https://github.com/project-radius/radius/pull/5975 -* Improve failure reporting in CLI by @rynowak in https://github.com/project-radius/radius/pull/5990 -* Improve test/infra bicep template by @youngbupark in https://github.com/project-radius/radius/pull/5969 -* Add host, port, vhost, username, password, and uri to RabbitMQ resource by @vishwahiremat in https://github.com/project-radius/radius/pull/5863 -* fix multiple bugs with rad credential by @nithyatsu in https://github.com/project-radius/radius/pull/5900 -* Upgrade tool versions for functional tests by @youngbupark in https://github.com/project-radius/radius/pull/5956 -* Add Comments: Part 15 (pkg/recipes, pkg/rp, pkg/resourcemodel, pkg/validator) by @shriraml-ms in https://github.com/project-radius/radius/pull/5933 -* Add Comments: Part 12 (pkg/corerp) by @shriraml-ms in https://github.com/project-radius/radius/pull/5922 -* Generate Terraform Providers Credentials Config by @kachawla in https://github.com/project-radius/radius/pull/5961 -* DaprRP Functional Tests by @lakshmimsft in https://github.com/project-radius/radius/pull/5959 -* Add unit test for JSON Terraform config validation by @kachawla in https://github.com/project-radius/radius/pull/6000 -* Dapr Test Update (dapr_component_name_conflict_test) by @lakshmimsft in https://github.com/project-radius/radius/pull/6011 -* Add container changes to generate a k8s service when it exposes ports. by @farazmsiddiqi in https://github.com/project-radius/radius/pull/5857 -* Lower polling frequency for async operations by @rynowak in https://github.com/project-radius/radius/pull/6019 -* Update `rad init --dev` to be the main experience instead of a flag by @AaronCrawfis in https://github.com/project-radius/radius/pull/5665 -* Display HTTP response body on health check failure by @rynowak in https://github.com/project-radius/radius/pull/6010 -* Add Terraform Recipe functional test by @kachawla in https://github.com/project-radius/radius/pull/6012 -* Add Comments: Part 19 (test/...) by @shriraml-ms in https://github.com/project-radius/radius/pull/5979 -* Populate RecipeContext to Terraform module config by @youngbupark in https://github.com/project-radius/radius/pull/5999 -* Populate missing env namespace in recipe config by @youngbupark in https://github.com/project-radius/radius/pull/6025 -* Use Recipe context to kubernetes redis recipe by @youngbupark in https://github.com/project-radius/radius/pull/6030 -* Add E2E test for Terraform recipe with Azure storage by @kachawla in https://github.com/project-radius/radius/pull/6014 -* Fix TF recipe context test in long-running by @youngbupark in https://github.com/project-radius/radius/pull/6033 -* Standardize cloud provider table labels by @AaronCrawfis in https://github.com/project-radius/radius/pull/6036 -* update gateway for dns functionality by @farazmsiddiqi in https://github.com/project-radius/radius/pull/6024 -* Split Namespace: Applications.Datastores Types by @lakshmimsft in https://github.com/project-radius/radius/pull/6018 -* Enable tutorial test by @rynowak in https://github.com/project-radius/radius/pull/6049 -* Test improvements to AWS functional tests by @willdavsmith in https://github.com/project-radius/radius/pull/6035 -* Fix misuse of log verbosity by @rynowak in https://github.com/project-radius/radius/pull/6050 -* Publish rad cli to GitHub Release by @youngbupark in https://github.com/project-radius/radius/pull/6026 -* Application.Datastores Functional Tests by @lakshmimsft in https://github.com/project-radius/radius/pull/6043 -* Configuring Terraform Driver logs by @ytimocin in https://github.com/project-radius/radius/pull/6037 -* Add check for Bicep filename in `rad app delete` by @AaronCrawfis in https://github.com/project-radius/radius/pull/6039 -* Increase memory limit for applications-rp by @rynowak in https://github.com/project-radius/radius/pull/6067 -* Making template kind a discriminator by @vishwahiremat in https://github.com/project-radius/radius/pull/6029 -* Split Namespace: Applications.Core/extender type update by @lakshmimsft in https://github.com/project-radius/radius/pull/6057 -* Remove imagePullPolicy from being set by @AaronCrawfis in https://github.com/project-radius/radius/pull/6066 -* Fix spelling by @AaronCrawfis in https://github.com/project-radius/radius/pull/6072 -* Add functional tests for Bicep driver by @rynowak in https://github.com/project-radius/radius/pull/6048 -* Update Radius release automation versions file by @willdavsmith in https://github.com/project-radius/radius/pull/5917 -* Fix typo in release script by @willdavsmith in https://github.com/project-radius/radius/pull/6078 -* Update TF Logs Writer by @ytimocin in https://github.com/project-radius/radius/pull/6076 -* Recipe Engine and Driver Metrics by @ytimocin in https://github.com/project-radius/radius/pull/6041 -* Release: 0.24.0-rc1 by @willdavsmith in https://github.com/project-radius/radius/pull/6077 -* Remove Function Explanation heading from comments by @rynowak in https://github.com/project-radius/radius/pull/6075 -* Implement Terraform Recipe Outputs by @kachawla in https://github.com/project-radius/radius/pull/6062 -* Fix failures of GitHub Release by @youngbupark in https://github.com/project-radius/radius/pull/6084 -* Use Kubernetes Secret as backend by @vishwahiremat in https://github.com/project-radius/radius/pull/6038 -* Add the step to publish chart to GHCR by @youngbupark in https://github.com/project-radius/radius/pull/6071 - - -**Full Changelog**: https://github.com/project-radius/radius/compare/v0.23.0...v0.24.0 +* Fix valid radius build window const by @youngbupark in https://github.com/radius-project/radius/pull/5901 +* Release v0.23.0 by @lakshmimsft in https://github.com/radius-project/radius/pull/5902 +* Generate Terraform Providers Config for Supported Required Providers by @kachawla in https://github.com/radius-project/radius/pull/5874 +* Remove deployments plane from Radius by @rynowak in https://github.com/radius-project/radius/pull/5821 +* Add terraform directory to gitignore by @rynowak in https://github.com/radius-project/radius/pull/5908 +* Improve table formatting for multi-line entries by @rynowak in https://github.com/radius-project/radius/pull/5899 +* Correction in docs URL by @lakshmimsft in https://github.com/radius-project/radius/pull/5905 +* Add publishing of terraform recipes for tests by @rynowak in https://github.com/radius-project/radius/pull/5909 +* Document release notes process and add 0.23.0 release notes by @AaronCrawfis in https://github.com/radius-project/radius/pull/5913 +* Skip MongoDB recipe test by @youngbupark in https://github.com/radius-project/radius/pull/5930 +* Add Comments: Part 4 (pkg/cli/cmd...) by @shriraml-ms in https://github.com/radius-project/radius/pull/5834 +* Add 'rad app connections' command by @rynowak in https://github.com/radius-project/radius/pull/5907 +* Add terraform recipes test infra by @rynowak in https://github.com/radius-project/radius/pull/5931 +* Add Comments: Part 14 (pkg/sdk, pkg/algorithm, pkg/middleware, pkg/to) by @shriraml-ms in https://github.com/radius-project/radius/pull/5927 +* Add Comments: Part 16 (pkg/metrics, pkg/trace, pkg/profiler) by @shriraml-ms in https://github.com/radius-project/radius/pull/5938 +* Add Comments: Part 13 (pkg/kube*) by @shriraml-ms in https://github.com/radius-project/radius/pull/5923 +* Use GHCR for container images by @youngbupark in https://github.com/radius-project/radius/pull/5915 +* Remove list output from rad CLI by @AaronCrawfis in https://github.com/radius-project/radius/pull/5945 +* Split Namespace: Applications.Dapr Types by @lakshmimsft in https://github.com/radius-project/radius/pull/5943 +* Update `rad run` port-forwarding logic by @willdavsmith in https://github.com/radius-project/radius/pull/5745 +* Allow functional test to set DE_IMAGE and DE_TAG by @willdavsmith in https://github.com/radius-project/radius/pull/5937 +* Cleanup todos by @vinayada1 in https://github.com/radius-project/radius/pull/5911 +* Fix undefined repo name in functional test run by @willdavsmith in https://github.com/radius-project/radius/pull/5951 +* Add az cli command for purging CDN by @youngbupark in https://github.com/radius-project/radius/pull/5955 +* Clean up sample resource groups and container images in 3 days by @youngbupark in https://github.com/radius-project/radius/pull/5957 +* Fail deployments based on pod status by @vinayada1 in https://github.com/radius-project/radius/pull/5823 +* Add Comments: Part 17 (pkg/daprrp) by @shriraml-ms in https://github.com/radius-project/radius/pull/5940 +* Upgrade all packages to resolve the security vulnerability by @youngbupark in https://github.com/radius-project/radius/pull/5960 +* Add Comments: Part 18 (pkg/messagingrp) by @shriraml-ms in https://github.com/radius-project/radius/pull/5942 +* Update the grafana dashboard to the latest by @youngbupark in https://github.com/radius-project/radius/pull/5965 +* Security vulnerability: Upgrade base container image and packages in magpiego by @youngbupark in https://github.com/radius-project/radius/pull/5966 +* Add functional test for Terraform recipes by @rynowak in https://github.com/radius-project/radius/pull/5939 +* disable pod unschedulable check by @vinayada1 in https://github.com/radius-project/radius/pull/5968 +* Skipping failing AWS tests by @willdavsmith in https://github.com/radius-project/radius/pull/5986 +* Fix DE_IMAGE and DE_TAG not being set by @willdavsmith in https://github.com/radius-project/radius/pull/5970 +* Fix rad debug-logs by @rynowak in https://github.com/radius-project/radius/pull/5989 +* Add TODO comment to enable new discovery client by @youngbupark in https://github.com/radius-project/radius/pull/5975 +* Improve failure reporting in CLI by @rynowak in https://github.com/radius-project/radius/pull/5990 +* Improve test/infra bicep template by @youngbupark in https://github.com/radius-project/radius/pull/5969 +* Add host, port, vhost, username, password, and uri to RabbitMQ resource by @vishwahiremat in https://github.com/radius-project/radius/pull/5863 +* fix multiple bugs with rad credential by @nithyatsu in https://github.com/radius-project/radius/pull/5900 +* Upgrade tool versions for functional tests by @youngbupark in https://github.com/radius-project/radius/pull/5956 +* Add Comments: Part 15 (pkg/recipes, pkg/rp, pkg/resourcemodel, pkg/validator) by @shriraml-ms in https://github.com/radius-project/radius/pull/5933 +* Add Comments: Part 12 (pkg/corerp) by @shriraml-ms in https://github.com/radius-project/radius/pull/5922 +* Generate Terraform Providers Credentials Config by @kachawla in https://github.com/radius-project/radius/pull/5961 +* DaprRP Functional Tests by @lakshmimsft in https://github.com/radius-project/radius/pull/5959 +* Add unit test for JSON Terraform config validation by @kachawla in https://github.com/radius-project/radius/pull/6000 +* Dapr Test Update (dapr_component_name_conflict_test) by @lakshmimsft in https://github.com/radius-project/radius/pull/6011 +* Add container changes to generate a k8s service when it exposes ports. by @farazmsiddiqi in https://github.com/radius-project/radius/pull/5857 +* Lower polling frequency for async operations by @rynowak in https://github.com/radius-project/radius/pull/6019 +* Update `rad init --dev` to be the main experience instead of a flag by @AaronCrawfis in https://github.com/radius-project/radius/pull/5665 +* Display HTTP response body on health check failure by @rynowak in https://github.com/radius-project/radius/pull/6010 +* Add Terraform Recipe functional test by @kachawla in https://github.com/radius-project/radius/pull/6012 +* Add Comments: Part 19 (test/...) by @shriraml-ms in https://github.com/radius-project/radius/pull/5979 +* Populate RecipeContext to Terraform module config by @youngbupark in https://github.com/radius-project/radius/pull/5999 +* Populate missing env namespace in recipe config by @youngbupark in https://github.com/radius-project/radius/pull/6025 +* Use Recipe context to kubernetes redis recipe by @youngbupark in https://github.com/radius-project/radius/pull/6030 +* Add E2E test for Terraform recipe with Azure storage by @kachawla in https://github.com/radius-project/radius/pull/6014 +* Fix TF recipe context test in long-running by @youngbupark in https://github.com/radius-project/radius/pull/6033 +* Standardize cloud provider table labels by @AaronCrawfis in https://github.com/radius-project/radius/pull/6036 +* update gateway for dns functionality by @farazmsiddiqi in https://github.com/radius-project/radius/pull/6024 +* Split Namespace: Applications.Datastores Types by @lakshmimsft in https://github.com/radius-project/radius/pull/6018 +* Enable tutorial test by @rynowak in https://github.com/radius-project/radius/pull/6049 +* Test improvements to AWS functional tests by @willdavsmith in https://github.com/radius-project/radius/pull/6035 +* Fix misuse of log verbosity by @rynowak in https://github.com/radius-project/radius/pull/6050 +* Publish rad cli to GitHub Release by @youngbupark in https://github.com/radius-project/radius/pull/6026 +* Application.Datastores Functional Tests by @lakshmimsft in https://github.com/radius-project/radius/pull/6043 +* Configuring Terraform Driver logs by @ytimocin in https://github.com/radius-project/radius/pull/6037 +* Add check for Bicep filename in `rad app delete` by @AaronCrawfis in https://github.com/radius-project/radius/pull/6039 +* Increase memory limit for applications-rp by @rynowak in https://github.com/radius-project/radius/pull/6067 +* Making template kind a discriminator by @vishwahiremat in https://github.com/radius-project/radius/pull/6029 +* Split Namespace: Applications.Core/extender type update by @lakshmimsft in https://github.com/radius-project/radius/pull/6057 +* Remove imagePullPolicy from being set by @AaronCrawfis in https://github.com/radius-project/radius/pull/6066 +* Fix spelling by @AaronCrawfis in https://github.com/radius-project/radius/pull/6072 +* Add functional tests for Bicep driver by @rynowak in https://github.com/radius-project/radius/pull/6048 +* Update Radius release automation versions file by @willdavsmith in https://github.com/radius-project/radius/pull/5917 +* Fix typo in release script by @willdavsmith in https://github.com/radius-project/radius/pull/6078 +* Update TF Logs Writer by @ytimocin in https://github.com/radius-project/radius/pull/6076 +* Recipe Engine and Driver Metrics by @ytimocin in https://github.com/radius-project/radius/pull/6041 +* Release: 0.24.0-rc1 by @willdavsmith in https://github.com/radius-project/radius/pull/6077 +* Remove Function Explanation heading from comments by @rynowak in https://github.com/radius-project/radius/pull/6075 +* Implement Terraform Recipe Outputs by @kachawla in https://github.com/radius-project/radius/pull/6062 +* Fix failures of GitHub Release by @youngbupark in https://github.com/radius-project/radius/pull/6084 +* Use Kubernetes Secret as backend by @vishwahiremat in https://github.com/radius-project/radius/pull/6038 +* Add the step to publish chart to GHCR by @youngbupark in https://github.com/radius-project/radius/pull/6071 + + +**Full Changelog**: https://github.com/radius-project/radius/compare/v0.23.0...v0.24.0 diff --git a/go.mod b/go.mod index f5f0142375..4e1df70233 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/project-radius/radius +module github.com/radius-project/radius go 1.21 diff --git a/pkg/armrpc/api/v1/armrequestcontext.go b/pkg/armrpc/api/v1/armrequestcontext.go index fdaf29a7c0..16c5da5400 100644 --- a/pkg/armrpc/api/v1/armrequestcontext.go +++ b/pkg/armrpc/api/v1/armrequestcontext.go @@ -27,8 +27,8 @@ import ( "strings" "github.com/google/uuid" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // The below contants are the headers in request from ARM. diff --git a/pkg/armrpc/api/v1/armrequestcontext_test.go b/pkg/armrpc/api/v1/armrequestcontext_test.go index d06a0cee59..0c2c23d5ea 100644 --- a/pkg/armrpc/api/v1/armrequestcontext_test.go +++ b/pkg/armrpc/api/v1/armrequestcontext_test.go @@ -24,7 +24,7 @@ import ( "strings" "testing" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/api/v1/types_test.go b/pkg/armrpc/api/v1/types_test.go index 8b95b03049..94e55ff709 100644 --- a/pkg/armrpc/api/v1/types_test.go +++ b/pkg/armrpc/api/v1/types_test.go @@ -19,7 +19,7 @@ package v1 import ( "testing" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/asyncoperation/controller/controller.go b/pkg/armrpc/asyncoperation/controller/controller.go index 951ed5186a..3081b69511 100644 --- a/pkg/armrpc/asyncoperation/controller/controller.go +++ b/pkg/armrpc/asyncoperation/controller/controller.go @@ -19,9 +19,9 @@ package controller import ( "context" - "github.com/project-radius/radius/pkg/corerp/backend/deployment" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/armrpc/asyncoperation/controller/request.go b/pkg/armrpc/asyncoperation/controller/request.go index 2e0b9752e2..dfcbf57ae7 100644 --- a/pkg/armrpc/asyncoperation/controller/request.go +++ b/pkg/armrpc/asyncoperation/controller/request.go @@ -21,8 +21,8 @@ import ( "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) var ( diff --git a/pkg/armrpc/asyncoperation/controller/request_test.go b/pkg/armrpc/asyncoperation/controller/request_test.go index b26fce6fe4..770255bd02 100644 --- a/pkg/armrpc/asyncoperation/controller/request_test.go +++ b/pkg/armrpc/asyncoperation/controller/request_test.go @@ -23,9 +23,9 @@ import ( "time" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/asyncoperation/controller/result.go b/pkg/armrpc/asyncoperation/controller/result.go index 8cb3a7e68a..ee7ee349b9 100644 --- a/pkg/armrpc/asyncoperation/controller/result.go +++ b/pkg/armrpc/asyncoperation/controller/result.go @@ -17,7 +17,7 @@ limitations under the License. package controller import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) // Result is the response of async operation controller. diff --git a/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go b/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go index 8ef35b142b..97d6a808b3 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go +++ b/pkg/armrpc/asyncoperation/statusmanager/mock_statusmanager.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager (interfaces: StatusManager) +// Source: github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager (interfaces: StatusManager) // Package statusmanager is a generated GoMock package. package statusmanager @@ -11,8 +11,8 @@ import ( gomock "github.com/golang/mock/gomock" uuid "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - resources "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + resources "github.com/radius-project/radius/pkg/ucp/resources" ) // MockStatusManager is a mock of StatusManager interface. diff --git a/pkg/armrpc/asyncoperation/statusmanager/status.go b/pkg/armrpc/asyncoperation/statusmanager/status.go index c9b6abd9c5..cb7be2127b 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/status.go +++ b/pkg/armrpc/asyncoperation/statusmanager/status.go @@ -19,7 +19,7 @@ package statusmanager import ( time "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) // Status is the datamodel for Async operation statuses. diff --git a/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go b/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go index 8743df7ef1..954324b755 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go +++ b/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go @@ -23,13 +23,13 @@ import ( "strings" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/trace" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/trace" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/google/uuid" ) @@ -50,7 +50,7 @@ type QueueOperationOptions struct { RetryAfter time.Duration } -//go:generate mockgen -destination=./mock_statusmanager.go -package=statusmanager -self_package github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager StatusManager +//go:generate mockgen -destination=./mock_statusmanager.go -package=statusmanager -self_package github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager StatusManager // StatusManager is an interface to manage async operation status. type StatusManager interface { diff --git a/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go b/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go index 03f8eacc10..8a3fa6b87a 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go +++ b/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go @@ -24,11 +24,11 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/asyncoperation/worker/registry.go b/pkg/armrpc/asyncoperation/worker/registry.go index 1b1b21f687..4a178e7b7f 100644 --- a/pkg/armrpc/asyncoperation/worker/registry.go +++ b/pkg/armrpc/asyncoperation/worker/registry.go @@ -20,9 +20,9 @@ import ( "context" "sync" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/ucp/dataprovider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/ucp/dataprovider" ) type ControllerFactoryFunc func(opts ctrl.Options) (ctrl.Controller, error) diff --git a/pkg/armrpc/asyncoperation/worker/registry_test.go b/pkg/armrpc/asyncoperation/worker/registry_test.go index d35ed9bf7b..633fcecf82 100644 --- a/pkg/armrpc/asyncoperation/worker/registry_test.go +++ b/pkg/armrpc/asyncoperation/worker/registry_test.go @@ -21,10 +21,10 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/corerp/backend/deployment" - "github.com/project-radius/radius/pkg/ucp/dataprovider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/ucp/dataprovider" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/asyncoperation/worker/service.go b/pkg/armrpc/asyncoperation/worker/service.go index 6b6d9c7aa4..f8fb7c508a 100644 --- a/pkg/armrpc/asyncoperation/worker/service.go +++ b/pkg/armrpc/asyncoperation/worker/service.go @@ -19,13 +19,13 @@ package worker import ( "context" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - qprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + qprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" @@ -87,7 +87,7 @@ func (s *Service) Init(ctx context.Context) error { } // Use legacy discovery client to avoid the issue of the staled GroupVersion discovery(api.ucp.dev/v1alpha3). - // TODO: Disable UseLegacyDiscovery once https://github.com/project-radius/radius/issues/5974 is resolved. + // TODO: Disable UseLegacyDiscovery once https://github.com/radius-project/radius/issues/5974 is resolved. discoveryClient.UseLegacyDiscovery = true s.KubeDiscoveryClient = discoveryClient } diff --git a/pkg/armrpc/asyncoperation/worker/worker.go b/pkg/armrpc/asyncoperation/worker/worker.go index 47c4b491b7..cc6a0626cd 100644 --- a/pkg/armrpc/asyncoperation/worker/worker.go +++ b/pkg/armrpc/asyncoperation/worker/worker.go @@ -26,16 +26,16 @@ import ( "strings" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/logging" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/trace" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/logging" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/trace" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" "github.com/google/uuid" "golang.org/x/sync/semaphore" diff --git a/pkg/armrpc/asyncoperation/worker/worker_runoperation_test.go b/pkg/armrpc/asyncoperation/worker/worker_runoperation_test.go index 1f3a01a821..c3db36fbe8 100644 --- a/pkg/armrpc/asyncoperation/worker/worker_runoperation_test.go +++ b/pkg/armrpc/asyncoperation/worker/worker_runoperation_test.go @@ -26,15 +26,15 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/corerp/backend/deployment" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - "github.com/project-radius/radius/pkg/ucp/queue/inmemory" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/queue/inmemory" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" "go.uber.org/atomic" ) diff --git a/pkg/armrpc/asyncoperation/worker/worker_test.go b/pkg/armrpc/asyncoperation/worker/worker_test.go index 4b70f1bc9c..735125c157 100644 --- a/pkg/armrpc/asyncoperation/worker/worker_test.go +++ b/pkg/armrpc/asyncoperation/worker/worker_test.go @@ -23,8 +23,8 @@ import ( "time" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/authentication/certvalidator.go b/pkg/armrpc/authentication/certvalidator.go index 397d27d0cb..3b23b639ee 100644 --- a/pkg/armrpc/authentication/certvalidator.go +++ b/pkg/armrpc/authentication/certvalidator.go @@ -22,9 +22,9 @@ import ( "time" "github.com/go-logr/logr" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/armrpc/authentication/certvalidator_test.go b/pkg/armrpc/authentication/certvalidator_test.go index d852837e7e..4edf84d630 100644 --- a/pkg/armrpc/authentication/certvalidator_test.go +++ b/pkg/armrpc/authentication/certvalidator_test.go @@ -32,7 +32,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-logr/logr" - "github.com/project-radius/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/middleware" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/frontend/controller/controller.go b/pkg/armrpc/frontend/controller/controller.go index 7d51c71002..cea4130853 100644 --- a/pkg/armrpc/frontend/controller/controller.go +++ b/pkg/armrpc/frontend/controller/controller.go @@ -21,12 +21,12 @@ import ( "net/http" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - sm "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + sm "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/armrpc/frontend/controller/controller_test.go b/pkg/armrpc/frontend/controller/controller_test.go index d2270acb36..d8435643e4 100644 --- a/pkg/armrpc/frontend/controller/controller_test.go +++ b/pkg/armrpc/frontend/controller/controller_test.go @@ -19,7 +19,7 @@ package controller import ( "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/frontend/controller/operation.go b/pkg/armrpc/frontend/controller/operation.go index 5fb45fabc1..db6d510148 100644 --- a/pkg/armrpc/frontend/controller/operation.go +++ b/pkg/armrpc/frontend/controller/operation.go @@ -23,12 +23,12 @@ import ( "net/http" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - sm "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + sm "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) const ( diff --git a/pkg/armrpc/frontend/controller/util.go b/pkg/armrpc/frontend/controller/util.go index d16e54984f..e673ce2526 100644 --- a/pkg/armrpc/frontend/controller/util.go +++ b/pkg/armrpc/frontend/controller/util.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) var ( diff --git a/pkg/armrpc/frontend/controller/util_test.go b/pkg/armrpc/frontend/controller/util_test.go index 2147966ba2..759b11e943 100644 --- a/pkg/armrpc/frontend/controller/util_test.go +++ b/pkg/armrpc/frontend/controller/util_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription.go b/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription.go index 2538a472d9..35724d5803 100644 --- a/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription.go +++ b/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription.go @@ -21,10 +21,10 @@ import ( "encoding/json" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ ctrl.Controller = (*CreateOrUpdateSubscription)(nil) diff --git a/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription_test.go b/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription_test.go index 1215bda8d8..3dc9a2b884 100644 --- a/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription_test.go +++ b/pkg/armrpc/frontend/defaultoperation/createorupdatesubscription_test.go @@ -23,11 +23,11 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete.go b/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete.go index 75bcbca39f..a2c38bfe4e 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete.go @@ -20,9 +20,9 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" ) // DefaultAsyncDelete is the controller implementation to delete async resource. diff --git a/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete_test.go b/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete_test.go index 787173806d..b586602868 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete_test.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultasyncdelete_test.go @@ -24,12 +24,12 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/defaultasyncput.go b/pkg/armrpc/frontend/defaultoperation/defaultasyncput.go index 54f783927b..017720c500 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultasyncput.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultasyncput.go @@ -20,9 +20,9 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" ) // DefaultAsyncPut is the controller implementation to create or update async resource. diff --git a/pkg/armrpc/frontend/defaultoperation/defaultasyncput_test.go b/pkg/armrpc/frontend/defaultoperation/defaultasyncput_test.go index e65dcd6aaa..21db1d1937 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultasyncput_test.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultasyncput_test.go @@ -25,12 +25,12 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete.go b/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete.go index 3c1d341413..6971c3c74a 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete.go @@ -21,10 +21,10 @@ import ( "errors" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/store" ) // DefaultSyncDelete is the controller implementation to delete resource synchronously. diff --git a/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete_test.go b/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete_test.go index f9509c93a1..6d4547ade3 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete_test.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultsyncdelete_test.go @@ -23,10 +23,10 @@ import ( "net/http/httptest" "testing" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/defaultsyncput.go b/pkg/armrpc/frontend/defaultoperation/defaultsyncput.go index 6cf70b9629..d38703e5a5 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultsyncput.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultsyncput.go @@ -20,9 +20,9 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" ) // DefaultSyncPut is the controller implementation to create or update resource synchronously. diff --git a/pkg/armrpc/frontend/defaultoperation/defaultsyncput_test.go b/pkg/armrpc/frontend/defaultoperation/defaultsyncput_test.go index 85717df213..f7738850ea 100644 --- a/pkg/armrpc/frontend/defaultoperation/defaultsyncput_test.go +++ b/pkg/armrpc/frontend/defaultoperation/defaultsyncput_test.go @@ -24,11 +24,11 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/getoperationresult.go b/pkg/armrpc/frontend/defaultoperation/getoperationresult.go index e162a2f4f0..bf2abbc946 100644 --- a/pkg/armrpc/frontend/defaultoperation/getoperationresult.go +++ b/pkg/armrpc/frontend/defaultoperation/getoperationresult.go @@ -23,12 +23,12 @@ import ( "net/http" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) var _ ctrl.Controller = (*GetOperationResult)(nil) diff --git a/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go b/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go index 2ccf396529..e9276d806c 100644 --- a/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go +++ b/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go @@ -24,12 +24,12 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/getoperationstatus.go b/pkg/armrpc/frontend/defaultoperation/getoperationstatus.go index c6116aa632..f83b31d4eb 100644 --- a/pkg/armrpc/frontend/defaultoperation/getoperationstatus.go +++ b/pkg/armrpc/frontend/defaultoperation/getoperationstatus.go @@ -21,11 +21,11 @@ import ( "errors" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/store" ) var _ ctrl.Controller = (*GetOperationStatus)(nil) diff --git a/pkg/armrpc/frontend/defaultoperation/getoperationstatus_test.go b/pkg/armrpc/frontend/defaultoperation/getoperationstatus_test.go index a6d02e8705..d9f908f846 100644 --- a/pkg/armrpc/frontend/defaultoperation/getoperationstatus_test.go +++ b/pkg/armrpc/frontend/defaultoperation/getoperationstatus_test.go @@ -23,12 +23,12 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/getresource.go b/pkg/armrpc/frontend/defaultoperation/getresource.go index d4ee091276..df19be5924 100644 --- a/pkg/armrpc/frontend/defaultoperation/getresource.go +++ b/pkg/armrpc/frontend/defaultoperation/getresource.go @@ -20,9 +20,9 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" ) // GetResource is the controller implementation to get a resource. @@ -43,7 +43,7 @@ func NewGetResource[P interface { }, nil } -// Run returns the requested resource from the datastore with etag. +// Run returns the requested resource from the datastore with etag. // If the resource does not exist, a not found response is returned. If an error occurs, an error is returned as an internal error. func (e *GetResource[P, T]) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { serviceCtx := v1.ARMRequestContextFromContext(ctx) diff --git a/pkg/armrpc/frontend/defaultoperation/getresource_test.go b/pkg/armrpc/frontend/defaultoperation/getresource_test.go index 17bd761117..9f910afa60 100644 --- a/pkg/armrpc/frontend/defaultoperation/getresource_test.go +++ b/pkg/armrpc/frontend/defaultoperation/getresource_test.go @@ -23,10 +23,10 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/armrpc/frontend/defaultoperation/listresources.go b/pkg/armrpc/frontend/defaultoperation/listresources.go index cf8d1d63c0..0329d6650e 100644 --- a/pkg/armrpc/frontend/defaultoperation/listresources.go +++ b/pkg/armrpc/frontend/defaultoperation/listresources.go @@ -20,10 +20,10 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/store" ) // ListResources is the controller implementation to get the list of resources in resource group. @@ -43,7 +43,7 @@ func NewListResources[P interface { return &ListResources[P, T]{ctrl.NewOperation[P](opts, ctrlOpts), ctrlOpts.ListRecursiveQuery}, nil } -// Run queries the resource data store with a given type and scope and returns the paginated resource list. An internal error +// Run queries the resource data store with a given type and scope and returns the paginated resource list. An internal error // is returned if the query fails. func (e *ListResources[P, T]) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { serviceCtx := v1.ARMRequestContextFromContext(ctx) diff --git a/pkg/armrpc/frontend/defaultoperation/listresources_test.go b/pkg/armrpc/frontend/defaultoperation/listresources_test.go index cc01173eae..549403ea45 100644 --- a/pkg/armrpc/frontend/defaultoperation/listresources_test.go +++ b/pkg/armrpc/frontend/defaultoperation/listresources_test.go @@ -24,10 +24,10 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/google/uuid" diff --git a/pkg/armrpc/frontend/defaultoperation/resource_test.go b/pkg/armrpc/frontend/defaultoperation/resource_test.go index 3b7df1dc3d..c07d305778 100644 --- a/pkg/armrpc/frontend/defaultoperation/resource_test.go +++ b/pkg/armrpc/frontend/defaultoperation/resource_test.go @@ -24,13 +24,13 @@ import ( "net/url" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" ) @@ -217,7 +217,7 @@ func setupTest(tb testing.TB) (func(testing.TB), *store.MockStorageClient, *stat }, mds, msm } -// TODO: Use Referer header instead of X-Forwarded-Proto by following ARM RPC spec - https://github.com/project-radius/radius/issues/3068 +// TODO: Use Referer header instead of X-Forwarded-Proto by following ARM RPC spec - https://github.com/radius-project/radius/issues/3068 func getAsyncLocationPath(sCtx *v1.ARMRequestContext, location string, resourceType string, req *http.Request) string { dest := url.URL{ Host: req.Host, diff --git a/pkg/armrpc/frontend/server/handler.go b/pkg/armrpc/frontend/server/handler.go index f80775e3d0..612c150bd2 100644 --- a/pkg/armrpc/frontend/server/handler.go +++ b/pkg/armrpc/frontend/server/handler.go @@ -25,12 +25,12 @@ import ( "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/servicecontext" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/servicecontext" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.opentelemetry.io/otel/attribute" ) diff --git a/pkg/armrpc/frontend/server/handler_test.go b/pkg/armrpc/frontend/server/handler_test.go index 487ceebc04..db7b005f24 100644 --- a/pkg/armrpc/frontend/server/handler_test.go +++ b/pkg/armrpc/frontend/server/handler_test.go @@ -27,11 +27,11 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/test/testcontext" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/frontend/server/server.go b/pkg/armrpc/frontend/server/server.go index e93ab86590..b69895580a 100644 --- a/pkg/armrpc/frontend/server/server.go +++ b/pkg/armrpc/frontend/server/server.go @@ -21,11 +21,11 @@ import ( "net" "net/http" - "github.com/project-radius/radius/pkg/armrpc/authentication" - "github.com/project-radius/radius/pkg/armrpc/servicecontext" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/validator" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/armrpc/authentication" + "github.com/radius-project/radius/pkg/armrpc/servicecontext" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/validator" + "github.com/radius-project/radius/pkg/version" "github.com/go-chi/chi/v5" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" diff --git a/pkg/armrpc/frontend/server/service.go b/pkg/armrpc/frontend/server/service.go index 4bd958aede..9a51ac2dc3 100644 --- a/pkg/armrpc/frontend/server/service.go +++ b/pkg/armrpc/frontend/server/service.go @@ -21,13 +21,13 @@ import ( "fmt" "net/http" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - "github.com/project-radius/radius/pkg/armrpc/authentication" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - qprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/armrpc/authentication" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + qprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/armrpc/hostoptions/hostoptions.go b/pkg/armrpc/hostoptions/hostoptions.go index 9d2a8ffded..83aaea0922 100644 --- a/pkg/armrpc/hostoptions/hostoptions.go +++ b/pkg/armrpc/hostoptions/hostoptions.go @@ -25,14 +25,14 @@ import ( "os" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/azure/armauth" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/ucp/config" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" - sprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/azure/armauth" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/config" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" + sprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" @@ -149,7 +149,7 @@ func WithContext(ctx context.Context, cfg *ProviderConfig) context.Context { func getKubernetes() (*rest.Config, error) { cfg, err := kubeutil.NewClientConfig(&kubeutil.ConfigOptions{ - // TODO: Allow to use custom context via configuration. - https://github.com/project-radius/radius/issues/5433 + // TODO: Allow to use custom context via configuration. - https://github.com/radius-project/radius/issues/5433 ContextName: "", QPS: kubeutil.DefaultServerQPS, Burst: kubeutil.DefaultServerBurst, diff --git a/pkg/armrpc/hostoptions/providerconfig.go b/pkg/armrpc/hostoptions/providerconfig.go index 45d945ee4b..f192552202 100644 --- a/pkg/armrpc/hostoptions/providerconfig.go +++ b/pkg/armrpc/hostoptions/providerconfig.go @@ -17,14 +17,14 @@ limitations under the License. package hostoptions import ( - metricsprovider "github.com/project-radius/radius/pkg/metrics/provider" - profilerprovider "github.com/project-radius/radius/pkg/profiler/provider" - "github.com/project-radius/radius/pkg/trace" - "github.com/project-radius/radius/pkg/ucp/config" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - qprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - sprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + metricsprovider "github.com/radius-project/radius/pkg/metrics/provider" + profilerprovider "github.com/radius-project/radius/pkg/profiler/provider" + "github.com/radius-project/radius/pkg/trace" + "github.com/radius-project/radius/pkg/ucp/config" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + qprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + sprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // ProviderConfig includes the resource provider configuration. diff --git a/pkg/armrpc/rest/results.go b/pkg/armrpc/rest/results.go index 5dc5783bbd..33d3dc2578 100644 --- a/pkg/armrpc/rest/results.go +++ b/pkg/armrpc/rest/results.go @@ -27,12 +27,12 @@ import ( "github.com/go-playground/validator/v10" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/logging" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/logging" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/ucplog" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/armrpc/rest/results_test.go b/pkg/armrpc/rest/results_test.go index dec3362866..de9d80ab9b 100644 --- a/pkg/armrpc/rest/results_test.go +++ b/pkg/armrpc/rest/results_test.go @@ -30,10 +30,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) func Test_NewLinkedResourceUpdateErrorResponse(t *testing.T) { diff --git a/pkg/armrpc/rpctest/controllers.go b/pkg/armrpc/rpctest/controllers.go index 2380eb428c..131ed3c5e6 100644 --- a/pkg/armrpc/rpctest/controllers.go +++ b/pkg/armrpc/rpctest/controllers.go @@ -22,9 +22,9 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" ) // ControllerContext represents the context of controller tests including common mocks. diff --git a/pkg/armrpc/rpctest/requests.go b/pkg/armrpc/rpctest/requests.go index 9a3a5c4a1c..de7344664f 100644 --- a/pkg/armrpc/rpctest/requests.go +++ b/pkg/armrpc/rpctest/requests.go @@ -23,7 +23,7 @@ import ( "net/http" "os" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) // MustParseOperationType parses the operation type or panics if it fails. diff --git a/pkg/armrpc/rpctest/routers.go b/pkg/armrpc/rpctest/routers.go index 303b0fa37c..73300eb1f1 100644 --- a/pkg/armrpc/rpctest/routers.go +++ b/pkg/armrpc/rpctest/routers.go @@ -25,8 +25,8 @@ import ( "testing" "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/test/testcontext" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/armrpc/servicecontext/middleware.go b/pkg/armrpc/servicecontext/middleware.go index 824333fc30..2563c63170 100644 --- a/pkg/armrpc/servicecontext/middleware.go +++ b/pkg/armrpc/servicecontext/middleware.go @@ -20,8 +20,8 @@ import ( "fmt" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rest" ) // ARMRequestCtx is a middleware handler that adds an ARM request context to an incoming request. It takes in a pathBase diff --git a/pkg/armrpc/servicecontext/middleware_test.go b/pkg/armrpc/servicecontext/middleware_test.go index 7bbfbd6e12..70dcc53cc4 100644 --- a/pkg/armrpc/servicecontext/middleware_test.go +++ b/pkg/armrpc/servicecontext/middleware_test.go @@ -25,7 +25,7 @@ import ( "testing" "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/aws/operations/operations.go b/pkg/aws/operations/operations.go index c5f33d88b2..55fb25ef03 100644 --- a/pkg/aws/operations/operations.go +++ b/pkg/aws/operations/operations.go @@ -119,7 +119,7 @@ func UnflattenProperties(state map[string]any) map[string]any { // GeneratePatch takes in the current state, desired state and type schema of a resource and returns a JSON patch to update the // current state to the desired state, taking into account read-only, create-only and conditional-create-only properties. func GeneratePatch(currentState []byte, desiredState []byte, schema []byte) (jsondiff.Patch, error) { - // See: https://github.com/project-radius/radius/blob/main/docs/adr/ucp/001-aws-resource-updating.md + // See: https://github.com/radius-project/radius/blob/main/docs/adr/ucp/001-aws-resource-updating.md // Get the resource type schema - this will tell us the properties of the // resource as well as which properties are read-only, create-only, etc. diff --git a/pkg/azure/armauth/auth.go b/pkg/azure/armauth/auth.go index 4f34d0f087..1a01674e79 100644 --- a/pkg/azure/armauth/auth.go +++ b/pkg/azure/armauth/auth.go @@ -21,9 +21,9 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/project-radius/radius/pkg/azure/clientv2" - azcred "github.com/project-radius/radius/pkg/azure/credential" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/azure/clientv2" + azcred "github.com/radius-project/radius/pkg/azure/credential" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" ) // Authentication methods diff --git a/pkg/azure/clientv2/customaction.go b/pkg/azure/clientv2/customaction.go index af1243f26a..4efc9a633a 100644 --- a/pkg/azure/clientv2/customaction.go +++ b/pkg/azure/clientv2/customaction.go @@ -26,7 +26,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" ) // ClientCustomActionResponse is the response we get from invoking a custom action. diff --git a/pkg/azure/clientv2/unfold.go b/pkg/azure/clientv2/unfold.go index a81370fedc..9d625a2903 100644 --- a/pkg/azure/clientv2/unfold.go +++ b/pkg/azure/clientv2/unfold.go @@ -26,9 +26,9 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/google/go-cmp/cmp" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/to" ) // ServiceError conforms to the OData v4 error format. diff --git a/pkg/azure/clientv2/unfold_test.go b/pkg/azure/clientv2/unfold_test.go index 5b75b3036f..c035d395c3 100644 --- a/pkg/azure/clientv2/unfold_test.go +++ b/pkg/azure/clientv2/unfold_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/azure/credential/ucpcredentials.go b/pkg/azure/credential/ucpcredentials.go index 32de619af7..b98eb5baf5 100644 --- a/pkg/azure/credential/ucpcredentials.go +++ b/pkg/azure/credential/ucpcredentials.go @@ -25,8 +25,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/ucplog" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.uber.org/atomic" ) diff --git a/pkg/azure/credential/ucpcredentials_test.go b/pkg/azure/credential/ucpcredentials_test.go index 3afa453ab1..7a94f58412 100644 --- a/pkg/azure/credential/ucpcredentials_test.go +++ b/pkg/azure/credential/ucpcredentials_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" ) type mockProvider struct { diff --git a/pkg/azure/roleassignment/roleassignment.go b/pkg/azure/roleassignment/roleassignment.go index dac903064d..b09373f018 100644 --- a/pkg/azure/roleassignment/roleassignment.go +++ b/pkg/azure/roleassignment/roleassignment.go @@ -26,13 +26,13 @@ import ( armauthorization "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization/v2" "github.com/google/uuid" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/to" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // Create checks if a role assignment already exists for a given managed identity, and if not, creates a new role diff --git a/pkg/cli/aws/client.go b/pkg/cli/aws/client.go index 9e32e38f32..fdf0f7f717 100644 --- a/pkg/cli/aws/client.go +++ b/pkg/cli/aws/client.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/sts" ) -//go:generate mockgen -destination=./client_mock.go -package=aws -self_package github.com/project-radius/radius/pkg/cli/aws github.com/project-radius/radius/pkg/cli/aws Client +//go:generate mockgen -destination=./client_mock.go -package=aws -self_package github.com/radius-project/radius/pkg/cli/aws github.com/radius-project/radius/pkg/cli/aws Client // Client is an interface that abstracts `rad init`'s interactions with AWS. This is for testing purposes. This is only exported because mockgen requires it. type Client interface { diff --git a/pkg/cli/aws/client_mock.go b/pkg/cli/aws/client_mock.go index a7699831a6..e0852a7337 100644 --- a/pkg/cli/aws/client_mock.go +++ b/pkg/cli/aws/client_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/aws (interfaces: Client) +// Source: github.com/radius-project/radius/pkg/cli/aws (interfaces: Client) // Package aws is a generated GoMock package. package aws diff --git a/pkg/cli/azure/client.go b/pkg/cli/azure/client.go index ce548aef63..41e90813ab 100644 --- a/pkg/cli/azure/client.go +++ b/pkg/cli/azure/client.go @@ -22,10 +22,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" - "github.com/project-radius/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/armauth" ) -//go:generate mockgen -destination=./client_mock.go -package=azure -self_package github.com/project-radius/radius/pkg/cli/azure github.com/project-radius/radius/pkg/cli/azure Client +//go:generate mockgen -destination=./client_mock.go -package=azure -self_package github.com/radius-project/radius/pkg/cli/azure github.com/radius-project/radius/pkg/cli/azure Client // Client is an interface that abstracts `rad init`'s interactions with Azure. This is for testing purposes. type Client interface { diff --git a/pkg/cli/azure/client_mock.go b/pkg/cli/azure/client_mock.go index f164bb10ea..9e6284f293 100644 --- a/pkg/cli/azure/client_mock.go +++ b/pkg/cli/azure/client_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/azure (interfaces: Client) +// Source: github.com/radius-project/radius/pkg/cli/azure (interfaces: Client) // Package azure is a generated GoMock package. package azure diff --git a/pkg/cli/azure/subscriptions.go b/pkg/cli/azure/subscriptions.go index 7952fe45aa..d5c5f5ba1a 100644 --- a/pkg/cli/azure/subscriptions.go +++ b/pkg/cli/azure/subscriptions.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" - "github.com/project-radius/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/azure/clientv2" ) // SubscriptionResult is the result of loading Azure subscriptions for the user. diff --git a/pkg/cli/bicep/bicep.go b/pkg/cli/bicep/bicep.go index 5715805a8c..11f7085f93 100644 --- a/pkg/cli/bicep/bicep.go +++ b/pkg/cli/bicep/bicep.go @@ -22,7 +22,7 @@ import ( "os" "time" - "github.com/project-radius/radius/pkg/cli/tools" + "github.com/radius-project/radius/pkg/cli/tools" ) const ( diff --git a/pkg/cli/bicep/build.go b/pkg/cli/bicep/build.go index 19d105e2ba..b28ec054e4 100644 --- a/pkg/cli/bicep/build.go +++ b/pkg/cli/bicep/build.go @@ -26,7 +26,7 @@ import ( "regexp" "strings" - "github.com/project-radius/radius/pkg/cli/tools" + "github.com/radius-project/radius/pkg/cli/tools" ) // Official regex for semver diff --git a/pkg/cli/bicep/deployment_parameters.go b/pkg/cli/bicep/deployment_parameters.go index cd92ff0823..d5161613b2 100644 --- a/pkg/cli/bicep/deployment_parameters.go +++ b/pkg/cli/bicep/deployment_parameters.go @@ -23,7 +23,7 @@ import ( "os" "strings" - "github.com/project-radius/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients" ) // ParameterParser is used to parse the parameters as part of the `rad deploy` command. See the docs for `rad deploy` for examples diff --git a/pkg/cli/bicep/deployment_parameters_test.go b/pkg/cli/bicep/deployment_parameters_test.go index baa7c47f0b..f348240984 100644 --- a/pkg/cli/bicep/deployment_parameters_test.go +++ b/pkg/cli/bicep/deployment_parameters_test.go @@ -23,7 +23,7 @@ import ( "testing" "testing/fstest" - "github.com/project-radius/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/bicep/mock_bicep.go b/pkg/cli/bicep/mock_bicep.go index 100e677547..15a178d229 100644 --- a/pkg/cli/bicep/mock_bicep.go +++ b/pkg/cli/bicep/mock_bicep.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/bicep (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/bicep (interfaces: Interface) // Package bicep is a generated GoMock package. package bicep diff --git a/pkg/cli/bicep/types.go b/pkg/cli/bicep/types.go index 3787e67ce2..2fb667f1e7 100644 --- a/pkg/cli/bicep/types.go +++ b/pkg/cli/bicep/types.go @@ -22,8 +22,8 @@ import ( "path" "strings" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/version" ) // Interface is the interface for preparing Bicep or ARM-JSON templates for deployment. This interface @@ -34,7 +34,7 @@ type Interface interface { var _ Interface = (*Impl)(nil) -//go:generate mockgen -destination=./mock_bicep.go -package=bicep -self_package github.com/project-radius/radius/pkg/cli/bicep github.com/project-radius/radius/pkg/cli/bicep Interface +//go:generate mockgen -destination=./mock_bicep.go -package=bicep -self_package github.com/radius-project/radius/pkg/cli/bicep github.com/radius-project/radius/pkg/cli/bicep Interface // Impl is the implementation of Interface. type Impl struct { diff --git a/pkg/cli/clients/clients.go b/pkg/cli/clients/clients.go index a506b8a003..374c528ea5 100644 --- a/pkg/cli/clients/clients.go +++ b/pkg/cli/clients/clients.go @@ -21,10 +21,10 @@ import ( "io" "os" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - ucp_v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - ucpresources "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + ucp_v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + ucpresources "github.com/radius-project/radius/pkg/ucp/resources" ) // NOTE: parameters in the template engine follow the structure: @@ -88,7 +88,7 @@ type DeploymentClient interface { Deploy(ctx context.Context, options DeploymentOptions) (DeploymentResult, error) } -//go:generate mockgen -destination=./mock_diagnosticsclient.go -package=clients -self_package github.com/project-radius/radius/pkg/cli/clients github.com/project-radius/radius/pkg/cli/clients DiagnosticsClient +//go:generate mockgen -destination=./mock_diagnosticsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients DiagnosticsClient // DiagnosticsClient is used to interface with diagnostics features like logs and port-forwards. type DiagnosticsClient interface { @@ -133,7 +133,7 @@ type LogStream struct { Stream io.ReadCloser } -//go:generate mockgen -destination=./mock_applicationsclient.go -package=clients -self_package github.com/project-radius/radius/pkg/cli/clients github.com/project-radius/radius/pkg/cli/clients ApplicationsManagementClient +//go:generate mockgen -destination=./mock_applicationsclient.go -package=clients -self_package github.com/radius-project/radius/pkg/cli/clients github.com/radius-project/radius/pkg/cli/clients ApplicationsManagementClient // ApplicationsManagementClient is used to interface with management features like listing resources by app, show details of a resource. type ApplicationsManagementClient interface { diff --git a/pkg/cli/clients/errors.go b/pkg/cli/clients/errors.go index 6559595ba7..aecd0be627 100644 --- a/pkg/cli/clients/errors.go +++ b/pkg/cli/clients/errors.go @@ -21,8 +21,8 @@ import ( "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" ) // Is404Error returns true if the error is a 404 payload from an autorest operation. diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index 75ff8dc366..189da916fd 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -25,14 +25,14 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "golang.org/x/sync/errgroup" - "github.com/project-radius/radius/pkg/azure/clientv2" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - corerpv20220315 "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources" - ucpv20220901 "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" + "github.com/radius-project/radius/pkg/azure/clientv2" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + corerpv20220315 "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources" + ucpv20220901 "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" ) type UCPApplicationsManagementClient struct { diff --git a/pkg/cli/clients/mock_applicationsclient.go b/pkg/cli/clients/mock_applicationsclient.go index e5c4ce8b4a..563fc52bc9 100644 --- a/pkg/cli/clients/mock_applicationsclient.go +++ b/pkg/cli/clients/mock_applicationsclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/clients (interfaces: ApplicationsManagementClient) +// Source: github.com/radius-project/radius/pkg/cli/clients (interfaces: ApplicationsManagementClient) // Package clients is a generated GoMock package. package clients @@ -9,9 +9,9 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - generated "github.com/project-radius/radius/pkg/cli/clients_new/generated" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + generated "github.com/radius-project/radius/pkg/cli/clients_new/generated" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) // MockApplicationsManagementClient is a mock of ApplicationsManagementClient interface. diff --git a/pkg/cli/clients/mock_diagnosticsclient.go b/pkg/cli/clients/mock_diagnosticsclient.go index 52a9cf12a6..b51bfdd22e 100644 --- a/pkg/cli/clients/mock_diagnosticsclient.go +++ b/pkg/cli/clients/mock_diagnosticsclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/clients (interfaces: DiagnosticsClient) +// Source: github.com/radius-project/radius/pkg/cli/clients (interfaces: DiagnosticsClient) // Package clients is a generated GoMock package. package clients diff --git a/pkg/cli/clivalidation.go b/pkg/cli/clivalidation.go index 21490a6470..195698d9be 100644 --- a/pkg/cli/clivalidation.go +++ b/pkg/cli/clivalidation.go @@ -23,12 +23,12 @@ import ( "strings" "github.com/google/uuid" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/config" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/config" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/pkg/cli/cmd/README.md b/pkg/cli/cmd/README.md index 05e2607c6b..c73f92316e 100644 --- a/pkg/cli/cmd/README.md +++ b/pkg/cli/cmd/README.md @@ -39,11 +39,11 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) @@ -132,8 +132,8 @@ package show import ( "testing" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/app/appswitch/switch.go b/pkg/cli/cmd/app/appswitch/switch.go index 956abc0622..08adc56db5 100644 --- a/pkg/cli/cmd/app/appswitch/switch.go +++ b/pkg/cli/cmd/app/appswitch/switch.go @@ -20,14 +20,14 @@ import ( "context" "strings" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/app/appswitch/switch_test.go b/pkg/cli/cmd/app/appswitch/switch_test.go index 2e26fd8b1f..fc371a7473 100644 --- a/pkg/cli/cmd/app/appswitch/switch_test.go +++ b/pkg/cli/cmd/app/appswitch/switch_test.go @@ -21,12 +21,12 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/config" - "github.com/project-radius/radius/pkg/cli/framework" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/config" + "github.com/radius-project/radius/pkg/cli/framework" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/app/connections/compute.go b/pkg/cli/cmd/app/connections/compute.go index 659602c73f..9ef8eed3f0 100644 --- a/pkg/cli/cmd/app/connections/compute.go +++ b/pkg/cli/cmd/app/connections/compute.go @@ -21,10 +21,10 @@ import ( "sort" "github.com/go-openapi/jsonpointer" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/resourcemodel" + "github.com/radius-project/radius/pkg/ucp/resources" ) // compute constructs an application graph from the given application and environment resources. diff --git a/pkg/cli/cmd/app/connections/compute_test.go b/pkg/cli/cmd/app/connections/compute_test.go index 217904ef1a..24c866eaf4 100644 --- a/pkg/cli/cmd/app/connections/compute_test.go +++ b/pkg/cli/cmd/app/connections/compute_test.go @@ -19,8 +19,8 @@ package connections import ( "testing" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/app/connections/connections.go b/pkg/cli/cmd/app/connections/connections.go index 4f064184d8..d4a64c5e5b 100644 --- a/pkg/cli/cmd/app/connections/connections.go +++ b/pkg/cli/cmd/app/connections/connections.go @@ -8,15 +8,15 @@ package connections import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/app/connections/connections_test.go b/pkg/cli/cmd/app/connections/connections_test.go index 22946ee09d..1927ec188a 100644 --- a/pkg/cli/cmd/app/connections/connections_test.go +++ b/pkg/cli/cmd/app/connections/connections_test.go @@ -11,16 +11,16 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/app/connections/shareddata_test.go b/pkg/cli/cmd/app/connections/shareddata_test.go index 802f854bb8..1188104a1a 100644 --- a/pkg/cli/cmd/app/connections/shareddata_test.go +++ b/pkg/cli/cmd/app/connections/shareddata_test.go @@ -17,7 +17,7 @@ limitations under the License. package connections import ( - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" ) // This file contains shared variables and functions used in tests. diff --git a/pkg/cli/cmd/app/delete/delete.go b/pkg/cli/cmd/app/delete/delete.go index 6356b00092..fdf0dcc214 100644 --- a/pkg/cli/cmd/app/delete/delete.go +++ b/pkg/cli/cmd/app/delete/delete.go @@ -21,14 +21,14 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/app/delete/delete_test.go b/pkg/cli/cmd/app/delete/delete_test.go index 9211e597e8..966f31f609 100644 --- a/pkg/cli/cmd/app/delete/delete_test.go +++ b/pkg/cli/cmd/app/delete/delete_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/app/list/list.go b/pkg/cli/cmd/app/list/list.go index 2666903601..b38a5f5f90 100644 --- a/pkg/cli/cmd/app/list/list.go +++ b/pkg/cli/cmd/app/list/list.go @@ -19,13 +19,13 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/app/list/list_test.go b/pkg/cli/cmd/app/list/list_test.go index 077c2f3005..6d13b4daec 100644 --- a/pkg/cli/cmd/app/list/list_test.go +++ b/pkg/cli/cmd/app/list/list_test.go @@ -21,15 +21,15 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/app/show/show.go b/pkg/cli/cmd/app/show/show.go index ff688f2003..bd618ecf2e 100644 --- a/pkg/cli/cmd/app/show/show.go +++ b/pkg/cli/cmd/app/show/show.go @@ -19,15 +19,15 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/app/show/show_test.go b/pkg/cli/cmd/app/show/show_test.go index d6c8c19037..bdf645ca10 100644 --- a/pkg/cli/cmd/app/show/show_test.go +++ b/pkg/cli/cmd/app/show/show_test.go @@ -21,16 +21,16 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/app/status/status.go b/pkg/cli/cmd/app/status/status.go index ec492a2020..fc481e43e0 100644 --- a/pkg/cli/cmd/app/status/status.go +++ b/pkg/cli/cmd/app/status/status.go @@ -19,16 +19,16 @@ package status import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/app/status/status_test.go b/pkg/cli/cmd/app/status/status_test.go index 7e8dbb3ff1..075e9d51c7 100644 --- a/pkg/cli/cmd/app/status/status_test.go +++ b/pkg/cli/cmd/app/status/status_test.go @@ -21,18 +21,18 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/bicep/publish/publish.go b/pkg/cli/cmd/bicep/publish/publish.go index 2ad2ff42db..f868c54905 100644 --- a/pkg/cli/cmd/bicep/publish/publish.go +++ b/pkg/cli/cmd/bicep/publish/publish.go @@ -24,11 +24,11 @@ import ( "strings" credentials "github.com/oras-project/oras-credentials-go" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" diff --git a/pkg/cli/cmd/bicep/publish/publish_test.go b/pkg/cli/cmd/bicep/publish/publish_test.go index 3e3d03ce2a..3c4de88648 100644 --- a/pkg/cli/cmd/bicep/publish/publish_test.go +++ b/pkg/cli/cmd/bicep/publish/publish_test.go @@ -25,8 +25,8 @@ import ( "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go" ocispec "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" "oras.land/oras-go/v2" "oras.land/oras-go/v2/content/memory" diff --git a/pkg/cli/cmd/commonflags/flags.go b/pkg/cli/cmd/commonflags/flags.go index 6f0a98004d..839ed52acf 100644 --- a/pkg/cli/cmd/commonflags/flags.go +++ b/pkg/cli/cmd/commonflags/flags.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/output" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/common/validation.go b/pkg/cli/cmd/credential/common/validation.go index d186ccbbde..36d23ada0a 100644 --- a/pkg/cli/cmd/credential/common/validation.go +++ b/pkg/cli/cmd/credential/common/validation.go @@ -19,9 +19,9 @@ package common import ( "strings" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clierrors" ) // Used in tests diff --git a/pkg/cli/cmd/credential/credential.go b/pkg/cli/cmd/credential/credential.go index 3084a0d061..bb58952131 100644 --- a/pkg/cli/cmd/credential/credential.go +++ b/pkg/cli/cmd/credential/credential.go @@ -17,12 +17,12 @@ limitations under the License. package credential import ( - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - credential_list "github.com/project-radius/radius/pkg/cli/cmd/credential/list" - credential_register "github.com/project-radius/radius/pkg/cli/cmd/credential/register" - credential_show "github.com/project-radius/radius/pkg/cli/cmd/credential/show" - credential_unregister "github.com/project-radius/radius/pkg/cli/cmd/credential/unregister" - "github.com/project-radius/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + credential_list "github.com/radius-project/radius/pkg/cli/cmd/credential/list" + credential_register "github.com/radius-project/radius/pkg/cli/cmd/credential/register" + credential_show "github.com/radius-project/radius/pkg/cli/cmd/credential/show" + credential_unregister "github.com/radius-project/radius/pkg/cli/cmd/credential/unregister" + "github.com/radius-project/radius/pkg/cli/framework" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/list/list.go b/pkg/cli/cmd/credential/list/list.go index ca0797582a..ed1c2c351d 100644 --- a/pkg/cli/cmd/credential/list/list.go +++ b/pkg/cli/cmd/credential/list/list.go @@ -19,14 +19,14 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/list/list_test.go b/pkg/cli/cmd/credential/list/list_test.go index 0d94224034..dd9721eb58 100644 --- a/pkg/cli/cmd/credential/list/list_test.go +++ b/pkg/cli/cmd/credential/list/list_test.go @@ -21,13 +21,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/credential/register/aws/aws.go b/pkg/cli/cmd/credential/register/aws/aws.go index a5091c94a0..97affe817e 100644 --- a/pkg/cli/cmd/credential/register/aws/aws.go +++ b/pkg/cli/cmd/credential/register/aws/aws.go @@ -19,18 +19,18 @@ package aws import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/register/aws/aws_test.go b/pkg/cli/cmd/credential/register/aws/aws_test.go index 19da30f4d2..71e70a2fe7 100644 --- a/pkg/cli/cmd/credential/register/aws/aws_test.go +++ b/pkg/cli/cmd/credential/register/aws/aws_test.go @@ -22,15 +22,15 @@ import ( "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/credential/register/azure/azure.go b/pkg/cli/cmd/credential/register/azure/azure.go index 27ede125db..4e5150aac6 100644 --- a/pkg/cli/cmd/credential/register/azure/azure.go +++ b/pkg/cli/cmd/credential/register/azure/azure.go @@ -20,18 +20,18 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/register/azure/azure_test.go b/pkg/cli/cmd/credential/register/azure/azure_test.go index 69108bec4c..2488fa3ceb 100644 --- a/pkg/cli/cmd/credential/register/azure/azure_test.go +++ b/pkg/cli/cmd/credential/register/azure/azure_test.go @@ -24,17 +24,17 @@ import ( "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" ) diff --git a/pkg/cli/cmd/credential/register/register.go b/pkg/cli/cmd/credential/register/register.go index 5437f6a8c6..682bbb3ce5 100644 --- a/pkg/cli/cmd/credential/register/register.go +++ b/pkg/cli/cmd/credential/register/register.go @@ -17,10 +17,10 @@ limitations under the License. package register import ( - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - credential_register_aws "github.com/project-radius/radius/pkg/cli/cmd/credential/register/aws" - credential_register_azure "github.com/project-radius/radius/pkg/cli/cmd/credential/register/azure" - "github.com/project-radius/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + credential_register_aws "github.com/radius-project/radius/pkg/cli/cmd/credential/register/aws" + credential_register_azure "github.com/radius-project/radius/pkg/cli/cmd/credential/register/azure" + "github.com/radius-project/radius/pkg/cli/framework" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/show/show.go b/pkg/cli/cmd/credential/show/show.go index 8f2d03ba12..1e4e25b042 100644 --- a/pkg/cli/cmd/credential/show/show.go +++ b/pkg/cli/cmd/credential/show/show.go @@ -19,15 +19,15 @@ package show import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/show/show_test.go b/pkg/cli/cmd/credential/show/show_test.go index 25391a8b09..8f8d882ff6 100644 --- a/pkg/cli/cmd/credential/show/show_test.go +++ b/pkg/cli/cmd/credential/show/show_test.go @@ -21,14 +21,14 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/credential/unregister/unregister.go b/pkg/cli/cmd/credential/unregister/unregister.go index 87dbbb8c59..40bf699a34 100644 --- a/pkg/cli/cmd/credential/unregister/unregister.go +++ b/pkg/cli/cmd/credential/unregister/unregister.go @@ -19,13 +19,13 @@ package unregister import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/credential/common" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/credential/common" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/credential/unregister/unregister_test.go b/pkg/cli/cmd/credential/unregister/unregister_test.go index 702b7f7e28..aa4ec30a23 100644 --- a/pkg/cli/cmd/credential/unregister/unregister_test.go +++ b/pkg/cli/cmd/credential/unregister/unregister_test.go @@ -21,12 +21,12 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/deploy/deploy.go b/pkg/cli/cmd/deploy/deploy.go index eed45a1d84..60e50421b9 100644 --- a/pkg/cli/cmd/deploy/deploy.go +++ b/pkg/cli/cmd/deploy/deploy.go @@ -20,19 +20,19 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/deploy" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/deploy" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/deploy/deploy_test.go b/pkg/cli/cmd/deploy/deploy_test.go index 28d989095a..cb4350a865 100644 --- a/pkg/cli/cmd/deploy/deploy_test.go +++ b/pkg/cli/cmd/deploy/deploy_test.go @@ -22,17 +22,17 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/config" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/deploy" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/config" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/deploy" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/env/create/create.go b/pkg/cli/cmd/env/create/create.go index 61c13948e7..2b6fb04641 100644 --- a/pkg/cli/cmd/env/create/create.go +++ b/pkg/cli/cmd/env/create/create.go @@ -19,23 +19,23 @@ package create import ( "context" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/spf13/cobra" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/env/namespace" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/env/namespace" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" ) // NewCommand creates an instance of the command and runner for the `rad env create` command. diff --git a/pkg/cli/cmd/env/create/create_test.go b/pkg/cli/cmd/env/create/create_test.go index 401cab0f0d..bb44cbc383 100644 --- a/pkg/cli/cmd/env/create/create_test.go +++ b/pkg/cli/cmd/env/create/create_test.go @@ -23,18 +23,18 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/env/namespace" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/env/namespace" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/env/delete/delete.go b/pkg/cli/cmd/env/delete/delete.go index eaa70562ba..aed9ff329b 100644 --- a/pkg/cli/cmd/env/delete/delete.go +++ b/pkg/cli/cmd/env/delete/delete.go @@ -20,13 +20,13 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/env/delete/delete_test.go b/pkg/cli/cmd/env/delete/delete_test.go index 0a6e310364..ebc79ed01a 100644 --- a/pkg/cli/cmd/env/delete/delete_test.go +++ b/pkg/cli/cmd/env/delete/delete_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/env/envswitch/switch.go b/pkg/cli/cmd/env/envswitch/switch.go index be552054dc..e346c4b864 100644 --- a/pkg/cli/cmd/env/envswitch/switch.go +++ b/pkg/cli/cmd/env/envswitch/switch.go @@ -22,15 +22,15 @@ import ( "github.com/spf13/cobra" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/resources" ) // NewCommand creates an instance of the command and runner for the `rad env switch` command. diff --git a/pkg/cli/cmd/env/envswitch/switch_test.go b/pkg/cli/cmd/env/envswitch/switch_test.go index d81ca1e7a0..f4b417dadf 100644 --- a/pkg/cli/cmd/env/envswitch/switch_test.go +++ b/pkg/cli/cmd/env/envswitch/switch_test.go @@ -21,11 +21,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/framework" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/framework" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/env/list/list.go b/pkg/cli/cmd/env/list/list.go index de5c1d4ec7..b38d0b57b3 100644 --- a/pkg/cli/cmd/env/list/list.go +++ b/pkg/cli/cmd/env/list/list.go @@ -19,13 +19,13 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/env/list/list_test.go b/pkg/cli/cmd/env/list/list_test.go index 838c252e1c..0317be4259 100644 --- a/pkg/cli/cmd/env/list/list_test.go +++ b/pkg/cli/cmd/env/list/list_test.go @@ -23,15 +23,15 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/env/namespace/mock_namespace.go b/pkg/cli/cmd/env/namespace/mock_namespace.go index 8cba58d012..f03b7878f0 100644 --- a/pkg/cli/cmd/env/namespace/mock_namespace.go +++ b/pkg/cli/cmd/env/namespace/mock_namespace.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/cmd/env/namespace (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/cmd/env/namespace (interfaces: Interface) // Package namespace is a generated GoMock package. package namespace diff --git a/pkg/cli/cmd/env/namespace/namespace.go b/pkg/cli/cmd/env/namespace/namespace.go index b3ec8cf942..ac983ef0da 100644 --- a/pkg/cli/cmd/env/namespace/namespace.go +++ b/pkg/cli/cmd/env/namespace/namespace.go @@ -19,10 +19,10 @@ package namespace import ( "context" - "github.com/project-radius/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/kubernetes" ) -//go:generate mockgen -destination=./mock_namespace.go -package=namespace -self_package github.com/project-radius/radius/pkg/cli/cmd/env/namespace github.com/project-radius/radius/pkg/cli/cmd/env/namespace Interface +//go:generate mockgen -destination=./mock_namespace.go -package=namespace -self_package github.com/radius-project/radius/pkg/cli/cmd/env/namespace github.com/radius-project/radius/pkg/cli/cmd/env/namespace Interface type Interface interface { ValidateNamespace(ctx context.Context, namespace string) error } diff --git a/pkg/cli/cmd/env/show/show.go b/pkg/cli/cmd/env/show/show.go index f341591612..af52a2687a 100644 --- a/pkg/cli/cmd/env/show/show.go +++ b/pkg/cli/cmd/env/show/show.go @@ -19,15 +19,15 @@ package show import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/env/show/show_test.go b/pkg/cli/cmd/env/show/show_test.go index caba1d9dab..06670efa2c 100644 --- a/pkg/cli/cmd/env/show/show_test.go +++ b/pkg/cli/cmd/env/show/show_test.go @@ -23,16 +23,16 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/env/update/update.go b/pkg/cli/cmd/env/update/update.go index 44e5219f55..4a1416776d 100644 --- a/pkg/cli/cmd/env/update/update.go +++ b/pkg/cli/cmd/env/update/update.go @@ -20,18 +20,18 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/spf13/cobra" ) @@ -89,7 +89,7 @@ rad env update myenv --clear-aws commonflags.AddAzureScopeFlags(cmd) commonflags.AddAWSScopeFlags(cmd) commonflags.AddOutputFlag(cmd) - //TODO: https://github.com/project-radius/radius/issues/5247 + //TODO: https://github.com/radius-project/radius/issues/5247 commonflags.AddEnvironmentNameFlag(cmd) return cmd, runner @@ -145,7 +145,7 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { return err } - // TODO: Validate Azure scope components (https://github.com/project-radius/radius/issues/5155) + // TODO: Validate Azure scope components (https://github.com/radius-project/radius/issues/5155) if cmd.Flags().Changed(commonflags.AzureSubscriptionIdFlag) || cmd.Flags().Changed(commonflags.AzureResourceGroupFlag) { azureSubId, err := cli.RequireAzureSubscriptionId(cmd) if err != nil { @@ -165,7 +165,7 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { return err } - // TODO: Validate AWS scope components (https://github.com/project-radius/radius/issues/5155) + // TODO: Validate AWS scope components (https://github.com/radius-project/radius/issues/5155) // stsclient can be used to validate if cmd.Flags().Changed(commonflags.AWSRegionFlag) || cmd.Flags().Changed(commonflags.AWSAccountIdFlag) { awsRegion, err := cmd.Flags().GetString(commonflags.AWSRegionFlag) diff --git a/pkg/cli/cmd/env/update/update_test.go b/pkg/cli/cmd/env/update/update_test.go index 4c0fdc08ed..8cff5dbf2e 100644 --- a/pkg/cli/cmd/env/update/update_test.go +++ b/pkg/cli/cmd/env/update/update_test.go @@ -24,17 +24,17 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/group/common/validation.go b/pkg/cli/cmd/group/common/validation.go index 65dc8abb4a..c97d727d8f 100644 --- a/pkg/cli/cmd/group/common/validation.go +++ b/pkg/cli/cmd/group/common/validation.go @@ -21,7 +21,7 @@ import ( "regexp" - "github.com/project-radius/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/clierrors" ) // ValidateResourceGroupName checks if the given resource group name is between 1 and 90 characters long, does not end with diff --git a/pkg/cli/cmd/group/create/create.go b/pkg/cli/cmd/group/create/create.go index 649df4b792..216ae87133 100644 --- a/pkg/cli/cmd/group/create/create.go +++ b/pkg/cli/cmd/group/create/create.go @@ -21,16 +21,16 @@ import ( "github.com/spf13/cobra" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/cmd/group/common" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/cmd/group/common" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) // NewCommand creates an instance of the command and runner for the `rad group create` command. diff --git a/pkg/cli/cmd/group/create/create_test.go b/pkg/cli/cmd/group/create/create_test.go index f47b0a6b25..f50fb56172 100644 --- a/pkg/cli/cmd/group/create/create_test.go +++ b/pkg/cli/cmd/group/create/create_test.go @@ -21,12 +21,12 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/group/delete/delete.go b/pkg/cli/cmd/group/delete/delete.go index 4e6cf008e7..fb55ee5b9d 100644 --- a/pkg/cli/cmd/group/delete/delete.go +++ b/pkg/cli/cmd/group/delete/delete.go @@ -20,13 +20,13 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/group/delete/delete_test.go b/pkg/cli/cmd/group/delete/delete_test.go index e336a6bff6..a0b7f2c97c 100644 --- a/pkg/cli/cmd/group/delete/delete_test.go +++ b/pkg/cli/cmd/group/delete/delete_test.go @@ -21,13 +21,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/group/group.go b/pkg/cli/cmd/group/group.go index fe6666bf9f..fb0b6bbeba 100644 --- a/pkg/cli/cmd/group/group.go +++ b/pkg/cli/cmd/group/group.go @@ -17,12 +17,12 @@ limitations under the License. package group import ( - group_create "github.com/project-radius/radius/pkg/cli/cmd/group/create" - group_delete "github.com/project-radius/radius/pkg/cli/cmd/group/delete" - group_switch "github.com/project-radius/radius/pkg/cli/cmd/group/groupswitch" - group_list "github.com/project-radius/radius/pkg/cli/cmd/group/list" - group_show "github.com/project-radius/radius/pkg/cli/cmd/group/show" - "github.com/project-radius/radius/pkg/cli/framework" + group_create "github.com/radius-project/radius/pkg/cli/cmd/group/create" + group_delete "github.com/radius-project/radius/pkg/cli/cmd/group/delete" + group_switch "github.com/radius-project/radius/pkg/cli/cmd/group/groupswitch" + group_list "github.com/radius-project/radius/pkg/cli/cmd/group/list" + group_show "github.com/radius-project/radius/pkg/cli/cmd/group/show" + "github.com/radius-project/radius/pkg/cli/framework" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/group/groupswitch/switch.go b/pkg/cli/cmd/group/groupswitch/switch.go index 1ed2319b96..0678acaa72 100644 --- a/pkg/cli/cmd/group/groupswitch/switch.go +++ b/pkg/cli/cmd/group/groupswitch/switch.go @@ -20,12 +20,12 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/group/groupswitch/switch_test.go b/pkg/cli/cmd/group/groupswitch/switch_test.go index 97ae3ef5b6..fb124d43c2 100644 --- a/pkg/cli/cmd/group/groupswitch/switch_test.go +++ b/pkg/cli/cmd/group/groupswitch/switch_test.go @@ -23,14 +23,14 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" ) diff --git a/pkg/cli/cmd/group/list/list.go b/pkg/cli/cmd/group/list/list.go index aca32d47ee..4ea61f8507 100644 --- a/pkg/cli/cmd/group/list/list.go +++ b/pkg/cli/cmd/group/list/list.go @@ -19,13 +19,13 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/group/list/list_test.go b/pkg/cli/cmd/group/list/list_test.go index 4483aa43a1..fbb75f8793 100644 --- a/pkg/cli/cmd/group/list/list_test.go +++ b/pkg/cli/cmd/group/list/list_test.go @@ -21,13 +21,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/group/show/show.go b/pkg/cli/cmd/group/show/show.go index 468a8b1f98..ef915ba556 100644 --- a/pkg/cli/cmd/group/show/show.go +++ b/pkg/cli/cmd/group/show/show.go @@ -19,13 +19,13 @@ package show import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/group/show/show_test.go b/pkg/cli/cmd/group/show/show_test.go index 95593fcb2e..afed1409d4 100644 --- a/pkg/cli/cmd/group/show/show_test.go +++ b/pkg/cli/cmd/group/show/show_test.go @@ -21,16 +21,16 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/install/kubernetes/kubernetes.go b/pkg/cli/cmd/install/kubernetes/kubernetes.go index 527e2a2e49..3b65a37b96 100644 --- a/pkg/cli/cmd/install/kubernetes/kubernetes.go +++ b/pkg/cli/cmd/install/kubernetes/kubernetes.go @@ -19,11 +19,11 @@ package kubernetes import ( "context" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/version" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/install/kubernetes/kubernetes_test.go b/pkg/cli/cmd/install/kubernetes/kubernetes_test.go index 3897736e10..b7b9a01b3d 100644 --- a/pkg/cli/cmd/install/kubernetes/kubernetes_test.go +++ b/pkg/cli/cmd/install/kubernetes/kubernetes_test.go @@ -21,9 +21,9 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/application.go b/pkg/cli/cmd/radinit/application.go index 31e2e6c381..4935634a49 100644 --- a/pkg/cli/cmd/radinit/application.go +++ b/pkg/cli/cmd/radinit/application.go @@ -21,7 +21,7 @@ import ( "os" "path/filepath" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/prompt" ) const ( diff --git a/pkg/cli/cmd/radinit/application_test.go b/pkg/cli/cmd/radinit/application_test.go index 48f7e914d5..0bd73b0e5b 100644 --- a/pkg/cli/cmd/radinit/application_test.go +++ b/pkg/cli/cmd/radinit/application_test.go @@ -21,7 +21,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/prompt" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/aws.go b/pkg/cli/cmd/radinit/aws.go index 3b61469cc6..6283aec637 100644 --- a/pkg/cli/cmd/radinit/aws.go +++ b/pkg/cli/cmd/radinit/aws.go @@ -21,9 +21,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/charmbracelet/bubbles/textinput" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/prompt" ) const ( diff --git a/pkg/cli/cmd/radinit/aws_test.go b/pkg/cli/cmd/radinit/aws_test.go index 8b61230fdb..61b1fe58c3 100644 --- a/pkg/cli/cmd/radinit/aws_test.go +++ b/pkg/cli/cmd/radinit/aws_test.go @@ -24,10 +24,10 @@ import ( ec2_types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/azure.go b/pkg/cli/cmd/radinit/azure.go index 26a8276242..456477a9b3 100644 --- a/pkg/cli/cmd/radinit/azure.go +++ b/pkg/cli/cmd/radinit/azure.go @@ -24,9 +24,9 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" "github.com/charmbracelet/bubbles/textinput" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/prompt" ) const ( diff --git a/pkg/cli/cmd/radinit/azure_test.go b/pkg/cli/cmd/radinit/azure_test.go index 729ac452eb..9d456e848a 100644 --- a/pkg/cli/cmd/radinit/azure_test.go +++ b/pkg/cli/cmd/radinit/azure_test.go @@ -24,10 +24,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/cloud.go b/pkg/cli/cmd/radinit/cloud.go index 16313dc73a..4e0a2e3ff4 100644 --- a/pkg/cli/cmd/radinit/cloud.go +++ b/pkg/cli/cmd/radinit/cloud.go @@ -20,9 +20,9 @@ import ( "context" "errors" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/prompt" ) const ( diff --git a/pkg/cli/cmd/radinit/cloud_test.go b/pkg/cli/cmd/radinit/cloud_test.go index f3a43480fc..7cc56a41c0 100644 --- a/pkg/cli/cmd/radinit/cloud_test.go +++ b/pkg/cli/cmd/radinit/cloud_test.go @@ -21,10 +21,10 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/cluster.go b/pkg/cli/cmd/radinit/cluster.go index 558522559a..7e3e66b1a1 100644 --- a/pkg/cli/cmd/radinit/cluster.go +++ b/pkg/cli/cmd/radinit/cluster.go @@ -20,8 +20,8 @@ import ( "context" "sort" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/version" "k8s.io/client-go/tools/clientcmd/api" ) diff --git a/pkg/cli/cmd/radinit/cluster_test.go b/pkg/cli/cmd/radinit/cluster_test.go index 5db8a04837..6363ca7a96 100644 --- a/pkg/cli/cmd/radinit/cluster_test.go +++ b/pkg/cli/cmd/radinit/cluster_test.go @@ -21,9 +21,9 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/prompt" "github.com/stretchr/testify/require" "k8s.io/client-go/tools/clientcmd/api" ) diff --git a/pkg/cli/cmd/radinit/display.go b/pkg/cli/cmd/radinit/display.go index a78e3f61ca..d3759a550b 100644 --- a/pkg/cli/cmd/radinit/display.go +++ b/pkg/cli/cmd/radinit/display.go @@ -26,7 +26,7 @@ import ( "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/prompt" ) const ( diff --git a/pkg/cli/cmd/radinit/environment.go b/pkg/cli/cmd/radinit/environment.go index f329711e3f..08ced4db85 100644 --- a/pkg/cli/cmd/radinit/environment.go +++ b/pkg/cli/cmd/radinit/environment.go @@ -21,9 +21,9 @@ import ( "sort" "strings" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" ) const ( diff --git a/pkg/cli/cmd/radinit/environment_test.go b/pkg/cli/cmd/radinit/environment_test.go index 7647279257..760aca9ba7 100644 --- a/pkg/cli/cmd/radinit/environment_test.go +++ b/pkg/cli/cmd/radinit/environment_test.go @@ -21,12 +21,12 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/init.go b/pkg/cli/cmd/radinit/init.go index e5fda2d902..a9d2f22963 100644 --- a/pkg/cli/cmd/radinit/init.go +++ b/pkg/cli/cmd/radinit/init.go @@ -20,26 +20,26 @@ import ( "context" "os" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/setup" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/setup" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/radinit/init_test.go b/pkg/cli/cmd/radinit/init_test.go index 06d8aa4766..e051ca678c 100644 --- a/pkg/cli/cmd/radinit/init_test.go +++ b/pkg/cli/cmd/radinit/init_test.go @@ -32,24 +32,24 @@ import ( "github.com/stretchr/testify/require" "k8s.io/client-go/tools/clientcmd/api" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" - - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" + + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/radinit/mock_devrecipeclient.go b/pkg/cli/cmd/radinit/mock_devrecipeclient.go index 902555c85a..f7ae50b1d1 100644 --- a/pkg/cli/cmd/radinit/mock_devrecipeclient.go +++ b/pkg/cli/cmd/radinit/mock_devrecipeclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/cmd/radinit (interfaces: DevRecipeClient) +// Source: github.com/radius-project/radius/pkg/cli/cmd/radinit (interfaces: DevRecipeClient) // Package radinit is a generated GoMock package. package radinit @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" ) // MockDevRecipeClient is a mock of DevRecipeClient interface. diff --git a/pkg/cli/cmd/radinit/options.go b/pkg/cli/cmd/radinit/options.go index 3848d6500f..1b4b586387 100644 --- a/pkg/cli/cmd/radinit/options.go +++ b/pkg/cli/cmd/radinit/options.go @@ -19,10 +19,10 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/cli" - cli_aws "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + cli_aws "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/workspaces" ) // initOptions holds all of the options that will be used to initialize Radius. diff --git a/pkg/cli/cmd/radinit/options_test.go b/pkg/cli/cmd/radinit/options_test.go index 9405f56d78..12b362796f 100644 --- a/pkg/cli/cmd/radinit/options_test.go +++ b/pkg/cli/cmd/radinit/options_test.go @@ -22,12 +22,12 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/version" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/radinit/recipe.go b/pkg/cli/cmd/radinit/recipe.go index 114cc0efbb..822be224f7 100644 --- a/pkg/cli/cmd/radinit/recipe.go +++ b/pkg/cli/cmd/radinit/recipe.go @@ -21,11 +21,11 @@ import ( "fmt" "strings" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources" - recipe_types "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/version" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources" + recipe_types "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/version" "oras.land/oras-go/v2/registry/remote" ) @@ -33,7 +33,7 @@ const ( DevRecipesRegistry = "radius.azurecr.io" ) -//go:generate mockgen -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/project-radius/radius/pkg/cli/cmd/radinit github.com/project-radius/radius/pkg/cli/cmd/radinit DevRecipeClient +//go:generate mockgen -destination=./mock_devrecipeclient.go -package=radinit -self_package github.com/radius-project/radius/pkg/cli/cmd/radinit github.com/radius-project/radius/pkg/cli/cmd/radinit DevRecipeClient type DevRecipeClient interface { GetDevRecipes(ctx context.Context) (map[string]map[string]corerp.RecipePropertiesClassification, error) } diff --git a/pkg/cli/cmd/radinit/recipe_test.go b/pkg/cli/cmd/radinit/recipe_test.go index 85e576635d..0c65b43ea2 100644 --- a/pkg/cli/cmd/radinit/recipe_test.go +++ b/pkg/cli/cmd/radinit/recipe_test.go @@ -21,9 +21,9 @@ import ( reflect "reflect" "testing" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/recipe/list/list.go b/pkg/cli/cmd/recipe/list/list.go index 76b66c548b..4974b7b656 100644 --- a/pkg/cli/cmd/recipe/list/list.go +++ b/pkg/cli/cmd/recipe/list/list.go @@ -20,15 +20,15 @@ import ( "context" "sort" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - types "github.com/project-radius/radius/pkg/cli/cmd/recipe" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + types "github.com/radius-project/radius/pkg/cli/cmd/recipe" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/recipe/list/list_test.go b/pkg/cli/cmd/recipe/list/list_test.go index ee7494c051..14e195d0da 100644 --- a/pkg/cli/cmd/recipe/list/list_test.go +++ b/pkg/cli/cmd/recipe/list/list_test.go @@ -21,19 +21,19 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - types "github.com/project-radius/radius/pkg/cli/cmd/recipe" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + types "github.com/radius-project/radius/pkg/cli/cmd/recipe" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/recipe/register/register.go b/pkg/cli/cmd/recipe/register/register.go index 5449aa3098..77a0fdedb0 100644 --- a/pkg/cli/cmd/recipe/register/register.go +++ b/pkg/cli/cmd/recipe/register/register.go @@ -19,17 +19,17 @@ package register import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/recipes" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/recipes" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/recipe/register/register_test.go b/pkg/cli/cmd/recipe/register/register_test.go index f63c35d4d4..cb84b910d6 100644 --- a/pkg/cli/cmd/recipe/register/register_test.go +++ b/pkg/cli/cmd/recipe/register/register_test.go @@ -25,17 +25,17 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/recipe/show/show.go b/pkg/cli/cmd/recipe/show/show.go index 6da820a74f..6698acbe7a 100644 --- a/pkg/cli/cmd/recipe/show/show.go +++ b/pkg/cli/cmd/recipe/show/show.go @@ -21,15 +21,15 @@ import ( "fmt" "sort" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - types "github.com/project-radius/radius/pkg/cli/cmd/recipe" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + types "github.com/radius-project/radius/pkg/cli/cmd/recipe" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/recipe/show/show_test.go b/pkg/cli/cmd/recipe/show/show_test.go index ad025c278a..e489c34390 100644 --- a/pkg/cli/cmd/recipe/show/show_test.go +++ b/pkg/cli/cmd/recipe/show/show_test.go @@ -22,18 +22,18 @@ import ( "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - types "github.com/project-radius/radius/pkg/cli/cmd/recipe" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + types "github.com/radius-project/radius/pkg/cli/cmd/recipe" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/recipe/unregister/unregister.go b/pkg/cli/cmd/recipe/unregister/unregister.go index 587a532268..c6c8e818f3 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister.go +++ b/pkg/cli/cmd/recipe/unregister/unregister.go @@ -19,15 +19,15 @@ package unregister import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/recipe/unregister/unregister_test.go b/pkg/cli/cmd/recipe/unregister/unregister_test.go index a24687d73e..a493fc8fa9 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister_test.go +++ b/pkg/cli/cmd/recipe/unregister/unregister_test.go @@ -25,17 +25,17 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/resource/delete/delete.go b/pkg/cli/cmd/resource/delete/delete.go index 4439cb0795..cb1035494b 100644 --- a/pkg/cli/cmd/resource/delete/delete.go +++ b/pkg/cli/cmd/resource/delete/delete.go @@ -22,13 +22,13 @@ import ( "net/http" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/resource/delete/delete_test.go b/pkg/cli/cmd/resource/delete/delete_test.go index 83005a6f84..348c043c7c 100644 --- a/pkg/cli/cmd/resource/delete/delete_test.go +++ b/pkg/cli/cmd/resource/delete/delete_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) @@ -158,19 +158,19 @@ func Test_Run(t *testing.T) { t.Run("Success: Prompt Confirmed", func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - + promptMock := prompt.NewMockInterface(ctrl) promptMock.EXPECT(). GetListInput([]string{prompt.ConfirmNo, prompt.ConfirmYes}, fmt.Sprintf(deleteConfirmation, "test-container", "containers")). Return(prompt.ConfirmYes, nil). Times(1) - + appManagementClient := clients.NewMockApplicationsManagementClient(ctrl) appManagementClient.EXPECT(). DeleteResource(gomock.Any(), "containers", "test-container"). Return(true, nil). Times(1) - + workspace := &workspaces.Workspace{ Connection: map[string]any{ "kind": "kubernetes", @@ -189,29 +189,29 @@ func Test_Run(t *testing.T) { Format: "table", InputPrompter: promptMock, } - + err := runner.Run(context.Background()) require.NoError(t, err) - + expected := []any{ output.LogOutput{ Format: "Resource deleted", }, } - + require.Equal(t, expected, outputSink.Writes) }) - + t.Run("Success: Prompt Cancelled", func(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - + promptMock := prompt.NewMockInterface(ctrl) promptMock.EXPECT(). GetListInput([]string{prompt.ConfirmNo, prompt.ConfirmYes}, fmt.Sprintf(deleteConfirmation, "test-container", "containers")). Return(prompt.ConfirmNo, nil). Times(1) - + workspace := &workspaces.Workspace{ Connection: map[string]any{ "kind": "kubernetes", @@ -222,14 +222,14 @@ func Test_Run(t *testing.T) { } outputSink := &output.MockOutput{} runner := &Runner{ - InputPrompter: promptMock, - Workspace: workspace, - Format: "table", - Output: outputSink, - ResourceType: "containers", - ResourceName: "test-container", + InputPrompter: promptMock, + Workspace: workspace, + Format: "table", + Output: outputSink, + ResourceType: "containers", + ResourceName: "test-container", } - + err := runner.Run(context.Background()) require.NoError(t, err) diff --git a/pkg/cli/cmd/resource/list/list.go b/pkg/cli/cmd/resource/list/list.go index b1519bf323..ee58655818 100644 --- a/pkg/cli/cmd/resource/list/list.go +++ b/pkg/cli/cmd/resource/list/list.go @@ -19,15 +19,15 @@ package list import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/resource/list/list_test.go b/pkg/cli/cmd/resource/list/list_test.go index d4dd1aa943..9ab7634129 100644 --- a/pkg/cli/cmd/resource/list/list_test.go +++ b/pkg/cli/cmd/resource/list/list_test.go @@ -21,16 +21,16 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/resource/show/show.go b/pkg/cli/cmd/resource/show/show.go index 2dddeb6a4a..f5cb788b6d 100644 --- a/pkg/cli/cmd/resource/show/show.go +++ b/pkg/cli/cmd/resource/show/show.go @@ -19,13 +19,13 @@ package show import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/resource/show/show_test.go b/pkg/cli/cmd/resource/show/show_test.go index c6af002756..5f5d1a79cf 100644 --- a/pkg/cli/cmd/resource/show/show_test.go +++ b/pkg/cli/cmd/resource/show/show_test.go @@ -21,13 +21,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/run/run.go b/pkg/cli/cmd/run/run.go index 86ff063980..f211628cf2 100644 --- a/pkg/cli/cmd/run/run.go +++ b/pkg/cli/cmd/run/run.go @@ -23,14 +23,14 @@ import ( "os" "github.com/fatih/color" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - deploycmd "github.com/project-radius/radius/pkg/cli/cmd/deploy" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/kubernetes/logstream" - "github.com/project-radius/radius/pkg/cli/kubernetes/portforward" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + deploycmd "github.com/radius-project/radius/pkg/cli/cmd/deploy" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/kubernetes/logstream" + "github.com/radius-project/radius/pkg/cli/kubernetes/portforward" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" ) diff --git a/pkg/cli/cmd/run/run_test.go b/pkg/cli/cmd/run/run_test.go index 6e5b068142..9e537c388f 100644 --- a/pkg/cli/cmd/run/run_test.go +++ b/pkg/cli/cmd/run/run_test.go @@ -24,21 +24,21 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clients" - deploycmd "github.com/project-radius/radius/pkg/cli/cmd/deploy" - "github.com/project-radius/radius/pkg/cli/config" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/deploy" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/kubernetes/logstream" - "github.com/project-radius/radius/pkg/cli/kubernetes/portforward" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/radcli" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clients" + deploycmd "github.com/radius-project/radius/pkg/cli/cmd/deploy" + "github.com/radius-project/radius/pkg/cli/config" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/deploy" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/kubernetes/logstream" + "github.com/radius-project/radius/pkg/cli/kubernetes/portforward" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/radcli" + "github.com/radius-project/radius/test/testcontext" ) func Test_CommandValidation(t *testing.T) { diff --git a/pkg/cli/cmd/uninstall/kubernetes/kubernetes.go b/pkg/cli/cmd/uninstall/kubernetes/kubernetes.go index f6b5ce208f..d6bbb53fe2 100644 --- a/pkg/cli/cmd/uninstall/kubernetes/kubernetes.go +++ b/pkg/cli/cmd/uninstall/kubernetes/kubernetes.go @@ -19,10 +19,10 @@ package kubernetes import ( "context" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/output" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/uninstall/kubernetes/kubernetes_test.go b/pkg/cli/cmd/uninstall/kubernetes/kubernetes_test.go index 9fbf713c26..381a12e765 100644 --- a/pkg/cli/cmd/uninstall/kubernetes/kubernetes_test.go +++ b/pkg/cli/cmd/uninstall/kubernetes/kubernetes_test.go @@ -21,9 +21,9 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/utils.go b/pkg/cli/cmd/utils.go index e3c916f51d..52637fbdff 100644 --- a/pkg/cli/cmd/utils.go +++ b/pkg/cli/cmd/utils.go @@ -20,12 +20,12 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" ) // CreateEnvProviders forms the provider scope from the given diff --git a/pkg/cli/cmd/utils_test.go b/pkg/cli/cmd/utils_test.go index 4e45d137e9..91626abd9c 100644 --- a/pkg/cli/cmd/utils_test.go +++ b/pkg/cli/cmd/utils_test.go @@ -20,11 +20,11 @@ import ( "errors" "testing" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clierrors" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clierrors" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/workspace/create/create.go b/pkg/cli/cmd/workspace/create/create.go index 065b2b0eef..2375d02982 100644 --- a/pkg/cli/cmd/workspace/create/create.go +++ b/pkg/cli/cmd/workspace/create/create.go @@ -21,16 +21,16 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clierrors" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clierrors" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/workspace/create/create_test.go b/pkg/cli/cmd/workspace/create/create_test.go index 61eedfdead..0f66e55ba0 100644 --- a/pkg/cli/cmd/workspace/create/create_test.go +++ b/pkg/cli/cmd/workspace/create/create_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - corerp "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + corerp "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" "k8s.io/client-go/tools/clientcmd/api" ) diff --git a/pkg/cli/cmd/workspace/delete/delete.go b/pkg/cli/cmd/workspace/delete/delete.go index 9df55649db..29c83b9eb3 100644 --- a/pkg/cli/cmd/workspace/delete/delete.go +++ b/pkg/cli/cmd/workspace/delete/delete.go @@ -20,12 +20,12 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/workspace/delete/delete_test.go b/pkg/cli/cmd/workspace/delete/delete_test.go index 89c2319fec..121a6111de 100644 --- a/pkg/cli/cmd/workspace/delete/delete_test.go +++ b/pkg/cli/cmd/workspace/delete/delete_test.go @@ -22,11 +22,11 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/workspace/list/list.go b/pkg/cli/cmd/workspace/list/list.go index aa84796f1e..e50bc7dc64 100644 --- a/pkg/cli/cmd/workspace/list/list.go +++ b/pkg/cli/cmd/workspace/list/list.go @@ -20,12 +20,12 @@ import ( "context" "sort" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/workspace/list/list_test.go b/pkg/cli/cmd/workspace/list/list_test.go index 4743e7cfad..3eabee8f8c 100644 --- a/pkg/cli/cmd/workspace/list/list_test.go +++ b/pkg/cli/cmd/workspace/list/list_test.go @@ -20,12 +20,12 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/workspace/show/show.go b/pkg/cli/cmd/workspace/show/show.go index 51bb00a677..1e0d1a7316 100644 --- a/pkg/cli/cmd/workspace/show/show.go +++ b/pkg/cli/cmd/workspace/show/show.go @@ -19,12 +19,12 @@ package show import ( "context" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/workspace/show/show_test.go b/pkg/cli/cmd/workspace/show/show_test.go index e425bca8e0..03207ac9c1 100644 --- a/pkg/cli/cmd/workspace/show/show_test.go +++ b/pkg/cli/cmd/workspace/show/show_test.go @@ -20,11 +20,11 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/cmd/workspace/switch/switch.go b/pkg/cli/cmd/workspace/switch/switch.go index 60cb17160c..35a596f39d 100644 --- a/pkg/cli/cmd/workspace/switch/switch.go +++ b/pkg/cli/cmd/workspace/switch/switch.go @@ -20,11 +20,11 @@ import ( "context" "strings" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/cmd/commonflags" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/cmd/commonflags" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/cobra" ) diff --git a/pkg/cli/cmd/workspace/switch/switch_test.go b/pkg/cli/cmd/workspace/switch/switch_test.go index 4f7d35453b..92eaf31b90 100644 --- a/pkg/cli/cmd/workspace/switch/switch_test.go +++ b/pkg/cli/cmd/workspace/switch/switch_test.go @@ -21,11 +21,11 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/test/radcli" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/config.go b/pkg/cli/config.go index 6f85f83722..a865588dab 100644 --- a/pkg/cli/config.go +++ b/pkg/cli/config.go @@ -33,8 +33,8 @@ import ( "github.com/spf13/viper" "golang.org/x/text/cases" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/workspaces" ) // EnvironmentKey is the key used for the environment section diff --git a/pkg/cli/config_test.go b/pkg/cli/config_test.go index 8d4c15d148..c452a37ce1 100644 --- a/pkg/cli/config_test.go +++ b/pkg/cli/config_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/connections/factory.go b/pkg/cli/connections/factory.go index a633bb8a74..35ed3f54f3 100644 --- a/pkg/cli/connections/factory.go +++ b/pkg/cli/connections/factory.go @@ -22,19 +22,19 @@ import ( "fmt" "strings" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/cli/clierrors" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/deployment" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/workspaces" - "github.com/project-radius/radius/pkg/sdk" - sdkclients "github.com/project-radius/radius/pkg/sdk/clients" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/cli/clierrors" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/deployment" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/sdk" + sdkclients "github.com/radius-project/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" ) // DefaultFactory provides easy access to the default implementation of the factory. DO NOT modify this in your code. Even if it's for tests. DO NOT DO IT. diff --git a/pkg/cli/connections/mock_factory.go b/pkg/cli/connections/mock_factory.go index 5b97f76b7b..7bc7cc820f 100644 --- a/pkg/cli/connections/mock_factory.go +++ b/pkg/cli/connections/mock_factory.go @@ -19,9 +19,9 @@ package connections import ( "context" - "github.com/project-radius/radius/pkg/cli/clients" - cli_credential "github.com/project-radius/radius/pkg/cli/credential" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli/clients" + cli_credential "github.com/radius-project/radius/pkg/cli/credential" + "github.com/radius-project/radius/pkg/cli/workspaces" ) var _ Factory = (*MockFactory)(nil) diff --git a/pkg/cli/credential/aws_credential_management.go b/pkg/cli/credential/aws_credential_management.go index c5e54f622d..119b221ab1 100644 --- a/pkg/cli/credential/aws_credential_management.go +++ b/pkg/cli/credential/aws_credential_management.go @@ -22,11 +22,11 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/project-radius/radius/pkg/cli/clierrors" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/cli/clierrors" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) -//go:generate mockgen -destination=./mock_aws_credential_management.go -package=credential -self_package github.com/project-radius/radius/pkg/cli/credential github.com/project-radius/radius/pkg/cli/credential AWSCredentialManagementClientInterface +//go:generate mockgen -destination=./mock_aws_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AWSCredentialManagementClientInterface // AWSCredentialManagementClient is used to interface with cloud provider configuration and credentials. type AWSCredentialManagementClient struct { diff --git a/pkg/cli/credential/azure_credential_management.go b/pkg/cli/credential/azure_credential_management.go index a387cca1c5..d30239be6f 100644 --- a/pkg/cli/credential/azure_credential_management.go +++ b/pkg/cli/credential/azure_credential_management.go @@ -22,11 +22,11 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/project-radius/radius/pkg/cli/clierrors" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/cli/clierrors" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) -//go:generate mockgen -destination=./mock_azure_credential_management.go -package=credential -self_package github.com/project-radius/radius/pkg/cli/credential github.com/project-radius/radius/pkg/cli/credential AzureCredentialManagementClientInterface +//go:generate mockgen -destination=./mock_azure_credential_management.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential AzureCredentialManagementClientInterface // AzureCredentialManagementClient is used to interface with cloud provider configuration and credentials. type AzureCredentialManagementClient struct { diff --git a/pkg/cli/credential/credential_management.go b/pkg/cli/credential/credential_management.go index ca92bf2c8b..edb1730366 100644 --- a/pkg/cli/credential/credential_management.go +++ b/pkg/cli/credential/credential_management.go @@ -20,8 +20,8 @@ import ( "context" "strings" - "github.com/project-radius/radius/pkg/cli/clients" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/cli/clients" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) const ( @@ -29,7 +29,7 @@ const ( AWSPlaneType = "aws" ) -//go:generate mockgen -destination=./mock_credentialmanagementclient.go -package=credential -self_package github.com/project-radius/radius/pkg/cli/credential github.com/project-radius/radius/pkg/cli/credential CredentialManagementClient +//go:generate mockgen -destination=./mock_credentialmanagementclient.go -package=credential -self_package github.com/radius-project/radius/pkg/cli/credential github.com/radius-project/radius/pkg/cli/credential CredentialManagementClient // CredentialManagementClient is used to interface with cloud provider configuration and credentials. type CredentialManagementClient interface { diff --git a/pkg/cli/credential/credential_management_test.go b/pkg/cli/credential/credential_management_test.go index 78aa49593f..35e764cf66 100644 --- a/pkg/cli/credential/credential_management_test.go +++ b/pkg/cli/credential/credential_management_test.go @@ -24,10 +24,10 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/test/testcontext" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/test/testcontext" ) const ( diff --git a/pkg/cli/credential/mock_aws_credential_management.go b/pkg/cli/credential/mock_aws_credential_management.go index a7a8ec9658..f66dd9faa5 100644 --- a/pkg/cli/credential/mock_aws_credential_management.go +++ b/pkg/cli/credential/mock_aws_credential_management.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/credential (interfaces: AWSCredentialManagementClientInterface) +// Source: github.com/radius-project/radius/pkg/cli/credential (interfaces: AWSCredentialManagementClientInterface) // Package credential is a generated GoMock package. package credential @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) // MockAWSCredentialManagementClientInterface is a mock of AWSCredentialManagementClientInterface interface. diff --git a/pkg/cli/credential/mock_azure_credential_management.go b/pkg/cli/credential/mock_azure_credential_management.go index 5bc746c47e..55f15185f1 100644 --- a/pkg/cli/credential/mock_azure_credential_management.go +++ b/pkg/cli/credential/mock_azure_credential_management.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/credential (interfaces: AzureCredentialManagementClientInterface) +// Source: github.com/radius-project/radius/pkg/cli/credential (interfaces: AzureCredentialManagementClientInterface) // Package credential is a generated GoMock package. package credential @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) // MockAzureCredentialManagementClientInterface is a mock of AzureCredentialManagementClientInterface interface. diff --git a/pkg/cli/credential/mock_credentialmanagementclient.go b/pkg/cli/credential/mock_credentialmanagementclient.go index 2d7a5e61a8..5e3d01bc68 100644 --- a/pkg/cli/credential/mock_credentialmanagementclient.go +++ b/pkg/cli/credential/mock_credentialmanagementclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/credential (interfaces: CredentialManagementClient) +// Source: github.com/radius-project/radius/pkg/cli/credential (interfaces: CredentialManagementClient) // Package credential is a generated GoMock package. package credential @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" ) // MockCredentialManagementClient is a mock of CredentialManagementClient interface. diff --git a/pkg/cli/deploy/deploy.go b/pkg/cli/deploy/deploy.go index 6702bf377e..83819a40fd 100644 --- a/pkg/cli/deploy/deploy.go +++ b/pkg/cli/deploy/deploy.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/output" ) // DeployWithProgress runs a deployment and displays progress to the user. This is intended to be used diff --git a/pkg/cli/deploy/endpoints.go b/pkg/cli/deploy/endpoints.go index d99e2ee377..d8ec1e7330 100644 --- a/pkg/cli/deploy/endpoints.go +++ b/pkg/cli/deploy/endpoints.go @@ -19,8 +19,8 @@ package deploy import ( "context" - "github.com/project-radius/radius/pkg/cli/clients" - ucpresources "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli/clients" + ucpresources "github.com/radius-project/radius/pkg/ucp/resources" ) type PublicEndpoint struct { diff --git a/pkg/cli/deploy/mock_deploy.go b/pkg/cli/deploy/mock_deploy.go index 674af6603c..6adbe54ab2 100644 --- a/pkg/cli/deploy/mock_deploy.go +++ b/pkg/cli/deploy/mock_deploy.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/deploy (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/deploy (interfaces: Interface) // Package deploy is a generated GoMock package. package deploy @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - clients "github.com/project-radius/radius/pkg/cli/clients" + clients "github.com/radius-project/radius/pkg/cli/clients" ) // MockInterface is a mock of Interface interface. diff --git a/pkg/cli/deploy/progress.go b/pkg/cli/deploy/progress.go index 2aaa484bf2..0e2aabdf4f 100644 --- a/pkg/cli/deploy/progress.go +++ b/pkg/cli/deploy/progress.go @@ -24,8 +24,8 @@ import ( "github.com/gosuri/uilive" "github.com/mattn/go-isatty" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/output" ) // NewProgressListener creates a new ProgressListener based on whether the output is a terminal or not, returning an diff --git a/pkg/cli/deploy/types.go b/pkg/cli/deploy/types.go index 7cf755e200..e89142dc62 100644 --- a/pkg/cli/deploy/types.go +++ b/pkg/cli/deploy/types.go @@ -19,9 +19,9 @@ package deploy import ( "context" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/workspaces" ) // Interface is the interface for executing Bicep deployments in the CLI. @@ -60,7 +60,7 @@ var _ Interface = (*Impl)(nil) type Impl struct { } -//go:generate mockgen -destination=./mock_deploy.go -package=deploy -self_package github.com/project-radius/radius/pkg/cli/deploy github.com/project-radius/radius/pkg/cli/deploy Interface +//go:generate mockgen -destination=./mock_deploy.go -package=deploy -self_package github.com/radius-project/radius/pkg/cli/deploy github.com/radius-project/radius/pkg/cli/deploy Interface // DeployWithProgress runs a deployment and displays progress to the user. This is intended to be used // from the CLI and thus logs to the console. diff --git a/pkg/cli/deployment/deploy.go b/pkg/cli/deployment/deploy.go index c1a330ae20..b00bd0557d 100644 --- a/pkg/cli/deployment/deploy.go +++ b/pkg/cli/deployment/deploy.go @@ -27,10 +27,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/clients" - sdkclients "github.com/project-radius/radius/pkg/sdk/clients" - ucpresources "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/clients" + sdkclients "github.com/radius-project/radius/pkg/sdk/clients" + ucpresources "github.com/radius-project/radius/pkg/ucp/resources" ) const ( diff --git a/pkg/cli/deployment/deploy_test.go b/pkg/cli/deployment/deploy_test.go index 05278d7bb6..6b13080986 100644 --- a/pkg/cli/deployment/deploy_test.go +++ b/pkg/cli/deployment/deploy_test.go @@ -19,8 +19,8 @@ package deployment import ( "testing" - "github.com/project-radius/radius/pkg/cli/clients" - sdkclients "github.com/project-radius/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/cli/clients" + sdkclients "github.com/radius-project/radius/pkg/sdk/clients" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/deployment/diagnostics.go b/pkg/cli/deployment/diagnostics.go index 57e8cb8b00..24b174184b 100644 --- a/pkg/cli/deployment/diagnostics.go +++ b/pkg/cli/deployment/diagnostics.go @@ -21,10 +21,10 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - k8slabels "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + k8slabels "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/ucp/resources" "io" "net/http" diff --git a/pkg/cli/framework/config.go b/pkg/cli/framework/config.go index 77180a3453..56393d0088 100644 --- a/pkg/cli/framework/config.go +++ b/pkg/cli/framework/config.go @@ -20,9 +20,9 @@ import ( "context" "strings" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/config" - "github.com/project-radius/radius/pkg/cli/workspaces" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/config" + "github.com/radius-project/radius/pkg/cli/workspaces" "github.com/spf13/viper" ) @@ -53,7 +53,7 @@ func ConfigFromContext(ctx context.Context) *viper.Viper { return holder.Config } -//go:generate mockgen -destination=./mock_config.go -package=framework -self_package github.com/project-radius/radius/pkg/cli/framework github.com/project-radius/radius/pkg/cli/framework ConfigFileInterface +//go:generate mockgen -destination=./mock_config.go -package=framework -self_package github.com/radius-project/radius/pkg/cli/framework github.com/radius-project/radius/pkg/cli/framework ConfigFileInterface type ConfigFileInterface interface { ConfigFromContext(ctx context.Context) *viper.Viper diff --git a/pkg/cli/framework/framework.go b/pkg/cli/framework/framework.go index 305fcf761c..e9b12a6ad8 100644 --- a/pkg/cli/framework/framework.go +++ b/pkg/cli/framework/framework.go @@ -19,18 +19,18 @@ package framework import ( "context" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/cmd/env/namespace" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/deploy" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/kubernetes/logstream" - "github.com/project-radius/radius/pkg/cli/kubernetes/portforward" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/cmd/env/namespace" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/deploy" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/kubernetes/logstream" + "github.com/radius-project/radius/pkg/cli/kubernetes/portforward" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" "github.com/spf13/cobra" ) diff --git a/pkg/cli/framework/mock_config.go b/pkg/cli/framework/mock_config.go index 71a94f140b..cf5abf4c9d 100644 --- a/pkg/cli/framework/mock_config.go +++ b/pkg/cli/framework/mock_config.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/framework (interfaces: ConfigFileInterface) +// Source: github.com/radius-project/radius/pkg/cli/framework (interfaces: ConfigFileInterface) // Package framework is a generated GoMock package. package framework @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - workspaces "github.com/project-radius/radius/pkg/cli/workspaces" + workspaces "github.com/radius-project/radius/pkg/cli/workspaces" viper "github.com/spf13/viper" ) diff --git a/pkg/cli/framework/mock_framework.go b/pkg/cli/framework/mock_framework.go index cc30e05af7..7ff91b90d2 100644 --- a/pkg/cli/framework/mock_framework.go +++ b/pkg/cli/framework/mock_framework.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/framework (interfaces: Runner) +// Source: github.com/radius-project/radius/pkg/cli/framework (interfaces: Runner) // Package framework is a generated GoMock package. package framework diff --git a/pkg/cli/helm/cluster.go b/pkg/cli/helm/cluster.go index 1c6f0ee677..b02566adb9 100644 --- a/pkg/cli/helm/cluster.go +++ b/pkg/cli/helm/cluster.go @@ -26,7 +26,7 @@ import ( "helm.sh/helm/v3/pkg/storage/driver" "k8s.io/cli-runtime/pkg/genericclioptions" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/version" ) const ( @@ -189,7 +189,7 @@ type InstallState struct { Version string } -//go:generate mockgen -destination=./mock_cluster.go -package=helm -self_package github.com/project-radius/radius/pkg/cli/helm github.com/project-radius/radius/pkg/cli/helm Interface +//go:generate mockgen -destination=./mock_cluster.go -package=helm -self_package github.com/radius-project/radius/pkg/cli/helm github.com/radius-project/radius/pkg/cli/helm Interface // Interface provides an abstraction over Helm operations for installing Radius. type Interface interface { diff --git a/pkg/cli/helm/cluster_test.go b/pkg/cli/helm/cluster_test.go index 565ba35495..fe82ba5a31 100644 --- a/pkg/cli/helm/cluster_test.go +++ b/pkg/cli/helm/cluster_test.go @@ -19,7 +19,7 @@ package helm import ( "testing" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/version" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/helm/contourclient.go b/pkg/cli/helm/contourclient.go index d9b8c7a1da..f6b1f6c816 100644 --- a/pkg/cli/helm/contourclient.go +++ b/pkg/cli/helm/contourclient.go @@ -27,7 +27,7 @@ import ( "helm.sh/helm/v3/pkg/storage/driver" "k8s.io/cli-runtime/pkg/genericclioptions" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/output" ) const ( @@ -63,7 +63,7 @@ func ApplyContourHelmChart(options ContourOptions, kubeContext string) error { // https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you // TODO: Apply CRDs because Helm doesn't upgrade CRDs for you. - // https://github.com/project-radius/radius/issues/712 + // https://github.com/radius-project/radius/issues/712 // We need the CRDs to be public to do this (or consider unpacking the chart // for the CRDs) diff --git a/pkg/cli/helm/mock_cluster.go b/pkg/cli/helm/mock_cluster.go index 3d6eee30d7..1b9f5052e7 100644 --- a/pkg/cli/helm/mock_cluster.go +++ b/pkg/cli/helm/mock_cluster.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/helm (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/helm (interfaces: Interface) // Package helm is a generated GoMock package. package helm diff --git a/pkg/cli/helm/radiusclient.go b/pkg/cli/helm/radiusclient.go index 2067fca867..41a59b362e 100644 --- a/pkg/cli/helm/radiusclient.go +++ b/pkg/cli/helm/radiusclient.go @@ -22,7 +22,7 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/output" helm "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" @@ -91,7 +91,7 @@ func ApplyRadiusHelmChart(options RadiusOptions, kubeContext string) (bool, erro // https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you // TODO: Apply CRDs because Helm doesn't upgrade CRDs for you. - // https://github.com/project-radius/radius/issues/712 + // https://github.com/radius-project/radius/issues/712 // We need the CRDs to be public to do this (or consider unpacking the chart // for the CRDs) diff --git a/pkg/cli/kubernetes/kubernetes.go b/pkg/cli/kubernetes/kubernetes.go index 1d54e9d6c7..d2bc725e96 100644 --- a/pkg/cli/kubernetes/kubernetes.go +++ b/pkg/cli/kubernetes/kubernetes.go @@ -33,8 +33,8 @@ import ( "k8s.io/client-go/tools/clientcmd/api" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/kubeutil" ) var ( @@ -152,7 +152,7 @@ func GetContextFromConfigFileIfExists(configFilePath, context string) (string, e return contextName, nil } -//go:generate mockgen -destination=./mock_kubernetes.go -package=kubernetes -self_package github.com/project-radius/radius/pkg/cli/kubernetes github.com/project-radius/radius/pkg/cli/kubernetes Interface +//go:generate mockgen -destination=./mock_kubernetes.go -package=kubernetes -self_package github.com/radius-project/radius/pkg/cli/kubernetes github.com/radius-project/radius/pkg/cli/kubernetes Interface type Interface interface { GetKubeContext() (*api.Config, error) } diff --git a/pkg/cli/kubernetes/kubernetes_test.go b/pkg/cli/kubernetes/kubernetes_test.go index edd0dcae71..1d2abfdae1 100644 --- a/pkg/cli/kubernetes/kubernetes_test.go +++ b/pkg/cli/kubernetes/kubernetes_test.go @@ -22,7 +22,7 @@ import ( "os" "testing" - "github.com/project-radius/radius/test/k8sutil" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/cli/kubernetes/logstream/mock_logstream.go b/pkg/cli/kubernetes/logstream/mock_logstream.go index a79f8e5779..cd47910373 100644 --- a/pkg/cli/kubernetes/logstream/mock_logstream.go +++ b/pkg/cli/kubernetes/logstream/mock_logstream.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/kubernetes/logstream (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/kubernetes/logstream (interfaces: Interface) // Package logstream is a generated GoMock package. package logstream diff --git a/pkg/cli/kubernetes/logstream/stern.go b/pkg/cli/kubernetes/logstream/stern.go index f1dd44d8a3..49c2fd2b97 100644 --- a/pkg/cli/kubernetes/logstream/stern.go +++ b/pkg/cli/kubernetes/logstream/stern.go @@ -23,7 +23,7 @@ import ( "time" "github.com/fatih/color" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" "github.com/stern/stern/stern" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" diff --git a/pkg/cli/kubernetes/logstream/types.go b/pkg/cli/kubernetes/logstream/types.go index c9f080d452..faa7585c1c 100644 --- a/pkg/cli/kubernetes/logstream/types.go +++ b/pkg/cli/kubernetes/logstream/types.go @@ -36,7 +36,7 @@ type Options struct { Out io.Writer } -//go:generate mockgen -destination=./mock_logstream.go -package=logstream -self_package github.com/project-radius/radius/pkg/cli/kubernetes/logstream github.com/project-radius/radius/pkg/cli/kubernetes/logstream Interface +//go:generate mockgen -destination=./mock_logstream.go -package=logstream -self_package github.com/radius-project/radius/pkg/cli/kubernetes/logstream github.com/radius-project/radius/pkg/cli/kubernetes/logstream Interface // Interface is the interface type for streaming application logs. type Interface interface { diff --git a/pkg/cli/kubernetes/mock_kubernetes.go b/pkg/cli/kubernetes/mock_kubernetes.go index cb78d814be..98aa4e7398 100644 --- a/pkg/cli/kubernetes/mock_kubernetes.go +++ b/pkg/cli/kubernetes/mock_kubernetes.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/kubernetes (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/kubernetes (interfaces: Interface) // Package kubernetes is a generated GoMock package. package kubernetes diff --git a/pkg/cli/kubernetes/portforward/application_watcher.go b/pkg/cli/kubernetes/portforward/application_watcher.go index 7734032604..5bff6da3bb 100644 --- a/pkg/cli/kubernetes/portforward/application_watcher.go +++ b/pkg/cli/kubernetes/portforward/application_watcher.go @@ -20,7 +20,7 @@ import ( "context" "reflect" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/pkg/cli/kubernetes/portforward/application_watcher_test.go b/pkg/cli/kubernetes/portforward/application_watcher_test.go index e60621f1e8..1ff2532fef 100644 --- a/pkg/cli/kubernetes/portforward/application_watcher_test.go +++ b/pkg/cli/kubernetes/portforward/application_watcher_test.go @@ -19,7 +19,7 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/cli/kubernetes/portforward/deployment_watcher_test.go b/pkg/cli/kubernetes/portforward/deployment_watcher_test.go index 08fcd72eac..f83232ad20 100644 --- a/pkg/cli/kubernetes/portforward/deployment_watcher_test.go +++ b/pkg/cli/kubernetes/portforward/deployment_watcher_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/cli/kubernetes/portforward/impl.go b/pkg/cli/kubernetes/portforward/impl.go index 29e330ae87..6982578415 100644 --- a/pkg/cli/kubernetes/portforward/impl.go +++ b/pkg/cli/kubernetes/portforward/impl.go @@ -19,7 +19,7 @@ package portforward import ( "context" - "github.com/project-radius/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/kubernetes" ) var _ Interface = (*Impl)(nil) diff --git a/pkg/cli/kubernetes/portforward/mock_portforward.go b/pkg/cli/kubernetes/portforward/mock_portforward.go index 518784ffda..6454ad00b6 100644 --- a/pkg/cli/kubernetes/portforward/mock_portforward.go +++ b/pkg/cli/kubernetes/portforward/mock_portforward.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/kubernetes/portforward (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/kubernetes/portforward (interfaces: Interface) // Package portforward is a generated GoMock package. package portforward diff --git a/pkg/cli/kubernetes/portforward/pod_watcher.go b/pkg/cli/kubernetes/portforward/pod_watcher.go index 71e4370e0e..1fa41d3028 100644 --- a/pkg/cli/kubernetes/portforward/pod_watcher.go +++ b/pkg/cli/kubernetes/portforward/pod_watcher.go @@ -25,7 +25,7 @@ import ( "net/http" "strings" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" corev1 "k8s.io/api/core/v1" clientgoportforward "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" diff --git a/pkg/cli/kubernetes/portforward/pod_watcher_test.go b/pkg/cli/kubernetes/portforward/pod_watcher_test.go index 98b3f7bf5c..58241d881e 100644 --- a/pkg/cli/kubernetes/portforward/pod_watcher_test.go +++ b/pkg/cli/kubernetes/portforward/pod_watcher_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/cli/kubernetes/portforward/types.go b/pkg/cli/kubernetes/portforward/types.go index c20dacfa0c..24c586a7b3 100644 --- a/pkg/cli/kubernetes/portforward/types.go +++ b/pkg/cli/kubernetes/portforward/types.go @@ -74,7 +74,7 @@ type StatusMessage struct { RemotePort uint16 } -//go:generate mockgen -destination=./mock_portforward.go -package=portforward -self_package github.com/project-radius/radius/pkg/cli/kubernetes/portforward github.com/project-radius/radius/pkg/cli/kubernetes/portforward Interface +//go:generate mockgen -destination=./mock_portforward.go -package=portforward -self_package github.com/radius-project/radius/pkg/cli/kubernetes/portforward github.com/radius-project/radius/pkg/cli/kubernetes/portforward Interface // Interface is the interface type for port-forwarding. type Interface interface { diff --git a/pkg/cli/kubernetes/portforward/util.go b/pkg/cli/kubernetes/portforward/util.go index cc6c12bf15..1cbb3827bd 100644 --- a/pkg/cli/kubernetes/portforward/util.go +++ b/pkg/cli/kubernetes/portforward/util.go @@ -19,7 +19,7 @@ package portforward import ( "context" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/pkg/cli/kubernetes/portforward/util_test.go b/pkg/cli/kubernetes/portforward/util_test.go index 9d0e907efe..8b7e13223c 100644 --- a/pkg/cli/kubernetes/portforward/util_test.go +++ b/pkg/cli/kubernetes/portforward/util_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/cli/objectformats/objectformats.go b/pkg/cli/objectformats/objectformats.go index f495219613..499bd2c957 100644 --- a/pkg/cli/objectformats/objectformats.go +++ b/pkg/cli/objectformats/objectformats.go @@ -19,7 +19,7 @@ package objectformats import ( "strings" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/output" ) // GetApplicationStatusTableFormat() sets up the columns and headings for a table to display application names and resource counts. diff --git a/pkg/cli/objectformats/objectformats_test.go b/pkg/cli/objectformats/objectformats_test.go index 2acdafa910..c210affd98 100644 --- a/pkg/cli/objectformats/objectformats_test.go +++ b/pkg/cli/objectformats/objectformats_test.go @@ -20,9 +20,9 @@ import ( "bytes" "testing" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/cli/output/mock_writer.go b/pkg/cli/output/mock_writer.go index 5f8b73c278..4fc3f6c04c 100644 --- a/pkg/cli/output/mock_writer.go +++ b/pkg/cli/output/mock_writer.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/output (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/output (interfaces: Interface) // Package output is a generated GoMock package. package output diff --git a/pkg/cli/output/resources.go b/pkg/cli/output/resources.go index e70069ad93..78904a8a80 100644 --- a/pkg/cli/output/resources.go +++ b/pkg/cli/output/resources.go @@ -19,7 +19,7 @@ package output import ( "fmt" - ucpresources "github.com/project-radius/radius/pkg/ucp/resources" + ucpresources "github.com/radius-project/radius/pkg/ucp/resources" ) const ( diff --git a/pkg/cli/prompt/mock_prompter.go b/pkg/cli/prompt/mock_prompter.go index 7ec2b92092..5aebfa01ce 100644 --- a/pkg/cli/prompt/mock_prompter.go +++ b/pkg/cli/prompt/mock_prompter.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/cli/prompt (interfaces: Interface) +// Source: github.com/radius-project/radius/pkg/cli/prompt (interfaces: Interface) // Package prompt is a generated GoMock package. package prompt @@ -9,7 +9,7 @@ import ( tea "github.com/charmbracelet/bubbletea" gomock "github.com/golang/mock/gomock" - text "github.com/project-radius/radius/pkg/cli/prompt/text" + text "github.com/radius-project/radius/pkg/cli/prompt/text" ) // MockInterface is a mock of Interface interface. diff --git a/pkg/cli/prompt/prompt.go b/pkg/cli/prompt/prompt.go index ae96f58525..357c0e4e9b 100644 --- a/pkg/cli/prompt/prompt.go +++ b/pkg/cli/prompt/prompt.go @@ -22,9 +22,9 @@ import ( "github.com/charmbracelet/bubbles/list" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" - "github.com/project-radius/radius/pkg/cli/clierrors" - cli_list "github.com/project-radius/radius/pkg/cli/prompt/list" - "github.com/project-radius/radius/pkg/cli/prompt/text" + "github.com/radius-project/radius/pkg/cli/clierrors" + cli_list "github.com/radius-project/radius/pkg/cli/prompt/list" + "github.com/radius-project/radius/pkg/cli/prompt/text" ) const ( @@ -35,7 +35,7 @@ const ( ConfirmNo = "No" ) -//go:generate mockgen -destination=./mock_prompter.go -package=prompt -self_package github.com/project-radius/radius/pkg/cli/prompt github.com/project-radius/radius/pkg/cli/prompt Interface +//go:generate mockgen -destination=./mock_prompter.go -package=prompt -self_package github.com/radius-project/radius/pkg/cli/prompt github.com/radius-project/radius/pkg/cli/prompt Interface // Interface contains operation to prompt the user interactively. // diff --git a/pkg/cli/tools/binary_tools.go b/pkg/cli/tools/binary_tools.go index 4ed7941635..53dcf58d08 100644 --- a/pkg/cli/tools/binary_tools.go +++ b/pkg/cli/tools/binary_tools.go @@ -24,7 +24,7 @@ import ( "path" "runtime" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/version" ) // validPlatforms is a map of valid platforms to download for. The key is the combination of GOOS and GOARCH. diff --git a/pkg/cli/tools/binary_tools_test.go b/pkg/cli/tools/binary_tools_test.go index c3ed321f82..683c4cdf60 100644 --- a/pkg/cli/tools/binary_tools_test.go +++ b/pkg/cli/tools/binary_tools_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/version" ) func TestGetDownloadURI(t *testing.T) { diff --git a/pkg/cli/workspaces/connection.go b/pkg/cli/workspaces/connection.go index d32260942e..12addf527c 100644 --- a/pkg/cli/workspaces/connection.go +++ b/pkg/cli/workspaces/connection.go @@ -22,8 +22,8 @@ import ( "strings" "github.com/mitchellh/mapstructure" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/sdk" ) const KindKubernetes string = "kubernetes" diff --git a/pkg/cli/workspaces/types.go b/pkg/cli/workspaces/types.go index c4d2f62dbe..c6b7569903 100644 --- a/pkg/cli/workspaces/types.go +++ b/pkg/cli/workspaces/types.go @@ -16,7 +16,7 @@ limitations under the License. package workspaces -import "github.com/project-radius/radius/pkg/cli/config" +import "github.com/radius-project/radius/pkg/cli/config" // Workspace represents configuration for the rad CLI. // diff --git a/pkg/corerp/api/v20220315privatepreview/application_conversion.go b/pkg/corerp/api/v20220315privatepreview/application_conversion.go index 05f94a845c..704b255de0 100644 --- a/pkg/corerp/api/v20220315privatepreview/application_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/application_conversion.go @@ -17,10 +17,10 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned Application resource to version-agnostic datamodel. diff --git a/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go index d3c85fe1d3..5c1f0073fe 100644 --- a/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/application_conversion_test.go @@ -20,10 +20,10 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion.go b/pkg/corerp/api/v20220315privatepreview/container_conversion.go index f49e3488ea..8d94e837fc 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion.go @@ -17,10 +17,10 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned Container resource to version-agnostic datamodel. diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go index f8e3ef17b1..b776ac1a2f 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go @@ -20,12 +20,12 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go index 099219beef..1f4610bb70 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go @@ -20,13 +20,13 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/portableresources" - types "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/portableresources" + types "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) const ( diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go index b65b76d64a..45423b8c3c 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go @@ -21,14 +21,14 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go index cf09b545b4..b01962447b 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go @@ -19,10 +19,10 @@ package v20220315privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - types "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + types "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo returns an error as it does not support converting Environment Recipe Properties to a version-agnostic object. diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go index d48330251c..ead1d8723e 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go @@ -20,10 +20,10 @@ import ( "encoding/json" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - types "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + types "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go index 890e53b733..1391b88f0e 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go @@ -19,12 +19,12 @@ package v20220315privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - pr_apiver "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + pr_apiver "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned Extender resource to version-agnostic datamodel and returns it, or an error if the diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go index f7833e618f..f79a6f36a7 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go @@ -20,13 +20,13 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go b/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go index 631ad9d322..237c3f6300 100644 --- a/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/gateway_conversion.go @@ -17,10 +17,10 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned Gateway resource to version-agnostic datamodel. diff --git a/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go index 02366a0cf5..521df4a370 100644 --- a/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/gateway_conversion_test.go @@ -20,11 +20,11 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go b/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go index 87a3847892..cd3c935f6d 100644 --- a/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/httproute_conversion.go @@ -17,10 +17,10 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned HTTPRoute resource to version-agnostic datamodel. diff --git a/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go index 924d34792c..bd75d6ea9b 100644 --- a/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/httproute_conversion_test.go @@ -20,11 +20,11 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go index 7649dd584d..a150a115a0 100644 --- a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion.go @@ -17,10 +17,10 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned SecretStoreResource resource to version-agnostic datamodel. diff --git a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go index 19e24e604e..27f5dd0bab 100644 --- a/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/secretstore_conversion_test.go @@ -20,12 +20,12 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/util.go b/pkg/corerp/api/v20220315privatepreview/util.go index 72fa11d87a..c38ea491ed 100644 --- a/pkg/corerp/api/v20220315privatepreview/util.go +++ b/pkg/corerp/api/v20220315privatepreview/util.go @@ -19,10 +19,10 @@ package v20220315privatepreview import ( "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" "golang.org/x/exp/slices" ) diff --git a/pkg/corerp/api/v20220315privatepreview/util_test.go b/pkg/corerp/api/v20220315privatepreview/util_test.go index 159befe14e..5518c45f12 100644 --- a/pkg/corerp/api/v20220315privatepreview/util_test.go +++ b/pkg/corerp/api/v20220315privatepreview/util_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/api/v20220315privatepreview/volume_conversion.go b/pkg/corerp/api/v20220315privatepreview/volume_conversion.go index bb859f53cb..d7b13011b9 100644 --- a/pkg/corerp/api/v20220315privatepreview/volume_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/volume_conversion.go @@ -17,10 +17,10 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned HTTPRoute resource to version-agnostic datamodel. diff --git a/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go index 41e41f8e84..f0b6222781 100644 --- a/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/volume_conversion_test.go @@ -20,11 +20,11 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/backend/controller/createorupdateresource.go b/pkg/corerp/backend/controller/createorupdateresource.go index b9c7bd133f..3ca8c6787b 100644 --- a/pkg/corerp/backend/controller/createorupdateresource.go +++ b/pkg/corerp/backend/controller/createorupdateresource.go @@ -23,16 +23,16 @@ import ( "net/http" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers/container" - "github.com/project-radius/radius/pkg/corerp/renderers/gateway" - "github.com/project-radius/radius/pkg/corerp/renderers/httproute" - "github.com/project-radius/radius/pkg/corerp/renderers/volume" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers/container" + "github.com/radius-project/radius/pkg/corerp/renderers/gateway" + "github.com/radius-project/radius/pkg/corerp/renderers/httproute" + "github.com/radius-project/radius/pkg/corerp/renderers/volume" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) var _ ctrl.Controller = (*CreateOrUpdateResource)(nil) diff --git a/pkg/corerp/backend/controller/createorupdateresource_test.go b/pkg/corerp/backend/controller/createorupdateresource_test.go index feaf381322..51107f2dde 100644 --- a/pkg/corerp/backend/controller/createorupdateresource_test.go +++ b/pkg/corerp/backend/controller/createorupdateresource_test.go @@ -27,16 +27,16 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - deployment "github.com/project-radius/radius/pkg/corerp/backend/deployment" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/corerp/renderers/container" - "github.com/project-radius/radius/pkg/corerp/renderers/gateway" - "github.com/project-radius/radius/pkg/corerp/renderers/httproute" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + deployment "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/corerp/renderers/container" + "github.com/radius-project/radius/pkg/corerp/renderers/gateway" + "github.com/radius-project/radius/pkg/corerp/renderers/httproute" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) func TestCreateOrUpdateResourceRun_20220315PrivatePreview(t *testing.T) { diff --git a/pkg/corerp/backend/controller/deleteresource.go b/pkg/corerp/backend/controller/deleteresource.go index 5ac28c1c48..de31e5c484 100644 --- a/pkg/corerp/backend/controller/deleteresource.go +++ b/pkg/corerp/backend/controller/deleteresource.go @@ -19,10 +19,10 @@ package controller import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) var _ ctrl.Controller = (*DeleteResource)(nil) diff --git a/pkg/corerp/backend/controller/deleteresource_test.go b/pkg/corerp/backend/controller/deleteresource_test.go index 11246cfcbb..03a9e87c35 100644 --- a/pkg/corerp/backend/controller/deleteresource_test.go +++ b/pkg/corerp/backend/controller/deleteresource_test.go @@ -24,9 +24,9 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - deployment "github.com/project-radius/radius/pkg/corerp/backend/deployment" - "github.com/project-radius/radius/pkg/ucp/store" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + deployment "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/backend/deployment/deploymentprocessor.go b/pkg/corerp/backend/deployment/deploymentprocessor.go index 294ae3d71a..36e550feec 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor.go @@ -24,23 +24,23 @@ import ( "os" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rp_util "github.com/project-radius/radius/pkg/rp/util" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - - corerp_dm "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/model" - "github.com/project-radius/radius/pkg/corerp/renderers" - - dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" - datastores_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rp_util "github.com/radius-project/radius/pkg/rp/util" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + + corerp_dm "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/model" + "github.com/radius-project/radius/pkg/corerp/renderers" + + dapr_dm "github.com/radius-project/radius/pkg/daprrp/datamodel" + datastores_dm "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" "github.com/go-openapi/jsonpointer" corev1 "k8s.io/api/core/v1" @@ -48,7 +48,7 @@ import ( controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) -//go:generate mockgen -destination=./mock_deploymentprocessor.go -package=deployment -self_package github.com/project-radius/radius/pkg/corerp/backend/deployment github.com/project-radius/radius/pkg/corerp/backend/deployment DeploymentProcessor +//go:generate mockgen -destination=./mock_deploymentprocessor.go -package=deployment -self_package github.com/radius-project/radius/pkg/corerp/backend/deployment github.com/radius-project/radius/pkg/corerp/backend/deployment DeploymentProcessor type DeploymentProcessor interface { Render(ctx context.Context, id resources.ID, resource v1.DataModelInterface) (renderers.RendererOutput, error) Deploy(ctx context.Context, id resources.ID, rendererOutput renderers.RendererOutput) (rpv1.DeploymentOutput, error) diff --git a/pkg/corerp/backend/deployment/deploymentprocessor_test.go b/pkg/corerp/backend/deployment/deploymentprocessor_test.go index e9deb9107d..a0b5efac37 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor_test.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor_test.go @@ -23,27 +23,27 @@ import ( "os" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/model" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/corerp/renderers/container" - dsrp_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - pr_renderers "github.com/project-radius/radius/pkg/portableresources/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/model" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/corerp/renderers/container" + dsrp_dm "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + pr_renderers "github.com/radius-project/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/corerp/backend/deployment/mock_deploymentprocessor.go b/pkg/corerp/backend/deployment/mock_deploymentprocessor.go index 66112b6ce0..81a7fc471a 100644 --- a/pkg/corerp/backend/deployment/mock_deploymentprocessor.go +++ b/pkg/corerp/backend/deployment/mock_deploymentprocessor.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/corerp/backend/deployment (interfaces: DeploymentProcessor) +// Source: github.com/radius-project/radius/pkg/corerp/backend/deployment (interfaces: DeploymentProcessor) // Package deployment is a generated GoMock package. package deployment @@ -9,10 +9,10 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - renderers "github.com/project-radius/radius/pkg/corerp/renderers" - v10 "github.com/project-radius/radius/pkg/rp/v1" - resources "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + renderers "github.com/radius-project/radius/pkg/corerp/renderers" + v10 "github.com/radius-project/radius/pkg/rp/v1" + resources "github.com/radius-project/radius/pkg/ucp/resources" ) // MockDeploymentProcessor is a mock of DeploymentProcessor interface. diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go index 827e08742a..acd679e5b1 100644 --- a/pkg/corerp/backend/service.go +++ b/pkg/corerp/backend/service.go @@ -20,26 +20,26 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/worker" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - backend_ctrl "github.com/project-radius/radius/pkg/corerp/backend/controller" - "github.com/project-radius/radius/pkg/corerp/backend/deployment" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/model" - "github.com/project-radius/radius/pkg/corerp/processors/extenders" - "github.com/project-radius/radius/pkg/portableresources" - pr_backend_ctrl "github.com/project-radius/radius/pkg/portableresources/backend/controller" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/configloader" - "github.com/project-radius/radius/pkg/recipes/driver" - "github.com/project-radius/radius/pkg/recipes/engine" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/sdk/clients" - "github.com/project-radius/radius/pkg/ucp/secret/provider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + backend_ctrl "github.com/radius-project/radius/pkg/corerp/backend/controller" + "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/model" + "github.com/radius-project/radius/pkg/corerp/processors/extenders" + "github.com/radius-project/radius/pkg/portableresources" + pr_backend_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + "github.com/radius-project/radius/pkg/recipes/driver" + "github.com/radius-project/radius/pkg/recipes/engine" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/ucp/secret/provider" ) const ( diff --git a/pkg/corerp/backend/systemservice.go b/pkg/corerp/backend/systemservice.go index 1f07c3e0f1..d2fec5e57f 100644 --- a/pkg/corerp/backend/systemservice.go +++ b/pkg/corerp/backend/systemservice.go @@ -22,9 +22,9 @@ import ( "net" "net/http" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/version" ) // SystemService represents the service which provides the basic health status and metric server. diff --git a/pkg/corerp/datamodel/application.go b/pkg/corerp/datamodel/application.go index 11aeadbd13..0eac1217ae 100644 --- a/pkg/corerp/datamodel/application.go +++ b/pkg/corerp/datamodel/application.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const ApplicationResourceType = "Applications.Core/applications" diff --git a/pkg/corerp/datamodel/container.go b/pkg/corerp/datamodel/container.go index 6b95c06875..791b7d5b35 100644 --- a/pkg/corerp/datamodel/container.go +++ b/pkg/corerp/datamodel/container.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const ContainerResourceType = "Applications.Core/containers" diff --git a/pkg/corerp/datamodel/converter/application_converter.go b/pkg/corerp/datamodel/converter/application_converter.go index cf593a97f1..d55534c7f8 100644 --- a/pkg/corerp/datamodel/converter/application_converter.go +++ b/pkg/corerp/datamodel/converter/application_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // ApplicationDataModelToVersioned converts version agnostic application datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/application_converter_test.go b/pkg/corerp/datamodel/converter/application_converter_test.go index 4644be2763..b884834868 100644 --- a/pkg/corerp/datamodel/converter/application_converter_test.go +++ b/pkg/corerp/datamodel/converter/application_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/container_converter.go b/pkg/corerp/datamodel/converter/container_converter.go index c2d9a0264e..42a5506966 100644 --- a/pkg/corerp/datamodel/converter/container_converter.go +++ b/pkg/corerp/datamodel/converter/container_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // ContainerDataModelToVersioned converts version agnostic Container datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/container_converter_test.go b/pkg/corerp/datamodel/converter/container_converter_test.go index 014fbe75db..046c9dbaa1 100644 --- a/pkg/corerp/datamodel/converter/container_converter_test.go +++ b/pkg/corerp/datamodel/converter/container_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/environment_converter.go b/pkg/corerp/datamodel/converter/environment_converter.go index 6ee54d4c03..9858949ff4 100644 --- a/pkg/corerp/datamodel/converter/environment_converter.go +++ b/pkg/corerp/datamodel/converter/environment_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // EnvironmentDataModelToVersioned converts version agnostic environment datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/environment_converter_test.go b/pkg/corerp/datamodel/converter/environment_converter_test.go index 96b6f46d28..dc9ceb76cb 100644 --- a/pkg/corerp/datamodel/converter/environment_converter_test.go +++ b/pkg/corerp/datamodel/converter/environment_converter_test.go @@ -21,9 +21,9 @@ import ( "os" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go index c881d2a39b..6076e294d7 100644 --- a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go +++ b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // EnvironmentRecipePropertiesDataModelToVersioned converts version agnostic environment recipe properties datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go index 39fb8c2c0f..5178154a19 100644 --- a/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go +++ b/pkg/corerp/datamodel/converter/environmentrecipeproperties_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/extender_converter.go b/pkg/corerp/datamodel/converter/extender_converter.go index e85a9b6c92..11904f44af 100644 --- a/pkg/corerp/datamodel/converter/extender_converter.go +++ b/pkg/corerp/datamodel/converter/extender_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // ExtenderDataModelToVersioned converts a datamodel.Extender to a versioned model interface based on the given version diff --git a/pkg/corerp/datamodel/converter/extender_converter_test.go b/pkg/corerp/datamodel/converter/extender_converter_test.go index ddb30057d3..45b02def98 100644 --- a/pkg/corerp/datamodel/converter/extender_converter_test.go +++ b/pkg/corerp/datamodel/converter/extender_converter_test.go @@ -21,9 +21,9 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/gateway_converter.go b/pkg/corerp/datamodel/converter/gateway_converter.go index 208f5ada34..9e3d34c392 100644 --- a/pkg/corerp/datamodel/converter/gateway_converter.go +++ b/pkg/corerp/datamodel/converter/gateway_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // GatewayDataModelToVersioned converts version agnostic Gateway datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/gateway_converter_test.go b/pkg/corerp/datamodel/converter/gateway_converter_test.go index 5abc0ab08c..b61b1602ca 100644 --- a/pkg/corerp/datamodel/converter/gateway_converter_test.go +++ b/pkg/corerp/datamodel/converter/gateway_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/httproute_converter.go b/pkg/corerp/datamodel/converter/httproute_converter.go index e2bf3e273a..e38d4ef8d8 100644 --- a/pkg/corerp/datamodel/converter/httproute_converter.go +++ b/pkg/corerp/datamodel/converter/httproute_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // HTTPRouteDataModelToVersioned converts version agnostic HTTPRoute datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/httproute_converter_test.go b/pkg/corerp/datamodel/converter/httproute_converter_test.go index b4ace08f13..014b96cd79 100644 --- a/pkg/corerp/datamodel/converter/httproute_converter_test.go +++ b/pkg/corerp/datamodel/converter/httproute_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/secretstore_converter.go b/pkg/corerp/datamodel/converter/secretstore_converter.go index 7c3431236d..f51ed9a419 100644 --- a/pkg/corerp/datamodel/converter/secretstore_converter.go +++ b/pkg/corerp/datamodel/converter/secretstore_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // SecretStoreModelToVersioned converts version agnostic SecretStore datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/secretstore_converter_test.go b/pkg/corerp/datamodel/converter/secretstore_converter_test.go index 9784e655a9..8d4fe5a53f 100644 --- a/pkg/corerp/datamodel/converter/secretstore_converter_test.go +++ b/pkg/corerp/datamodel/converter/secretstore_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/converter/volume_converter.go b/pkg/corerp/datamodel/converter/volume_converter.go index 230b6fc2f4..19bc6e53cc 100644 --- a/pkg/corerp/datamodel/converter/volume_converter.go +++ b/pkg/corerp/datamodel/converter/volume_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // VolumeResourceModelToVersioned converts version agnostic Volume datamodel to versioned model. diff --git a/pkg/corerp/datamodel/converter/volume_converter_test.go b/pkg/corerp/datamodel/converter/volume_converter_test.go index ead05fc681..e0895dc04b 100644 --- a/pkg/corerp/datamodel/converter/volume_converter_test.go +++ b/pkg/corerp/datamodel/converter/volume_converter_test.go @@ -20,9 +20,9 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/datamodel/environment.go b/pkg/corerp/datamodel/environment.go index 62423dae4c..c3648f4d11 100644 --- a/pkg/corerp/datamodel/environment.go +++ b/pkg/corerp/datamodel/environment.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const EnvironmentResourceType = "Applications.Core/environments" diff --git a/pkg/corerp/datamodel/extender.go b/pkg/corerp/datamodel/extender.go index ab25f6ee76..a2b721d1bc 100644 --- a/pkg/corerp/datamodel/extender.go +++ b/pkg/corerp/datamodel/extender.go @@ -17,9 +17,9 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // ExtenderResourceType is the resource type for Extender portable resources. diff --git a/pkg/corerp/datamodel/gateway.go b/pkg/corerp/datamodel/gateway.go index f6e15b9bc5..68c9a9e682 100644 --- a/pkg/corerp/datamodel/gateway.go +++ b/pkg/corerp/datamodel/gateway.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const GatewayResourceType = "Applications.Core/gateways" diff --git a/pkg/corerp/datamodel/httproute.go b/pkg/corerp/datamodel/httproute.go index b10a9d43f0..bd59039180 100644 --- a/pkg/corerp/datamodel/httproute.go +++ b/pkg/corerp/datamodel/httproute.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const HTTPRouteResourceType = "Applications.Core/httpRoutes" diff --git a/pkg/corerp/datamodel/linkmetadata.go b/pkg/corerp/datamodel/linkmetadata.go index 065242e366..dd6b47fa47 100644 --- a/pkg/corerp/datamodel/linkmetadata.go +++ b/pkg/corerp/datamodel/linkmetadata.go @@ -17,7 +17,7 @@ limitations under the License. package datamodel import ( - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // LinkMetadata represents internal DataModel properties common to all portable resource types. diff --git a/pkg/corerp/datamodel/secretstore.go b/pkg/corerp/datamodel/secretstore.go index c5a8988fa7..5a3e7d24e0 100644 --- a/pkg/corerp/datamodel/secretstore.go +++ b/pkg/corerp/datamodel/secretstore.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const SecretStoreResourceType = "Applications.Core/secretStores" diff --git a/pkg/corerp/datamodel/volume.go b/pkg/corerp/datamodel/volume.go index 8b1d4cf8d7..924ff428fb 100644 --- a/pkg/corerp/datamodel/volume.go +++ b/pkg/corerp/datamodel/volume.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const VolumeResourceType = "Applications.Core/volumes" diff --git a/pkg/corerp/frontend/controller/applications/updatefilter.go b/pkg/corerp/frontend/controller/applications/updatefilter.go index 6e596e546f..caf3db25fd 100644 --- a/pkg/corerp/frontend/controller/applications/updatefilter.go +++ b/pkg/corerp/frontend/controller/applications/updatefilter.go @@ -20,16 +20,16 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/frontend/controller/util" - "github.com/project-radius/radius/pkg/kubernetes" - rp_kube "github.com/project-radius/radius/pkg/rp/kube" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/frontend/controller/util" + "github.com/radius-project/radius/pkg/kubernetes" + rp_kube "github.com/radius-project/radius/pkg/rp/kube" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -120,7 +120,7 @@ func CreateAppScopedNamespace(ctx context.Context, newResource, oldResource *dat KubernetesCompute: rpv1.KubernetesComputeProperties{Namespace: kubeNamespace}, } - // TODO: Move it to backend controller - https://github.com/project-radius/radius/issues/4742 + // TODO: Move it to backend controller - https://github.com/radius-project/radius/issues/4742 err = opt.KubeClient.Create(ctx, &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: kubeNamespace}}) if apierrors.IsAlreadyExists(err) { logger.Info("Using existing namespace", "namespace", kubeNamespace) diff --git a/pkg/corerp/frontend/controller/applications/updatefilter_test.go b/pkg/corerp/frontend/controller/applications/updatefilter_test.go index 4ccb851cc7..d7318f6b3d 100644 --- a/pkg/corerp/frontend/controller/applications/updatefilter_test.go +++ b/pkg/corerp/frontend/controller/applications/updatefilter_test.go @@ -21,17 +21,17 @@ import ( "strings" "testing" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/k8sutil" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/k8sutil" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/frontend/controller/containers/validator.go b/pkg/corerp/frontend/controller/containers/validator.go index 229bee6b28..57693a7135 100644 --- a/pkg/corerp/frontend/controller/containers/validator.go +++ b/pkg/corerp/frontend/controller/containers/validator.go @@ -25,11 +25,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/kubeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/kubeutil" ) const ( diff --git a/pkg/corerp/frontend/controller/containers/validator_test.go b/pkg/corerp/frontend/controller/containers/validator_test.go index 19abdd6ab8..46ec9b816b 100644 --- a/pkg/corerp/frontend/controller/containers/validator_test.go +++ b/pkg/corerp/frontend/controller/containers/validator_test.go @@ -22,11 +22,11 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go b/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go index 4dc768c685..c011b2675d 100644 --- a/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go +++ b/pkg/corerp/frontend/controller/environments/createorupdateenvironment.go @@ -21,12 +21,12 @@ import ( "fmt" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/datamodel/converter" - "github.com/project-radius/radius/pkg/corerp/frontend/controller/util" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel/converter" + "github.com/radius-project/radius/pkg/corerp/frontend/controller/util" ) var _ ctrl.Controller = (*CreateOrUpdateEnvironment)(nil) diff --git a/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go b/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go index befbf87945..869ea008b8 100644 --- a/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go +++ b/pkg/corerp/frontend/controller/environments/createorupdateenvironment_test.go @@ -24,10 +24,10 @@ import ( "net/http/httptest" "testing" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/ucp/store" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/google/uuid" diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go index 44a78d3487..67824220f8 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go @@ -22,13 +22,13 @@ import ( "net/http" "sort" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/datamodel/converter" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/rp/util" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel/converter" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/rp/util" "golang.org/x/exp/maps" ) diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go index cdb0d2de7b..cec49101e1 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go @@ -24,12 +24,12 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go index e34ab716e7..9a4f17f9da 100644 --- a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go +++ b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go @@ -19,9 +19,9 @@ package environments import ( "encoding/json" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/test/testutil" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/test/testutil" ) const testHeaderfile = "requestheaders20220315privatepreview.json" diff --git a/pkg/corerp/frontend/controller/extenders/listsecretsextender.go b/pkg/corerp/frontend/controller/extenders/listsecretsextender.go index 8e83791981..88d0bc79dd 100644 --- a/pkg/corerp/frontend/controller/extenders/listsecretsextender.go +++ b/pkg/corerp/frontend/controller/extenders/listsecretsextender.go @@ -20,11 +20,11 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/datamodel/converter" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel/converter" ) var _ ctrl.Controller = (*ListSecretsExtender)(nil) diff --git a/pkg/corerp/frontend/controller/extenders/listsecretsextender_test.go b/pkg/corerp/frontend/controller/extenders/listsecretsextender_test.go index c788061996..d18a5ea924 100644 --- a/pkg/corerp/frontend/controller/extenders/listsecretsextender_test.go +++ b/pkg/corerp/frontend/controller/extenders/listsecretsextender_test.go @@ -24,10 +24,10 @@ import ( "net/http/httptest" "testing" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/corerp/frontend/controller/extenders/v20220315privatepreview_test.go b/pkg/corerp/frontend/controller/extenders/v20220315privatepreview_test.go index 270db9cd41..ee2bd2dd4f 100644 --- a/pkg/corerp/frontend/controller/extenders/v20220315privatepreview_test.go +++ b/pkg/corerp/frontend/controller/extenders/v20220315privatepreview_test.go @@ -19,9 +19,9 @@ package extenders import ( "encoding/json" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/test/testutil" ) const testHeaderfile = "20220315privatepreview_requestheaders.json" diff --git a/pkg/corerp/frontend/controller/gateways/validator.go b/pkg/corerp/frontend/controller/gateways/validator.go index 6b9f1f847e..5d6c2ed17e 100644 --- a/pkg/corerp/frontend/controller/gateways/validator.go +++ b/pkg/corerp/frontend/controller/gateways/validator.go @@ -19,9 +19,9 @@ package gateways import ( "context" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // ValidateAndMutateRequest checks if the TLS configuration is valid and sets the TLS protocol version to 1.2 if it is not diff --git a/pkg/corerp/frontend/controller/gateways/validator_test.go b/pkg/corerp/frontend/controller/gateways/validator_test.go index dc3551b4eb..50ed82cd2c 100644 --- a/pkg/corerp/frontend/controller/gateways/validator_test.go +++ b/pkg/corerp/frontend/controller/gateways/validator_test.go @@ -20,8 +20,8 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/frontend/controller/secretstores/kubernetes.go b/pkg/corerp/frontend/controller/secretstores/kubernetes.go index e53b196125..f25562c2c7 100644 --- a/pkg/corerp/frontend/controller/secretstores/kubernetes.go +++ b/pkg/corerp/frontend/controller/secretstores/kubernetes.go @@ -23,15 +23,15 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/ucp/store" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go b/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go index e1176ec9fc..1b300409e1 100644 --- a/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go +++ b/pkg/corerp/frontend/controller/secretstores/kubernetes_test.go @@ -23,15 +23,15 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/k8sutil" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/k8sutil" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/corerp/frontend/controller/secretstores/listsecrets.go b/pkg/corerp/frontend/controller/secretstores/listsecrets.go index a72cc52f01..11edf39697 100644 --- a/pkg/corerp/frontend/controller/secretstores/listsecrets.go +++ b/pkg/corerp/frontend/controller/secretstores/listsecrets.go @@ -23,12 +23,12 @@ import ( "fmt" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/datamodel/converter" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel/converter" + "github.com/radius-project/radius/pkg/to" ) const ( diff --git a/pkg/corerp/frontend/controller/secretstores/listsecrets_test.go b/pkg/corerp/frontend/controller/secretstores/listsecrets_test.go index 28a0af4e7f..8de872eb7c 100644 --- a/pkg/corerp/frontend/controller/secretstores/listsecrets_test.go +++ b/pkg/corerp/frontend/controller/secretstores/listsecrets_test.go @@ -24,14 +24,14 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/k8sutil" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/k8sutil" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/corerp/frontend/controller/util/query.go b/pkg/corerp/frontend/controller/util/query.go index 52b1b779f6..a6a8c76f94 100644 --- a/pkg/corerp/frontend/controller/util/query.go +++ b/pkg/corerp/frontend/controller/util/query.go @@ -19,7 +19,7 @@ package util import ( "context" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/store" ) // FindResources searches for resources of a given type with a given filter key and value, and returns the query result. diff --git a/pkg/corerp/frontend/controller/volumes/validator.go b/pkg/corerp/frontend/controller/volumes/validator.go index 5b95aa9a6b..ad274b08d9 100644 --- a/pkg/corerp/frontend/controller/volumes/validator.go +++ b/pkg/corerp/frontend/controller/volumes/validator.go @@ -20,9 +20,9 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/corerp/frontend/controller/volumes/validator_test.go b/pkg/corerp/frontend/controller/volumes/validator_test.go index 3c5ec877d7..3271632021 100644 --- a/pkg/corerp/frontend/controller/volumes/validator_test.go +++ b/pkg/corerp/frontend/controller/volumes/validator_test.go @@ -22,12 +22,12 @@ import ( "net/http" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" diff --git a/pkg/corerp/frontend/handler/getoperations.go b/pkg/corerp/frontend/handler/getoperations.go index 35d1add06e..18bc4dc937 100644 --- a/pkg/corerp/frontend/handler/getoperations.go +++ b/pkg/corerp/frontend/handler/getoperations.go @@ -20,10 +20,10 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" ) var _ ctrl.Controller = (*GetOperations)(nil) diff --git a/pkg/corerp/frontend/handler/getoperations_test.go b/pkg/corerp/frontend/handler/getoperations_test.go index f8a34d1a4a..d43066d618 100644 --- a/pkg/corerp/frontend/handler/getoperations_test.go +++ b/pkg/corerp/frontend/handler/getoperations_test.go @@ -21,10 +21,10 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/frontend/handler/routes.go b/pkg/corerp/frontend/handler/routes.go index aa7d591b5c..12066478af 100644 --- a/pkg/corerp/frontend/handler/routes.go +++ b/pkg/corerp/frontend/handler/routes.go @@ -22,25 +22,25 @@ import ( "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - frontend_ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - rp_frontend "github.com/project-radius/radius/pkg/rp/frontend" - "github.com/project-radius/radius/pkg/validator" - "github.com/project-radius/radius/swagger" - - "github.com/project-radius/radius/pkg/corerp/datamodel" - converter "github.com/project-radius/radius/pkg/corerp/datamodel/converter" - - app_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/applications" - ctr_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/containers" - env_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/environments" - ext_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/extenders" - gtwy_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/gateways" - hrt_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/httproutes" - secret_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/secretstores" - vol_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/volumes" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + frontend_ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + rp_frontend "github.com/radius-project/radius/pkg/rp/frontend" + "github.com/radius-project/radius/pkg/validator" + "github.com/radius-project/radius/swagger" + + "github.com/radius-project/radius/pkg/corerp/datamodel" + converter "github.com/radius-project/radius/pkg/corerp/datamodel/converter" + + app_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/applications" + ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" + env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" + ext_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/extenders" + gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" + hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes" + secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" + vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" ) const ( diff --git a/pkg/corerp/frontend/handler/routes_test.go b/pkg/corerp/frontend/handler/routes_test.go index b3588d8ed0..0338838b99 100644 --- a/pkg/corerp/frontend/handler/routes_test.go +++ b/pkg/corerp/frontend/handler/routes_test.go @@ -23,19 +23,19 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" - app_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/applications" - ctr_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/containers" - env_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/environments" - gtwy_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/gateways" - hrt_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/httproutes" - secret_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/secretstores" - vol_ctrl "github.com/project-radius/radius/pkg/corerp/frontend/controller/volumes" + app_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/applications" + ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" + env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" + gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" + hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes" + secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" + vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" ) var handlerTests = []rpctest.HandlerTestSpec{ diff --git a/pkg/corerp/frontend/service.go b/pkg/corerp/frontend/service.go index 253b1e080d..f628ecba9c 100644 --- a/pkg/corerp/frontend/service.go +++ b/pkg/corerp/frontend/service.go @@ -21,10 +21,10 @@ import ( "fmt" "github.com/go-chi/chi/v5" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/corerp/frontend/handler" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/corerp/frontend/handler" ) type Service struct { diff --git a/pkg/corerp/handlers/arm_handler.go b/pkg/corerp/handlers/arm_handler.go index e7e6d21ad3..2352136537 100644 --- a/pkg/corerp/handlers/arm_handler.go +++ b/pkg/corerp/handlers/arm_handler.go @@ -22,10 +22,10 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" ) // NewARMHandler creates a new ARMHandler instance with the given ARM configuration, for 'generic' ARM resources. diff --git a/pkg/corerp/handlers/azure_federatedidentity.go b/pkg/corerp/handlers/azure_federatedidentity.go index 7f688d2200..fe3c4912df 100644 --- a/pkg/corerp/handlers/azure_federatedidentity.go +++ b/pkg/corerp/handlers/azure_federatedidentity.go @@ -24,14 +24,14 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/logging" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/logging" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/corerp/handlers/azure_roleassignment.go b/pkg/corerp/handlers/azure_roleassignment.go index 4a0b55b587..c6f4e062ad 100644 --- a/pkg/corerp/handlers/azure_roleassignment.go +++ b/pkg/corerp/handlers/azure_roleassignment.go @@ -21,13 +21,13 @@ import ( "errors" "fmt" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/roleassignment" - "github.com/project-radius/radius/pkg/logging" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/roleassignment" + "github.com/radius-project/radius/pkg/logging" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/corerp/handlers/azure_userassigned_managedidentity.go b/pkg/corerp/handlers/azure_userassigned_managedidentity.go index 88241c7d4d..32ababcf12 100644 --- a/pkg/corerp/handlers/azure_userassigned_managedidentity.go +++ b/pkg/corerp/handlers/azure_userassigned_managedidentity.go @@ -21,14 +21,14 @@ import ( "fmt" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/msi/armmsi" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - "github.com/project-radius/radius/pkg/logging" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/clientv2" + "github.com/radius-project/radius/pkg/logging" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/corerp/handlers/kubernetes.go b/pkg/corerp/handlers/kubernetes.go index e319df2827..11cfb8eeb8 100644 --- a/pkg/corerp/handlers/kubernetes.go +++ b/pkg/corerp/handlers/kubernetes.go @@ -23,13 +23,13 @@ import ( "strings" "time" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/ucp/ucplog" v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/corerp/handlers/kubernetes_test.go b/pkg/corerp/handlers/kubernetes_test.go index 46915ff432..11d1c87e13 100644 --- a/pkg/corerp/handlers/kubernetes_test.go +++ b/pkg/corerp/handlers/kubernetes_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/test/k8sutil" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/api/apps/v1" diff --git a/pkg/corerp/handlers/mock_resource_handler.go b/pkg/corerp/handlers/mock_resource_handler.go index 11654a2413..9d13298438 100644 --- a/pkg/corerp/handlers/mock_resource_handler.go +++ b/pkg/corerp/handlers/mock_resource_handler.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/corerp/handlers (interfaces: ResourceHandler) +// Source: github.com/radius-project/radius/pkg/corerp/handlers (interfaces: ResourceHandler) // Package handlers is a generated GoMock package. package handlers diff --git a/pkg/corerp/handlers/resource_handler.go b/pkg/corerp/handlers/resource_handler.go index 0c78efaf38..928b9daa01 100644 --- a/pkg/corerp/handlers/resource_handler.go +++ b/pkg/corerp/handlers/resource_handler.go @@ -19,7 +19,7 @@ package handlers import ( "context" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const ( @@ -57,7 +57,7 @@ type DeleteOptions struct { // ResourceHandler interface defines the methods that every output resource will implement // -//go:generate mockgen -destination=./mock_resource_handler.go -package=handlers -self_package github.com/project-radius/radius/pkg/corerp/handlers github.com/project-radius/radius/pkg/corerp/handlers ResourceHandler +//go:generate mockgen -destination=./mock_resource_handler.go -package=handlers -self_package github.com/radius-project/radius/pkg/corerp/handlers github.com/radius-project/radius/pkg/corerp/handlers ResourceHandler type ResourceHandler interface { // Put deploys the rendered output resource and returns and populates the properties during deployment, // which can be used by the next resource handlers. diff --git a/pkg/corerp/model/application_model.go b/pkg/corerp/model/application_model.go index eff9a4054c..3f74b837d3 100644 --- a/pkg/corerp/model/application_model.go +++ b/pkg/corerp/model/application_model.go @@ -19,21 +19,21 @@ package model import ( "fmt" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers/container" - azcontainer "github.com/project-radius/radius/pkg/corerp/renderers/container/azure" - "github.com/project-radius/radius/pkg/corerp/renderers/daprextension" - "github.com/project-radius/radius/pkg/corerp/renderers/gateway" - "github.com/project-radius/radius/pkg/corerp/renderers/httproute" - "github.com/project-radius/radius/pkg/corerp/renderers/kubernetesmetadata" - "github.com/project-radius/radius/pkg/corerp/renderers/manualscale" - "github.com/project-radius/radius/pkg/corerp/renderers/volume" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers/container" + azcontainer "github.com/radius-project/radius/pkg/corerp/renderers/container/azure" + "github.com/radius-project/radius/pkg/corerp/renderers/daprextension" + "github.com/radius-project/radius/pkg/corerp/renderers/gateway" + "github.com/radius-project/radius/pkg/corerp/renderers/httproute" + "github.com/radius-project/radius/pkg/corerp/renderers/kubernetesmetadata" + "github.com/radius-project/radius/pkg/corerp/renderers/manualscale" + "github.com/radius-project/radius/pkg/corerp/renderers/volume" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" @@ -71,7 +71,7 @@ func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sCli }, datamodel.KindAzure: { // RBAC for non-Radius Azure resources. Supports user specified roles. - // More information can be found here: https://github.com/project-radius/radius/issues/1321 + // More information can be found here: https://github.com/radius-project/radius/issues/1321 }, } diff --git a/pkg/corerp/model/types.go b/pkg/corerp/model/types.go index 6193f1cc86..b9326522b7 100644 --- a/pkg/corerp/model/types.go +++ b/pkg/corerp/model/types.go @@ -21,9 +21,9 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" ) // ApplicationModel defines the set of supported resource types and related features. diff --git a/pkg/corerp/processors/extenders/processor.go b/pkg/corerp/processors/extenders/processor.go index 5b66c712a9..9a2efc855e 100644 --- a/pkg/corerp/processors/extenders/processor.go +++ b/pkg/corerp/processors/extenders/processor.go @@ -4,9 +4,9 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" ) // Processor is a processor for Extender resources. diff --git a/pkg/corerp/processors/extenders/processor_test.go b/pkg/corerp/processors/extenders/processor_test.go index 8f77eba079..523faf527f 100644 --- a/pkg/corerp/processors/extenders/processor_test.go +++ b/pkg/corerp/processors/extenders/processor_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/renderers/container/azure/fileshare.go b/pkg/corerp/renderers/container/azure/fileshare.go index b0d2341c39..f448c8f8d2 100644 --- a/pkg/corerp/renderers/container/azure/fileshare.go +++ b/pkg/corerp/renderers/container/azure/fileshare.go @@ -17,9 +17,9 @@ limitations under the License. package azure import ( - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/ucp/resources" corev1 "k8s.io/api/core/v1" ) diff --git a/pkg/corerp/renderers/container/azure/identity.go b/pkg/corerp/renderers/container/azure/identity.go index f57dc5fd32..c7e0dfd550 100644 --- a/pkg/corerp/renderers/container/azure/identity.go +++ b/pkg/corerp/renderers/container/azure/identity.go @@ -21,13 +21,13 @@ import ( "errors" "fmt" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" corev1 "k8s.io/api/core/v1" ) diff --git a/pkg/corerp/renderers/container/azure/identity_test.go b/pkg/corerp/renderers/container/azure/identity_test.go index c540068f94..14115b7107 100644 --- a/pkg/corerp/renderers/container/azure/identity_test.go +++ b/pkg/corerp/renderers/container/azure/identity_test.go @@ -21,12 +21,12 @@ import ( "errors" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" diff --git a/pkg/corerp/renderers/container/azure/keyvaultvolume.go b/pkg/corerp/renderers/container/azure/keyvaultvolume.go index cdaf7ebfe9..aceedc00c8 100644 --- a/pkg/corerp/renderers/container/azure/keyvaultvolume.go +++ b/pkg/corerp/renderers/container/azure/keyvaultvolume.go @@ -20,13 +20,13 @@ import ( "context" "errors" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go b/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go index 4d11bce717..6cc7188988 100644 --- a/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go +++ b/pkg/corerp/renderers/container/azure/keyvaultvolume_test.go @@ -20,13 +20,13 @@ import ( "context" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" diff --git a/pkg/corerp/renderers/container/azure/util.go b/pkg/corerp/renderers/container/azure/util.go index b462f82650..5e5fd506fb 100644 --- a/pkg/corerp/renderers/container/azure/util.go +++ b/pkg/corerp/renderers/container/azure/util.go @@ -17,7 +17,7 @@ limitations under the License. package azure import ( - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" ) const ( diff --git a/pkg/corerp/renderers/container/manifest.go b/pkg/corerp/renderers/container/manifest.go index f31f29b384..bb1a8ffa1b 100644 --- a/pkg/corerp/renderers/container/manifest.go +++ b/pkg/corerp/renderers/container/manifest.go @@ -22,12 +22,12 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubeutil" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/ucplog" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/corerp/renderers/container/manifest_test.go b/pkg/corerp/renderers/container/manifest_test.go index 7db5946bee..67a9dd9936 100644 --- a/pkg/corerp/renderers/container/manifest_test.go +++ b/pkg/corerp/renderers/container/manifest_test.go @@ -21,13 +21,13 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubeutil" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/k8sutil" - "github.com/project-radius/radius/test/testcontext" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubeutil" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/k8sutil" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" diff --git a/pkg/corerp/renderers/container/rbac.go b/pkg/corerp/renderers/container/rbac.go index e23dbe06d6..86e9197ab1 100644 --- a/pkg/corerp/renderers/container/rbac.go +++ b/pkg/corerp/renderers/container/rbac.go @@ -20,9 +20,9 @@ import ( rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) func makeRBACRole(appName, name, namespace string, resource *datamodel.ContainerResource) *rpv1.OutputResource { diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index 6498df63cd..eec9574ec9 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -32,20 +32,20 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/intstr" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - azrenderer "github.com/project-radius/radius/pkg/corerp/renderers/container/azure" - azvolrenderer "github.com/project-radius/radius/pkg/corerp/renderers/volume/azure" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + azrenderer "github.com/radius-project/radius/pkg/corerp/renderers/container/azure" + azvolrenderer "github.com/radius-project/radius/pkg/corerp/renderers/volume/azure" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" ) const ( @@ -630,7 +630,7 @@ func (r Renderer) makeDeployment( podSpec.Volumes = append(podSpec.Volumes, volumes...) // See: https://github.com/kubernetes/kubernetes/issues/92226 and - // https://github.com/project-radius/radius/issues/3002 + // https://github.com/radius-project/radius/issues/3002 // // Service links are a flawed and Kubernetes-only feature that we don't // want to leak into Radius containers. diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index d22ba3385b..d3436b006e 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -20,20 +20,20 @@ import ( "fmt" "testing" - apiv1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/handlers" - "github.com/project-radius/radius/pkg/corerp/renderers" - azrenderer "github.com/project-radius/radius/pkg/corerp/renderers/container/azure" - azvolrenderer "github.com/project-radius/radius/pkg/corerp/renderers/volume/azure" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/test/testcontext" + apiv1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/handlers" + "github.com/radius-project/radius/pkg/corerp/renderers" + azrenderer "github.com/radius-project/radius/pkg/corerp/renderers/container/azure" + azvolrenderer "github.com/radius-project/radius/pkg/corerp/renderers/volume/azure" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/test/testcontext" "github.com/google/uuid" "github.com/stretchr/testify/require" @@ -237,7 +237,7 @@ func Test_GetDependencyIDs_InvalidAzureResourceId(t *testing.T) { properties := datamodel.ContainerProperties{ // Simulating error code path - // Revert this once TODO: https://github.com/project-radius/core-team/issues/238 is done. + // Revert this once TODO: https://github.com/radius-project/core-team/issues/238 is done. Connections: map[string]datamodel.ConnectionProperties{ "AzureResourceTest": { Source: "//subscriptions/test-sub-id/providers/Microsoft.ServiceBus/namespaces/testNamespace", @@ -304,7 +304,7 @@ func Test_Render_Basic(t *testing.T) { require.Equal(t, labels, deployment.Spec.Template.Labels) require.Equal(t, matchLabels, deployment.Spec.Selector.MatchLabels) - // See https://github.com/project-radius/radius/issues/3002 + // See https://github.com/radius-project/radius/issues/3002 // // We disable service links and rely on Radius' connections feature instead. require.NotNil(t, deployment.Spec.Template.Spec.EnableServiceLinks) diff --git a/pkg/corerp/renderers/container/volumes.go b/pkg/corerp/renderers/container/volumes.go index f606540461..b914a89851 100644 --- a/pkg/corerp/renderers/container/volumes.go +++ b/pkg/corerp/renderers/container/volumes.go @@ -17,7 +17,7 @@ limitations under the License. package container import ( - "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel" corev1 "k8s.io/api/core/v1" ) diff --git a/pkg/corerp/renderers/daprextension/renderer.go b/pkg/corerp/renderers/daprextension/renderer.go index 165618fd30..d486718ed3 100644 --- a/pkg/corerp/renderers/daprextension/renderer.go +++ b/pkg/corerp/renderers/daprextension/renderer.go @@ -21,11 +21,11 @@ import ( "errors" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" + "github.com/radius-project/radius/pkg/ucp/resources" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/corerp/renderers/daprextension/renderer_test.go b/pkg/corerp/renderers/daprextension/renderer_test.go index f330f910dd..f1afe3ab67 100644 --- a/pkg/corerp/renderers/daprextension/renderer_test.go +++ b/pkg/corerp/renderers/daprextension/renderer_test.go @@ -20,15 +20,15 @@ import ( "context" "testing" - apiv1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/resourcemodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + apiv1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/resourcemodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" ) diff --git a/pkg/corerp/renderers/gateway/render.go b/pkg/corerp/renderers/gateway/render.go index 1073f45ba2..8203328292 100644 --- a/pkg/corerp/renderers/gateway/render.go +++ b/pkg/corerp/renderers/gateway/render.go @@ -28,13 +28,13 @@ import ( contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" ) type Renderer struct { diff --git a/pkg/corerp/renderers/gateway/render_test.go b/pkg/corerp/renderers/gateway/render_test.go index 62d28e2622..204f75b041 100644 --- a/pkg/corerp/renderers/gateway/render_test.go +++ b/pkg/corerp/renderers/gateway/render_test.go @@ -21,17 +21,17 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/corerp/renderers/httproute" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/test/testcontext" contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/corerp/renderers/httproute" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/renderers/httproute/render.go b/pkg/corerp/renderers/httproute/render.go index 4122a6f08a..00426a8f78 100644 --- a/pkg/corerp/renderers/httproute/render.go +++ b/pkg/corerp/renderers/httproute/render.go @@ -25,12 +25,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) type Renderer struct { diff --git a/pkg/corerp/renderers/httproute/render_test.go b/pkg/corerp/renderers/httproute/render_test.go index 635a7bd1f1..fab3d54993 100644 --- a/pkg/corerp/renderers/httproute/render_test.go +++ b/pkg/corerp/renderers/httproute/render_test.go @@ -22,11 +22,11 @@ import ( "strings" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" diff --git a/pkg/corerp/renderers/kubernetesmetadata.go b/pkg/corerp/renderers/kubernetesmetadata.go index 16b9c0be29..3beacebe56 100644 --- a/pkg/corerp/renderers/kubernetesmetadata.go +++ b/pkg/corerp/renderers/kubernetesmetadata.go @@ -17,8 +17,8 @@ limitations under the License. package renderers import ( - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/rp/kube" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/rp/kube" ) // GetLabels merges cumulative label values from Environment, Application, Container and InputExt kubernetes metadata and diff --git a/pkg/corerp/renderers/kubernetesmetadata/render.go b/pkg/corerp/renderers/kubernetesmetadata/render.go index 034f6e2fef..74ff3d91c3 100644 --- a/pkg/corerp/renderers/kubernetesmetadata/render.go +++ b/pkg/corerp/renderers/kubernetesmetadata/render.go @@ -19,12 +19,12 @@ package kubernetesmetadata import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/rp/kube" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" + "github.com/radius-project/radius/pkg/rp/kube" + "github.com/radius-project/radius/pkg/ucp/resources" appsv1 "k8s.io/api/apps/v1" ) diff --git a/pkg/corerp/renderers/kubernetesmetadata/render_test.go b/pkg/corerp/renderers/kubernetesmetadata/render_test.go index 19ee99fb57..6720efa234 100644 --- a/pkg/corerp/renderers/kubernetesmetadata/render_test.go +++ b/pkg/corerp/renderers/kubernetesmetadata/render_test.go @@ -4,13 +4,13 @@ import ( "context" "testing" - apiv1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + apiv1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/stretchr/testify/require" diff --git a/pkg/corerp/renderers/manualscale/render.go b/pkg/corerp/renderers/manualscale/render.go index fae681c9b7..6cef43e64d 100644 --- a/pkg/corerp/renderers/manualscale/render.go +++ b/pkg/corerp/renderers/manualscale/render.go @@ -20,11 +20,11 @@ import ( "context" "errors" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/resourcemodel" + "github.com/radius-project/radius/pkg/ucp/resources" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/pkg/corerp/renderers/manualscale/render_test.go b/pkg/corerp/renderers/manualscale/render_test.go index 28e256201e..1e526ee76b 100644 --- a/pkg/corerp/renderers/manualscale/render_test.go +++ b/pkg/corerp/renderers/manualscale/render_test.go @@ -20,12 +20,12 @@ import ( "context" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/kubernetes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/stretchr/testify/require" diff --git a/pkg/corerp/renderers/mock_renderer.go b/pkg/corerp/renderers/mock_renderer.go index d03fa5ea10..8e9ed8879c 100644 --- a/pkg/corerp/renderers/mock_renderer.go +++ b/pkg/corerp/renderers/mock_renderer.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/corerp/renderers (interfaces: Renderer) +// Source: github.com/radius-project/radius/pkg/corerp/renderers (interfaces: Renderer) // Package renderers is a generated GoMock package. package renderers @@ -9,8 +9,8 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - resources "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + resources "github.com/radius-project/radius/pkg/ucp/resources" ) // MockRenderer is a mock of Renderer interface. diff --git a/pkg/corerp/renderers/types.go b/pkg/corerp/renderers/types.go index 3e375dba2c..a4f6ebc87a 100644 --- a/pkg/corerp/renderers/types.go +++ b/pkg/corerp/renderers/types.go @@ -19,10 +19,10 @@ package renderers import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) const ( @@ -33,7 +33,7 @@ const ( DefaultSecurePort int32 = 443 ) -//go:generate mockgen -destination=./mock_renderer.go -package=renderers github.com/project-radius/radius/pkg/corerp/renderers Renderer +//go:generate mockgen -destination=./mock_renderer.go -package=renderers github.com/radius-project/radius/pkg/corerp/renderers Renderer type Renderer interface { GetDependencyIDs(ctx context.Context, resource v1.DataModelInterface) (radiusResourceIDs []resources.ID, azureResourceIDs []resources.ID, err error) Render(ctx context.Context, resource v1.DataModelInterface, options RenderOptions) (RendererOutput, error) diff --git a/pkg/corerp/renderers/volume/azure/keyvault.go b/pkg/corerp/renderers/volume/azure/keyvault.go index 3af893097d..e303704e5c 100644 --- a/pkg/corerp/renderers/volume/azure/keyvault.go +++ b/pkg/corerp/renderers/volume/azure/keyvault.go @@ -20,11 +20,11 @@ import ( "context" "errors" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" azcsi "github.com/Azure/secrets-store-csi-driver-provider-azure/pkg/provider/types" "gopkg.in/yaml.v3" diff --git a/pkg/corerp/renderers/volume/azure/keyvault_test.go b/pkg/corerp/renderers/volume/azure/keyvault_test.go index 18caf37fbe..cba65f1bfb 100644 --- a/pkg/corerp/renderers/volume/azure/keyvault_test.go +++ b/pkg/corerp/renderers/volume/azure/keyvault_test.go @@ -21,10 +21,10 @@ import ( "encoding/json" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" azcsi "github.com/Azure/secrets-store-csi-driver-provider-azure/pkg/provider/types" "github.com/stretchr/testify/require" diff --git a/pkg/corerp/renderers/volume/render.go b/pkg/corerp/renderers/volume/render.go index 8153b353d4..ab8ee9fb57 100644 --- a/pkg/corerp/renderers/volume/render.go +++ b/pkg/corerp/renderers/volume/render.go @@ -20,12 +20,12 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" - azvolrenderer "github.com/project-radius/radius/pkg/corerp/renderers/volume/azure" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" + azvolrenderer "github.com/radius-project/radius/pkg/corerp/renderers/volume/azure" + "github.com/radius-project/radius/pkg/ucp/resources" ) var _ renderers.Renderer = (*Renderer)(nil) diff --git a/pkg/corerp/renderers/volume/render_test.go b/pkg/corerp/renderers/volume/render_test.go index 7532ecaad0..4f6d4824ef 100644 --- a/pkg/corerp/renderers/volume/render_test.go +++ b/pkg/corerp/renderers/volume/render_test.go @@ -20,8 +20,8 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/corerp/renderers" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/renderers" "github.com/stretchr/testify/require" ) diff --git a/pkg/corerp/renderers/volume/types.go b/pkg/corerp/renderers/volume/types.go index a02701990b..dde1845e9a 100644 --- a/pkg/corerp/renderers/volume/types.go +++ b/pkg/corerp/renderers/volume/types.go @@ -19,8 +19,8 @@ package volume import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/renderers" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/renderers" ) const ( diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go index 00d6eeb5c6..e8ad78c497 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go @@ -19,11 +19,11 @@ package v20220315privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) func toProvisioningStateDataModel(state *ProvisioningState) v1.ProvisioningState { diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go index ac7ed861a5..f93491c1ec 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go @@ -20,10 +20,10 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go index 23de68750e..88b5214b1c 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion.go @@ -21,11 +21,11 @@ import ( "reflect" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts a versioned DaprPubSubBrokerResource to a version-agnostic DaprPubSubBroker. It returns an error diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go index 9e6842e2a9..3a40262630 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go @@ -20,13 +20,13 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go index d2b1e7df58..80145f0893 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion.go @@ -21,11 +21,11 @@ import ( "reflect" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned DaprSecretStore resource to version-agnostic datamodel and returns an error if the diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go index 1ae07ed03a..7a94d9e5bc 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go @@ -20,13 +20,13 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go index 064190e1b8..9f2ef1e3c8 100644 --- a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go +++ b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion.go @@ -5,11 +5,11 @@ import ( "reflect" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned DaprStateStore resource to version-agnostic datamodel and returns an error diff --git a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go index 60784cdc22..5f074e8e01 100644 --- a/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/statestore_conversion_test.go @@ -20,13 +20,13 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/datamodel/converter/pubsubbroker_converter.go b/pkg/daprrp/datamodel/converter/pubsubbroker_converter.go index 1aef1098ad..7f7dbff24c 100644 --- a/pkg/daprrp/datamodel/converter/pubsubbroker_converter.go +++ b/pkg/daprrp/datamodel/converter/pubsubbroker_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/daprrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/daprrp/datamodel" ) // PubSubBrokerDataModelToVersioned converts a version-agnostic datamodel.DaprPubSubBroker to a versioned model based on the version diff --git a/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go b/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go index 397cbfaee8..b5d1750ec0 100644 --- a/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go +++ b/pkg/daprrp/datamodel/converter/pubsubbroker_converter_test.go @@ -21,12 +21,12 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/datamodel/converter/secretstore_converter.go b/pkg/daprrp/datamodel/converter/secretstore_converter.go index e7fc12ca7c..5c56cb6eb2 100644 --- a/pkg/daprrp/datamodel/converter/secretstore_converter.go +++ b/pkg/daprrp/datamodel/converter/secretstore_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/daprrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/daprrp/datamodel" ) // SecretStoreDataModelToVersioned converts a version-agnostic datamodel.DaprSecretStore to a versioned model based on the version diff --git a/pkg/daprrp/datamodel/converter/secretstore_converter_test.go b/pkg/daprrp/datamodel/converter/secretstore_converter_test.go index 91315b5ac8..8adc548111 100644 --- a/pkg/daprrp/datamodel/converter/secretstore_converter_test.go +++ b/pkg/daprrp/datamodel/converter/secretstore_converter_test.go @@ -21,10 +21,10 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/datamodel/converter/statestore_converter.go b/pkg/daprrp/datamodel/converter/statestore_converter.go index 6cdb595596..c73e7b2eee 100644 --- a/pkg/daprrp/datamodel/converter/statestore_converter.go +++ b/pkg/daprrp/datamodel/converter/statestore_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/daprrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/daprrp/datamodel" ) // StateStoreDataModelToVersioned converts a version-agnostic datamodel.DaprStateStore to a versioned model interface based on the diff --git a/pkg/daprrp/datamodel/converter/statestore_converter_test.go b/pkg/daprrp/datamodel/converter/statestore_converter_test.go index 7a9bbc95da..9be6856103 100644 --- a/pkg/daprrp/datamodel/converter/statestore_converter_test.go +++ b/pkg/daprrp/datamodel/converter/statestore_converter_test.go @@ -20,10 +20,10 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/datamodel/daprpubsubbroker.go b/pkg/daprrp/datamodel/daprpubsubbroker.go index f11924ff0e..e89499107b 100644 --- a/pkg/daprrp/datamodel/daprpubsubbroker.go +++ b/pkg/daprrp/datamodel/daprpubsubbroker.go @@ -17,10 +17,10 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // DaprPubSubBroker represents Dapr PubSubBroker portable resource. diff --git a/pkg/daprrp/datamodel/daprsecretstore.go b/pkg/daprrp/datamodel/daprsecretstore.go index 0bd174916b..fb9dc1fd15 100644 --- a/pkg/daprrp/datamodel/daprsecretstore.go +++ b/pkg/daprrp/datamodel/daprsecretstore.go @@ -17,10 +17,10 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // DaprSecretStore represents Dapr SecretStore portable resource. diff --git a/pkg/daprrp/datamodel/daprstatestore.go b/pkg/daprrp/datamodel/daprstatestore.go index faeeb98abd..ae224edb0e 100644 --- a/pkg/daprrp/datamodel/daprstatestore.go +++ b/pkg/daprrp/datamodel/daprstatestore.go @@ -17,11 +17,11 @@ limitations under the License. package datamodel import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/portableresources/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/renderers" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // DaprStateStore represents DaprStateStore portable resource. diff --git a/pkg/daprrp/datamodel/daprstatestore_test.go b/pkg/daprrp/datamodel/daprstatestore_test.go index c10a6c7de0..d376817fdb 100644 --- a/pkg/daprrp/datamodel/daprstatestore_test.go +++ b/pkg/daprrp/datamodel/daprstatestore_test.go @@ -19,9 +19,9 @@ package datamodel import ( "testing" - "github.com/project-radius/radius/pkg/portableresources/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/portableresources/renderers" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/daprrp/processors/pubsubbrokers/processor.go b/pkg/daprrp/processors/pubsubbrokers/processor.go index df68295629..38fb525c41 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor.go @@ -19,16 +19,16 @@ package pubsubbrokers import ( "context" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/handlers" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/handlers" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers/dapr" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/daprrp/processors/pubsubbrokers/processor_test.go b/pkg/daprrp/processors/pubsubbrokers/processor_test.go index 528d59c18a..62df14eed6 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor_test.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor_test.go @@ -20,16 +20,16 @@ import ( "context" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers/dapr" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" diff --git a/pkg/daprrp/processors/secretstores/processor.go b/pkg/daprrp/processors/secretstores/processor.go index e2ecce65e9..b29fb7327b 100644 --- a/pkg/daprrp/processors/secretstores/processor.go +++ b/pkg/daprrp/processors/secretstores/processor.go @@ -19,16 +19,16 @@ package secretstores import ( "context" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/handlers" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/handlers" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers/dapr" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/daprrp/processors/secretstores/processor_test.go b/pkg/daprrp/processors/secretstores/processor_test.go index bca405bb95..2dfbdd785d 100644 --- a/pkg/daprrp/processors/secretstores/processor_test.go +++ b/pkg/daprrp/processors/secretstores/processor_test.go @@ -20,16 +20,16 @@ import ( "context" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers/dapr" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" diff --git a/pkg/daprrp/processors/statestores/processor.go b/pkg/daprrp/processors/statestores/processor.go index 0fa3800557..7b242d6934 100644 --- a/pkg/daprrp/processors/statestores/processor.go +++ b/pkg/daprrp/processors/statestores/processor.go @@ -19,16 +19,16 @@ package statestores import ( "context" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/handlers" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/handlers" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers/dapr" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/daprrp/processors/statestores/processor_test.go b/pkg/daprrp/processors/statestores/processor_test.go index 70c11f9874..3c40e6b2ff 100644 --- a/pkg/daprrp/processors/statestores/processor_test.go +++ b/pkg/daprrp/processors/statestores/processor_test.go @@ -20,16 +20,16 @@ import ( "context" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers/dapr" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers/dapr" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go index 19084a23c6..9b87b52187 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go @@ -19,11 +19,11 @@ package v20220315privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) func toProvisioningStateDataModel(state *ProvisioningState) v1.ProvisioningState { diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go index 7c3f011a51..6c144f499c 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go @@ -20,10 +20,10 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go index dc6b04890b..c958300c12 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion.go @@ -17,11 +17,11 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned Mongo database resource to version-agnostic datamodel and returns it, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go index 60c149f91a..614e66d310 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go @@ -20,14 +20,14 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go index 9089a5acd1..ad62edf69a 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion.go @@ -17,11 +17,11 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned Redis cache resource to version-agnostic datamodel diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go index ac16b71fc1..863c72de59 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go @@ -21,14 +21,14 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go index 1175736ee3..d25dd22ae9 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion.go @@ -17,11 +17,11 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts from the versioned SqlDatabase resource to version-agnostic datamodel diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go index c41261f4cf..05c71ed1c8 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go @@ -20,13 +20,13 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/datamodel/converter/mongodatabase_converter.go b/pkg/datastoresrp/datamodel/converter/mongodatabase_converter.go index d8889f2afc..9097162347 100644 --- a/pkg/datastoresrp/datamodel/converter/mongodatabase_converter.go +++ b/pkg/datastoresrp/datamodel/converter/mongodatabase_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" ) // MongoDatabaseDataModelToVersioned converts a Mongo database data model to a versioned model interface based on the diff --git a/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go b/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go index 77565a2c24..9dd0e8ea2e 100644 --- a/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go +++ b/pkg/datastoresrp/datamodel/converter/mongodatabase_converter_test.go @@ -21,10 +21,10 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/datamodel/converter/rediscache_converter.go b/pkg/datastoresrp/datamodel/converter/rediscache_converter.go index bf895a8c91..4acecd0076 100644 --- a/pkg/datastoresrp/datamodel/converter/rediscache_converter.go +++ b/pkg/datastoresrp/datamodel/converter/rediscache_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" ) // RedisCacheDataModelToVersioned converts a Redis cache data model to a versioned model interface and returns an error if diff --git a/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go b/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go index 73d8b09918..61d5f58d5a 100644 --- a/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go +++ b/pkg/datastoresrp/datamodel/converter/rediscache_converter_test.go @@ -21,10 +21,10 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/datamodel/converter/sqldatabase_converter.go b/pkg/datastoresrp/datamodel/converter/sqldatabase_converter.go index d976be4bf3..7be7ab51f6 100644 --- a/pkg/datastoresrp/datamodel/converter/sqldatabase_converter.go +++ b/pkg/datastoresrp/datamodel/converter/sqldatabase_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" ) // SqlDatabaseDataModelToVersioned converts a SqlDatabase data model to a VersionedModelInterface based on the specified diff --git a/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go b/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go index f5b01c76ba..b67707974f 100644 --- a/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go +++ b/pkg/datastoresrp/datamodel/converter/sqldatabase_converter_test.go @@ -21,10 +21,10 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/datamodel/mongodatabase.go b/pkg/datastoresrp/datamodel/mongodatabase.go index fbb2d55f34..ea526354f1 100644 --- a/pkg/datastoresrp/datamodel/mongodatabase.go +++ b/pkg/datastoresrp/datamodel/mongodatabase.go @@ -20,11 +20,11 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/portableresources/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/renderers" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // MongoDatabase represents Mongo database portable resource. diff --git a/pkg/datastoresrp/datamodel/rediscache.go b/pkg/datastoresrp/datamodel/rediscache.go index f747a09144..4d1ce293b9 100644 --- a/pkg/datastoresrp/datamodel/rediscache.go +++ b/pkg/datastoresrp/datamodel/rediscache.go @@ -22,11 +22,11 @@ import ( "strconv" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/portableresources/renderers" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/renderers" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // RedisCache represents Redis cache portable resource. diff --git a/pkg/datastoresrp/datamodel/sqldatabase.go b/pkg/datastoresrp/datamodel/sqldatabase.go index 326b15e9e0..2c67929475 100644 --- a/pkg/datastoresrp/datamodel/sqldatabase.go +++ b/pkg/datastoresrp/datamodel/sqldatabase.go @@ -20,10 +20,10 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // Recipe returns the LinkRecipe associated with the SQL database instance if the ResourceProvisioning is not diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go index 7f93670ee5..133cf19afd 100644 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go +++ b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase.go @@ -20,12 +20,12 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - "github.com/project-radius/radius/pkg/portableresources/renderers" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel/converter" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) var _ ctrl.Controller = (*ListSecretsMongoDatabase)(nil) diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go index 8d45f34ab9..0c4b368a47 100644 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go +++ b/pkg/datastoresrp/frontend/controller/mongodatabases/listsecretsmongodatabase_test.go @@ -24,12 +24,12 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources/renderers" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/datastoresrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go b/pkg/datastoresrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go index 11dab84f74..9ff527de65 100644 --- a/pkg/datastoresrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go +++ b/pkg/datastoresrp/frontend/controller/mongodatabases/v20220315privatepreview_test.go @@ -19,9 +19,9 @@ package mongodatabases import ( "encoding/json" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/test/testutil" ) const testHeaderfile = "20220315privatepreview_requestheaders.json" diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go index dfcb94389e..1fc78c14aa 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go +++ b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache.go @@ -21,13 +21,13 @@ import ( "errors" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - "github.com/project-radius/radius/pkg/portableresources/renderers" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel/converter" + "github.com/radius-project/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/ucp/store" ) var _ ctrl.Controller = (*ListSecretsRedisCache)(nil) diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go index 38ef5ce8c1..3f9d314d6a 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go +++ b/pkg/datastoresrp/frontend/controller/rediscaches/listsecretsrediscache_test.go @@ -24,12 +24,12 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources/renderers" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/datastoresrp/frontend/controller/rediscaches/v20220315privatepreview_test.go b/pkg/datastoresrp/frontend/controller/rediscaches/v20220315privatepreview_test.go index d8b33f53b7..124b46fe60 100644 --- a/pkg/datastoresrp/frontend/controller/rediscaches/v20220315privatepreview_test.go +++ b/pkg/datastoresrp/frontend/controller/rediscaches/v20220315privatepreview_test.go @@ -19,9 +19,9 @@ package rediscaches import ( "encoding/json" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/test/testutil" ) const testHeaderfile = "20220315privatepreview_requestheaders.json" diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go b/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go index e392df64b5..ef3c8c5a44 100644 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go +++ b/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase.go @@ -20,12 +20,12 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - "github.com/project-radius/radius/pkg/portableresources/renderers" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel/converter" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) var _ ctrl.Controller = (*ListSecretsSqlDatabase)(nil) diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go b/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go index 6288854458..083255677d 100644 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go +++ b/pkg/datastoresrp/frontend/controller/sqldatabases/listsecretssqldatabase_test.go @@ -24,11 +24,11 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" diff --git a/pkg/datastoresrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go b/pkg/datastoresrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go index cca9fd06c0..117c18a161 100644 --- a/pkg/datastoresrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go +++ b/pkg/datastoresrp/frontend/controller/sqldatabases/v20220315privatepreview_test.go @@ -19,9 +19,9 @@ package sqldatabases import ( "encoding/json" - "github.com/project-radius/radius/pkg/datastoresrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/datastoresrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/test/testutil" ) const testHeaderfile = "20220315privatepreview_requestheaders.json" diff --git a/pkg/datastoresrp/processors/mongodatabases/processor.go b/pkg/datastoresrp/processors/mongodatabases/processor.go index 9aacf88955..2acce23c5e 100644 --- a/pkg/datastoresrp/processors/mongodatabases/processor.go +++ b/pkg/datastoresrp/processors/mongodatabases/processor.go @@ -20,9 +20,9 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) // Processor is a processor for MongoDB resources. diff --git a/pkg/datastoresrp/processors/mongodatabases/processor_test.go b/pkg/datastoresrp/processors/mongodatabases/processor_test.go index 2d5a8c81b0..dc1525d642 100644 --- a/pkg/datastoresrp/processors/mongodatabases/processor_test.go +++ b/pkg/datastoresrp/processors/mongodatabases/processor_test.go @@ -20,11 +20,11 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/processors/rediscaches/processor.go b/pkg/datastoresrp/processors/rediscaches/processor.go index 45c81a435f..9c04d791a3 100644 --- a/pkg/datastoresrp/processors/rediscaches/processor.go +++ b/pkg/datastoresrp/processors/rediscaches/processor.go @@ -20,9 +20,9 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) const ( diff --git a/pkg/datastoresrp/processors/rediscaches/processor_test.go b/pkg/datastoresrp/processors/rediscaches/processor_test.go index facc615e0c..47c92c156c 100644 --- a/pkg/datastoresrp/processors/rediscaches/processor_test.go +++ b/pkg/datastoresrp/processors/rediscaches/processor_test.go @@ -20,11 +20,11 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/datastoresrp/processors/sqldatabases/processor.go b/pkg/datastoresrp/processors/sqldatabases/processor.go index a514296467..3b974d2b85 100644 --- a/pkg/datastoresrp/processors/sqldatabases/processor.go +++ b/pkg/datastoresrp/processors/sqldatabases/processor.go @@ -9,9 +9,9 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) // Processor is a processor for SQL database resources. diff --git a/pkg/datastoresrp/processors/sqldatabases/processor_test.go b/pkg/datastoresrp/processors/sqldatabases/processor_test.go index 6273d14191..0337ee4ec7 100644 --- a/pkg/datastoresrp/processors/sqldatabases/processor_test.go +++ b/pkg/datastoresrp/processors/sqldatabases/processor_test.go @@ -9,11 +9,11 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/kubernetes/object.go b/pkg/kubernetes/object.go index b14bac0844..54bd6c2e2d 100644 --- a/pkg/kubernetes/object.go +++ b/pkg/kubernetes/object.go @@ -21,8 +21,8 @@ import ( "hash/fnv" "strings" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" appsv1 "k8s.io/api/apps/v1" diff --git a/pkg/kubeutil/namespace.go b/pkg/kubeutil/namespace.go index ff0015457b..3059411bbc 100644 --- a/pkg/kubeutil/namespace.go +++ b/pkg/kubeutil/namespace.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/kubeutil/namespace_test.go b/pkg/kubeutil/namespace_test.go index 6b8fe1cfdc..f8f591af88 100644 --- a/pkg/kubeutil/namespace_test.go +++ b/pkg/kubeutil/namespace_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/k8sutil" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go index 00d6eeb5c6..e8ad78c497 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go @@ -19,11 +19,11 @@ package v20220315privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) func toProvisioningStateDataModel(state *ProvisioningState) v1.ProvisioningState { diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go index 9507919e4a..26ee795605 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go @@ -19,10 +19,10 @@ package v20220315privatepreview import ( "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go index 53f4a38d14..9602586f8a 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion.go @@ -17,11 +17,11 @@ limitations under the License. package v20220315privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) // ConvertTo converts a versioned RabbitMQQueueResource to a version-agnostic datamodel.RabbitMQQueue diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go index 8644272dbe..899020a827 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go @@ -20,13 +20,13 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/messagingrp/datamodel/converter/rabbitmq_converter.go b/pkg/messagingrp/datamodel/converter/rabbitmq_converter.go index 21f2d835ea..6eba77b8ac 100644 --- a/pkg/messagingrp/datamodel/converter/rabbitmq_converter.go +++ b/pkg/messagingrp/datamodel/converter/rabbitmq_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/messagingrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/messagingrp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/messagingrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/messagingrp/datamodel" ) // RabbitMQQueueDataModelToVersioned converts a version-agnostic datamodel.RabbitMQQueue to a versioned model interface diff --git a/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go b/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go index 2abf098af5..1a7b411349 100644 --- a/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go +++ b/pkg/messagingrp/datamodel/converter/rabbitmq_converter_test.go @@ -21,10 +21,10 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/messagingrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/messagingrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/messagingrp/datamodel/rabbitmq.go b/pkg/messagingrp/datamodel/rabbitmq.go index 9f00dfb0a7..29a5aa28d5 100644 --- a/pkg/messagingrp/datamodel/rabbitmq.go +++ b/pkg/messagingrp/datamodel/rabbitmq.go @@ -20,10 +20,10 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/portableresources" - pr_dm "github.com/project-radius/radius/pkg/portableresources/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/portableresources" + pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // RabbitMQQueue represents RabbitMQQueue portable resource. diff --git a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go index 115281a777..f73e4da6ce 100644 --- a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go +++ b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq.go @@ -20,12 +20,12 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - msg_conv "github.com/project-radius/radius/pkg/messagingrp/datamodel/converter" - "github.com/project-radius/radius/pkg/portableresources/renderers" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + msg_conv "github.com/radius-project/radius/pkg/messagingrp/datamodel/converter" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) var _ ctrl.Controller = (*ListSecretsRabbitMQQueue)(nil) diff --git a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go index 1f4f4975d1..d96eb40d91 100644 --- a/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go +++ b/pkg/messagingrp/frontend/controller/rabbitmqqueues/listsecretsrabbitmq_test.go @@ -25,11 +25,11 @@ import ( "testing" "github.com/golang/mock/gomock" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/messagingrp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/portableresources/renderers" - "github.com/project-radius/radius/pkg/ucp/store" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/messagingrp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/portableresources/renderers" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/messagingrp/frontend/controller/rabbitmqqueues/v20220315privatepreview_test.go b/pkg/messagingrp/frontend/controller/rabbitmqqueues/v20220315privatepreview_test.go index ddbddb35f5..f607368d30 100644 --- a/pkg/messagingrp/frontend/controller/rabbitmqqueues/v20220315privatepreview_test.go +++ b/pkg/messagingrp/frontend/controller/rabbitmqqueues/v20220315privatepreview_test.go @@ -19,9 +19,9 @@ package rabbitmqqueues import ( "encoding/json" - "github.com/project-radius/radius/pkg/messagingrp/api/v20220315privatepreview" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/test/testutil" + "github.com/radius-project/radius/pkg/messagingrp/api/v20220315privatepreview" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/test/testutil" ) const testHeaderfile = "20220315privatepreview_requestheaders.json" diff --git a/pkg/messagingrp/processors/rabbitmqqueues/processor.go b/pkg/messagingrp/processors/rabbitmqqueues/processor.go index 90422a60ef..683ea9e9aa 100644 --- a/pkg/messagingrp/processors/rabbitmqqueues/processor.go +++ b/pkg/messagingrp/processors/rabbitmqqueues/processor.go @@ -20,9 +20,9 @@ import ( "context" "fmt" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/portableresources/renderers" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/portableresources/renderers" ) const ( diff --git a/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go b/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go index a49bf419b9..37a31a4ec1 100644 --- a/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go +++ b/pkg/messagingrp/processors/rabbitmqqueues/processor_test.go @@ -18,10 +18,10 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/metrics/asyncoperationmetrics.go b/pkg/metrics/asyncoperationmetrics.go index 1d5dd48df2..0b6e0b986b 100644 --- a/pkg/metrics/asyncoperationmetrics.go +++ b/pkg/metrics/asyncoperationmetrics.go @@ -21,9 +21,9 @@ import ( "strings" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/ucp/resources" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" diff --git a/pkg/metrics/recipeenginemetrics.go b/pkg/metrics/recipeenginemetrics.go index ce28a5c047..13b4cf747a 100644 --- a/pkg/metrics/recipeenginemetrics.go +++ b/pkg/metrics/recipeenginemetrics.go @@ -21,7 +21,7 @@ import ( "strings" "time" - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" diff --git a/pkg/metrics/service/hostoptions.go b/pkg/metrics/service/hostoptions.go index b7f893a968..009d3bea90 100644 --- a/pkg/metrics/service/hostoptions.go +++ b/pkg/metrics/service/hostoptions.go @@ -17,8 +17,8 @@ limitations under the License. package metricsservice import ( - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/metrics/provider" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/metrics/provider" ) // HostOptions defines all of the settings that our metric's execution environment provides. diff --git a/pkg/metrics/service/service.go b/pkg/metrics/service/service.go index 3a614dbe31..915205f22c 100644 --- a/pkg/metrics/service/service.go +++ b/pkg/metrics/service/service.go @@ -24,9 +24,9 @@ import ( "strconv" "time" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/metrics/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/metrics/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/contrib/instrumentation/runtime" ) diff --git a/pkg/middleware/logger.go b/pkg/middleware/logger.go index 4fd71d30b6..427384ab29 100644 --- a/pkg/middleware/logger.go +++ b/pkg/middleware/logger.go @@ -19,8 +19,8 @@ package middleware import ( "net/http" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // WithLogger adds logger to the context based on the Resource ID (if present). diff --git a/pkg/middleware/lowercaseurlpath.go b/pkg/middleware/lowercaseurlpath.go index 793c2c7b7a..1cc013f5c8 100644 --- a/pkg/middleware/lowercaseurlpath.go +++ b/pkg/middleware/lowercaseurlpath.go @@ -20,7 +20,7 @@ import ( "net/http" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) // LowercaseURLPath sets the Referer header to the original URL if it is not already set, and then lowercases the URL path diff --git a/pkg/middleware/lowercaseurlpath_test.go b/pkg/middleware/lowercaseurlpath_test.go index f477a159ed..4ad371db16 100644 --- a/pkg/middleware/lowercaseurlpath_test.go +++ b/pkg/middleware/lowercaseurlpath_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/middleware/recoverer.go b/pkg/middleware/recoverer.go index 59c17d9e1c..ea8a20589d 100644 --- a/pkg/middleware/recoverer.go +++ b/pkg/middleware/recoverer.go @@ -21,9 +21,9 @@ import ( "net/http" "runtime/debug" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // Recoverer handles panics and logs the error, returning an Internal Server Error response. diff --git a/pkg/portableresources/backend/controller/createorupdateresource.go b/pkg/portableresources/backend/controller/createorupdateresource.go index b5e98a11bf..24a77d94bf 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource.go +++ b/pkg/portableresources/backend/controller/createorupdateresource.go @@ -20,14 +20,14 @@ import ( "context" "errors" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/configloader" - "github.com/project-radius/radius/pkg/recipes/engine" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/store" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + "github.com/radius-project/radius/pkg/recipes/engine" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/store" ) // CreateOrUpdateResource is the async operation controller to create or update portable resources. diff --git a/pkg/portableresources/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go index e9f00f4319..3b9732103b 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -26,17 +26,17 @@ import ( "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/configloader" - "github.com/project-radius/radius/pkg/recipes/engine" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + "github.com/radius-project/radius/pkg/recipes/engine" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) const ( diff --git a/pkg/portableresources/backend/controller/deleteresource.go b/pkg/portableresources/backend/controller/deleteresource.go index 579e2014a5..c8cf805942 100644 --- a/pkg/portableresources/backend/controller/deleteresource.go +++ b/pkg/portableresources/backend/controller/deleteresource.go @@ -21,18 +21,18 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - ext_dm "github.com/project-radius/radius/pkg/corerp/datamodel" - dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" - ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/engine" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + ext_dm "github.com/radius-project/radius/pkg/corerp/datamodel" + dapr_dm "github.com/radius-project/radius/pkg/daprrp/datamodel" + ds_dm "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/engine" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) var _ ctrl.Controller = (*DeleteResource)(nil) diff --git a/pkg/portableresources/backend/controller/deleteresource_test.go b/pkg/portableresources/backend/controller/deleteresource_test.go index 2b6f45f12f..a005bc3214 100644 --- a/pkg/portableresources/backend/controller/deleteresource_test.go +++ b/pkg/portableresources/backend/controller/deleteresource_test.go @@ -24,14 +24,14 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/engine" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/engine" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/portableresources/backend/service.go b/pkg/portableresources/backend/service.go index 3edb43196f..9c8c0177e2 100644 --- a/pkg/portableresources/backend/service.go +++ b/pkg/portableresources/backend/service.go @@ -20,35 +20,35 @@ import ( "context" "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/worker" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" - "github.com/project-radius/radius/pkg/daprrp/processors/pubsubbrokers" - "github.com/project-radius/radius/pkg/daprrp/processors/secretstores" - "github.com/project-radius/radius/pkg/daprrp/processors/statestores" - ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - mongo_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/mongodatabases" - redis_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/rediscaches" - sql_prc "github.com/project-radius/radius/pkg/datastoresrp/processors/sqldatabases" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - "github.com/project-radius/radius/pkg/messagingrp/processors/rabbitmqqueues" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/portableresources/frontend/handler" - "github.com/project-radius/radius/pkg/portableresources/processors" - - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/configloader" - "github.com/project-radius/radius/pkg/recipes/driver" - "github.com/project-radius/radius/pkg/recipes/engine" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/sdk/clients" - - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" - backend_ctrl "github.com/project-radius/radius/pkg/portableresources/backend/controller" - - "github.com/project-radius/radius/pkg/ucp/secret/provider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + dapr_dm "github.com/radius-project/radius/pkg/daprrp/datamodel" + "github.com/radius-project/radius/pkg/daprrp/processors/pubsubbrokers" + "github.com/radius-project/radius/pkg/daprrp/processors/secretstores" + "github.com/radius-project/radius/pkg/daprrp/processors/statestores" + ds_dm "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + mongo_prc "github.com/radius-project/radius/pkg/datastoresrp/processors/mongodatabases" + redis_prc "github.com/radius-project/radius/pkg/datastoresrp/processors/rediscaches" + sql_prc "github.com/radius-project/radius/pkg/datastoresrp/processors/sqldatabases" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + "github.com/radius-project/radius/pkg/messagingrp/processors/rabbitmqqueues" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources/frontend/handler" + "github.com/radius-project/radius/pkg/portableresources/processors" + + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + "github.com/radius-project/radius/pkg/recipes/driver" + "github.com/radius-project/radius/pkg/recipes/engine" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/sdk/clients" + + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + backend_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" + + "github.com/radius-project/radius/pkg/ucp/secret/provider" ) type Service struct { diff --git a/pkg/portableresources/datamodel/linkmetadata.go b/pkg/portableresources/datamodel/linkmetadata.go index 46fee4597b..1282dd0f0e 100644 --- a/pkg/portableresources/datamodel/linkmetadata.go +++ b/pkg/portableresources/datamodel/linkmetadata.go @@ -17,8 +17,8 @@ limitations under the License. package datamodel import ( - "github.com/project-radius/radius/pkg/portableresources" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/portableresources" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // LinkMetadata represents internal DataModel properties common to all portable resource types. diff --git a/pkg/portableresources/datamodel/recipes.go b/pkg/portableresources/datamodel/recipes.go index cf756cabee..6bf152a331 100644 --- a/pkg/portableresources/datamodel/recipes.go +++ b/pkg/portableresources/datamodel/recipes.go @@ -21,7 +21,7 @@ limitations under the License. package datamodel import ( - "github.com/project-radius/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/portableresources" ) // RecipeDataModel should be implemented on the datamodel of types that support recipes. diff --git a/pkg/portableresources/frontend/handler/getoperations.go b/pkg/portableresources/frontend/handler/getoperations.go index b9b32ccc33..0e61ce1950 100644 --- a/pkg/portableresources/frontend/handler/getoperations.go +++ b/pkg/portableresources/frontend/handler/getoperations.go @@ -20,10 +20,10 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + v20220315privatepreview "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" ) var _ ctrl.Controller = (*GetOperations)(nil) diff --git a/pkg/portableresources/frontend/handler/getoperations_test.go b/pkg/portableresources/frontend/handler/getoperations_test.go index c2adb9674f..36f3f152fa 100644 --- a/pkg/portableresources/frontend/handler/getoperations_test.go +++ b/pkg/portableresources/frontend/handler/getoperations_test.go @@ -21,10 +21,10 @@ import ( "net/http/httptest" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/project-radius/radius/pkg/portableresources/api/v20220315privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + v20220315privatepreview "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/stretchr/testify/require" ) diff --git a/pkg/portableresources/frontend/handler/routes.go b/pkg/portableresources/frontend/handler/routes.go index 723175c1c8..c86134aea8 100644 --- a/pkg/portableresources/frontend/handler/routes.go +++ b/pkg/portableresources/frontend/handler/routes.go @@ -22,28 +22,28 @@ import ( "time" "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - frontend_ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/portableresources" - rp_frontend "github.com/project-radius/radius/pkg/rp/frontend" - "github.com/project-radius/radius/pkg/validator" - "github.com/project-radius/radius/swagger" - - dapr_dm "github.com/project-radius/radius/pkg/daprrp/datamodel" - dapr_conv "github.com/project-radius/radius/pkg/daprrp/datamodel/converter" - dapr_ctrl "github.com/project-radius/radius/pkg/daprrp/frontend/controller" - ds_dm "github.com/project-radius/radius/pkg/datastoresrp/datamodel" - ds_conv "github.com/project-radius/radius/pkg/datastoresrp/datamodel/converter" - ds_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller" - mongo_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/mongodatabases" - redis_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/rediscaches" - sql_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller/sqldatabases" - msg_dm "github.com/project-radius/radius/pkg/messagingrp/datamodel" - msg_conv "github.com/project-radius/radius/pkg/messagingrp/datamodel/converter" - msg_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller" - rmq_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + frontend_ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/portableresources" + rp_frontend "github.com/radius-project/radius/pkg/rp/frontend" + "github.com/radius-project/radius/pkg/validator" + "github.com/radius-project/radius/swagger" + + dapr_dm "github.com/radius-project/radius/pkg/daprrp/datamodel" + dapr_conv "github.com/radius-project/radius/pkg/daprrp/datamodel/converter" + dapr_ctrl "github.com/radius-project/radius/pkg/daprrp/frontend/controller" + ds_dm "github.com/radius-project/radius/pkg/datastoresrp/datamodel" + ds_conv "github.com/radius-project/radius/pkg/datastoresrp/datamodel/converter" + ds_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller" + mongo_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller/mongodatabases" + redis_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller/rediscaches" + sql_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller/sqldatabases" + msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" + msg_conv "github.com/radius-project/radius/pkg/messagingrp/datamodel/converter" + msg_ctrl "github.com/radius-project/radius/pkg/messagingrp/frontend/controller" + rmq_ctrl "github.com/radius-project/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" ) const ( diff --git a/pkg/portableresources/frontend/handler/routes_test.go b/pkg/portableresources/frontend/handler/routes_test.go index 71289e4b1e..29802a4bf4 100644 --- a/pkg/portableresources/frontend/handler/routes_test.go +++ b/pkg/portableresources/frontend/handler/routes_test.go @@ -23,14 +23,14 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ds_ctrl "github.com/project-radius/radius/pkg/datastoresrp/frontend/controller" - rabbitmq_ctrl "github.com/project-radius/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ds_ctrl "github.com/radius-project/radius/pkg/datastoresrp/frontend/controller" + rabbitmq_ctrl "github.com/radius-project/radius/pkg/messagingrp/frontend/controller/rabbitmqqueues" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" ) var handlerTests = []rpctest.HandlerTestSpec{ diff --git a/pkg/portableresources/frontend/service.go b/pkg/portableresources/frontend/service.go index 02acd3ff33..b83a0f4027 100644 --- a/pkg/portableresources/frontend/service.go +++ b/pkg/portableresources/frontend/service.go @@ -21,10 +21,10 @@ import ( "fmt" "github.com/go-chi/chi/v5" - ctrl "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/portableresources/frontend/handler" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/portableresources/frontend/handler" ) type Service struct { diff --git a/pkg/portableresources/handlers/util.go b/pkg/portableresources/handlers/util.go index 58d4497f1c..a9db93e812 100644 --- a/pkg/portableresources/handlers/util.go +++ b/pkg/portableresources/handlers/util.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/pkg/portableresources/handlers/util_test.go b/pkg/portableresources/handlers/util_test.go index 3d5f85485c..590c2ac622 100644 --- a/pkg/portableresources/handlers/util_test.go +++ b/pkg/portableresources/handlers/util_test.go @@ -21,9 +21,9 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/test/k8sutil" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/portableresources/processors/mock_resourceclient.go b/pkg/portableresources/processors/mock_resourceclient.go index 080855ee59..5cbcfcb5d6 100644 --- a/pkg/portableresources/processors/mock_resourceclient.go +++ b/pkg/portableresources/processors/mock_resourceclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/portableresources/processors (interfaces: ResourceClient) +// Source: github.com/radius-project/radius/pkg/portableresources/processors (interfaces: ResourceClient) // Package processors is a generated GoMock package. package processors diff --git a/pkg/portableresources/processors/resourceclient.go b/pkg/portableresources/processors/resourceclient.go index a840cfe476..8543a99e86 100644 --- a/pkg/portableresources/processors/resourceclient.go +++ b/pkg/portableresources/processors/resourceclient.go @@ -23,16 +23,16 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/trace" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/clientv2" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/trace" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/otel/attribute" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/pkg/portableresources/processors/resourceclient_test.go b/pkg/portableresources/processors/resourceclient_test.go index 8a65dd62da..bdc9667f9a 100644 --- a/pkg/portableresources/processors/resourceclient_test.go +++ b/pkg/portableresources/processors/resourceclient_test.go @@ -27,13 +27,13 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/azure/armauth" - "github.com/project-radius/radius/pkg/azure/clientv2" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/azure/armauth" + "github.com/radius-project/radius/pkg/azure/clientv2" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/portableresources/processors/types.go b/pkg/portableresources/processors/types.go index f96bfb18f4..56224318d2 100644 --- a/pkg/portableresources/processors/types.go +++ b/pkg/portableresources/processors/types.go @@ -20,8 +20,8 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // ResourceProcessor is responsible for processing the results of recipe execution or any @@ -55,7 +55,7 @@ func (e *ValidationError) Error() string { return e.Message } -//go:generate mockgen -destination=./mock_resourceclient.go -package=processors -self_package github.com/project-radius/radius/pkg/portableresources/processors github.com/project-radius/radius/pkg/portableresources/processors ResourceClient +//go:generate mockgen -destination=./mock_resourceclient.go -package=processors -self_package github.com/radius-project/radius/pkg/portableresources/processors github.com/radius-project/radius/pkg/portableresources/processors ResourceClient // ResourceClient is a client used by resource processors for interacting with UCP resources. type ResourceClient interface { diff --git a/pkg/portableresources/processors/util.go b/pkg/portableresources/processors/util.go index 3ff7477690..cff2fd61ec 100644 --- a/pkg/portableresources/processors/util.go +++ b/pkg/portableresources/processors/util.go @@ -19,11 +19,11 @@ package processors import ( "fmt" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" ) // GetOutputResourcesFromResourcesField parses a slice of resource references and converts each resource into an OutputResource. diff --git a/pkg/portableresources/processors/util_test.go b/pkg/portableresources/processors/util_test.go index f17643a2d9..7104ce0d59 100644 --- a/pkg/portableresources/processors/util_test.go +++ b/pkg/portableresources/processors/util_test.go @@ -19,11 +19,11 @@ package processors import ( "testing" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/portableresources/processors/validator.go b/pkg/portableresources/processors/validator.go index 906e26397a..668980ae54 100644 --- a/pkg/portableresources/processors/validator.go +++ b/pkg/portableresources/processors/validator.go @@ -21,9 +21,9 @@ import ( "reflect" "strings" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) const ( diff --git a/pkg/portableresources/processors/validator_test.go b/pkg/portableresources/processors/validator_test.go index 880af110ca..3eef229781 100644 --- a/pkg/portableresources/processors/validator_test.go +++ b/pkg/portableresources/processors/validator_test.go @@ -19,11 +19,11 @@ package processors import ( "testing" - "github.com/project-radius/radius/pkg/portableresources" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/portableresources/renderers/dapr/generic.go b/pkg/portableresources/renderers/dapr/generic.go index a4ded7639e..54106785e5 100644 --- a/pkg/portableresources/renderers/dapr/generic.go +++ b/pkg/portableresources/renderers/dapr/generic.go @@ -19,8 +19,8 @@ package dapr import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/kubernetes" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/kubernetes" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) diff --git a/pkg/profiler/service/hostoptions.go b/pkg/profiler/service/hostoptions.go index 5947a721f5..795ac7d334 100644 --- a/pkg/profiler/service/hostoptions.go +++ b/pkg/profiler/service/hostoptions.go @@ -17,8 +17,8 @@ limitations under the License. package profilerservice import ( - "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/profiler/provider" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/profiler/provider" ) type HostOptions struct { diff --git a/pkg/profiler/service/service.go b/pkg/profiler/service/service.go index 7b362075fd..96a7668d70 100644 --- a/pkg/profiler/service/service.go +++ b/pkg/profiler/service/service.go @@ -23,7 +23,7 @@ import ( "net/http" "strconv" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) type Service struct { diff --git a/pkg/recipes/configloader/environment.go b/pkg/recipes/configloader/environment.go index 1c05b420eb..f30b573ee1 100644 --- a/pkg/recipes/configloader/environment.go +++ b/pkg/recipes/configloader/environment.go @@ -22,20 +22,20 @@ import ( "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/rp/kube" - "github.com/project-radius/radius/pkg/rp/util" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/rp/kube" + "github.com/radius-project/radius/pkg/rp/util" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" ) var ( ErrUnsupportedComputeKind = errors.New("unsupported compute kind in environment resource") ) -//go:generate mockgen -destination=./mock_config_loader.go -package=configloader -self_package github.com/project-radius/radius/pkg/recipes/configloader github.com/project-radius/radius/pkg/recipes/configloader ConfigurationLoader +//go:generate mockgen -destination=./mock_config_loader.go -package=configloader -self_package github.com/radius-project/radius/pkg/recipes/configloader github.com/radius-project/radius/pkg/recipes/configloader ConfigurationLoader var _ ConfigurationLoader = (*environmentLoader)(nil) diff --git a/pkg/recipes/configloader/environment_test.go b/pkg/recipes/configloader/environment_test.go index 3292eef9fa..6e0623eefc 100644 --- a/pkg/recipes/configloader/environment_test.go +++ b/pkg/recipes/configloader/environment_test.go @@ -19,10 +19,10 @@ package configloader import ( "testing" - model "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/to" + model "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/configloader/mock_config_loader.go b/pkg/recipes/configloader/mock_config_loader.go index 32976c77c1..59fcd47027 100644 --- a/pkg/recipes/configloader/mock_config_loader.go +++ b/pkg/recipes/configloader/mock_config_loader.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/recipes/configloader (interfaces: ConfigurationLoader) +// Source: github.com/radius-project/radius/pkg/recipes/configloader (interfaces: ConfigurationLoader) // Package configloader is a generated GoMock package. package configloader @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - recipes "github.com/project-radius/radius/pkg/recipes" + recipes "github.com/radius-project/radius/pkg/recipes" ) // MockConfigurationLoader is a mock of ConfigurationLoader interface. diff --git a/pkg/recipes/configloader/types.go b/pkg/recipes/configloader/types.go index 20ed8e3cb1..861196690d 100644 --- a/pkg/recipes/configloader/types.go +++ b/pkg/recipes/configloader/types.go @@ -19,7 +19,7 @@ package configloader import ( "context" - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes" ) type ConfigurationLoader interface { diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index d1a2eeff06..e01a8dabb9 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -27,22 +27,22 @@ import ( deployments "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/go-logr/logr" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/portableresources/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/recipecontext" - "github.com/project-radius/radius/pkg/rp/util" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - clients "github.com/project-radius/radius/pkg/sdk/clients" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" - "github.com/project-radius/radius/pkg/ucp/ucplog" - - coredm "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/recipecontext" + "github.com/radius-project/radius/pkg/rp/util" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + clients "github.com/radius-project/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" + "github.com/radius-project/radius/pkg/ucp/ucplog" + + coredm "github.com/radius-project/radius/pkg/corerp/datamodel" ) -//go:generate mockgen -destination=./mock_driver.go -package=driver -self_package github.com/project-radius/radius/pkg/recipes/driver github.com/project-radius/radius/pkg/recipes/driver Driver +//go:generate mockgen -destination=./mock_driver.go -package=driver -self_package github.com/radius-project/radius/pkg/recipes/driver github.com/radius-project/radius/pkg/recipes/driver Driver const ( deploymentPrefix = "recipe" pollFrequency = time.Second * 5 diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index 143f62f611..2276caff55 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -23,17 +23,17 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" gomock "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - corerp_datamodel "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/portableresources/processors" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/recipecontext" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - clients "github.com/project-radius/radius/pkg/sdk/clients" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" - "github.com/project-radius/radius/test/testcontext" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + corerp_datamodel "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/recipecontext" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + clients "github.com/radius-project/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/driver/mock_driver.go b/pkg/recipes/driver/mock_driver.go index 6b0131dc1d..7643d65348 100644 --- a/pkg/recipes/driver/mock_driver.go +++ b/pkg/recipes/driver/mock_driver.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/recipes/driver (interfaces: Driver) +// Source: github.com/radius-project/radius/pkg/recipes/driver (interfaces: Driver) // Package driver is a generated GoMock package. package driver @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - recipes "github.com/project-radius/radius/pkg/recipes" + recipes "github.com/radius-project/radius/pkg/recipes" ) // MockDriver is a mock of Driver interface. diff --git a/pkg/recipes/driver/terraform.go b/pkg/recipes/driver/terraform.go index 95b99943ea..f421c2cdc8 100644 --- a/pkg/recipes/driver/terraform.go +++ b/pkg/recipes/driver/terraform.go @@ -24,14 +24,14 @@ import ( "path/filepath" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/recipes" - - "github.com/project-radius/radius/pkg/recipes/terraform" - "github.com/project-radius/radius/pkg/sdk" - ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "github.com/project-radius/radius/pkg/ucp/util" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/recipes" + + "github.com/radius-project/radius/pkg/recipes/terraform" + "github.com/radius-project/radius/pkg/sdk" + ucp_provider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/util" "k8s.io/client-go/kubernetes" tfjson "github.com/hashicorp/terraform-json" diff --git a/pkg/recipes/driver/terraform_test.go b/pkg/recipes/driver/terraform_test.go index 274812b723..f564f76f36 100644 --- a/pkg/recipes/driver/terraform_test.go +++ b/pkg/recipes/driver/terraform_test.go @@ -26,13 +26,13 @@ import ( gomock "github.com/golang/mock/gomock" "github.com/google/uuid" tfjson "github.com/hashicorp/terraform-json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/recipes/terraform" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/recipes/terraform" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/driver/types.go b/pkg/recipes/driver/types.go index a8886fdfc1..94006e374d 100644 --- a/pkg/recipes/driver/types.go +++ b/pkg/recipes/driver/types.go @@ -19,8 +19,8 @@ package driver import ( "context" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // Driver is an interface to implement recipe deployment and recipe resources deletion. diff --git a/pkg/recipes/engine/engine.go b/pkg/recipes/engine/engine.go index dc2e455f80..345a128515 100644 --- a/pkg/recipes/engine/engine.go +++ b/pkg/recipes/engine/engine.go @@ -21,11 +21,11 @@ import ( "fmt" "time" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/configloader" - recipedriver "github.com/project-radius/radius/pkg/recipes/driver" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + recipedriver "github.com/radius-project/radius/pkg/recipes/driver" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // NewEngine creates a new Engine to deploy recipe. diff --git a/pkg/recipes/engine/engine_test.go b/pkg/recipes/engine/engine_test.go index 2718c41277..2063e9f48d 100644 --- a/pkg/recipes/engine/engine_test.go +++ b/pkg/recipes/engine/engine_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/configloader" - recipedriver "github.com/project-radius/radius/pkg/recipes/driver" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + recipedriver "github.com/radius-project/radius/pkg/recipes/driver" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/engine/mock_engine.go b/pkg/recipes/engine/mock_engine.go index 62aac203af..615a397ee0 100644 --- a/pkg/recipes/engine/mock_engine.go +++ b/pkg/recipes/engine/mock_engine.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/recipes/engine (interfaces: Engine) +// Source: github.com/radius-project/radius/pkg/recipes/engine (interfaces: Engine) // Package engine is a generated GoMock package. package engine @@ -9,8 +9,8 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - recipes "github.com/project-radius/radius/pkg/recipes" - v1 "github.com/project-radius/radius/pkg/rp/v1" + recipes "github.com/radius-project/radius/pkg/recipes" + v1 "github.com/radius-project/radius/pkg/rp/v1" ) // MockEngine is a mock of Engine interface. diff --git a/pkg/recipes/engine/types.go b/pkg/recipes/engine/types.go index b7309c97ed..b917d4d644 100644 --- a/pkg/recipes/engine/types.go +++ b/pkg/recipes/engine/types.go @@ -19,11 +19,11 @@ package engine import ( "context" - "github.com/project-radius/radius/pkg/recipes" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/recipes" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) -//go:generate mockgen -destination=./mock_engine.go -package=engine -self_package github.com/project-radius/radius/pkg/recipes/engine github.com/project-radius/radius/pkg/recipes/engine Engine +//go:generate mockgen -destination=./mock_engine.go -package=engine -self_package github.com/radius-project/radius/pkg/recipes/engine github.com/radius-project/radius/pkg/recipes/engine Engine type Engine interface { // Execute gathers environment configuration, recipe definition and calls the driver to deploy the recipe. diff --git a/pkg/recipes/error.go b/pkg/recipes/error.go index ca6b5f50f6..b03b7f373f 100644 --- a/pkg/recipes/error.go +++ b/pkg/recipes/error.go @@ -16,7 +16,7 @@ package recipes import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) type RecipeError struct { diff --git a/pkg/recipes/error_test.go b/pkg/recipes/error_test.go index d50c0a0354..a9f888a61c 100644 --- a/pkg/recipes/error_test.go +++ b/pkg/recipes/error_test.go @@ -20,7 +20,7 @@ import ( "errors" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/recipecontext/context.go b/pkg/recipes/recipecontext/context.go index 3330e67197..0366a4728c 100644 --- a/pkg/recipes/recipecontext/context.go +++ b/pkg/recipes/recipecontext/context.go @@ -19,11 +19,11 @@ package recipecontext import ( "fmt" - coredm "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" + coredm "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_aws "github.com/radius-project/radius/pkg/ucp/resources/aws" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" ) var ( diff --git a/pkg/recipes/recipecontext/context_test.go b/pkg/recipes/recipecontext/context_test.go index 610c9d6b1d..b7b88b540a 100644 --- a/pkg/recipes/recipecontext/context_test.go +++ b/pkg/recipes/recipecontext/context_test.go @@ -19,8 +19,8 @@ package recipecontext import ( "testing" - coredm "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" + coredm "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/recipecontext/types.go b/pkg/recipes/recipecontext/types.go index 823bd6b041..20e11a9f8b 100644 --- a/pkg/recipes/recipecontext/types.go +++ b/pkg/recipes/recipecontext/types.go @@ -17,7 +17,7 @@ limitations under the License. package recipecontext import ( - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes" ) const ( diff --git a/pkg/recipes/terraform/config/backends/kubernetes.go b/pkg/recipes/terraform/config/backends/kubernetes.go index bd6d8767c6..e91de84c80 100644 --- a/pkg/recipes/terraform/config/backends/kubernetes.go +++ b/pkg/recipes/terraform/config/backends/kubernetes.go @@ -22,8 +22,8 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/ucp/resources" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" ) diff --git a/pkg/recipes/terraform/config/backends/kubernetes_test.go b/pkg/recipes/terraform/config/backends/kubernetes_test.go index 3c16b08c91..0ad6be122f 100644 --- a/pkg/recipes/terraform/config/backends/kubernetes_test.go +++ b/pkg/recipes/terraform/config/backends/kubernetes_test.go @@ -22,7 +22,7 @@ import ( "strings" "testing" - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes" "github.com/stretchr/testify/require" "k8s.io/client-go/tools/clientcmd" ) diff --git a/pkg/recipes/terraform/config/backends/mock_backend.go b/pkg/recipes/terraform/config/backends/mock_backend.go index f9486ac932..df8df9a02c 100644 --- a/pkg/recipes/terraform/config/backends/mock_backend.go +++ b/pkg/recipes/terraform/config/backends/mock_backend.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/recipes/terraform/config/backends (interfaces: Backend) +// Source: github.com/radius-project/radius/pkg/recipes/terraform/config/backends (interfaces: Backend) // Package backends is a generated GoMock package. package backends @@ -8,7 +8,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - recipes "github.com/project-radius/radius/pkg/recipes" + recipes "github.com/radius-project/radius/pkg/recipes" ) // MockBackend is a mock of Backend interface. diff --git a/pkg/recipes/terraform/config/backends/types.go b/pkg/recipes/terraform/config/backends/types.go index 5a8e18fb0d..6e27b9c65a 100644 --- a/pkg/recipes/terraform/config/backends/types.go +++ b/pkg/recipes/terraform/config/backends/types.go @@ -17,10 +17,10 @@ limitations under the License. package backends import ( - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes" ) -//go:generate mockgen -destination=./mock_backend.go -package=backends -self_package github.com/project-radius/radius/pkg/recipes/terraform/config/backends github.com/project-radius/radius/pkg/recipes/terraform/config/backends Backend +//go:generate mockgen -destination=./mock_backend.go -package=backends -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/backends github.com/radius-project/radius/pkg/recipes/terraform/config/backends Backend // Backend is an interface for generating Terraform backend configurations. type Backend interface { diff --git a/pkg/recipes/terraform/config/config.go b/pkg/recipes/terraform/config/config.go index 416f34a034..e123029722 100644 --- a/pkg/recipes/terraform/config/config.go +++ b/pkg/recipes/terraform/config/config.go @@ -24,11 +24,11 @@ import ( "io/fs" "os" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/recipecontext" - "github.com/project-radius/radius/pkg/recipes/terraform/config/backends" - "github.com/project-radius/radius/pkg/recipes/terraform/config/providers" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/recipecontext" + "github.com/radius-project/radius/pkg/recipes/terraform/config/backends" + "github.com/radius-project/radius/pkg/recipes/terraform/config/providers" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/recipes/terraform/config/config_test.go b/pkg/recipes/terraform/config/config_test.go index e4566907ba..e86f7870c2 100644 --- a/pkg/recipes/terraform/config/config_test.go +++ b/pkg/recipes/terraform/config/config_test.go @@ -26,12 +26,12 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/recipecontext" - "github.com/project-radius/radius/pkg/recipes/terraform/config/backends" - "github.com/project-radius/radius/pkg/recipes/terraform/config/providers" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/recipecontext" + "github.com/radius-project/radius/pkg/recipes/terraform/config/backends" + "github.com/radius-project/radius/pkg/recipes/terraform/config/providers" + "github.com/radius-project/radius/test/testcontext" ) const ( diff --git a/pkg/recipes/terraform/config/providers/aws.go b/pkg/recipes/terraform/config/providers/aws.go index 129940e1e9..e00418e733 100644 --- a/pkg/recipes/terraform/config/providers/aws.go +++ b/pkg/recipes/terraform/config/providers/aws.go @@ -21,16 +21,16 @@ import ( "errors" "fmt" - "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" - "github.com/project-radius/radius/pkg/ucp/secret" - ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_aws "github.com/radius-project/radius/pkg/ucp/resources/aws" + "github.com/radius-project/radius/pkg/ucp/secret" + ucp_provider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // Provider's config parameters need to match the values expected by Terraform diff --git a/pkg/recipes/terraform/config/providers/aws_test.go b/pkg/recipes/terraform/config/providers/aws_test.go index ae1c5ebb3d..965f3d7113 100644 --- a/pkg/recipes/terraform/config/providers/aws_test.go +++ b/pkg/recipes/terraform/config/providers/aws_test.go @@ -21,12 +21,12 @@ import ( "errors" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/sdk" - ucp_credentials "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/sdk" + ucp_credentials "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/terraform/config/providers/azure.go b/pkg/recipes/terraform/config/providers/azure.go index 6431f06527..6880fe339d 100644 --- a/pkg/recipes/terraform/config/providers/azure.go +++ b/pkg/recipes/terraform/config/providers/azure.go @@ -21,16 +21,16 @@ import ( "errors" "fmt" - "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/secret" - ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/secret" + ucp_provider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // Provider's config parameters need to match the values expected by Terraform diff --git a/pkg/recipes/terraform/config/providers/azure_test.go b/pkg/recipes/terraform/config/providers/azure_test.go index be16f8f42d..9ba20ddc91 100644 --- a/pkg/recipes/terraform/config/providers/azure_test.go +++ b/pkg/recipes/terraform/config/providers/azure_test.go @@ -21,12 +21,12 @@ import ( "errors" "testing" - "github.com/project-radius/radius/pkg/corerp/datamodel" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/sdk" - ucp_credentials "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/sdk" + ucp_credentials "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/terraform/config/providers/kubernetes.go b/pkg/recipes/terraform/config/providers/kubernetes.go index 8ee8309299..e7708d4563 100644 --- a/pkg/recipes/terraform/config/providers/kubernetes.go +++ b/pkg/recipes/terraform/config/providers/kubernetes.go @@ -20,7 +20,7 @@ import ( "context" "errors" - "github.com/project-radius/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" ) diff --git a/pkg/recipes/terraform/config/providers/kubernetes_test.go b/pkg/recipes/terraform/config/providers/kubernetes_test.go index f321b87580..5c292a7cf9 100644 --- a/pkg/recipes/terraform/config/providers/kubernetes_test.go +++ b/pkg/recipes/terraform/config/providers/kubernetes_test.go @@ -19,7 +19,7 @@ package providers import ( "testing" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" "k8s.io/client-go/tools/clientcmd" ) diff --git a/pkg/recipes/terraform/config/providers/mock_provider.go b/pkg/recipes/terraform/config/providers/mock_provider.go index f45154e3bc..4934f2523b 100644 --- a/pkg/recipes/terraform/config/providers/mock_provider.go +++ b/pkg/recipes/terraform/config/providers/mock_provider.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/recipes/terraform/config/providers (interfaces: Provider) +// Source: github.com/radius-project/radius/pkg/recipes/terraform/config/providers (interfaces: Provider) // Package providers is a generated GoMock package. package providers @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - recipes "github.com/project-radius/radius/pkg/recipes" + recipes "github.com/radius-project/radius/pkg/recipes" ) // MockProvider is a mock of Provider interface. diff --git a/pkg/recipes/terraform/config/providers/types.go b/pkg/recipes/terraform/config/providers/types.go index dcee1f07ce..7a12fec82c 100644 --- a/pkg/recipes/terraform/config/providers/types.go +++ b/pkg/recipes/terraform/config/providers/types.go @@ -19,12 +19,12 @@ package providers import ( "context" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/sdk" - ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/sdk" + ucp_provider "github.com/radius-project/radius/pkg/ucp/secret/provider" ) -//go:generate mockgen -destination=./mock_provider.go -package=providers -self_package github.com/project-radius/radius/pkg/recipes/terraform/config/providers github.com/project-radius/radius/pkg/recipes/terraform/config/providers Provider +//go:generate mockgen -destination=./mock_provider.go -package=providers -self_package github.com/radius-project/radius/pkg/recipes/terraform/config/providers github.com/radius-project/radius/pkg/recipes/terraform/config/providers Provider // Provider is an interface for generating Terraform provider configurations. type Provider interface { diff --git a/pkg/recipes/terraform/execute.go b/pkg/recipes/terraform/execute.go index d070bf1c5f..7753f38386 100644 --- a/pkg/recipes/terraform/execute.go +++ b/pkg/recipes/terraform/execute.go @@ -27,15 +27,15 @@ import ( install "github.com/hashicorp/hc-install" tfjson "github.com/hashicorp/terraform-json" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/recipecontext" - "github.com/project-radius/radius/pkg/recipes/terraform/config" - "github.com/project-radius/radius/pkg/recipes/terraform/config/backends" - "github.com/project-radius/radius/pkg/recipes/terraform/config/providers" - "github.com/project-radius/radius/pkg/sdk" - ucp_provider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/recipecontext" + "github.com/radius-project/radius/pkg/recipes/terraform/config" + "github.com/radius-project/radius/pkg/recipes/terraform/config/backends" + "github.com/radius-project/radius/pkg/recipes/terraform/config/providers" + "github.com/radius-project/radius/pkg/sdk" + ucp_provider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/otel/attribute" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/recipes/terraform/execute_test.go b/pkg/recipes/terraform/execute_test.go index 72093d28b6..9b8aaa4391 100644 --- a/pkg/recipes/terraform/execute_test.go +++ b/pkg/recipes/terraform/execute_test.go @@ -21,8 +21,8 @@ import ( "path/filepath" "testing" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/terraform/install.go b/pkg/recipes/terraform/install.go index ffae120958..03bd561fd4 100644 --- a/pkg/recipes/terraform/install.go +++ b/pkg/recipes/terraform/install.go @@ -27,8 +27,8 @@ import ( "github.com/hashicorp/hc-install/product" "github.com/hashicorp/hc-install/releases" "github.com/hashicorp/hc-install/src" - "github.com/project-radius/radius/pkg/metrics" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/metrics" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/otel/attribute" ) diff --git a/pkg/recipes/terraform/mock_executor.go b/pkg/recipes/terraform/mock_executor.go index c5fc7c3dcd..da8b286811 100644 --- a/pkg/recipes/terraform/mock_executor.go +++ b/pkg/recipes/terraform/mock_executor.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/recipes/terraform (interfaces: TerraformExecutor) +// Source: github.com/radius-project/radius/pkg/recipes/terraform (interfaces: TerraformExecutor) // Package terraform is a generated GoMock package. package terraform diff --git a/pkg/recipes/terraform/module.go b/pkg/recipes/terraform/module.go index dc3fef0f09..cb07993b58 100644 --- a/pkg/recipes/terraform/module.go +++ b/pkg/recipes/terraform/module.go @@ -22,8 +22,8 @@ import ( "path/filepath" "github.com/hashicorp/terraform-config-inspect/tfconfig" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/recipes/recipecontext" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/recipecontext" ) const ( diff --git a/pkg/recipes/terraform/module_test.go b/pkg/recipes/terraform/module_test.go index acf987feda..72a29c0649 100644 --- a/pkg/recipes/terraform/module_test.go +++ b/pkg/recipes/terraform/module_test.go @@ -20,7 +20,7 @@ import ( "path/filepath" "testing" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/recipes/terraform/types.go b/pkg/recipes/terraform/types.go index 9d4b2b362b..6074caea0c 100644 --- a/pkg/recipes/terraform/types.go +++ b/pkg/recipes/terraform/types.go @@ -22,11 +22,11 @@ import ( "github.com/go-logr/logr" "github.com/hashicorp/terraform-exec/tfexec" tfjson "github.com/hashicorp/terraform-json" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) -//go:generate mockgen -destination=./mock_executor.go -package=terraform -self_package github.com/project-radius/radius/pkg/recipes/terraform github.com/project-radius/radius/pkg/recipes/terraform TerraformExecutor +//go:generate mockgen -destination=./mock_executor.go -package=terraform -self_package github.com/radius-project/radius/pkg/recipes/terraform github.com/radius-project/radius/pkg/recipes/terraform TerraformExecutor type TerraformExecutor interface { // Deploy installs terraform and runs terraform init and apply on the terraform module referenced by the recipe using terraform-exec. diff --git a/pkg/recipes/types.go b/pkg/recipes/types.go index 045b2654ea..2e0831ab35 100644 --- a/pkg/recipes/types.go +++ b/pkg/recipes/types.go @@ -21,7 +21,7 @@ import ( "encoding/json" "fmt" - "github.com/project-radius/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel" ) // Configuration represents kubernetes runtime and cloud provider configuration, which is used by the driver while deploying recipes. diff --git a/pkg/rp/frontend/resource_test.go b/pkg/rp/frontend/resource_test.go index 9f086ff48e..9c0e6dd66e 100644 --- a/pkg/rp/frontend/resource_test.go +++ b/pkg/rp/frontend/resource_test.go @@ -17,9 +17,9 @@ limitations under the License. package frontend import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" ) const ( diff --git a/pkg/rp/frontend/validator.go b/pkg/rp/frontend/validator.go index 6b6b17839b..27f89fa2a6 100644 --- a/pkg/rp/frontend/validator.go +++ b/pkg/rp/frontend/validator.go @@ -19,11 +19,11 @@ package frontend import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) // PrepareRadiusResource validates the Radius resource and prepare new resource data. diff --git a/pkg/rp/frontend/validator_test.go b/pkg/rp/frontend/validator_test.go index 83d7500305..b660e56634 100644 --- a/pkg/rp/frontend/validator_test.go +++ b/pkg/rp/frontend/validator_test.go @@ -20,12 +20,12 @@ import ( "context" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/daprrp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/test/k8sutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/daprrp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/rp/kube/kubernetesmetadata.go b/pkg/rp/kube/kubernetesmetadata.go index fb6f0254cd..e36e584fe7 100644 --- a/pkg/rp/kube/kubernetesmetadata.go +++ b/pkg/rp/kube/kubernetesmetadata.go @@ -19,7 +19,7 @@ package kube import ( "strings" - "github.com/project-radius/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/kubernetes" "k8s.io/apimachinery/pkg/labels" ) diff --git a/pkg/rp/kube/resources.go b/pkg/rp/kube/resources.go index c2bdc989ae..59c418a6df 100644 --- a/pkg/rp/kube/resources.go +++ b/pkg/rp/kube/resources.go @@ -21,12 +21,12 @@ import ( "errors" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - cdm "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + cdm "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/resources" ) // FindNamespaceByEnvID finds the environment-scope Kubernetes namespace. If the environment ID is invalid or the environment is not a Kubernetes diff --git a/pkg/rp/kube/resources_test.go b/pkg/rp/kube/resources_test.go index 7eb582dc40..d6c3f10d0b 100644 --- a/pkg/rp/kube/resources_test.go +++ b/pkg/rp/kube/resources_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - model "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + model "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/rp/util/application.go b/pkg/rp/util/application.go index f9f40d86a1..db0feefa85 100644 --- a/pkg/rp/util/application.go +++ b/pkg/rp/util/application.go @@ -20,9 +20,9 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - resources "github.com/project-radius/radius/pkg/ucp/resources" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + resources "github.com/radius-project/radius/pkg/ucp/resources" ) // FetchApplication fetches an application resource from the Azure Resource Manager using the given application ID and diff --git a/pkg/rp/util/datastore.go b/pkg/rp/util/datastore.go index 83c30cad58..5aa2306221 100644 --- a/pkg/rp/util/datastore.go +++ b/pkg/rp/util/datastore.go @@ -22,10 +22,10 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - resources "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + resources "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) // FetchScopeResource checks if the given scopeID is a valid resource ID for the given resource type, fetches the resource diff --git a/pkg/rp/util/environment.go b/pkg/rp/util/environment.go index 9a663125dd..00bec92f23 100644 --- a/pkg/rp/util/environment.go +++ b/pkg/rp/util/environment.go @@ -20,9 +20,9 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - resources "github.com/project-radius/radius/pkg/ucp/resources" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + resources "github.com/radius-project/radius/pkg/ucp/resources" ) // FetchEnvironment fetches an environment resource using the provided environmentID and ClientOptions, diff --git a/pkg/rp/util/registry.go b/pkg/rp/util/registry.go index f0873620e9..a7886708bd 100644 --- a/pkg/rp/util/registry.go +++ b/pkg/rp/util/registry.go @@ -22,8 +22,8 @@ import ( "fmt" dockerParser "github.com/novln/docker-parser" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/recipes" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/recipes" "oras.land/oras-go/v2/content" "oras.land/oras-go/v2/registry/remote" ) diff --git a/pkg/rp/v1/outputresource.go b/pkg/rp/v1/outputresource.go index 0223f93052..695a8a19e7 100644 --- a/pkg/rp/v1/outputresource.go +++ b/pkg/rp/v1/outputresource.go @@ -19,10 +19,10 @@ package v1 import ( "errors" - "github.com/project-radius/radius/pkg/algorithm/graph" - "github.com/project-radius/radius/pkg/resourcemodel" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/algorithm/graph" + "github.com/radius-project/radius/pkg/resourcemodel" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/pkg/rp/v1/outputresource_test.go b/pkg/rp/v1/outputresource_test.go index 061092141b..bba4876936 100644 --- a/pkg/rp/v1/outputresource_test.go +++ b/pkg/rp/v1/outputresource_test.go @@ -19,8 +19,8 @@ package v1 import ( "testing" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_kubernetes "github.com/project-radius/radius/pkg/ucp/resources/kubernetes" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "github.com/stretchr/testify/require" ) diff --git a/pkg/rp/v1/types.go b/pkg/rp/v1/types.go index c9f8efa161..b801e2e342 100644 --- a/pkg/rp/v1/types.go +++ b/pkg/rp/v1/types.go @@ -19,7 +19,7 @@ package v1 import ( "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) // EnvironmentComputeKind is the type of compute resource. diff --git a/pkg/sdk/clients/resourcedeploymentoperationsclient.go b/pkg/sdk/clients/resourcedeploymentoperationsclient.go index dd3d8ccc46..ac838dfd40 100644 --- a/pkg/sdk/clients/resourcedeploymentoperationsclient.go +++ b/pkg/sdk/clients/resourcedeploymentoperationsclient.go @@ -22,7 +22,7 @@ import ( "net/http" "strconv" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/to" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" diff --git a/pkg/sdk/clients/resourcedeploymentsclient.go b/pkg/sdk/clients/resourcedeploymentsclient.go index 81f4a0aacb..11a3a2b72a 100644 --- a/pkg/sdk/clients/resourcedeploymentsclient.go +++ b/pkg/sdk/clients/resourcedeploymentsclient.go @@ -27,7 +27,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" ) type Deployment struct { diff --git a/pkg/trace/util.go b/pkg/trace/util.go index eb49cc56ae..f2add31453 100644 --- a/pkg/trace/util.go +++ b/pkg/trace/util.go @@ -18,7 +18,7 @@ package trace import ( "context" - ctrl "github.com/project-radius/radius/pkg/armrpc/asyncoperation/controller" + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" otelcodes "go.opentelemetry.io/otel/codes" diff --git a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go index 0ae71d435f..f129b478f3 100644 --- a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go +++ b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go @@ -21,8 +21,8 @@ import ( azto "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/go-autorest/autorest/to" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) const ( diff --git a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go index 2e34c110e2..7b82896dc5 100644 --- a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go @@ -21,9 +21,9 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/stretchr/testify/require" diff --git a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go index 635622b7e8..61fa156d69 100644 --- a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go +++ b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go @@ -19,9 +19,9 @@ package v20220901privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) const ( diff --git a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go index c623108063..11786d899b 100644 --- a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/api/v20220901privatepreview/plane_conversion.go b/pkg/ucp/api/v20220901privatepreview/plane_conversion.go index b20f65d829..443f0743a0 100644 --- a/pkg/ucp/api/v20220901privatepreview/plane_conversion.go +++ b/pkg/ucp/api/v20220901privatepreview/plane_conversion.go @@ -19,10 +19,10 @@ package v20220901privatepreview import ( "fmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) // ConvertTo converts from the versioned Plane resource to version-agnostic datamodel. diff --git a/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go index 001d6b1e96..d2c7ba8037 100644 --- a/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/plane_conversion_test.go @@ -21,11 +21,11 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion.go b/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion.go index 3faf7e4481..c240115bd1 100644 --- a/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion.go +++ b/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion.go @@ -17,9 +17,9 @@ limitations under the License. package v20220901privatepreview import ( - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) const ( diff --git a/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go index 87f377a983..1ff898a1ce 100644 --- a/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/resourcegroup_conversion_test.go @@ -20,11 +20,11 @@ import ( "encoding/json" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/test/testutil" - "github.com/project-radius/radius/test/testutil/resourcetypeutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/test/testutil" + "github.com/radius-project/radius/test/testutil/resourcetypeutil" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/aws/cloudcontrolclient.go b/pkg/ucp/aws/cloudcontrolclient.go index 7346626844..8c31132f1a 100644 --- a/pkg/ucp/aws/cloudcontrolclient.go +++ b/pkg/ucp/aws/cloudcontrolclient.go @@ -25,7 +25,7 @@ import ( // Didn't see an interface for aws-sdk-go-v2, v1 had: https://pkg.go.dev/github.com/aws/aws-sdk-go/service/cloudcontrolapi/cloudcontrolapiiface // This is most likely due to using json schemas to define types rather than crafting by hand. There are significantly less functions in v2, so a small mock. // -//go:generate mockgen -destination=./mock_awscloudcontrolclient.go -package=aws -self_package github.com/project-radius/radius/pkg/ucp/aws github.com/project-radius/radius/pkg/ucp/aws AWSCloudControlClient +//go:generate mockgen -destination=./mock_awscloudcontrolclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudControlClient type AWSCloudControlClient interface { GetResource(ctx context.Context, params *cloudcontrol.GetResourceInput, optFns ...func(*cloudcontrol.Options)) (*cloudcontrol.GetResourceOutput, error) ListResources(ctx context.Context, params *cloudcontrol.ListResourcesInput, optFns ...func(*cloudcontrol.Options)) (*cloudcontrol.ListResourcesOutput, error) diff --git a/pkg/ucp/aws/cloudformationclient.go b/pkg/ucp/aws/cloudformationclient.go index 4b9fe723ca..4658297a10 100644 --- a/pkg/ucp/aws/cloudformationclient.go +++ b/pkg/ucp/aws/cloudformationclient.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" ) -//go:generate mockgen -destination=./mock_awscloudformationclient.go -package=aws -self_package github.com/project-radius/radius/pkg/ucp/aws github.com/project-radius/radius/pkg/ucp/aws AWSCloudFormationClient +//go:generate mockgen -destination=./mock_awscloudformationclient.go -package=aws -self_package github.com/radius-project/radius/pkg/ucp/aws github.com/radius-project/radius/pkg/ucp/aws AWSCloudFormationClient type AWSCloudFormationClient interface { DescribeType(ctx context.Context, params *cloudformation.DescribeTypeInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeTypeOutput, error) } diff --git a/pkg/ucp/aws/errorhandler.go b/pkg/ucp/aws/errorhandler.go index 3c0ff83251..130af3d3d7 100644 --- a/pkg/ucp/aws/errorhandler.go +++ b/pkg/ucp/aws/errorhandler.go @@ -22,8 +22,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" "github.com/aws/smithy-go" smithyhttp "github.com/aws/smithy-go/transport/http" - armrpc_v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" + armrpc_v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" ) // HandleAWSError takes in an error and returns an ARMResponse and an error. It checks the error type and returns an diff --git a/pkg/ucp/aws/mock_awscloudcontrolclient.go b/pkg/ucp/aws/mock_awscloudcontrolclient.go index b3e9a251e7..d58fecccb0 100644 --- a/pkg/ucp/aws/mock_awscloudcontrolclient.go +++ b/pkg/ucp/aws/mock_awscloudcontrolclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/ucp/aws (interfaces: AWSCloudControlClient) +// Source: github.com/radius-project/radius/pkg/ucp/aws (interfaces: AWSCloudControlClient) // Package aws is a generated GoMock package. package aws diff --git a/pkg/ucp/aws/mock_awscloudformationclient.go b/pkg/ucp/aws/mock_awscloudformationclient.go index a6b8e62f49..eaeacf97c1 100644 --- a/pkg/ucp/aws/mock_awscloudformationclient.go +++ b/pkg/ucp/aws/mock_awscloudformationclient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/ucp/aws (interfaces: AWSCloudFormationClient) +// Source: github.com/radius-project/radius/pkg/ucp/aws (interfaces: AWSCloudFormationClient) // Package aws is a generated GoMock package. package aws diff --git a/pkg/ucp/aws/servicecontext/awsrequestcontext.go b/pkg/ucp/aws/servicecontext/awsrequestcontext.go index 850b5d4c18..a250562374 100644 --- a/pkg/ucp/aws/servicecontext/awsrequestcontext.go +++ b/pkg/ucp/aws/servicecontext/awsrequestcontext.go @@ -19,8 +19,8 @@ package servicecontext import ( "context" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + resources_aws "github.com/radius-project/radius/pkg/ucp/resources/aws" ) // AWSRequestContext is the context for AWS request. diff --git a/pkg/ucp/aws/servicecontext/awsrequestcontext_test.go b/pkg/ucp/aws/servicecontext/awsrequestcontext_test.go index f9bb588755..04c2e72300 100644 --- a/pkg/ucp/aws/servicecontext/awsrequestcontext_test.go +++ b/pkg/ucp/aws/servicecontext/awsrequestcontext_test.go @@ -24,7 +24,7 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/aws/ucpcredentialprovider.go b/pkg/ucp/aws/ucpcredentialprovider.go index a803c44629..c77b8055dc 100644 --- a/pkg/ucp/aws/ucpcredentialprovider.go +++ b/pkg/ucp/aws/ucpcredentialprovider.go @@ -24,8 +24,8 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/ucplog" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ aws.CredentialsProvider = (*UCPCredentialProvider)(nil) diff --git a/pkg/ucp/aws/ucpcredentialprovider_test.go b/pkg/ucp/aws/ucpcredentialprovider_test.go index 412841379b..bb5e9fb8d4 100644 --- a/pkg/ucp/aws/ucpcredentialprovider_test.go +++ b/pkg/ucp/aws/ucpcredentialprovider_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" ) type mockProvider struct { diff --git a/pkg/ucp/backend/service.go b/pkg/ucp/backend/service.go index 12846f10d1..ad3039e447 100644 --- a/pkg/ucp/backend/service.go +++ b/pkg/ucp/backend/service.go @@ -20,8 +20,8 @@ import ( "context" "fmt" - "github.com/project-radius/radius/pkg/armrpc/asyncoperation/worker" - "github.com/project-radius/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" ) const ( diff --git a/pkg/ucp/config/ucpoptions.go b/pkg/ucp/config/ucpoptions.go index 33a781bae0..57583033ae 100644 --- a/pkg/ucp/config/ucpoptions.go +++ b/pkg/ucp/config/ucpoptions.go @@ -19,7 +19,7 @@ package config import ( "errors" - "github.com/project-radius/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/sdk" "k8s.io/client-go/rest" ) diff --git a/pkg/ucp/credentials/aws.go b/pkg/ucp/credentials/aws.go index 73d8c42506..3c08d14737 100644 --- a/pkg/ucp/credentials/aws.go +++ b/pkg/ucp/credentials/aws.go @@ -22,11 +22,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/to" - ucpapi "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/to" + ucpapi "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/secret/provider" ) var _ CredentialProvider[AWSCredential] = (*AWSCredentialProvider)(nil) diff --git a/pkg/ucp/credentials/azure.go b/pkg/ucp/credentials/azure.go index de9f96be50..a2490a274a 100644 --- a/pkg/ucp/credentials/azure.go +++ b/pkg/ucp/credentials/azure.go @@ -22,11 +22,11 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/to" - ucpapi "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/to" + ucpapi "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/secret/provider" ) var _ CredentialProvider[AzureCredential] = (*AzureCredentialProvider)(nil) diff --git a/pkg/ucp/credentials/types.go b/pkg/ucp/credentials/types.go index 2eb9a29a12..2303bead61 100644 --- a/pkg/ucp/credentials/types.go +++ b/pkg/ucp/credentials/types.go @@ -19,7 +19,7 @@ package credentials import ( "context" - ucp_dm "github.com/project-radius/radius/pkg/ucp/datamodel" + ucp_dm "github.com/radius-project/radius/pkg/ucp/datamodel" ) const ( diff --git a/pkg/ucp/data/etcd.go b/pkg/ucp/data/etcd.go index f752d96463..46f041696e 100644 --- a/pkg/ucp/data/etcd.go +++ b/pkg/ucp/data/etcd.go @@ -25,8 +25,8 @@ import ( "strings" "time" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/ucplog" etcdclient "go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/server/v3/embed" ) diff --git a/pkg/ucp/datamodel/awsresource.go b/pkg/ucp/datamodel/awsresource.go index 9c04481e28..f62d90e34b 100644 --- a/pkg/ucp/datamodel/awsresource.go +++ b/pkg/ucp/datamodel/awsresource.go @@ -16,7 +16,7 @@ limitations under the License. package datamodel -import v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" +import v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" // AWSResource represents any AWS Resource. // AWSResource is not a tracked resource, so it does not implement ResourceDataModel. diff --git a/pkg/ucp/datamodel/converter/awscredential_converter.go b/pkg/ucp/datamodel/converter/awscredential_converter.go index b2a36d8de4..195436d6bf 100644 --- a/pkg/ucp/datamodel/converter/awscredential_converter.go +++ b/pkg/ucp/datamodel/converter/awscredential_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) // AWSCredentialDataModelToVersioned converts version agnostic AWS credential datamodel to versioned model. diff --git a/pkg/ucp/datamodel/converter/azurecredential_converter.go b/pkg/ucp/datamodel/converter/azurecredential_converter.go index 3e0231b562..30247171c3 100644 --- a/pkg/ucp/datamodel/converter/azurecredential_converter.go +++ b/pkg/ucp/datamodel/converter/azurecredential_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) // AzureCredentialDataModelToVersioned converts version agnostic Azure credential datamodel to versioned model. diff --git a/pkg/ucp/datamodel/converter/plane_converter.go b/pkg/ucp/datamodel/converter/plane_converter.go index d9c856934b..7af1a042cc 100644 --- a/pkg/ucp/datamodel/converter/plane_converter.go +++ b/pkg/ucp/datamodel/converter/plane_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) // PlaneDataModelToVersioned converts version agnostic plane datamodel to versioned model. diff --git a/pkg/ucp/datamodel/converter/resourcegroup_converter.go b/pkg/ucp/datamodel/converter/resourcegroup_converter.go index 7e4ab22422..66a4782543 100644 --- a/pkg/ucp/datamodel/converter/resourcegroup_converter.go +++ b/pkg/ucp/datamodel/converter/resourcegroup_converter.go @@ -19,9 +19,9 @@ package converter import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) // ResourceGroupDataModelToVersioned converts version agnostic environment datamodel to versioned model. diff --git a/pkg/ucp/datamodel/credential.go b/pkg/ucp/datamodel/credential.go index 8149ad444a..921308f1a3 100644 --- a/pkg/ucp/datamodel/credential.go +++ b/pkg/ucp/datamodel/credential.go @@ -16,7 +16,7 @@ limitations under the License. package datamodel -import v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" +import v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" const ( // InternalStorageKind represents ucp credential storage type for internal credential type diff --git a/pkg/ucp/datamodel/plane.go b/pkg/ucp/datamodel/plane.go index 668da5462c..39191e2812 100644 --- a/pkg/ucp/datamodel/plane.go +++ b/pkg/ucp/datamodel/plane.go @@ -19,7 +19,7 @@ package datamodel import ( "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) type PlaneKind string diff --git a/pkg/ucp/datamodel/resourcegroup.go b/pkg/ucp/datamodel/resourcegroup.go index d6bc906ba7..0272b954a6 100644 --- a/pkg/ucp/datamodel/resourcegroup.go +++ b/pkg/ucp/datamodel/resourcegroup.go @@ -16,7 +16,7 @@ limitations under the License. package datamodel -import v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" +import v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" // ResourceGroup represents UCP ResourceGroup. type ResourceGroup struct { diff --git a/pkg/ucp/dataprovider/factory.go b/pkg/ucp/dataprovider/factory.go index 1043873d6a..a5d9ee45d0 100644 --- a/pkg/ucp/dataprovider/factory.go +++ b/pkg/ucp/dataprovider/factory.go @@ -21,12 +21,12 @@ import ( "errors" "fmt" - "github.com/project-radius/radius/pkg/kubeutil" - store "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/store/apiserverstore" - ucpv1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" - "github.com/project-radius/radius/pkg/ucp/store/cosmosdb" - "github.com/project-radius/radius/pkg/ucp/store/etcdstore" + "github.com/radius-project/radius/pkg/kubeutil" + store "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/store/apiserverstore" + ucpv1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + "github.com/radius-project/radius/pkg/ucp/store/cosmosdb" + "github.com/radius-project/radius/pkg/ucp/store/etcdstore" "k8s.io/apimachinery/pkg/runtime" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/ucp/dataprovider/mock_datastorage_provider.go b/pkg/ucp/dataprovider/mock_datastorage_provider.go index 6cd44631f7..ec128fa196 100644 --- a/pkg/ucp/dataprovider/mock_datastorage_provider.go +++ b/pkg/ucp/dataprovider/mock_datastorage_provider.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/ucp/dataprovider (interfaces: DataStorageProvider) +// Source: github.com/radius-project/radius/pkg/ucp/dataprovider (interfaces: DataStorageProvider) // Package dataprovider is a generated GoMock package. package dataprovider @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - store "github.com/project-radius/radius/pkg/ucp/store" + store "github.com/radius-project/radius/pkg/ucp/store" ) // MockDataStorageProvider is a mock of DataStorageProvider interface. diff --git a/pkg/ucp/dataprovider/options.go b/pkg/ucp/dataprovider/options.go index eac87c0c0b..7494d18cb4 100644 --- a/pkg/ucp/dataprovider/options.go +++ b/pkg/ucp/dataprovider/options.go @@ -17,7 +17,7 @@ limitations under the License. package dataprovider import ( - "github.com/project-radius/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/hosting" etcdclient "go.etcd.io/etcd/client/v3" ) diff --git a/pkg/ucp/dataprovider/storageprovider.go b/pkg/ucp/dataprovider/storageprovider.go index cce9cff948..ce90641bd5 100644 --- a/pkg/ucp/dataprovider/storageprovider.go +++ b/pkg/ucp/dataprovider/storageprovider.go @@ -21,8 +21,8 @@ import ( "errors" "sync" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/util" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/util" ) var ( diff --git a/pkg/ucp/dataprovider/types.go b/pkg/ucp/dataprovider/types.go index f2b002db46..54e1b2619b 100644 --- a/pkg/ucp/dataprovider/types.go +++ b/pkg/ucp/dataprovider/types.go @@ -19,7 +19,7 @@ package dataprovider import ( "context" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/store" ) // StorageProviderType represents types of storage provider. @@ -36,7 +36,7 @@ const ( TypeETCD StorageProviderType = "etcd" ) -//go:generate mockgen -destination=./mock_datastorage_provider.go -package=dataprovider -self_package github.com/project-radius/radius/pkg/ucp/dataprovider github.com/project-radius/radius/pkg/ucp/dataprovider DataStorageProvider +//go:generate mockgen -destination=./mock_datastorage_provider.go -package=dataprovider -self_package github.com/radius-project/radius/pkg/ucp/dataprovider github.com/radius-project/radius/pkg/ucp/dataprovider DataStorageProvider // DataStorageProvider is an interfae to provide storage client. type DataStorageProvider interface { diff --git a/pkg/ucp/frontend/api/routes.go b/pkg/ucp/frontend/api/routes.go index 1cf395a3eb..7a2ad92ae0 100644 --- a/pkg/ucp/frontend/api/routes.go +++ b/pkg/ucp/frontend/api/routes.go @@ -23,17 +23,17 @@ import ( "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - kubernetes_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/kubernetes" - planes_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/planes" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "github.com/project-radius/radius/pkg/validator" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + kubernetes_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/kubernetes" + planes_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/planes" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/validator" ) const ( diff --git a/pkg/ucp/frontend/api/routes_test.go b/pkg/ucp/frontend/api/routes_test.go index 53ddf399f3..8728540e2e 100644 --- a/pkg/ucp/frontend/api/routes_test.go +++ b/pkg/ucp/frontend/api/routes_test.go @@ -23,10 +23,10 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" ) func Test_Routes(t *testing.T) { diff --git a/pkg/ucp/frontend/api/server.go b/pkg/ucp/frontend/api/server.go index 00c0592c0e..7c3fa20045 100644 --- a/pkg/ucp/frontend/api/server.go +++ b/pkg/ucp/frontend/api/server.go @@ -24,28 +24,28 @@ import ( "net" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/servicecontext" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - aws_frontend "github.com/project-radius/radius/pkg/ucp/frontend/aws" - azure_frontend "github.com/project-radius/radius/pkg/ucp/frontend/azure" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - radius_frontend "github.com/project-radius/radius/pkg/ucp/frontend/radius" - "github.com/project-radius/radius/pkg/ucp/frontend/versions" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - queueprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - "github.com/project-radius/radius/pkg/ucp/rest" - secretprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "github.com/project-radius/radius/pkg/validator" - "github.com/project-radius/radius/swagger" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/servicecontext" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + aws_frontend "github.com/radius-project/radius/pkg/ucp/frontend/aws" + azure_frontend "github.com/radius-project/radius/pkg/ucp/frontend/azure" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + radius_frontend "github.com/radius-project/radius/pkg/ucp/frontend/radius" + "github.com/radius-project/radius/pkg/ucp/frontend/versions" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + queueprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + "github.com/radius-project/radius/pkg/ucp/rest" + secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/validator" + "github.com/radius-project/radius/swagger" "github.com/go-chi/chi/v5" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" @@ -171,7 +171,7 @@ func (s *Service) Initialize(ctx context.Context) (*http.Server, error) { // Need to be able to respond to requests with planes and resourcegroups segments with any casing e.g.: /Planes, /resourceGroups // AWS SDK is case sensitive. Therefore, cannot use lowercase middleware. Therefore, introducing a new middleware that translates // the path for only these segments and preserves the case for the other parts of the path. - // TODO: https://github.com/project-radius/radius/issues/5921 + // TODO: https://github.com/radius-project/radius/issues/5921 Handler: app, BaseContext: func(ln net.Listener) context.Context { return ctx diff --git a/pkg/ucp/frontend/aws/module.go b/pkg/ucp/frontend/aws/module.go index 8689bc338e..49e5f31646 100644 --- a/pkg/ucp/frontend/aws/module.go +++ b/pkg/ucp/frontend/aws/module.go @@ -18,9 +18,9 @@ package aws import ( "github.com/go-chi/chi/v5" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/validator" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/validator" ) // NewModule creates a new AWS module. diff --git a/pkg/ucp/frontend/aws/routes.go b/pkg/ucp/frontend/aws/routes.go index 7d2710b537..85cc8e609a 100644 --- a/pkg/ucp/frontend/aws/routes.go +++ b/pkg/ucp/frontend/aws/routes.go @@ -24,21 +24,21 @@ import ( "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudformation" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - sdk_cred "github.com/project-radius/radius/pkg/ucp/credentials" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - awsproxy_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/awsproxy" - aws_credential_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/credentials/aws" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "github.com/project-radius/radius/pkg/validator" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + sdk_cred "github.com/radius-project/radius/pkg/ucp/credentials" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + awsproxy_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/awsproxy" + aws_credential_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/credentials/aws" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + "github.com/radius-project/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/validator" ) const ( diff --git a/pkg/ucp/frontend/aws/routes_test.go b/pkg/ucp/frontend/aws/routes_test.go index a4e3b23e98..0549bc3387 100644 --- a/pkg/ucp/frontend/aws/routes_test.go +++ b/pkg/ucp/frontend/aws/routes_test.go @@ -24,14 +24,14 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - "github.com/project-radius/radius/pkg/ucp/secret" - secretprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + "github.com/radius-project/radius/pkg/ucp/secret" + secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" ) const pathBase = "/some-path-base" diff --git a/pkg/ucp/frontend/azure/module.go b/pkg/ucp/frontend/azure/module.go index c7aca3d774..d956d6ce30 100644 --- a/pkg/ucp/frontend/azure/module.go +++ b/pkg/ucp/frontend/azure/module.go @@ -18,8 +18,8 @@ package azure import ( "github.com/go-chi/chi/v5" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/validator" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/validator" ) // NewModule creates a new Azure module. diff --git a/pkg/ucp/frontend/azure/routes.go b/pkg/ucp/frontend/azure/routes.go index b301d6e4e8..c0c45b6d80 100644 --- a/pkg/ucp/frontend/azure/routes.go +++ b/pkg/ucp/frontend/azure/routes.go @@ -20,16 +20,16 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - azure_credential_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/credentials/azure" - planes_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/planes" - "github.com/project-radius/radius/pkg/validator" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + azure_credential_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/credentials/azure" + planes_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/planes" + "github.com/radius-project/radius/pkg/validator" ) const ( diff --git a/pkg/ucp/frontend/azure/routes_test.go b/pkg/ucp/frontend/azure/routes_test.go index 6a2df68708..6906152b67 100644 --- a/pkg/ucp/frontend/azure/routes_test.go +++ b/pkg/ucp/frontend/azure/routes_test.go @@ -24,14 +24,14 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - "github.com/project-radius/radius/pkg/ucp/secret" - secretprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + "github.com/radius-project/radius/pkg/ucp/secret" + secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" ) const pathBase = "/some-path-base" diff --git a/pkg/ucp/frontend/controller/awsproxy/awsparsing.go b/pkg/ucp/frontend/controller/awsproxy/awsparsing.go index 0fdce60576..c471836c2d 100644 --- a/pkg/ucp/frontend/controller/awsproxy/awsparsing.go +++ b/pkg/ucp/frontend/controller/awsproxy/awsparsing.go @@ -23,12 +23,12 @@ import ( "net/http" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - awsoperations "github.com/project-radius/radius/pkg/aws/operations" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + awsoperations "github.com/radius-project/radius/pkg/aws/operations" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_aws "github.com/radius-project/radius/pkg/ucp/resources/aws" ) // getPrimaryIdentifiersFromSchema returns the primaryIdentifier field from the diff --git a/pkg/ucp/frontend/controller/awsproxy/awsparsing_test.go b/pkg/ucp/frontend/controller/awsproxy/awsparsing_test.go index 3a78af312d..b91418c399 100644 --- a/pkg/ucp/frontend/controller/awsproxy/awsparsing_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/awsparsing_test.go @@ -21,7 +21,7 @@ import ( "encoding/json" "testing" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/awsproxytest.go b/pkg/ucp/frontend/controller/awsproxy/awsproxytest.go index 4a52a5ce24..417cf5d15a 100644 --- a/pkg/ucp/frontend/controller/awsproxy/awsproxytest.go +++ b/pkg/ucp/frontend/controller/awsproxy/awsproxytest.go @@ -22,9 +22,9 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/store" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" ) const ( diff --git a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource.go b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource.go index a6c9e969ac..aca9f6c88d 100644 --- a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource.go +++ b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource.go @@ -25,14 +25,14 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - awsoperations "github.com/project-radius/radius/pkg/aws/operations" - "github.com/project-radius/radius/pkg/to" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + awsoperations "github.com/radius-project/radius/pkg/aws/operations" + "github.com/radius-project/radius/pkg/to" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) var _ armrpc_controller.Controller = (*CreateOrUpdateAWSResource)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource_test.go b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource_test.go index 825513fa82..e7207f8228 100644 --- a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresource_test.go @@ -29,10 +29,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost.go b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost.go index 3bd186c806..55eed3453b 100644 --- a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost.go +++ b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost.go @@ -27,15 +27,15 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - awsoperations "github.com/project-radius/radius/pkg/aws/operations" - "github.com/project-radius/radius/pkg/to" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + awsoperations "github.com/radius-project/radius/pkg/aws/operations" + "github.com/radius-project/radius/pkg/to" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*CreateOrUpdateAWSResourceWithPost)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost_test.go b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost_test.go index 0aa807f38a..a7dd6f8042 100644 --- a/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/createorupdateawsresourcewithpost_test.go @@ -29,10 +29,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/resources" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/deleteawsresource.go b/pkg/ucp/frontend/controller/awsproxy/deleteawsresource.go index 9647a88f83..075ce4b429 100644 --- a/pkg/ucp/frontend/controller/awsproxy/deleteawsresource.go +++ b/pkg/ucp/frontend/controller/awsproxy/deleteawsresource.go @@ -22,13 +22,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/to" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/to" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) var _ armrpc_controller.Controller = (*DeleteAWSResource)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/deleteawsresource_test.go b/pkg/ucp/frontend/controller/awsproxy/deleteawsresource_test.go index 25a3248c81..21afc1a937 100644 --- a/pkg/ucp/frontend/controller/awsproxy/deleteawsresource_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/deleteawsresource_test.go @@ -26,9 +26,9 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost.go b/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost.go index 8ed6bb1047..a9fca38094 100644 --- a/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost.go +++ b/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost.go @@ -24,15 +24,15 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/to" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/to" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*DeleteAWSResourceWithPost)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost_test.go b/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost_test.go index 4b7b553522..15b0cc0fd8 100644 --- a/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/deleteawsresourcewithpost_test.go @@ -29,10 +29,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/golang/mock/gomock" "github.com/google/uuid" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rpctest" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults.go b/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults.go index c2ca6cf625..59a31df829 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults.go @@ -22,13 +22,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" - armrpcv1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" + armrpcv1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) var _ armrpc_controller.Controller = (*GetAWSOperationResults)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults_test.go b/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults_test.go index 1f0c3a891a..f01c52b216 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsoperationresults_test.go @@ -26,10 +26,10 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses.go b/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses.go index 300c43ae4d..6dc9933584 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses.go @@ -22,14 +22,14 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" - armrpcv1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - manager "github.com/project-radius/radius/pkg/armrpc/asyncoperation/statusmanager" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" + armrpcv1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) var _ armrpc_controller.Controller = (*GetAWSOperationStatuses)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses_test.go b/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses_test.go index 3f65fce533..a4761d4560 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsoperationstatuses_test.go @@ -26,11 +26,11 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsresource.go b/pkg/ucp/frontend/controller/awsproxy/getawsresource.go index 37c0936c5d..8c3131e3b6 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsresource.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsresource.go @@ -22,13 +22,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/to" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/to" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) var _ armrpc_controller.Controller = (*GetAWSResource)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsresource_test.go b/pkg/ucp/frontend/controller/awsproxy/getawsresource_test.go index 4008301e2b..0ad89bf132 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsresource_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsresource_test.go @@ -29,12 +29,12 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/resources" + armrpc_v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost.go b/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost.go index e7664c6116..e60b63492a 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost.go @@ -26,16 +26,16 @@ import ( "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/to" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/to" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*GetAWSResourceWithPost)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost_test.go b/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost_test.go index 006a58db22..8cb8c2d73a 100644 --- a/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/getawsresourcewithpost_test.go @@ -34,12 +34,12 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/resources" + armrpc_v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/awsproxy/listawsresources.go b/pkg/ucp/frontend/controller/awsproxy/listawsresources.go index 78854dc0ef..2b9f4acf81 100644 --- a/pkg/ucp/frontend/controller/awsproxy/listawsresources.go +++ b/pkg/ucp/frontend/controller/awsproxy/listawsresources.go @@ -22,13 +22,13 @@ import ( "path" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/to" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/aws/servicecontext" - "github.com/project-radius/radius/pkg/ucp/datamodel" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/to" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/aws/servicecontext" + "github.com/radius-project/radius/pkg/ucp/datamodel" ) var _ armrpc_controller.Controller = (*ListAWSResources)(nil) diff --git a/pkg/ucp/frontend/controller/awsproxy/listawsresources_test.go b/pkg/ucp/frontend/controller/awsproxy/listawsresources_test.go index d56e4121e3..4a0c428879 100644 --- a/pkg/ucp/frontend/controller/awsproxy/listawsresources_test.go +++ b/pkg/ucp/frontend/controller/awsproxy/listawsresources_test.go @@ -29,11 +29,11 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - armrpc_v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" + armrpc_v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential.go b/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential.go index e61588a0aa..edcab9e37f 100644 --- a/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential.go +++ b/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential.go @@ -19,13 +19,13 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/frontend/controller/credentials" - "github.com/project-radius/radius/pkg/ucp/secret" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/frontend/controller/credentials" + "github.com/radius-project/radius/pkg/ucp/secret" ) var _ armrpc_controller.Controller = (*CreateOrUpdateAWSCredential)(nil) diff --git a/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go b/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go index 102f889913..db47e039d2 100644 --- a/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go +++ b/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go @@ -22,17 +22,17 @@ import ( "net/http" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential.go b/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential.go index 7a975daba1..ed4800f74e 100644 --- a/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential.go +++ b/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential.go @@ -21,16 +21,16 @@ import ( "fmt" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/frontend/controller/credentials" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/frontend/controller/credentials" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*DeleteAWSCredential)(nil) diff --git a/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential_test.go b/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential_test.go index bf0a358c10..7274fd39d7 100644 --- a/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential_test.go +++ b/pkg/ucp/frontend/controller/credentials/aws/deleteawscredential_test.go @@ -22,14 +22,14 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/rest" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential.go b/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential.go index dee0844cc6..1149e5134d 100644 --- a/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential.go +++ b/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential.go @@ -19,13 +19,13 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/frontend/controller/credentials" - "github.com/project-radius/radius/pkg/ucp/secret" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/frontend/controller/credentials" + "github.com/radius-project/radius/pkg/ucp/secret" ) var _ armrpc_controller.Controller = (*CreateOrUpdateAzureCredential)(nil) diff --git a/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go b/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go index 8602c70e32..1ee1440fd1 100644 --- a/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go +++ b/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go @@ -22,17 +22,17 @@ import ( "net/http" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential.go b/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential.go index c79e61ec05..896d936304 100644 --- a/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential.go +++ b/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential.go @@ -21,15 +21,15 @@ import ( "fmt" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/frontend/controller/credentials" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/frontend/controller/credentials" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*DeleteAzureCredential)(nil) diff --git a/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential_test.go b/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential_test.go index c3e6f2529c..ef6ae7ec6b 100644 --- a/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential_test.go +++ b/pkg/ucp/frontend/controller/credentials/azure/deleteazurecredential_test.go @@ -22,13 +22,13 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/credentials/utils.go b/pkg/ucp/frontend/controller/credentials/utils.go index 255c253a23..ab97650422 100644 --- a/pkg/ucp/frontend/controller/credentials/utils.go +++ b/pkg/ucp/frontend/controller/credentials/utils.go @@ -18,8 +18,8 @@ package credentials import ( "strings" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/ucp/resources" ) // GetSecretName takes in a resources.ID and returns a string which is the normalized name of the resource. diff --git a/pkg/ucp/frontend/controller/credentials/utils_test.go b/pkg/ucp/frontend/controller/credentials/utils_test.go index 67e92f3c14..def7234efc 100644 --- a/pkg/ucp/frontend/controller/credentials/utils_test.go +++ b/pkg/ucp/frontend/controller/credentials/utils_test.go @@ -18,7 +18,7 @@ package credentials import ( "testing" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/kubernetes/discoverydoc.go b/pkg/ucp/frontend/controller/kubernetes/discoverydoc.go index cf37efd95f..681e7f4944 100644 --- a/pkg/ucp/frontend/controller/kubernetes/discoverydoc.go +++ b/pkg/ucp/frontend/controller/kubernetes/discoverydoc.go @@ -20,9 +20,9 @@ import ( "encoding/json" http "net/http" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" ) var _ armrpc_controller.Controller = (*DiscoveryDoc)(nil) diff --git a/pkg/ucp/frontend/controller/kubernetes/openapiv2doc.go b/pkg/ucp/frontend/controller/kubernetes/openapiv2doc.go index 2da04e404a..0a80dedfce 100644 --- a/pkg/ucp/frontend/controller/kubernetes/openapiv2doc.go +++ b/pkg/ucp/frontend/controller/kubernetes/openapiv2doc.go @@ -20,9 +20,9 @@ import ( "encoding/json" http "net/http" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" ) var _ armrpc_controller.Controller = (*OpenAPIv2Doc)(nil) diff --git a/pkg/ucp/frontend/controller/kubernetes/openapiv3doc.go b/pkg/ucp/frontend/controller/kubernetes/openapiv3doc.go index e3c330afb6..255c0f4dab 100644 --- a/pkg/ucp/frontend/controller/kubernetes/openapiv3doc.go +++ b/pkg/ucp/frontend/controller/kubernetes/openapiv3doc.go @@ -21,9 +21,9 @@ import ( "encoding/json" http "net/http" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" ) var _ armrpc_controller.Controller = (*OpenAPIv3Doc)(nil) diff --git a/pkg/ucp/frontend/controller/planes/listplanes.go b/pkg/ucp/frontend/controller/planes/listplanes.go index d321e12547..7767493a8f 100644 --- a/pkg/ucp/frontend/controller/planes/listplanes.go +++ b/pkg/ucp/frontend/controller/planes/listplanes.go @@ -20,13 +20,13 @@ import ( "fmt" http "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*ListPlanes)(nil) diff --git a/pkg/ucp/frontend/controller/planes/listplanes_test.go b/pkg/ucp/frontend/controller/planes/listplanes_test.go index e9c00c4a9d..46d3f701e2 100644 --- a/pkg/ucp/frontend/controller/planes/listplanes_test.go +++ b/pkg/ucp/frontend/controller/planes/listplanes_test.go @@ -20,14 +20,14 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/planes/listplanesbytype.go b/pkg/ucp/frontend/controller/planes/listplanesbytype.go index fa09b8e62c..cd22fcc0d7 100644 --- a/pkg/ucp/frontend/controller/planes/listplanesbytype.go +++ b/pkg/ucp/frontend/controller/planes/listplanesbytype.go @@ -22,15 +22,15 @@ import ( http "net/http" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*ListPlanesByType)(nil) diff --git a/pkg/ucp/frontend/controller/planes/listplanesbytype_test.go b/pkg/ucp/frontend/controller/planes/listplanesbytype_test.go index c80a0e1061..269dfe5a92 100644 --- a/pkg/ucp/frontend/controller/planes/listplanesbytype_test.go +++ b/pkg/ucp/frontend/controller/planes/listplanesbytype_test.go @@ -20,14 +20,14 @@ import ( "testing" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/frontend/controller/planes/proxyplane.go b/pkg/ucp/frontend/controller/planes/proxyplane.go index 14dd6e8bc0..52ed462f7d 100644 --- a/pkg/ucp/frontend/controller/planes/proxyplane.go +++ b/pkg/ucp/frontend/controller/planes/proxyplane.go @@ -21,15 +21,15 @@ import ( http "net/http" "net/url" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/proxy" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/rest" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/proxy" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/rest" + "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) diff --git a/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups.go b/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups.go index 7b89e787c3..a7d0430dab 100644 --- a/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups.go +++ b/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups.go @@ -20,14 +20,14 @@ import ( "fmt" http "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var _ armrpc_controller.Controller = (*ListResourceGroups)(nil) diff --git a/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups_test.go b/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups_test.go index 1f17617d2c..f13816461b 100644 --- a/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups_test.go +++ b/pkg/ucp/frontend/controller/resourcegroups/listresourcegroups_test.go @@ -23,14 +23,14 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - armrpc_controller "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - armrpc_rest "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/store" ) func Test_ListResourceGroups(t *testing.T) { diff --git a/pkg/ucp/frontend/modules/errors.go b/pkg/ucp/frontend/modules/errors.go index 6c133d4bbb..4fe434a68b 100644 --- a/pkg/ucp/frontend/modules/errors.go +++ b/pkg/ucp/frontend/modules/errors.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rest" ) // InvalidPlaneTypeErrorResponse returns a 400 response with error code CodeInvalidPlaneType. diff --git a/pkg/ucp/frontend/modules/types.go b/pkg/ucp/frontend/modules/types.go index 3448d32306..a8d4cd7d05 100644 --- a/pkg/ucp/frontend/modules/types.go +++ b/pkg/ucp/frontend/modules/types.go @@ -20,12 +20,12 @@ import ( "context" "net/http" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - queueprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - secretprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/validator" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + queueprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/validator" ) // Initializer is an interface that can be implemented by modules that want to provide functionality for a plane. diff --git a/pkg/ucp/frontend/radius/module.go b/pkg/ucp/frontend/radius/module.go index ddcf781d0d..1dae8a5641 100644 --- a/pkg/ucp/frontend/radius/module.go +++ b/pkg/ucp/frontend/radius/module.go @@ -18,8 +18,8 @@ package radius import ( "github.com/go-chi/chi/v5" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/validator" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/validator" ) // NewModule creates a new Radius module. diff --git a/pkg/ucp/frontend/radius/routes.go b/pkg/ucp/frontend/radius/routes.go index 8d9dfcf60d..7fa6e70284 100644 --- a/pkg/ucp/frontend/radius/routes.go +++ b/pkg/ucp/frontend/radius/routes.go @@ -20,16 +20,16 @@ import ( "context" "net/http" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/frontend/controller" - "github.com/project-radius/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/project-radius/radius/pkg/armrpc/frontend/server" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/datamodel" - "github.com/project-radius/radius/pkg/ucp/datamodel/converter" - planes_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/planes" - resourcegroups_ctrl "github.com/project-radius/radius/pkg/ucp/frontend/controller/resourcegroups" - "github.com/project-radius/radius/pkg/validator" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + planes_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/planes" + resourcegroups_ctrl "github.com/radius-project/radius/pkg/ucp/frontend/controller/resourcegroups" + "github.com/radius-project/radius/pkg/validator" ) const ( diff --git a/pkg/ucp/frontend/radius/routes_test.go b/pkg/ucp/frontend/radius/routes_test.go index 9f62a3fad8..5e3fd67667 100644 --- a/pkg/ucp/frontend/radius/routes_test.go +++ b/pkg/ucp/frontend/radius/routes_test.go @@ -23,14 +23,14 @@ import ( "github.com/go-chi/chi/v5" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - "github.com/project-radius/radius/pkg/ucp/secret" - secretprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + "github.com/radius-project/radius/pkg/ucp/secret" + secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" ) const pathBase = "/some-path-base" diff --git a/pkg/ucp/hosting/asyncvalue_test.go b/pkg/ucp/hosting/asyncvalue_test.go index a0dd17787c..ec19d4fbe8 100644 --- a/pkg/ucp/hosting/asyncvalue_test.go +++ b/pkg/ucp/hosting/asyncvalue_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/hosting/hosting_test.go b/pkg/ucp/hosting/hosting_test.go index c6421b3e88..ceba912aac 100644 --- a/pkg/ucp/hosting/hosting_test.go +++ b/pkg/ucp/hosting/hosting_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/hostoptions/hostoptions.go b/pkg/ucp/hostoptions/hostoptions.go index 2a8be883a8..de4605bc3f 100644 --- a/pkg/ucp/hostoptions/hostoptions.go +++ b/pkg/ucp/hostoptions/hostoptions.go @@ -24,7 +24,7 @@ import ( "fmt" "os" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "gopkg.in/yaml.v3" ) diff --git a/pkg/ucp/hostoptions/providerconfig.go b/pkg/ucp/hostoptions/providerconfig.go index bcfce99972..40907d7082 100644 --- a/pkg/ucp/hostoptions/providerconfig.go +++ b/pkg/ucp/hostoptions/providerconfig.go @@ -17,15 +17,15 @@ limitations under the License. package hostoptions import ( - metricsprovider "github.com/project-radius/radius/pkg/metrics/provider" - profilerprovider "github.com/project-radius/radius/pkg/profiler/provider" - "github.com/project-radius/radius/pkg/trace" - "github.com/project-radius/radius/pkg/ucp/config" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - qprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - "github.com/project-radius/radius/pkg/ucp/rest" - "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + metricsprovider "github.com/radius-project/radius/pkg/metrics/provider" + profilerprovider "github.com/radius-project/radius/pkg/profiler/provider" + "github.com/radius-project/radius/pkg/trace" + "github.com/radius-project/radius/pkg/ucp/config" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + qprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + "github.com/radius-project/radius/pkg/ucp/rest" + "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) // UCPConfig includes the resource provider configuration. diff --git a/pkg/ucp/integrationtests/aws/awstest.go b/pkg/ucp/integrationtests/aws/awstest.go index 01b85b2cfa..039e380512 100644 --- a/pkg/ucp/integrationtests/aws/awstest.go +++ b/pkg/ucp/integrationtests/aws/awstest.go @@ -22,12 +22,12 @@ import ( "testing" "github.com/golang/mock/gomock" - ucp_aws "github.com/project-radius/radius/pkg/ucp/aws" - ucp_aws_frontend "github.com/project-radius/radius/pkg/ucp/frontend/aws" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/store" + ucp_aws "github.com/radius-project/radius/pkg/ucp/aws" + ucp_aws_frontend "github.com/radius-project/radius/pkg/ucp/frontend/aws" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/store" ) const ( diff --git a/pkg/ucp/integrationtests/aws/createresource_test.go b/pkg/ucp/integrationtests/aws/createresource_test.go index fda10e61b6..408291cda7 100644 --- a/pkg/ucp/integrationtests/aws/createresource_test.go +++ b/pkg/ucp/integrationtests/aws/createresource_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" diff --git a/pkg/ucp/integrationtests/aws/createresourcewithpost_test.go b/pkg/ucp/integrationtests/aws/createresourcewithpost_test.go index 6cc932b60a..6d4c21e209 100644 --- a/pkg/ucp/integrationtests/aws/createresourcewithpost_test.go +++ b/pkg/ucp/integrationtests/aws/createresourcewithpost_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" diff --git a/pkg/ucp/integrationtests/aws/deleteresource_test.go b/pkg/ucp/integrationtests/aws/deleteresource_test.go index fb978fe189..745dba5d2c 100644 --- a/pkg/ucp/integrationtests/aws/deleteresource_test.go +++ b/pkg/ucp/integrationtests/aws/deleteresource_test.go @@ -23,8 +23,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" diff --git a/pkg/ucp/integrationtests/aws/deleteresourcewithpost_test.go b/pkg/ucp/integrationtests/aws/deleteresourcewithpost_test.go index bf5d3e7d82..fa26fa2495 100644 --- a/pkg/ucp/integrationtests/aws/deleteresourcewithpost_test.go +++ b/pkg/ucp/integrationtests/aws/deleteresourcewithpost_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" diff --git a/pkg/ucp/integrationtests/aws/getresource_test.go b/pkg/ucp/integrationtests/aws/getresource_test.go index 833a79b007..e959e5b9e4 100644 --- a/pkg/ucp/integrationtests/aws/getresource_test.go +++ b/pkg/ucp/integrationtests/aws/getresource_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" diff --git a/pkg/ucp/integrationtests/aws/getresourcewithpost_test.go b/pkg/ucp/integrationtests/aws/getresourcewithpost_test.go index 73a2febc07..ece49560d6 100644 --- a/pkg/ucp/integrationtests/aws/getresourcewithpost_test.go +++ b/pkg/ucp/integrationtests/aws/getresourcewithpost_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" diff --git a/pkg/ucp/integrationtests/aws/listresources_test.go b/pkg/ucp/integrationtests/aws/listresources_test.go index cf7b762da8..43455f5f4f 100644 --- a/pkg/ucp/integrationtests/aws/listresources_test.go +++ b/pkg/ucp/integrationtests/aws/listresources_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" diff --git a/pkg/ucp/integrationtests/aws/operationresults_test.go b/pkg/ucp/integrationtests/aws/operationresults_test.go index ed532c65ef..933329b1a2 100644 --- a/pkg/ucp/integrationtests/aws/operationresults_test.go +++ b/pkg/ucp/integrationtests/aws/operationresults_test.go @@ -24,8 +24,8 @@ import ( "strings" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" diff --git a/pkg/ucp/integrationtests/aws/operationstatuses_test.go b/pkg/ucp/integrationtests/aws/operationstatuses_test.go index 96d2d2b519..17ee212563 100644 --- a/pkg/ucp/integrationtests/aws/operationstatuses_test.go +++ b/pkg/ucp/integrationtests/aws/operationstatuses_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol/types" diff --git a/pkg/ucp/integrationtests/aws/updateresource_test.go b/pkg/ucp/integrationtests/aws/updateresource_test.go index f00f95f42c..4d8e7724ea 100644 --- a/pkg/ucp/integrationtests/aws/updateresource_test.go +++ b/pkg/ucp/integrationtests/aws/updateresource_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" diff --git a/pkg/ucp/integrationtests/aws/updateresourcewithpost_test.go b/pkg/ucp/integrationtests/aws/updateresourcewithpost_test.go index 3c32b2ee66..5b690bfdcf 100644 --- a/pkg/ucp/integrationtests/aws/updateresourcewithpost_test.go +++ b/pkg/ucp/integrationtests/aws/updateresourcewithpost_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" diff --git a/pkg/ucp/integrationtests/azure/proxy_test.go b/pkg/ucp/integrationtests/azure/proxy_test.go index 8921a578fc..69a5a327df 100644 --- a/pkg/ucp/integrationtests/azure/proxy_test.go +++ b/pkg/ucp/integrationtests/azure/proxy_test.go @@ -22,12 +22,12 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testrp" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testrp" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/integrationtests/handler_test.go b/pkg/ucp/integrationtests/handler_test.go index 703dc4015e..2a791f239f 100644 --- a/pkg/ucp/integrationtests/handler_test.go +++ b/pkg/ucp/integrationtests/handler_test.go @@ -20,8 +20,8 @@ import ( "net/http" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/integrationtests/planes/aws_test.go b/pkg/ucp/integrationtests/planes/aws_test.go index 82364cb275..c4e1582927 100644 --- a/pkg/ucp/integrationtests/planes/aws_test.go +++ b/pkg/ucp/integrationtests/planes/aws_test.go @@ -19,9 +19,9 @@ package planes import ( "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" ) const ( @@ -73,7 +73,7 @@ func Test_AWSPlane_GET_Found(t *testing.T) { } func Test_AWSPlane_LIST(t *testing.T) { - t.Skip("This functionality is currently broken. See https://github.com/project-radius/radius/issues/4878") + t.Skip("This functionality is currently broken. See https://github.com/radius-project/radius/issues/4878") server := testserver.StartWithETCD(t, api.DefaultModules) defer server.Close() diff --git a/pkg/ucp/integrationtests/planes/planes_test.go b/pkg/ucp/integrationtests/planes/planes_test.go index a9b09298d1..913b6144e4 100644 --- a/pkg/ucp/integrationtests/planes/planes_test.go +++ b/pkg/ucp/integrationtests/planes/planes_test.go @@ -19,8 +19,8 @@ package planes import ( "testing" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" ) const ( diff --git a/pkg/ucp/integrationtests/planes/radius_test.go b/pkg/ucp/integrationtests/planes/radius_test.go index b2f75b9cfc..52f5738f4b 100644 --- a/pkg/ucp/integrationtests/planes/radius_test.go +++ b/pkg/ucp/integrationtests/planes/radius_test.go @@ -19,9 +19,9 @@ package planes import ( "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" ) const ( diff --git a/pkg/ucp/integrationtests/planes/validation_test.go b/pkg/ucp/integrationtests/planes/validation_test.go index 2ee8df7f73..2c5af626b5 100644 --- a/pkg/ucp/integrationtests/planes/validation_test.go +++ b/pkg/ucp/integrationtests/planes/validation_test.go @@ -20,11 +20,11 @@ import ( "net/http" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/integrationtests/radius/proxy_test.go b/pkg/ucp/integrationtests/radius/proxy_test.go index e2306ce835..f24d4b704c 100644 --- a/pkg/ucp/integrationtests/radius/proxy_test.go +++ b/pkg/ucp/integrationtests/radius/proxy_test.go @@ -22,12 +22,12 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testrp" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testrp" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/integrationtests/resourcegroups/resourcegroups_test.go b/pkg/ucp/integrationtests/resourcegroups/resourcegroups_test.go index 8cab5009e6..f8fd723122 100644 --- a/pkg/ucp/integrationtests/resourcegroups/resourcegroups_test.go +++ b/pkg/ucp/integrationtests/resourcegroups/resourcegroups_test.go @@ -19,9 +19,9 @@ package resourcegroups import ( "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/integrationtests/testserver" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" ) const ( diff --git a/pkg/ucp/integrationtests/testserver/testserver.go b/pkg/ucp/integrationtests/testserver/testserver.go index fb1ba305af..67a0f91331 100644 --- a/pkg/ucp/integrationtests/testserver/testserver.go +++ b/pkg/ucp/integrationtests/testserver/testserver.go @@ -36,22 +36,22 @@ import ( "github.com/stretchr/testify/require" etcdclient "go.etcd.io/etcd/client/v3" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rpctest" - "github.com/project-radius/radius/pkg/armrpc/servicecontext" - "github.com/project-radius/radius/pkg/middleware" - "github.com/project-radius/radius/pkg/ucp/data" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/frontend/modules" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - "github.com/project-radius/radius/pkg/ucp/secret" - secretprovider "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/validator" - "github.com/project-radius/radius/swagger" - "github.com/project-radius/radius/test/testcontext" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/armrpc/servicecontext" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/data" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/frontend/modules" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + "github.com/radius-project/radius/pkg/ucp/secret" + secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/validator" + "github.com/radius-project/radius/swagger" + "github.com/radius-project/radius/test/testcontext" ) // NoModules can be used to start a test server without any modules. This is useful for testing the server itself and core functionality diff --git a/pkg/ucp/proxy/arm_test.go b/pkg/ucp/proxy/arm_test.go index f6c05abf28..ded859148a 100644 --- a/pkg/ucp/proxy/arm_test.go +++ b/pkg/ucp/proxy/arm_test.go @@ -24,8 +24,8 @@ import ( "path/filepath" "testing" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/ucp/httpbaseline" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/ucp/httpbaseline" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/ucp/proxy/policy.go b/pkg/ucp/proxy/policy.go index ebeb0fff26..f3f6503e60 100644 --- a/pkg/ucp/proxy/policy.go +++ b/pkg/ucp/proxy/policy.go @@ -21,8 +21,8 @@ import ( "net/http" "strings" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) func workaround28169(r *http.Request) { diff --git a/pkg/ucp/proxy/types.go b/pkg/ucp/proxy/types.go index 3b792ba0b9..e3f7485d3c 100644 --- a/pkg/ucp/proxy/types.go +++ b/pkg/ucp/proxy/types.go @@ -24,9 +24,9 @@ import ( "net/url" "strings" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/rest" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/rest" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) type UCPRequestInfo struct { diff --git a/pkg/ucp/proxy/types_test.go b/pkg/ucp/proxy/types_test.go index c14f319b4c..8f901c13a3 100644 --- a/pkg/ucp/proxy/types_test.go +++ b/pkg/ucp/proxy/types_test.go @@ -23,7 +23,7 @@ import ( "net/textproto" "testing" - "github.com/project-radius/radius/pkg/ucp/rest" + "github.com/radius-project/radius/pkg/ucp/rest" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/queue/apiserver/client.go b/pkg/ucp/queue/apiserver/client.go index a3386fc348..ed2f2bc49c 100644 --- a/pkg/ucp/queue/apiserver/client.go +++ b/pkg/ucp/queue/apiserver/client.go @@ -60,9 +60,9 @@ import ( "strconv" "time" - "github.com/project-radius/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/queue/client" - v1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + v1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/ucp/queue/apiserver/client_test.go b/pkg/ucp/queue/apiserver/client_test.go index 61c5905025..6b786ebb51 100644 --- a/pkg/ucp/queue/apiserver/client_test.go +++ b/pkg/ucp/queue/apiserver/client_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/ucp/queue/client" - v1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/ucp/kubeenv" - sharedtest "github.com/project-radius/radius/test/ucp/queuetest" + "github.com/radius-project/radius/pkg/ucp/queue/client" + v1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/ucp/kubeenv" + sharedtest "github.com/radius-project/radius/test/ucp/queuetest" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/ucp/queue/client/client.go b/pkg/ucp/queue/client/client.go index ee7dbe7bf5..f120008c9b 100644 --- a/pkg/ucp/queue/client/client.go +++ b/pkg/ucp/queue/client/client.go @@ -21,7 +21,7 @@ import ( "errors" "time" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var ( @@ -41,7 +41,7 @@ var ( ErrEmptyMessage = errors.New("message must not be nil or message is empty") ) -//go:generate mockgen -destination=./mock_client.go -package=client -self_package github.com/project-radius/radius/pkg/ucp/queue/client github.com/project-radius/radius/pkg/ucp/queue/client Client +//go:generate mockgen -destination=./mock_client.go -package=client -self_package github.com/radius-project/radius/pkg/ucp/queue/client github.com/radius-project/radius/pkg/ucp/queue/client Client // Client is an interface to implement queue operations. type Client interface { diff --git a/pkg/ucp/queue/client/mock_client.go b/pkg/ucp/queue/client/mock_client.go index 3cd1059ac1..0ca7f44107 100644 --- a/pkg/ucp/queue/client/mock_client.go +++ b/pkg/ucp/queue/client/mock_client.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/ucp/queue/client (interfaces: Client) +// Source: github.com/radius-project/radius/pkg/ucp/queue/client (interfaces: Client) // Package client is a generated GoMock package. package client diff --git a/pkg/ucp/queue/inmemory/client.go b/pkg/ucp/queue/inmemory/client.go index 4f7d23d594..70347ca322 100644 --- a/pkg/ucp/queue/inmemory/client.go +++ b/pkg/ucp/queue/inmemory/client.go @@ -20,7 +20,7 @@ import ( "context" "sync" - "github.com/project-radius/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/queue/client" ) var namedQueue = &sync.Map{} diff --git a/pkg/ucp/queue/inmemory/client_test.go b/pkg/ucp/queue/inmemory/client_test.go index c116201be7..e3b35b9281 100644 --- a/pkg/ucp/queue/inmemory/client_test.go +++ b/pkg/ucp/queue/inmemory/client_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/queue/client" "github.com/stretchr/testify/require" - sharedtest "github.com/project-radius/radius/test/ucp/queuetest" + sharedtest "github.com/radius-project/radius/test/ucp/queuetest" ) func TestNamedQueue(t *testing.T) { diff --git a/pkg/ucp/queue/inmemory/queue.go b/pkg/ucp/queue/inmemory/queue.go index 009d0baa7d..5a428db340 100644 --- a/pkg/ucp/queue/inmemory/queue.go +++ b/pkg/ucp/queue/inmemory/queue.go @@ -22,7 +22,7 @@ import ( "time" "github.com/google/uuid" - "github.com/project-radius/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/queue/client" ) var ( diff --git a/pkg/ucp/queue/inmemory/queue_test.go b/pkg/ucp/queue/inmemory/queue_test.go index 864390c139..1a13e8d769 100644 --- a/pkg/ucp/queue/inmemory/queue_test.go +++ b/pkg/ucp/queue/inmemory/queue_test.go @@ -22,7 +22,7 @@ import ( "time" - "github.com/project-radius/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/queue/client" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/queue/provider/factory.go b/pkg/ucp/queue/provider/factory.go index 0da9a09ded..7cf1bc4efd 100644 --- a/pkg/ucp/queue/provider/factory.go +++ b/pkg/ucp/queue/provider/factory.go @@ -21,11 +21,11 @@ import ( "errors" "fmt" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/ucp/queue/apiserver" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - qinmem "github.com/project-radius/radius/pkg/ucp/queue/inmemory" - ucpv1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/ucp/queue/apiserver" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + qinmem "github.com/radius-project/radius/pkg/ucp/queue/inmemory" + ucpv1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" "k8s.io/apimachinery/pkg/runtime" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/ucp/queue/provider/provider.go b/pkg/ucp/queue/provider/provider.go index 7e01f8c46b..bd706949cb 100644 --- a/pkg/ucp/queue/provider/provider.go +++ b/pkg/ucp/queue/provider/provider.go @@ -21,8 +21,8 @@ import ( "errors" "sync" - queue "github.com/project-radius/radius/pkg/ucp/queue/client" - "github.com/project-radius/radius/pkg/ucp/util" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/pkg/ucp/util" ) var ( diff --git a/pkg/ucp/resources/aws/aws.go b/pkg/ucp/resources/aws/aws.go index c1ecfdddd1..1fef076151 100644 --- a/pkg/ucp/resources/aws/aws.go +++ b/pkg/ucp/resources/aws/aws.go @@ -19,7 +19,7 @@ package aws import ( "strings" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" ) const ( diff --git a/pkg/ucp/resources/aws/aws_test.go b/pkg/ucp/resources/aws/aws_test.go index 8a5aec6a69..fae5ba586f 100644 --- a/pkg/ucp/resources/aws/aws_test.go +++ b/pkg/ucp/resources/aws/aws_test.go @@ -19,7 +19,7 @@ package aws import ( "testing" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/resources/azure/azure.go b/pkg/ucp/resources/azure/azure.go index ae422719b6..1c19114e80 100644 --- a/pkg/ucp/resources/azure/azure.go +++ b/pkg/ucp/resources/azure/azure.go @@ -16,7 +16,7 @@ limitations under the License. package azure -import "github.com/project-radius/radius/pkg/ucp/resources" +import "github.com/radius-project/radius/pkg/ucp/resources" const ( // PlaneTypeAzure defines the type name of the Azure plane. diff --git a/pkg/ucp/resources/id_test.go b/pkg/ucp/resources/id_test.go index 2ee5a36696..b11869c21a 100644 --- a/pkg/ucp/resources/id_test.go +++ b/pkg/ucp/resources/id_test.go @@ -21,8 +21,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/azure/azresources" - "github.com/project-radius/radius/pkg/portableresources" + "github.com/radius-project/radius/pkg/azure/azresources" + "github.com/radius-project/radius/pkg/portableresources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/resources/kubernetes/kubernetes.go b/pkg/ucp/resources/kubernetes/kubernetes.go index de687744b1..bf58726e3f 100644 --- a/pkg/ucp/resources/kubernetes/kubernetes.go +++ b/pkg/ucp/resources/kubernetes/kubernetes.go @@ -19,7 +19,7 @@ package kubernetes import ( "strings" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" ) diff --git a/pkg/ucp/resources/radius/radius.go b/pkg/ucp/resources/radius/radius.go index 9af9788e66..1cfaf5a50f 100644 --- a/pkg/ucp/resources/radius/radius.go +++ b/pkg/ucp/resources/radius/radius.go @@ -16,7 +16,7 @@ limitations under the License. package radius -import "github.com/project-radius/radius/pkg/ucp/resources" +import "github.com/radius-project/radius/pkg/ucp/resources" const ( // PlaneTypeRadius defines the type name of the Radius plane. diff --git a/pkg/ucp/resources/radius/radius_test.go b/pkg/ucp/resources/radius/radius_test.go index dabfacf932..001ae8920a 100644 --- a/pkg/ucp/resources/radius/radius_test.go +++ b/pkg/ucp/resources/radius/radius_test.go @@ -20,7 +20,7 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/secret/client.go b/pkg/ucp/secret/client.go index 725ded2b18..c3f9dfad98 100644 --- a/pkg/ucp/secret/client.go +++ b/pkg/ucp/secret/client.go @@ -21,7 +21,7 @@ import ( "encoding/json" ) -//go:generate mockgen -destination=./mock_client.go -package=secret -self_package github.com/project-radius/radius/pkg/ucp/secret github.com/project-radius/radius/pkg/ucp/secret Client +//go:generate mockgen -destination=./mock_client.go -package=secret -self_package github.com/radius-project/radius/pkg/ucp/secret github.com/radius-project/radius/pkg/ucp/secret Client // Client is an interface to implement secret operations. type Client interface { diff --git a/pkg/ucp/secret/etcd/client.go b/pkg/ucp/secret/etcd/client.go index 0416960924..05a26276d6 100644 --- a/pkg/ucp/secret/etcd/client.go +++ b/pkg/ucp/secret/etcd/client.go @@ -19,8 +19,8 @@ package etcd import ( "context" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/util" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/util" etcdclient "go.etcd.io/etcd/client/v3" ) diff --git a/pkg/ucp/secret/etcd/client_test.go b/pkg/ucp/secret/etcd/client_test.go index cd9bdf0f67..f7f033a11d 100644 --- a/pkg/ucp/secret/etcd/client_test.go +++ b/pkg/ucp/secret/etcd/client_test.go @@ -22,10 +22,10 @@ import ( "strconv" "testing" - "github.com/project-radius/radius/pkg/ucp/data" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/ucp/data" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" etcdclient "go.etcd.io/etcd/client/v3" ) diff --git a/pkg/ucp/secret/kubernetes/client.go b/pkg/ucp/secret/kubernetes/client.go index cc52ebf9b7..6a1c7dfc89 100644 --- a/pkg/ucp/secret/kubernetes/client.go +++ b/pkg/ucp/secret/kubernetes/client.go @@ -19,8 +19,8 @@ package kubernetes import ( "context" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/ucp/secret" corev1 "k8s.io/api/core/v1" k8s_error "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/ucp/secret/kubernetes/client_test.go b/pkg/ucp/secret/kubernetes/client_test.go index 75ffa2b2b9..f65d502ab3 100644 --- a/pkg/ucp/secret/kubernetes/client_test.go +++ b/pkg/ucp/secret/kubernetes/client_test.go @@ -21,8 +21,8 @@ import ( "encoding/json" "testing" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/test/k8sutil" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/test/k8sutil" "github.com/stretchr/testify/require" "k8s.io/kubectl/pkg/scheme" diff --git a/pkg/ucp/secret/mock_client.go b/pkg/ucp/secret/mock_client.go index e155a7e69d..ccbfdbda66 100644 --- a/pkg/ucp/secret/mock_client.go +++ b/pkg/ucp/secret/mock_client.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/ucp/secret (interfaces: Client) +// Source: github.com/radius-project/radius/pkg/ucp/secret (interfaces: Client) // Package secret is a generated GoMock package. package secret diff --git a/pkg/ucp/secret/provider/factory.go b/pkg/ucp/secret/provider/factory.go index 07d26cc744..396b1995c6 100644 --- a/pkg/ucp/secret/provider/factory.go +++ b/pkg/ucp/secret/provider/factory.go @@ -20,12 +20,12 @@ import ( "context" "errors" - "github.com/project-radius/radius/pkg/kubeutil" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/secret" - "github.com/project-radius/radius/pkg/ucp/secret/etcd" - kubernetes_client "github.com/project-radius/radius/pkg/ucp/secret/kubernetes" - "github.com/project-radius/radius/pkg/ucp/store/etcdstore" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/secret/etcd" + kubernetes_client "github.com/radius-project/radius/pkg/ucp/secret/kubernetes" + "github.com/radius-project/radius/pkg/ucp/store/etcdstore" "k8s.io/kubectl/pkg/scheme" controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -56,7 +56,7 @@ func initETCDSecretClient(ctx context.Context, opts SecretProviderOptions) (secr func initKubernetesSecretClient(ctx context.Context, opt SecretProviderOptions) (secret.Client, error) { s := scheme.Scheme cfg, err := kubeutil.NewClientConfig(&kubeutil.ConfigOptions{ - // TODO: Allow to use custom context via configuration. - https://github.com/project-radius/radius/issues/5433 + // TODO: Allow to use custom context via configuration. - https://github.com/radius-project/radius/issues/5433 ContextName: "", QPS: kubeutil.DefaultServerQPS, Burst: kubeutil.DefaultServerBurst, diff --git a/pkg/ucp/secret/provider/options.go b/pkg/ucp/secret/provider/options.go index b29ce116a6..7e54354446 100644 --- a/pkg/ucp/secret/provider/options.go +++ b/pkg/ucp/secret/provider/options.go @@ -16,7 +16,7 @@ limitations under the License. package provider -import "github.com/project-radius/radius/pkg/ucp/dataprovider" +import "github.com/radius-project/radius/pkg/ucp/dataprovider" // SecretProviderOptions contains provider information of the secret. type SecretProviderOptions struct { diff --git a/pkg/ucp/secret/provider/provider.go b/pkg/ucp/secret/provider/provider.go index ea16ace19e..8365851aef 100644 --- a/pkg/ucp/secret/provider/provider.go +++ b/pkg/ucp/secret/provider/provider.go @@ -21,7 +21,7 @@ import ( "errors" "sync" - "github.com/project-radius/radius/pkg/ucp/secret" + "github.com/radius-project/radius/pkg/ucp/secret" ) var ( diff --git a/pkg/ucp/server/server.go b/pkg/ucp/server/server.go index d6cbc7c75b..b13f2d1e93 100644 --- a/pkg/ucp/server/server.go +++ b/pkg/ucp/server/server.go @@ -24,25 +24,25 @@ import ( "strings" "time" - hostOpts "github.com/project-radius/radius/pkg/armrpc/hostoptions" - "github.com/project-radius/radius/pkg/kubeutil" - metricsprovider "github.com/project-radius/radius/pkg/metrics/provider" - metricsservice "github.com/project-radius/radius/pkg/metrics/service" - profilerprovider "github.com/project-radius/radius/pkg/profiler/provider" - profilerservice "github.com/project-radius/radius/pkg/profiler/service" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/trace" - "github.com/project-radius/radius/pkg/ucp/backend" - "github.com/project-radius/radius/pkg/ucp/config" - "github.com/project-radius/radius/pkg/ucp/data" - "github.com/project-radius/radius/pkg/ucp/dataprovider" - "github.com/project-radius/radius/pkg/ucp/frontend/api" - "github.com/project-radius/radius/pkg/ucp/hosting" - "github.com/project-radius/radius/pkg/ucp/hostoptions" - qprovider "github.com/project-radius/radius/pkg/ucp/queue/provider" - "github.com/project-radius/radius/pkg/ucp/rest" - "github.com/project-radius/radius/pkg/ucp/secret/provider" - "github.com/project-radius/radius/pkg/ucp/ucplog" + hostOpts "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/kubeutil" + metricsprovider "github.com/radius-project/radius/pkg/metrics/provider" + metricsservice "github.com/radius-project/radius/pkg/metrics/service" + profilerprovider "github.com/radius-project/radius/pkg/profiler/provider" + profilerservice "github.com/radius-project/radius/pkg/profiler/service" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/trace" + "github.com/radius-project/radius/pkg/ucp/backend" + "github.com/radius-project/radius/pkg/ucp/config" + "github.com/radius-project/radius/pkg/ucp/data" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/frontend/api" + "github.com/radius-project/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/hostoptions" + qprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" + "github.com/radius-project/radius/pkg/ucp/rest" + "github.com/radius-project/radius/pkg/ucp/secret/provider" + "github.com/radius-project/radius/pkg/ucp/ucplog" kube_rest "k8s.io/client-go/rest" ) @@ -114,7 +114,7 @@ func NewServerOptionsFromEnvironment() (Options, error) { var cfg *kube_rest.Config if opts.Config.UCP.Kind == config.UCPConnectionKindKubernetes { cfg, err = kubeutil.NewClientConfig(&kubeutil.ConfigOptions{ - // TODO: Allow to use custom context via configuration. - https://github.com/project-radius/radius/issues/5433 + // TODO: Allow to use custom context via configuration. - https://github.com/radius-project/radius/issues/5433 ContextName: "", QPS: kubeutil.DefaultServerQPS, Burst: kubeutil.DefaultServerBurst, diff --git a/pkg/ucp/store/apiserverstore/apiserverclient.go b/pkg/ucp/store/apiserverstore/apiserverclient.go index 2eb75c07ae..739f9766bb 100644 --- a/pkg/ucp/store/apiserverstore/apiserverclient.go +++ b/pkg/ucp/store/apiserverstore/apiserverclient.go @@ -48,12 +48,12 @@ import ( "strings" "unicode" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - ucpv1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" - "github.com/project-radius/radius/pkg/ucp/store/storeutil" - "github.com/project-radius/radius/pkg/ucp/ucplog" - "github.com/project-radius/radius/pkg/ucp/util/etag" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + ucpv1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + "github.com/radius-project/radius/pkg/ucp/store/storeutil" + "github.com/radius-project/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/util/etag" apierrors "k8s.io/apimachinery/pkg/api/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/pkg/ucp/store/apiserverstore/apiserverclient_test.go b/pkg/ucp/store/apiserverstore/apiserverclient_test.go index e626711737..22cfbcb80f 100644 --- a/pkg/ucp/store/apiserverstore/apiserverclient_test.go +++ b/pkg/ucp/store/apiserverstore/apiserverclient_test.go @@ -28,13 +28,13 @@ import ( "k8s.io/apimachinery/pkg/runtime" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - ucpv1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" - "github.com/project-radius/radius/pkg/ucp/util/etag" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/ucp/kubeenv" - shared "github.com/project-radius/radius/test/ucp/storetest" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + ucpv1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + "github.com/radius-project/radius/pkg/ucp/util/etag" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/ucp/kubeenv" + shared "github.com/radius-project/radius/test/ucp/storetest" ) func Test_ResourceName_Normalize(t *testing.T) { diff --git a/pkg/ucp/store/client.go b/pkg/ucp/store/client.go index c09df0856b..8f735c1b46 100644 --- a/pkg/ucp/store/client.go +++ b/pkg/ucp/store/client.go @@ -20,7 +20,7 @@ import ( "context" ) -//go:generate mockgen -destination=./mock_storageClient.go -package=store -self_package github.com/project-radius/radius/pkg/ucp/store github.com/project-radius/radius/pkg/ucp/store StorageClient +//go:generate mockgen -destination=./mock_storageClient.go -package=store -self_package github.com/radius-project/radius/pkg/ucp/store github.com/radius-project/radius/pkg/ucp/store StorageClient type StorageClient interface { Query(ctx context.Context, query Query, options ...QueryOptions) (*ObjectQueryResult, error) diff --git a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go index 0a6d273531..dc4b4f504b 100644 --- a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go +++ b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient.go @@ -21,9 +21,9 @@ import ( "fmt" "strings" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/vippsas/go-cosmosdb/cosmosapi" ) @@ -33,7 +33,7 @@ const ( // go-cosmosdb does not return the error response code. Comparing error message is the only way to check the errors. // Once we move to official Go SDK, we can have the better error handling. - // TODO: Switch to the official cosmosdb SDK - https://github.com/project-radius/radius/issues/2225 + // TODO: Switch to the official cosmosdb SDK - https://github.com/radius-project/radius/issues/2225 // 1. Repalce github.com/vippsas/go-cosmosdb/cosmosapi with the official sdk when it supports query api. // 2. Improve error handling using response code instead of string match. errResourceNotFoundMsg = "Resource that no longer exists" diff --git a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go index 4ef33ebd28..a696d9d753 100644 --- a/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go +++ b/pkg/ucp/store/cosmosdb/cosmosdbstorageclient_test.go @@ -25,11 +25,11 @@ import ( "testing" "github.com/google/uuid" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/corerp/datamodel" - rpv1 "github.com/project-radius/radius/pkg/rp/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/corerp/datamodel" + rpv1 "github.com/radius-project/radius/pkg/rp/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" "github.com/vippsas/go-cosmosdb/cosmosapi" ) diff --git a/pkg/ucp/store/cosmosdb/options.go b/pkg/ucp/store/cosmosdb/options.go index 62f3e1eba9..a0dc279aca 100644 --- a/pkg/ucp/store/cosmosdb/options.go +++ b/pkg/ucp/store/cosmosdb/options.go @@ -16,7 +16,7 @@ limitations under the License. package cosmosdb -import "github.com/project-radius/radius/pkg/ucp/store" +import "github.com/radius-project/radius/pkg/ucp/store" const ( defaultQueryItemCount = 20 diff --git a/pkg/ucp/store/cosmosdb/util.go b/pkg/ucp/store/cosmosdb/util.go index 7af102d4e2..4af73d0ea3 100644 --- a/pkg/ucp/store/cosmosdb/util.go +++ b/pkg/ucp/store/cosmosdb/util.go @@ -22,9 +22,9 @@ import ( "strings" "unicode" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_azure "github.com/project-radius/radius/pkg/ucp/resources/azure" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_azure "github.com/radius-project/radius/pkg/ucp/resources/azure" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/spaolacci/murmur3" ) diff --git a/pkg/ucp/store/cosmosdb/util_test.go b/pkg/ucp/store/cosmosdb/util_test.go index f1ab151762..2a70fa46eb 100644 --- a/pkg/ucp/store/cosmosdb/util_test.go +++ b/pkg/ucp/store/cosmosdb/util_test.go @@ -19,8 +19,8 @@ package cosmosdb import ( "testing" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/store/etcdstore/etcdclient.go b/pkg/ucp/store/etcdstore/etcdclient.go index 4fbcf365c3..93a81e771b 100644 --- a/pkg/ucp/store/etcdstore/etcdclient.go +++ b/pkg/ucp/store/etcdstore/etcdclient.go @@ -51,10 +51,10 @@ import ( "errors" "strings" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/store/storeutil" - "github.com/project-radius/radius/pkg/ucp/util/etag" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/store/storeutil" + "github.com/radius-project/radius/pkg/ucp/util/etag" etcdclient "go.etcd.io/etcd/client/v3" ) diff --git a/pkg/ucp/store/etcdstore/etcdclient_test.go b/pkg/ucp/store/etcdstore/etcdclient_test.go index 734044d9d6..7fa57dd31f 100644 --- a/pkg/ucp/store/etcdstore/etcdclient_test.go +++ b/pkg/ucp/store/etcdstore/etcdclient_test.go @@ -20,13 +20,13 @@ import ( "context" "testing" - "github.com/project-radius/radius/pkg/ucp/data" - "github.com/project-radius/radius/pkg/ucp/hosting" + "github.com/radius-project/radius/pkg/ucp/data" + "github.com/radius-project/radius/pkg/ucp/hosting" "github.com/stretchr/testify/require" etcdclient "go.etcd.io/etcd/client/v3" - "github.com/project-radius/radius/test/testcontext" - shared "github.com/project-radius/radius/test/ucp/storetest" + "github.com/radius-project/radius/test/testcontext" + shared "github.com/radius-project/radius/test/ucp/storetest" ) func Test_ETCDClient(t *testing.T) { diff --git a/pkg/ucp/store/map_test.go b/pkg/ucp/store/map_test.go index 6f66cc792f..fd99198bcd 100644 --- a/pkg/ucp/store/map_test.go +++ b/pkg/ucp/store/map_test.go @@ -22,7 +22,7 @@ import ( "time" "github.com/mitchellh/mapstructure" - "github.com/project-radius/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/resources" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/store/mock_storageClient.go b/pkg/ucp/store/mock_storageClient.go index dc6ee2e430..1d86105389 100644 --- a/pkg/ucp/store/mock_storageClient.go +++ b/pkg/ucp/store/mock_storageClient.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/project-radius/radius/pkg/ucp/store (interfaces: StorageClient) +// Source: github.com/radius-project/radius/pkg/ucp/store (interfaces: StorageClient) // Package store is a generated GoMock package. package store diff --git a/pkg/ucp/store/storeutil/id.go b/pkg/ucp/store/storeutil/id.go index 57f9bd88bb..03cd8700e5 100644 --- a/pkg/ucp/store/storeutil/id.go +++ b/pkg/ucp/store/storeutil/id.go @@ -19,8 +19,8 @@ package storeutil import ( "strings" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" ) const ( diff --git a/pkg/ucp/store/storeutil/id_test.go b/pkg/ucp/store/storeutil/id_test.go index 8a55b3c476..b118279147 100644 --- a/pkg/ucp/store/storeutil/id_test.go +++ b/pkg/ucp/store/storeutil/id_test.go @@ -19,8 +19,8 @@ package storeutil import ( "testing" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/ucp/ucplog/log.go b/pkg/ucp/ucplog/log.go index 15b0067a10..22f42c35a2 100644 --- a/pkg/ucp/ucplog/log.go +++ b/pkg/ucp/ucplog/log.go @@ -25,7 +25,7 @@ import ( "github.com/go-logr/logr" "github.com/go-logr/zapr" - "github.com/project-radius/radius/pkg/version" + "github.com/radius-project/radius/pkg/version" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" "go.uber.org/zap/zapcore" diff --git a/pkg/validator/apivalidator.go b/pkg/validator/apivalidator.go index 33e3af84ba..84f628eb67 100644 --- a/pkg/validator/apivalidator.go +++ b/pkg/validator/apivalidator.go @@ -23,10 +23,10 @@ import ( "strings" "github.com/go-chi/chi/v5" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/armrpc/rest" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/ucplog" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) const ( diff --git a/pkg/validator/apivalidator_test.go b/pkg/validator/apivalidator_test.go index a419be3cb0..44d9e05d3f 100644 --- a/pkg/validator/apivalidator_test.go +++ b/pkg/validator/apivalidator_test.go @@ -25,9 +25,9 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/swagger" - "github.com/project-radius/radius/test/testutil" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/swagger" + "github.com/radius-project/radius/test/testutil" "github.com/go-chi/chi/v5" "github.com/stretchr/testify/require" diff --git a/pkg/validator/loader.go b/pkg/validator/loader.go index e421452247..349dfd9f24 100644 --- a/pkg/validator/loader.go +++ b/pkg/validator/loader.go @@ -28,7 +28,7 @@ import ( "github.com/go-openapi/loads" "github.com/go-openapi/spec" - "github.com/project-radius/radius/pkg/ucp/ucplog" + "github.com/radius-project/radius/pkg/ucp/ucplog" ) var ( diff --git a/pkg/validator/loader_test.go b/pkg/validator/loader_test.go index 917ec7f75d..0c609332e4 100644 --- a/pkg/validator/loader_test.go +++ b/pkg/validator/loader_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/project-radius/radius/swagger" + "github.com/radius-project/radius/swagger" "github.com/stretchr/testify/require" ) diff --git a/pkg/validator/validator.go b/pkg/validator/validator.go index 3c74f5acb1..953208637c 100644 --- a/pkg/validator/validator.go +++ b/pkg/validator/validator.go @@ -33,8 +33,8 @@ import ( "github.com/go-openapi/spec" "github.com/go-openapi/strfmt" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/ucp/resources" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/resources" ) const ( @@ -198,7 +198,7 @@ func (v *validator) ValidateRequest(req *http.Request) []ValidationError { }} } - // WORKAROUND: https://github.com/project-radius/radius/issues/2683 + // WORKAROUND: https://github.com/radius-project/radius/issues/2683 // UCP or DE sends the invalid request which has -1 ContentLength header so validator treats it as empty content. if req.ContentLength < 0 && len(content) > 0 { req.ContentLength = (int64)(len(content)) diff --git a/pkg/validator/validator_test.go b/pkg/validator/validator_test.go index 29994f997a..0eb8293b8b 100644 --- a/pkg/validator/validator_test.go +++ b/pkg/validator/validator_test.go @@ -26,7 +26,7 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/stretchr/testify/require" - "github.com/project-radius/radius/swagger" + "github.com/radius-project/radius/swagger" ) func Test_FindParam(t *testing.T) { diff --git a/pkg/version/version.go b/pkg/version/version.go index 329d5469d9..9e4c596d2c 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/output" ) // Values for these are injected by the build. diff --git a/test/functional/daprrp/dapr_component_name_conflict_test.go b/test/functional/daprrp/dapr_component_name_conflict_test.go index efa715f397..b8f396552d 100644 --- a/test/functional/daprrp/dapr_component_name_conflict_test.go +++ b/test/functional/daprrp/dapr_component_name_conflict_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_DaprComponentNameConflict(t *testing.T) { diff --git a/test/functional/daprrp/dapr_pubsub_test.go b/test/functional/daprrp/dapr_pubsub_test.go index b0c24bebb8..7b286c74ae 100644 --- a/test/functional/daprrp/dapr_pubsub_test.go +++ b/test/functional/daprrp/dapr_pubsub_test.go @@ -20,10 +20,10 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_DaprPubSubBroker_Manual(t *testing.T) { diff --git a/test/functional/daprrp/dapr_secretstore_test.go b/test/functional/daprrp/dapr_secretstore_test.go index adc708d1ad..c7665acf31 100644 --- a/test/functional/daprrp/dapr_secretstore_test.go +++ b/test/functional/daprrp/dapr_secretstore_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_DaprSecretStore_Manual(t *testing.T) { diff --git a/test/functional/daprrp/dapr_serviceinvocation_test.go b/test/functional/daprrp/dapr_serviceinvocation_test.go index 6deeff3a2e..0bea322e1a 100644 --- a/test/functional/daprrp/dapr_serviceinvocation_test.go +++ b/test/functional/daprrp/dapr_serviceinvocation_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_DaprServiceInvocation(t *testing.T) { diff --git a/test/functional/daprrp/dapr_statestore_test.go b/test/functional/daprrp/dapr_statestore_test.go index 1b15ec49c5..4dc9a5282d 100644 --- a/test/functional/daprrp/dapr_statestore_test.go +++ b/test/functional/daprrp/dapr_statestore_test.go @@ -20,10 +20,10 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_DaprStateStore_Manual(t *testing.T) { diff --git a/test/functional/datastoresrp/resources/microsoftsql_test.go b/test/functional/datastoresrp/resources/microsoftsql_test.go index 7f09ace4a3..fe1c70ea40 100644 --- a/test/functional/datastoresrp/resources/microsoftsql_test.go +++ b/test/functional/datastoresrp/resources/microsoftsql_test.go @@ -20,10 +20,10 @@ import ( "os" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_MicrosoftSQL_Manual(t *testing.T) { diff --git a/test/functional/datastoresrp/resources/mongodb_test.go b/test/functional/datastoresrp/resources/mongodb_test.go index 63989f7e8b..f46369ad1e 100644 --- a/test/functional/datastoresrp/resources/mongodb_test.go +++ b/test/functional/datastoresrp/resources/mongodb_test.go @@ -20,10 +20,10 @@ import ( "os" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) // Opt-out case for manual resource provisioning @@ -129,7 +129,7 @@ func Test_MongoDB_Recipe(t *testing.T) { // If the same parameters are set by the developer and the operator then the developer parameters are applied in to resolve conflicts. // Container uses the mongoDB resource to connect to the mongoDB resource func Test_MongoDB_RecipeParameters(t *testing.T) { - t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/project-radius/radius/issues/5929") + t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/radius-project/radius/issues/5929") template := "testdata/datastoresrp-resources-mongodb-recipe-parameters.bicep" name := "dsrp-resources-mongodb-recipe-parameters" @@ -184,7 +184,7 @@ func Test_MongoDB_RecipeParameters(t *testing.T) { // a default recipe using the context parameter generated and set by DatastoresRP, // and container using the mongoDatabases portable resource to connect to the underlying mongoDB resource. func Test_MongoDB_Recipe_ContextParameter(t *testing.T) { - t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/project-radius/radius/issues/5929") + t.Skip("Skipping test as creating/deleting cosmosdb resource is unreliable - https://github.com/radius-project/radius/issues/5929") template := "testdata/datastoresrp-resources-mongodb-recipe-context.bicep" name := "dsrp-resources-mongodb-recipe-context" diff --git a/test/functional/datastoresrp/resources/redis_test.go b/test/functional/datastoresrp/resources/redis_test.go index 7f1b472069..7dd32a8ca6 100644 --- a/test/functional/datastoresrp/resources/redis_test.go +++ b/test/functional/datastoresrp/resources/redis_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_Redis_Manual(t *testing.T) { diff --git a/test/functional/datastoresrp/resources/sql_test.go b/test/functional/datastoresrp/resources/sql_test.go index 442852aec9..1f93e3e40b 100644 --- a/test/functional/datastoresrp/resources/sql_test.go +++ b/test/functional/datastoresrp/resources/sql_test.go @@ -20,10 +20,10 @@ import ( "runtime" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_SQLDatabase_Manual(t *testing.T) { diff --git a/test/functional/messagingrp/resources/rabbitmq_test.go b/test/functional/messagingrp/resources/rabbitmq_test.go index 9559889ee9..23e35122ea 100644 --- a/test/functional/messagingrp/resources/rabbitmq_test.go +++ b/test/functional/messagingrp/resources/rabbitmq_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_RabbitMQ_Manual(t *testing.T) { diff --git a/test/functional/samples/README.md b/test/functional/samples/README.md index c68277e608..0bf4c7421a 100644 --- a/test/functional/samples/README.md +++ b/test/functional/samples/README.md @@ -1,5 +1,5 @@ # Sample validation -This directory contains validation for samples in https://github.com/project-radius/samples. +This directory contains validation for samples in https://github.com/radius-project/samples. These validate that the sample is deployable and can be accessed accordingly via APIs. These flows will include common user actions, like adding items to a Todo list, validating gateway availability, etc. \ No newline at end of file diff --git a/test/functional/samples/tutorial_test.go b/test/functional/samples/tutorial_test.go index 9cf0b949e9..f5fc904876 100644 --- a/test/functional/samples/tutorial_test.go +++ b/test/functional/samples/tutorial_test.go @@ -29,11 +29,11 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -53,11 +53,11 @@ var samplesRepoAbsPath, samplesRepoEnvVarSet = os.LookupEnv("RADIUS_SAMPLES_REPO // Ex: export PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH=/home/uname/src/samples func Test_FirstApplicationSample(t *testing.T) { // TODO: Remove the following statement - // LJ: Skipping this test to test pipeline for this PR: https://github.com/project-radius/radius/pull/6130 + // LJ: Skipping this test to test pipeline for this PR: https://github.com/radius-project/radius/pull/6130 t.Skipf("Temporary: Skip samples test execution, samples repo still contains Applications.Links resources, which is deprecated in this PR") if !samplesRepoEnvVarSet { - t.Skipf("Skip samples test execution, to enable you must set env var PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH to the absolute path of the project-radius/samples repository") + t.Skipf("Skip samples test execution, to enable you must set env var PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH to the absolute path of the radius-project/samples repository") } cwd, err := os.Getwd() @@ -109,7 +109,7 @@ func Test_FirstApplicationSample(t *testing.T) { require.Fail(t, fmt.Sprintf("tests failed after %d retries", retries)) }, - // TODO: validation of k8s resources blocked by https://github.com/project-radius/radius/issues/4689 + // TODO: validation of k8s resources blocked by https://github.com/radius-project/radius/issues/4689 K8sOutputResources: []unstructured.Unstructured{}, K8sObjects: &validation.K8sObjectSet{ Namespaces: map[string][]validation.K8sObject{ diff --git a/test/functional/shared/api_test.go b/test/functional/shared/api_test.go index ba1bfcb9f9..44c0f73297 100644 --- a/test/functional/shared/api_test.go +++ b/test/functional/shared/api_test.go @@ -20,14 +20,14 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" ) // Test_ResourceList covers the plane and resource-group scope list APIs for all Radius resource types. diff --git a/test/functional/shared/cli/cli_test.go b/test/functional/shared/cli/cli_test.go index ec7b1e631f..f9338f20bd 100644 --- a/test/functional/shared/cli/cli_test.go +++ b/test/functional/shared/cli/cli_test.go @@ -33,19 +33,19 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/cli/bicep" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/objectformats" - "github.com/project-radius/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/radcli" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/cli/bicep" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/objectformats" + "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/radcli" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" ) const ( @@ -173,7 +173,7 @@ func verifyCLIBasics(ctx context.Context, t *testing.T, test shared.RPTest) { require.Contains(t, output, "Server running at http://localhost:3000") }) t.Run("Validate rad resource expose Container", func(t *testing.T) { - t.Skip("https://github.com/project-radius/radius/issues/3232") + t.Skip("https://github.com/radius-project/radius/issues/3232") port, err := GetAvailablePort() require.NoError(t, err) diff --git a/test/functional/shared/mechanics/aws_mechanics_test.go b/test/functional/shared/mechanics/aws_mechanics_test.go index 5b1d3be0f3..f5a3535809 100644 --- a/test/functional/shared/mechanics/aws_mechanics_test.go +++ b/test/functional/shared/mechanics/aws_mechanics_test.go @@ -21,9 +21,9 @@ import ( "testing" "github.com/google/uuid" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_AWSRedeployWithUpdatedResourceUpdatesResource(t *testing.T) { diff --git a/test/functional/shared/mechanics/k8s_extensibility_test.go b/test/functional/shared/mechanics/k8s_extensibility_test.go index e85b4ca197..747f507dee 100644 --- a/test/functional/shared/mechanics/k8s_extensibility_test.go +++ b/test/functional/shared/mechanics/k8s_extensibility_test.go @@ -22,9 +22,9 @@ import ( "strings" "testing" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "gopkg.in/yaml.v3" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) diff --git a/test/functional/shared/mechanics/mechanics_test.go b/test/functional/shared/mechanics/mechanics_test.go index c22c5dbe85..0cb95087f4 100644 --- a/test/functional/shared/mechanics/mechanics_test.go +++ b/test/functional/shared/mechanics/mechanics_test.go @@ -23,11 +23,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/project-radius/radius/pkg/kubernetes" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/labels" ) diff --git a/test/functional/shared/resources/application_environment_test.go b/test/functional/shared/resources/application_environment_test.go index add3c8d9c9..23ee2a1adb 100644 --- a/test/functional/shared/resources/application_environment_test.go +++ b/test/functional/shared/resources/application_environment_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/functional/shared/resources/application_test.go b/test/functional/shared/resources/application_test.go index d23038b642..c6c21f9616 100644 --- a/test/functional/shared/resources/application_test.go +++ b/test/functional/shared/resources/application_test.go @@ -20,9 +20,9 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/functional/shared/resources/aws_multi_identifier_resource_test.go b/test/functional/shared/resources/aws_multi_identifier_resource_test.go index 0f794c02e2..6042e26a97 100644 --- a/test/functional/shared/resources/aws_multi_identifier_resource_test.go +++ b/test/functional/shared/resources/aws_multi_identifier_resource_test.go @@ -20,9 +20,9 @@ import ( "testing" "github.com/google/uuid" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_AWS_MultiIdentifier_Resource(t *testing.T) { diff --git a/test/functional/shared/resources/aws_s3_bucket_test.go b/test/functional/shared/resources/aws_s3_bucket_test.go index b6082ddf75..0bb73f858a 100644 --- a/test/functional/shared/resources/aws_s3_bucket_test.go +++ b/test/functional/shared/resources/aws_s3_bucket_test.go @@ -20,9 +20,9 @@ import ( "testing" "github.com/google/uuid" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_AWS_S3Bucket(t *testing.T) { diff --git a/test/functional/shared/resources/azure_connections_test.go b/test/functional/shared/resources/azure_connections_test.go index 78bec54eb6..e341c7b640 100644 --- a/test/functional/shared/resources/azure_connections_test.go +++ b/test/functional/shared/resources/azure_connections_test.go @@ -20,10 +20,10 @@ import ( "os" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_AzureConnections(t *testing.T) { diff --git a/test/functional/shared/resources/container_runtimes_test.go b/test/functional/shared/resources/container_runtimes_test.go index 1003bbb03a..2e2d2ff260 100644 --- a/test/functional/shared/resources/container_runtimes_test.go +++ b/test/functional/shared/resources/container_runtimes_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/functional/shared/resources/container_test.go b/test/functional/shared/resources/container_test.go index ce1b9fcb04..ccfa1af3f8 100644 --- a/test/functional/shared/resources/container_test.go +++ b/test/functional/shared/resources/container_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/functional/shared/resources/container_versioning_test.go b/test/functional/shared/resources/container_versioning_test.go index 745f1b46ed..ae76cb0c94 100644 --- a/test/functional/shared/resources/container_versioning_test.go +++ b/test/functional/shared/resources/container_versioning_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/test/functional/shared/resources/environment_test.go b/test/functional/shared/resources/environment_test.go index 1eb7f36179..6c9249785e 100644 --- a/test/functional/shared/resources/environment_test.go +++ b/test/functional/shared/resources/environment_test.go @@ -19,9 +19,9 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_Environment(t *testing.T) { diff --git a/test/functional/shared/resources/extender_test.go b/test/functional/shared/resources/extender_test.go index 04e60e075a..f42fe2c36c 100644 --- a/test/functional/shared/resources/extender_test.go +++ b/test/functional/shared/resources/extender_test.go @@ -22,10 +22,10 @@ import ( "os" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_Extender_Manual(t *testing.T) { diff --git a/test/functional/shared/resources/gateway_test.go b/test/functional/shared/resources/gateway_test.go index 954b15a285..ab6d45f006 100644 --- a/test/functional/shared/resources/gateway_test.go +++ b/test/functional/shared/resources/gateway_test.go @@ -26,10 +26,10 @@ import ( "testing" "time" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" ) diff --git a/test/functional/shared/resources/kubemetadata_container_test.go b/test/functional/shared/resources/kubemetadata_container_test.go index c17dcf619f..7290a9dfb3 100644 --- a/test/functional/shared/resources/kubemetadata_container_test.go +++ b/test/functional/shared/resources/kubemetadata_container_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/functional/shared/resources/kubemetadata_gateway_test.go b/test/functional/shared/resources/kubemetadata_gateway_test.go index 9b5151f99d..8e6879b7ff 100644 --- a/test/functional/shared/resources/kubemetadata_gateway_test.go +++ b/test/functional/shared/resources/kubemetadata_gateway_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" ) diff --git a/test/functional/shared/resources/kubemetadata_httproute_test.go b/test/functional/shared/resources/kubemetadata_httproute_test.go index f6e7471a38..897dbe38f4 100644 --- a/test/functional/shared/resources/kubemetadata_httproute_test.go +++ b/test/functional/shared/resources/kubemetadata_httproute_test.go @@ -20,10 +20,10 @@ import ( "context" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/functional/shared/resources/kubmetadata_cascade_test.go b/test/functional/shared/resources/kubmetadata_cascade_test.go index 422e90a44f..19bdb2d04a 100644 --- a/test/functional/shared/resources/kubmetadata_cascade_test.go +++ b/test/functional/shared/resources/kubmetadata_cascade_test.go @@ -21,10 +21,10 @@ import ( "fmt" "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/test/functional/shared/resources/persistent_volume_test.go b/test/functional/shared/resources/persistent_volume_test.go index c55f5ae235..59f2f21fb9 100644 --- a/test/functional/shared/resources/persistent_volume_test.go +++ b/test/functional/shared/resources/persistent_volume_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) func Test_PersistentVolume(t *testing.T) { diff --git a/test/functional/shared/resources/recipe_bicep_test.go b/test/functional/shared/resources/recipe_bicep_test.go index f5ba760123..cfa86848f8 100644 --- a/test/functional/shared/resources/recipe_bicep_test.go +++ b/test/functional/shared/resources/recipe_bicep_test.go @@ -23,12 +23,12 @@ import ( "strings" "testing" - "github.com/project-radius/radius/pkg/recipes" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" ) @@ -258,7 +258,7 @@ func Test_BicepRecipe_ParameterNotDefined(t *testing.T) { // NOTE: There is a bug in our error handling for deployements. We return the JSON text of the deployment error inside the message // of our error. This is wrong. // - // See: https://github.com/project-radius/radius/issues/6045 + // See: https://github.com/radius-project/radius/issues/6045 MessageContains: "Deployment template validation failed: 'The template parameters 'a, b' in the parameters file are not valid", }, @@ -345,7 +345,7 @@ func Test_BicepRecipe_LanguageFailure(t *testing.T) { // NOTE: There is a bug in our error handling for deployements. We return the JSON text of the deployment error inside the message // of our error. This is wrong. // - // See: https://github.com/project-radius/radius/issues/6046 + // See: https://github.com/radius-project/radius/issues/6046 MessageContains: "Unable to process template language expressions for resource", }, @@ -391,7 +391,7 @@ func Test_BicepRecipe_ResourceCreationFailure(t *testing.T) { // NOTE: There is a bug in our error handling for deployements. We return the JSON text of the deployment error inside the message // of our error. This is wrong. // - // See: https://github.com/project-radius/radius/issues/6047 + // See: https://github.com/radius-project/radius/issues/6047 MessageContains: "'not an id, just deal with it' is not a valid resource id", }, diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index b67687849b..4318e3b5f9 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -37,12 +37,12 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_radius "github.com/project-radius/radius/pkg/ucp/resources/radius" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) var ( diff --git a/test/functional/shared/resources/recipe_test.go b/test/functional/shared/resources/recipe_test.go index 982d15862c..d367fd1e1a 100644 --- a/test/functional/shared/resources/recipe_test.go +++ b/test/functional/shared/resources/recipe_test.go @@ -20,10 +20,10 @@ import ( "fmt" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) // This file contains tests for general recipe engine functionality - covering general behaviors that should @@ -34,7 +34,7 @@ import ( // behaviors. Some functionality needs to be tested for each driver. func Test_Recipe_NotFound(t *testing.T) { - t.Skip("Blocked by https://github.com/project-radius/radius/issues/6040") + t.Skip("Blocked by https://github.com/radius-project/radius/issues/6040") template := "testdata/corerp-resources-recipe-notfound.bicep" name := "corerp-resources-recipe-notfound" diff --git a/test/functional/shared/resources/storage_test.go b/test/functional/shared/resources/storage_test.go index 1726361526..574f93ce42 100644 --- a/test/functional/shared/resources/storage_test.go +++ b/test/functional/shared/resources/storage_test.go @@ -19,10 +19,10 @@ package resource_test import ( "testing" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/functional/shared" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/functional/shared" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/validation" ) // Test_Storage tests if a container can be created and then deleted by the magpiego with the workload identity. diff --git a/test/functional/shared/resources/testdata/manifest/sidecar.yaml b/test/functional/shared/resources/testdata/manifest/sidecar.yaml index ead07a339e..25d164474b 100644 --- a/test/functional/shared/resources/testdata/manifest/sidecar.yaml +++ b/test/functional/shared/resources/testdata/manifest/sidecar.yaml @@ -18,5 +18,5 @@ spec: spec: containers: - name: log-collector - # TODO: change it to ghcr.io/project-radius/fluent-bit:2.1.8 + # TODO: change it to ghcr.io/radius-project/fluent-bit:2.1.8 image: radiusdev.azurecr.io/fluent/fluent-bit:2.1.8 diff --git a/test/functional/shared/rptest.go b/test/functional/shared/rptest.go index 312494d93f..0f93500c4e 100644 --- a/test/functional/shared/rptest.go +++ b/test/functional/shared/rptest.go @@ -32,12 +32,12 @@ import ( "k8s.io/client-go/discovery" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/test" - "github.com/project-radius/radius/test/radcli" - "github.com/project-radius/radius/test/step" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/test" + "github.com/radius-project/radius/test/radcli" + "github.com/radius-project/radius/test/step" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/validation" ) var radiusControllerLogSync sync.Once diff --git a/test/functional/shared/test.go b/test/functional/shared/test.go index a0cf80f5e3..f0e172cea4 100644 --- a/test/functional/shared/test.go +++ b/test/functional/shared/test.go @@ -24,16 +24,16 @@ import ( "github.com/stretchr/testify/require" awsconfig "github.com/aws/aws-sdk-go-v2/config" - "github.com/project-radius/radius/pkg/azure/clientv2" - aztoken "github.com/project-radius/radius/pkg/azure/tokencredentials" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/test" - "github.com/project-radius/radius/test/functional" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/azure/clientv2" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/test" + "github.com/radius-project/radius/test/functional" + "github.com/radius-project/radius/test/testcontext" ) // NewRPTestOptions sets up the test environment by loading configs, creating a test context, creating an diff --git a/test/functional/ucp/aws_credential_test.go b/test/functional/ucp/aws_credential_test.go index 8733143d48..108a5b22f5 100644 --- a/test/functional/ucp/aws_credential_test.go +++ b/test/functional/ucp/aws_credential_test.go @@ -25,7 +25,7 @@ import ( "testing" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/stretchr/testify/require" ) diff --git a/test/functional/ucp/aws_test.go b/test/functional/ucp/aws_test.go index 943028b5e0..25657113bb 100644 --- a/test/functional/ucp/aws_test.go +++ b/test/functional/ucp/aws_test.go @@ -31,10 +31,10 @@ import ( awsconfig "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/google/uuid" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/frontend/controller/awsproxy" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/frontend/controller/awsproxy" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" ) @@ -44,7 +44,7 @@ var ( ) func Test_AWS_DeleteResource(t *testing.T) { - t.Skip("https://github.com/project-radius/radius/issues/5967") + t.Skip("https://github.com/radius-project/radius/issues/5967") ctx := context.Background() bucketName := generateS3BucketName() @@ -106,7 +106,7 @@ func Test_AWS_DeleteResource(t *testing.T) { } func Test_AWS_ListResources(t *testing.T) { - t.Skip("https://github.com/project-radius/radius/issues/5967") + t.Skip("https://github.com/radius-project/radius/issues/5967") ctx := context.Background() var bucketName = generateS3BucketName() diff --git a/test/functional/ucp/azure_credential_test.go b/test/functional/ucp/azure_credential_test.go index d29206cfd5..bba566ec51 100644 --- a/test/functional/ucp/azure_credential_test.go +++ b/test/functional/ucp/azure_credential_test.go @@ -24,8 +24,8 @@ import ( "net/http" "testing" - "github.com/project-radius/radius/pkg/to" - ucp "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/to" + ucp "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/stretchr/testify/require" ) diff --git a/test/functional/ucp/plane_test.go b/test/functional/ucp/plane_test.go index c216306fe6..0cf26ddfb3 100644 --- a/test/functional/ucp/plane_test.go +++ b/test/functional/ucp/plane_test.go @@ -24,10 +24,10 @@ import ( "net/http" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/rest" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/rest" "github.com/stretchr/testify/require" ) diff --git a/test/functional/ucp/proxy_test.go b/test/functional/ucp/proxy_test.go index 845eacf1ba..2f934ca797 100644 --- a/test/functional/ucp/proxy_test.go +++ b/test/functional/ucp/proxy_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/to" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/to" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/stretchr/testify/require" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/test/functional/ucp/resourcegroup_test.go b/test/functional/ucp/resourcegroup_test.go index 4b8fcced71..af5b2e425e 100644 --- a/test/functional/ucp/resourcegroup_test.go +++ b/test/functional/ucp/resourcegroup_test.go @@ -25,10 +25,10 @@ import ( "strings" "testing" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/to" - v20220901privatepreview "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" - "github.com/project-radius/radius/pkg/ucp/frontend/controller/resourcegroups" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/frontend/controller/resourcegroups" "github.com/stretchr/testify/require" ) diff --git a/test/functional/ucp/ucptest.go b/test/functional/ucp/ucptest.go index 6180a59b99..85bea2f774 100644 --- a/test/functional/ucp/ucptest.go +++ b/test/functional/ucp/ucptest.go @@ -23,11 +23,11 @@ import ( "sync" "testing" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/sdk" - "github.com/project-radius/radius/test" - "github.com/project-radius/radius/test/testcontext" - "github.com/project-radius/radius/test/validation" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/test" + "github.com/radius-project/radius/test/testcontext" + "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" ) diff --git a/test/magpiego/go.mod b/test/magpiego/go.mod index 5da9853095..94ef20a305 100644 --- a/test/magpiego/go.mod +++ b/test/magpiego/go.mod @@ -1,4 +1,4 @@ -module github.com/project-radius/radius/test/magpiego +module github.com/radius-project/radius/test/magpiego go 1.20 diff --git a/test/magpiego/server.go b/test/magpiego/server.go index bb9d147f6f..cc4f78104c 100644 --- a/test/magpiego/server.go +++ b/test/magpiego/server.go @@ -7,7 +7,7 @@ import ( "net/http" "github.com/go-chi/chi/v5" - "github.com/project-radius/radius/test/magpiego/bindings" + "github.com/radius-project/radius/test/magpiego/bindings" ) var server *http.Server diff --git a/test/options.go b/test/options.go index f050ef5ad4..77c12a1405 100644 --- a/test/options.go +++ b/test/options.go @@ -25,8 +25,8 @@ import ( "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/project-radius/radius/pkg/cli" - "github.com/project-radius/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli" + "github.com/radius-project/radius/pkg/cli/kubernetes" ) type TestOptions struct { diff --git a/test/radcli/cli.go b/test/radcli/cli.go index b3c287a998..eb258a8d0f 100644 --- a/test/radcli/cli.go +++ b/test/radcli/cli.go @@ -28,7 +28,7 @@ import ( "testing" "time" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) const ( diff --git a/test/radcli/shared.go b/test/radcli/shared.go index 2cb53afe63..b0a85de67d 100644 --- a/test/radcli/shared.go +++ b/test/radcli/shared.go @@ -27,19 +27,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/golang/mock/gomock" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/pkg/cli/aws" - "github.com/project-radius/radius/pkg/cli/azure" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/clients_new/generated" - "github.com/project-radius/radius/pkg/cli/cmd/env/namespace" - "github.com/project-radius/radius/pkg/cli/connections" - "github.com/project-radius/radius/pkg/cli/framework" - "github.com/project-radius/radius/pkg/cli/helm" - "github.com/project-radius/radius/pkg/cli/kubernetes" - "github.com/project-radius/radius/pkg/cli/output" - "github.com/project-radius/radius/pkg/cli/prompt" - "github.com/project-radius/radius/pkg/ucp/api/v20220901privatepreview" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/cli/aws" + "github.com/radius-project/radius/pkg/cli/azure" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/pkg/cli/cmd/env/namespace" + "github.com/radius-project/radius/pkg/cli/connections" + "github.com/radius-project/radius/pkg/cli/framework" + "github.com/radius-project/radius/pkg/cli/helm" + "github.com/radius-project/radius/pkg/cli/kubernetes" + "github.com/radius-project/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/prompt" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" diff --git a/test/step/deployerrorexecutor.go b/test/step/deployerrorexecutor.go index 9c0c1bcdae..0132c7c994 100644 --- a/test/step/deployerrorexecutor.go +++ b/test/step/deployerrorexecutor.go @@ -27,9 +27,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" - "github.com/project-radius/radius/test" - "github.com/project-radius/radius/test/radcli" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/test" + "github.com/radius-project/radius/test/radcli" ) var _ Executor = (*DeployErrorExecutor)(nil) diff --git a/test/step/deployexecutor.go b/test/step/deployexecutor.go index c31705639f..b5e7377c02 100644 --- a/test/step/deployexecutor.go +++ b/test/step/deployexecutor.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/project-radius/radius/test" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/test" + "github.com/radius-project/radius/test/radcli" ) var _ Executor = (*DeployExecutor)(nil) diff --git a/test/step/interface.go b/test/step/interface.go index 3a530bcec0..a32f7268a6 100644 --- a/test/step/interface.go +++ b/test/step/interface.go @@ -20,7 +20,7 @@ import ( "context" "testing" - "github.com/project-radius/radius/test" + "github.com/radius-project/radius/test" ) type Executor interface { diff --git a/test/testutil/resourcetypeutil/types.go b/test/testutil/resourcetypeutil/types.go index b8754dbd10..a0f3776312 100644 --- a/test/testutil/resourcetypeutil/types.go +++ b/test/testutil/resourcetypeutil/types.go @@ -19,7 +19,7 @@ package resourcetypeutil import ( "encoding/json" - v1 "github.com/project-radius/radius/pkg/armrpc/api/v1" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ) // FakeResource is a fake resource type. diff --git a/test/ucp/kubeenv/testenv.go b/test/ucp/kubeenv/testenv.go index d2ab0a2dcc..a800c309c9 100644 --- a/test/ucp/kubeenv/testenv.go +++ b/test/ucp/kubeenv/testenv.go @@ -23,7 +23,7 @@ import ( "os" "os/exec" - ucpv1alpha1 "github.com/project-radius/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" + ucpv1alpha1 "github.com/radius-project/radius/pkg/ucp/store/apiserverstore/api/ucp.dev/v1alpha1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/test/ucp/queuetest/shared.go b/test/ucp/queuetest/shared.go index 46ff944999..dbe640e06f 100644 --- a/test/ucp/queuetest/shared.go +++ b/test/ucp/queuetest/shared.go @@ -24,8 +24,8 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/ucp/queue/client" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/ucp/queue/client" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/test/ucp/storetest/shared.go b/test/ucp/storetest/shared.go index e02fca2309..f0ccd5cefa 100644 --- a/test/ucp/storetest/shared.go +++ b/test/ucp/storetest/shared.go @@ -21,10 +21,10 @@ import ( "encoding/json" "testing" - "github.com/project-radius/radius/pkg/ucp/resources" - "github.com/project-radius/radius/pkg/ucp/store" - "github.com/project-radius/radius/pkg/ucp/util/etag" - "github.com/project-radius/radius/test/testcontext" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/pkg/ucp/util/etag" + "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) diff --git a/test/validation/aws.go b/test/validation/aws.go index 7ee37a8c8c..fb731db981 100644 --- a/test/validation/aws.go +++ b/test/validation/aws.go @@ -23,14 +23,14 @@ import ( "testing" "time" - "github.com/project-radius/radius/pkg/to" + "github.com/radius-project/radius/pkg/to" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/aws-sdk-go-v2/service/sts" - awsclient "github.com/project-radius/radius/pkg/ucp/aws" - "github.com/project-radius/radius/pkg/ucp/resources" - resources_aws "github.com/project-radius/radius/pkg/ucp/resources/aws" + awsclient "github.com/radius-project/radius/pkg/ucp/aws" + "github.com/radius-project/radius/pkg/ucp/resources" + resources_aws "github.com/radius-project/radius/pkg/ucp/resources/aws" "github.com/stretchr/testify/require" ) diff --git a/test/validation/k8s.go b/test/validation/k8s.go index 8f682cf2a9..0772efd7e1 100644 --- a/test/validation/k8s.go +++ b/test/validation/k8s.go @@ -24,7 +24,7 @@ import ( "testing" "time" - kuberneteskeys "github.com/project-radius/radius/pkg/kubernetes" + kuberneteskeys "github.com/radius-project/radius/pkg/kubernetes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" @@ -418,7 +418,7 @@ func ValidateNoPodsInApplication(ctx context.Context, t *testing.T, k8s *kuberne } func listPodsWithRetries(t *testing.T, k8s *kubernetes.Clientset, labelset map[string]string, namespace, application string) (*corev1.PodList, error) { - // Need to retry because of AKS error: https://github.com/project-radius/radius/issues/2484 + // Need to retry because of AKS error: https://github.com/radius-project/radius/issues/2484 retries := 3 for i := 1; i <= retries; i++ { actualPods, err := k8s.CoreV1().Pods(namespace).List(context.Background(), metav1.ListOptions{ diff --git a/test/validation/shared.go b/test/validation/shared.go index a031bffd4c..768be879c0 100644 --- a/test/validation/shared.go +++ b/test/validation/shared.go @@ -24,11 +24,11 @@ import ( "testing" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/project-radius/radius/pkg/cli/clients" - "github.com/project-radius/radius/pkg/cli/output" + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/output" "github.com/stretchr/testify/require" - "github.com/project-radius/radius/test/radcli" + "github.com/radius-project/radius/test/radcli" ) const ( From dc245450f0c58e401adbc64d6a8c5f6baafd08a1 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 31 Aug 2023 13:42:06 -0700 Subject: [PATCH 31/57] Clean up CADL and unused swagger files (#6181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is to clean up CADL and unused swagger files. UCP cadl will be removed once the migration is done. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 7d15be3 ### Summary 🐰📝🔑 This pull request removes the cadl files for the applications Dapr, Datastores, and Messaging, as they are no longer needed for the radius project. It also adds examples of using the Applications.Messaging API to create, delete, get, list, and list secrets of RabbitMQQueue resources, as part of the new feature of RabbitMQ integration for applications and environments. > _`Messaging` examples_ > _RabbitMQQueue resource_ > _Autumn of new features_ ### Walkthrough * Add examples of using the Applications.Messaging API to create, update, delete, get, list, and list secrets of RabbitMQQueue resources ([link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-cb0d845f8632d782e5a978ca954cf793494d86ea271ac98ce895fcaa3e958cdbL1-R58), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-53e3d40b317d384f84aaaef6b5ca8f4228609565649e6608a95cddf2941420f1L1-R13), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-6a9cb25866912e2dfd3aacc6588cc567f9ab22f801c2560b1f28cbac89b9ca66L1-R28), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-fbcf6aa905d9924a1418d0c615a327df2f2ee647796862a7bedebec8f126327aL1-R46), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-649f60750aa41e3c5ae49fa9aea42db50ff55a7cc247be3678c4bc7a559da752L1-R49), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-1cdf3d557a1230d3a2c08fd96642de8f0925acea623baa295757b79655098bfeL1-R16)) * Delete the `cadl` folder and its contents ([link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-40f1bfac9566022507c89cafd12022810ff810a221b560387d6786da38433054), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-29eeade9e077e9bc114f5e1dc1167f671b29811653bba82fd2457a7603d5cff3), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-a598c7d0f81b22cc149e38630aa4bb3e60d164b0b1984cdcfbd86b50b48ec005), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-238173129cc785d5ddb0fa28c866a0dd5bda38025a400033952b50cf12bc7ab1), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-effbd2730324dc1f4b480c822c82d7625c8af004f0e27ad7f29dd882f6c28709), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-0a6ad1c176a1d8076ecb8980ebcaa112460c948f96b4120346575439cfd61c43), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-e2c33ddb1923ee3f39c1cfd167b284c71728fe529cf255e56737757b21057329), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-5a7d1284350bbf2eceedb7bffb285cba1abe5a415a4cdb26b32565dc6bd05e77), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-2100c3de970390a26aded0dd4f09c0885bceb9442e05d02c41fced56fa976200), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-08c5d0ac45508f610a75277b2539e66f89bdf606846114722563a893c55df3e5), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-c191ee43980bf3db660a408b25bcd85bbd072722f62acf71346f61d079ffad4d), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-8c4f8650af19e87b0f9a8ef6ea0bccbe3489efced9368448e41b3d7ce4b4722a), [link](https://github.com/radius-project/radius/pull/6181/files?diff=unified&w=0#diff-9eb9b73ca128253c55880f0fee287ef369c63cef6bc091e5582ead8687234136)) --- cadl/Applications.Dapr/cadl-project.yaml | 5 - cadl/Applications.Dapr/main.cadl | 38 - cadl/Applications.Dapr/pubSubBrokers.cadl | 79 -- cadl/Applications.Dapr/secretStores.cadl | 76 -- cadl/Applications.Dapr/stateStores.cadl | 79 -- .../Applications.Datastores/cadl-project.yaml | 5 - cadl/Applications.Datastores/main.cadl | 38 - .../mongoDatabases.cadl | 111 -- cadl/Applications.Datastores/redisCaches.cadl | 113 -- .../Applications.Datastores/sqlDatabases.cadl | 111 -- cadl/Applications.Messaging/cadl-project.yaml | 5 - cadl/Applications.Messaging/main.cadl | 36 - .../rabbitMQQueues.cadl | 125 -- .../2022-03-15-privatepreview/openapi.json | 885 -------------- .../RabbitMQQueues_CreateOrUpdate.json | 59 + .../examples/RabbitMQQueues_Delete.json | 14 + .../examples/RabbitMQQueues_Get.json | 29 + .../examples/RabbitMQQueues_List.json | 47 + .../RabbitMQQueues_ListByRootScope.json | 50 + .../examples/RabbitMQQueues_ListSecrets.json | 17 + .../examples/RabbitMQQueues_Update.json | 59 + .../2022-03-15-privatepreview/openapi.json | 33 + .../TestAsyncResource_CreateOrUpdate.json | 30 - .../examples/TestAsyncResource_Delete.json | 14 - .../examples/TestAsyncResource_Get.json | 22 - .../examples/TestAsyncResource_List.json | 35 - .../TestAsyncResource_ListByScope.json | 35 - .../examples/TestAsyncResource_Update.json | 30 - .../preview/2022-08-19-preview/openapi.json | 744 ------------ .../TestAsyncResource_CreateOrUpdate.json | 30 - .../examples/TestAsyncResource_Delete.json | 14 - .../examples/TestAsyncResource_Get.json | 22 - .../examples/TestAsyncResource_List.json | 35 - .../TestAsyncResource_ListByScope.json | 35 - .../examples/TestAsyncResource_Update.json | 30 - .../TestSyncResource_CreateOrUpdate.json | 30 - .../examples/TestSyncResource_Get.json | 22 - .../examples/TestSyncResource_List.json | 35 - .../TestSyncResource_ListByScope.json | 35 - .../examples/TestSyncResource_Update.json | 30 - .../stable/2023-08-19/openapi.json | 1038 ----------------- .../RabbitMQQueues_CreateOrUpdate.json | 2 +- .../RabbitMQQueues_Delete.json | 2 +- .../RabbitMQQueues_Get.json | 2 +- .../RabbitMQQueues_List.json | 2 +- .../RabbitMQQueues_ListByRootScope.json | 2 +- .../RabbitMQQueues_ListSecrets.json | 2 +- .../RabbitMQQueues_Update.json | 2 +- 48 files changed, 315 insertions(+), 3979 deletions(-) delete mode 100644 cadl/Applications.Dapr/cadl-project.yaml delete mode 100644 cadl/Applications.Dapr/main.cadl delete mode 100644 cadl/Applications.Dapr/pubSubBrokers.cadl delete mode 100644 cadl/Applications.Dapr/secretStores.cadl delete mode 100644 cadl/Applications.Dapr/stateStores.cadl delete mode 100644 cadl/Applications.Datastores/cadl-project.yaml delete mode 100644 cadl/Applications.Datastores/main.cadl delete mode 100644 cadl/Applications.Datastores/mongoDatabases.cadl delete mode 100644 cadl/Applications.Datastores/redisCaches.cadl delete mode 100644 cadl/Applications.Datastores/sqlDatabases.cadl delete mode 100644 cadl/Applications.Messaging/cadl-project.yaml delete mode 100644 cadl/Applications.Messaging/main.cadl delete mode 100644 cadl/Applications.Messaging/rabbitMQQueues.cadl delete mode 100644 swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_CreateOrUpdate.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Delete.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Get.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_List.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListByRootScope.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListSecrets.json create mode 100644 swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json delete mode 100644 swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json diff --git a/cadl/Applications.Dapr/cadl-project.yaml b/cadl/Applications.Dapr/cadl-project.yaml deleted file mode 100644 index e462dbc8a3..0000000000 --- a/cadl/Applications.Dapr/cadl-project.yaml +++ /dev/null @@ -1,5 +0,0 @@ -emit: - - "@azure-tools/cadl-autorest" -options: - "@azure-tools/cadl-autorest": - emitter-output-dir: "{project-root}/../../swagger/specification/applications/resource-manager/Applications.Dapr/preview/2022-03-15-privatepreview/" \ No newline at end of file diff --git a/cadl/Applications.Dapr/main.cadl b/cadl/Applications.Dapr/main.cadl deleted file mode 100644 index 44c055608b..0000000000 --- a/cadl/Applications.Dapr/main.cadl +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "./pubSubBrokers.cadl"; -import "./secretStores.cadl"; -import "./stateStores.cadl"; -import "@cadl-lang/openapi"; -import "../common.cadl"; - -using OpenAPI; -using Cadl.Versioning; -using Azure.ResourceManager; - -@armProviderNamespace -@service({ - title: "Applications.Dapr Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Dapr") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Dapr; - -interface Operations extends Azure.ResourceManager.Operations {} \ No newline at end of file diff --git a/cadl/Applications.Dapr/pubSubBrokers.cadl b/cadl/Applications.Dapr/pubSubBrokers.cadl deleted file mode 100644 index fc23464936..0000000000 --- a/cadl/Applications.Dapr/pubSubBrokers.cadl +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Dapr; -@doc("Dapr PubSubBroker portable resource properties") -model DaprPubSubBrokerProperties extends BasicDaprResourceProperties { - @doc("Provisioning state of the Dapr PubSubBroker portable resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Metadata for the Dapr PubSubBroker resource. This should match the values specified in Dapr component spec") - metadata?: object; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Dapr PubSubBroker portable resource") - recipe?: Recipe; - - @doc("A collection of references to resources associated with the Dapr PubSubBroker") - resources?: ResourceReference[]; - - @doc("Dapr PubSubBroker type. These strings match the format used by Dapr Kubernetes configuration format.") - type?: string; - - @doc("Dapr component version") - version?: string; -} - -@doc("Dapr PubSubBroker portable resource") -model DaprPubSubBrokerResource is TrackedResource { - @doc("Dapr PubSubBroker name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$") - @key("daprPubSubBrokerName") - @path - @extension("x-ms-parameter-location", "method") - @segment("pubSubBrokers") - name: string; -} - -@armResourceOperations -interface DaprPubSubBroker - extends Radius.ResourceOperationWithAsyncDelete< - DaprPubSubBrokerResource, - DaprPubSubBrokerProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Dapr/secretStores.cadl b/cadl/Applications.Dapr/secretStores.cadl deleted file mode 100644 index 04cd162b6b..0000000000 --- a/cadl/Applications.Dapr/secretStores.cadl +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Dapr; -@doc("Dapr SecretStore portable resource properties") -model DaprSecretStoreProperties extends BasicDaprResourceProperties { - @doc("Provisioning state of the dapr secret store portable resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Dapr SecretStore type. These strings match the types defined in Dapr Component format: https://docs.dapr.io/reference/components-reference/supported-secret-stores/") - type?: string; - - @doc("Dapr component version") - version?: string; - - @doc("Metadata for the Dapr SecretStore resource. This should match the values specified in Dapr component spec") - metadata?: object; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Dapr SecretStore portable resource") - recipe?: Recipe; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; -} - -@doc("Dapr SecretStore portable resource") -model DaprSecretStoreResource is TrackedResource { - @doc("Dapr SecretStore name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$") - @key("daprSecretStoreName") - @path - @segment("secretStores") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@armResourceOperations -interface DaprSecretStore - extends Radius.ResourceOperationWithSyncDelete< - DaprSecretStoreResource, - DaprSecretStoreProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Dapr/stateStores.cadl b/cadl/Applications.Dapr/stateStores.cadl deleted file mode 100644 index cdd549d9e1..0000000000 --- a/cadl/Applications.Dapr/stateStores.cadl +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Dapr; -@doc("Dapr StateStore portable resource properties") -model DaprStateStoreProperties extends BasicDaprResourceProperties { - @doc("Provisioning state of the DaprStateStore portable resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Metadata for the Dapr StateStore resource. This should match the values specified in Dapr component spec") - metadata?: object; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Dapr StateStore portable resource") - recipe?: Recipe; - - @doc("A collection of references to resources associated with the Dapr StateStore") - resources?: ResourceReference[]; - - @doc("Dapr StateStore type. These strings match the format used by Dapr Kubernetes configuration format.") - type?: string; - - @doc("Dapr component version") - version?: string; -} - -@doc("Dapr StateStore portable resource") -model DaprStateStoreResource is TrackedResource { - @doc("Dapr StateStore name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9\\.]*[A-Za-z0-9\\.])?$") - @key("daprStateStoreName") - @path - @segment("stateStores") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@armResourceOperations -interface DaprStateStore - extends Radius.ResourceOperationWithAsyncDelete< - DaprStateStoreResource, - DaprStateStoreProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Datastores/cadl-project.yaml b/cadl/Applications.Datastores/cadl-project.yaml deleted file mode 100644 index 1d06506b2e..0000000000 --- a/cadl/Applications.Datastores/cadl-project.yaml +++ /dev/null @@ -1,5 +0,0 @@ -emit: - - "@azure-tools/cadl-autorest" -options: - "@azure-tools/cadl-autorest": - emitter-output-dir: "{project-root}/../../swagger/specification/applications/resource-manager/Applications.Datastores/preview/2022-03-15-privatepreview/" \ No newline at end of file diff --git a/cadl/Applications.Datastores/main.cadl b/cadl/Applications.Datastores/main.cadl deleted file mode 100644 index 8d4e1be6a9..0000000000 --- a/cadl/Applications.Datastores/main.cadl +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "./mongoDatabases.cadl"; -import "./sqlDatabases.cadl"; -import "./redisCaches.cadl"; -import "@cadl-lang/openapi"; -import "../common.cadl"; - -using OpenAPI; -using Cadl.Versioning; -using Azure.ResourceManager; - -@armProviderNamespace -@service({ - title: "Applications.Datastores Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Datastores") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Datastores; - -interface Operations extends Azure.ResourceManager.Operations {} \ No newline at end of file diff --git a/cadl/Applications.Datastores/mongoDatabases.cadl b/cadl/Applications.Datastores/mongoDatabases.cadl deleted file mode 100644 index c23714b480..0000000000 --- a/cadl/Applications.Datastores/mongoDatabases.cadl +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Datastores; -@doc("Mongo database portable resource") -model MongoDatabaseResource is TrackedResource { - @doc("The name of the Mongo database portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @segment("mongoDatabases") - @key("mongoDatabaseName") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@doc("The secret values for the given Mongo database resource") -model MongoDatabaseListSecretsResult is MongoDatabaseSecrets; - -@doc("The secret values for the given Mongo database resource") -model MongoDatabaseSecrets { - @doc("Password to use when connecting to the target Mongo database") - password?: string; - - @doc("Connection string used to connect to the target Mongo database") - connectionString?: string; -} - -@doc("Mongo database portable resource properties") -model MongoDatabaseProperties extends BasicResourceProperties{ - @doc("Provisioning state of the Mongo database portable resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Secret values provided for the resource") - secrets?: MongoDatabaseSecrets; - - @doc("Host name of the target Mongo database") - host?: string; - - @doc("Port value of the target Mongo database") - port?: int32; - - @doc("Database name of the target Mongo database") - database?: string; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Mongo database portable resource") - recipe?: Recipe; - - @doc("List of the resource IDs that support the Mongo database resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Username to use when connecting to the target Mongo database") - username?: string; -} - -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified Mongo database resource") -@post -@route("/{rootScope}/providers/Applications.Datastores/mongoDatabases/{mongoDatabaseName}/listSecrets") -op MongoDatabases_listSecrets(...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the Mongo database portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - mongoDatabaseName: string): ArmResponse - | ErrorResponse; - -@armResourceOperations -interface MongoDatabases - extends Radius.ResourceOperationWithAsyncDelete< - MongoDatabaseResource, - MongoDatabaseProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Datastores/redisCaches.cadl b/cadl/Applications.Datastores/redisCaches.cadl deleted file mode 100644 index ff107121ea..0000000000 --- a/cadl/Applications.Datastores/redisCaches.cadl +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Datastores; -@doc("Redis cache portable resource") -model RedisCacheResource - is TrackedResource { - @doc("The name of the Redis cache portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("redisCacheName") - @path - @segment("redisCaches") - name: string; -} - -@doc("The secret values for the given Redis cache resource") -model RedisCacheListSecretsResult is RedisCacheSecrets; - -@doc("The secret values for the given Redis cache resource") -model RedisCacheSecrets { - @doc("The connection string used to connect to the Redis cache") - connectionString?: string; - - @doc("The password for this Redis cache instance") - password?: string; - - @doc("The URL used to connect to the Redis cache") - url?: string -} - -@doc("Redis cache portable resource properties") -model RedisCacheProperties extends BasicResourceProperties { - @doc("Provisioning state of the redis cache portable at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Secrets provided by resource") - secrets?: RedisCacheSecrets; - - @doc("The host name of the target Redis cache") - host?: string; - - @doc("The port value of the target Redis cache") - port?: int32; - - @doc("The username for Redis cache") - username?: string; - - @doc("Specifies whether to enable SSL connections to the Redis cache") - tls?: boolean; - - @doc("The recipe used to automatically deploy underlying infrastructure for the Redis cache portable resource") - recipe?: Recipe; - - @doc("List of the resource IDs that support the Redis resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; -} -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified Redis cache resource") -@route("/{rootScope}/providers/Applications.Datastores/redisCaches/{redisCacheName}/listSecrets") -@post -op RedisCaches_listSecrets( - ...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the Redis cache portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - redisCacheName: string): ArmResponse | ErrorResponse; - -@armResourceOperations -interface RedisCaches - extends Radius.ResourceOperationWithSyncDelete< - RedisCacheResource, - RedisCacheProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Datastores/sqlDatabases.cadl b/cadl/Applications.Datastores/sqlDatabases.cadl deleted file mode 100644 index f784960c5d..0000000000 --- a/cadl/Applications.Datastores/sqlDatabases.cadl +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Datastores; -@doc("Sql database properties") -model SqlDatabaseProperties extends BasicResourceProperties { - @doc("Provisioning state of the SQL database portable resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("The name of the SQL database.") - database?: string; - - @doc("The fully qualified domain name of the target SQL database.") - server?: string; - - @doc("Port value of the target SQL database") - port?: int32; - - @doc("Username to use when connecting to the target SQL database") - username?: string; - - @doc("The recipe used to automatically deploy underlying infrastructure for the SQL database portable resource") - recipe?: Recipe; - - @doc("List of the resource IDs that support the SQL database resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("Secret values provided for the resource") - secrets?: SqlDatabaseSecrets; -} - -@doc("The secret values for the given SQL database resource") -model SqlDatabaseListSecretsResult is SqlDatabaseSecrets; - -@doc("The secret values for the given SQL database resource") -model SqlDatabaseSecrets { - @doc("Password to use when connecting to the target SQL database") - password?: string; - - @doc("Connection string used to connect to the target SQL database") - connectionString?: string; -} - -@doc("Sql database portable resource") -model SqlDatabaseResource is TrackedResource { - @doc("The name of the SQL database portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("sqlDatabaseName") - @path - @segment("sqlDatabases") - @extension("x-ms-parameter-location", "method") - name: string; -} - -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified SQL database resource") -@post -@route("/{rootScope}/providers/Applications.Datastores/sqlDatabases/{sqlDatabaseName}/listSecrets") -op SqlDatabases_listSecrets(...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the SQL database portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - sqlDatabaseName: string): ArmResponse - | ErrorResponse; - -@armResourceOperations -interface SqlDatabases - extends Radius.ResourceOperationWithSyncDelete< - SqlDatabaseResource, - SqlDatabaseProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/cadl/Applications.Messaging/cadl-project.yaml b/cadl/Applications.Messaging/cadl-project.yaml deleted file mode 100644 index d1cdac3f53..0000000000 --- a/cadl/Applications.Messaging/cadl-project.yaml +++ /dev/null @@ -1,5 +0,0 @@ -emit: - - "@azure-tools/cadl-autorest" -options: - "@azure-tools/cadl-autorest": - emitter-output-dir: "{project-root}/../../swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/" \ No newline at end of file diff --git a/cadl/Applications.Messaging/main.cadl b/cadl/Applications.Messaging/main.cadl deleted file mode 100644 index 4d2c0daccf..0000000000 --- a/cadl/Applications.Messaging/main.cadl +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "./rabbitMQQueues.cadl"; -import "@cadl-lang/openapi"; -import "../common.cadl"; - -using OpenAPI; -using Cadl.Versioning; -using Azure.ResourceManager; - -@armProviderNamespace -@service({ - title: "Applications.Messaging Management APIs", - version: "2022-03-15-privatepreview", -}) -@doc("REST APIs for Applications.Messaging") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Applications.Messaging; - -interface Operations extends Azure.ResourceManager.Operations {} diff --git a/cadl/Applications.Messaging/rabbitMQQueues.cadl b/cadl/Applications.Messaging/rabbitMQQueues.cadl deleted file mode 100644 index 2403f0022a..0000000000 --- a/cadl/Applications.Messaging/rabbitMQQueues.cadl +++ /dev/null @@ -1,125 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -// These files allow the use of {rootScope} in the generated paths with a custom resourceOperations object -import "../customRootScope.cadl"; -import "../aksrootscope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using OpenAPI; - -namespace Applications.Messaging; - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("RabbitMQQueue portable resource") -model RabbitMQQueueResource - is TrackedResource { - @doc("The name of the RabbitMQQueue portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("rabbitMQQueueName") - @path - @segment("rabbitMQQueues") - name: string; -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("The secret values for the given RabbitMQQueue resource") -model RabbitMQListSecretsResult is RabbitMQSecrets; - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("The secret values for the given RabbitMQQueue resource") -model RabbitMQSecrets { - @doc("The password used to connect to the RabbitMQ instance") - password?: string; - - @doc("The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value") - uri?: string; -} -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use PascalCase" -@doc("RabbitMQQueue portable resource properties") -model RabbitMQQueueProperties extends BasicResourceProperties { - @doc("Provisioning state of the rabbitMQ message queue portable resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; - - @doc("Secrets provided by resources,") - secrets?: RabbitMQSecrets; - - @doc("The name of the queue") - queue?: string; - - @doc("The hostname of the RabbitMQ instance") - host?: string; - - @doc("The port of the RabbitMQ instance. Defaults to 5672") - port?: int32; - - @doc("The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost.") - vHost?: string; - - @doc("The username to use when connecting to the RabbitMQ instance") - username?: string; - - @doc("List of the resource IDs that support the rabbitMQ resource") - resources?: ResourceReference[]; - - @doc("Specifies how the underlying service/resource is provisioned and managed.") - resourceProvisioning?: ResourceProvisioning; - - @doc("The recipe used to automatically deploy underlying infrastructure for the rabbitMQQueue portable resource") - recipe?: Recipe; - - @doc("Specifies whether to use SSL when connecting to the RabbitMQ instance") - tls?: boolean; - -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Model types must use camelCase" -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-outside-interface" "This is an interface template" -@doc("Lists secrets values for the specified RabbitMQQueue resource") -@post -@route("/{rootScope}/providers/Applications.Messaging/rabbitMQQueues/{rabbitMQQueueName}/listSecrets") -op RabbitMQQueues_listSecrets( - ...ApiVersionParameter, - ...RootScopeParam, - @doc("The name of the RabbitMQQueue portable resource") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @path - @extension("x-ms-parameter-location", "method") - rabbitMQQueueName: string -): ArmResponse | ErrorResponse; - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCase" -@armResourceOperations -interface RabbitMQQueues - extends Radius.ResourceOperationWithSyncDelete< - RabbitMQQueueResource, - RabbitMQQueueProperties, - RootScopeParam - > {} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json deleted file mode 100644 index 33873541da..0000000000 --- a/swagger/specification/applications/resource-manager/Applications.Messagging/preview/2022-03-15-privatepreview/openapi.json +++ /dev/null @@ -1,885 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Applications.Messagging Resource Management APIs", - "version": "2022-03-15-privatepreview", - "description": "REST API for Applications.Messagging", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "tags": [ - { - "name": "Operations" - }, - { - "name": "RabbitMQQueues" - } - ], - "paths": { - "/{rootScope}/providers/Applications.Messagging/rabbitMQQueues": { - "get": { - "operationId": "RabbitMqQueues_ListByScope", - "tags": [ - "RabbitMQQueues" - ], - "description": "List RabbitMQQueueResource resources by Scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQQueueResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Applications.Messagging/rabbitMQQueues/{rabbitMQQueueName}": { - "get": { - "operationId": "RabbitMqQueues_Get", - "tags": [ - "RabbitMQQueues" - ], - "description": "Get a RabbitMQQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "rabbitMQQueueName", - "in": "path", - "description": "The name of the RabbitMQQueue portable resource resource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQQueueResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - }, - "put": { - "operationId": "RabbitMqQueues_Create", - "tags": [ - "RabbitMQQueues" - ], - "description": "Create a RabbitMQQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "rabbitMQQueueName", - "in": "path", - "description": "The name of the RabbitMQQueue portable resource resource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "resource", - "in": "body", - "description": "Resource create parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/RabbitMQQueueResource" - } - } - ], - "responses": { - "200": { - "description": "Resource 'RabbitMQQueueResource' update operation succeeded", - "schema": { - "$ref": "#/definitions/RabbitMQQueueResource" - } - }, - "201": { - "description": "Resource 'RabbitMQQueueResource' create operation succeeded", - "schema": { - "$ref": "#/definitions/RabbitMQQueueResource" - }, - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "operationId": "RabbitMqQueues_Update", - "tags": [ - "RabbitMQQueues" - ], - "description": "Update a RabbitMQQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "rabbitMQQueueName", - "in": "path", - "description": "The name of the RabbitMQQueue portable resource resource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "properties", - "in": "body", - "description": "The resource properties to be updated.", - "required": true, - "schema": { - "$ref": "#/definitions/RabbitMQQueueResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQQueueResource" - } - }, - "202": { - "description": "Resource update request accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - }, - "delete": { - "operationId": "RabbitMqQueues_Delete", - "tags": [ - "RabbitMQQueues" - ], - "description": "Delete a RabbitMQQueueResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "rabbitMQQueueName", - "in": "path", - "description": "The name of the RabbitMQQueue portable resource resource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - } - }, - "/{rootScope}/providers/Applications.Messagging/rabbitMQQueues/{rabbitMQQueueName}/listSecrets": { - "post": { - "operationId": "RabbitMqQueues_ListSecrets", - "tags": [ - "RabbitMQQueues" - ], - "description": "Lists secrets values for the specified RabbitMQQueue resource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "rabbitMQQueueName", - "in": "path", - "description": "The name of the RabbitMQQueue portable resource resource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "body", - "in": "body", - "description": "The content of the action request", - "required": true, - "schema": { - "type": "object", - "properties": {} - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/RabbitMQListSecretsResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Applications.Messagging/operations": { - "get": { - "operationId": "Operations_List", - "tags": [ - "Operations" - ], - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "EnvironmentCompute": { - "type": "object", - "description": "Represents backing compute resource", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for EnvironmentCompute." - }, - "resourceId": { - "type": "string", - "description": "The resource id of the compute resource for application environment." - }, - "identity": { - "$ref": "#/definitions/IdentitySettings", - "description": "Configuration for supported external identity providers" - } - }, - "discriminator": "kind", - "required": [ - "kind" - ] - }, - "IdentitySettingKind": { - "type": "string", - "description": "IdentitySettingKind is the kind of supported external identity setting", - "enum": [ - "undefined", - "azure.com.workload" - ], - "x-ms-enum": { - "name": "IdentitySettingKind", - "modelAsString": true, - "values": [ - { - "name": "undefined", - "value": "undefined", - "description": "undefined identity" - }, - { - "name": "azure.com.workload", - "value": "azure.com.workload", - "description": "azure ad workload identity" - } - ] - } - }, - "IdentitySettings": { - "type": "object", - "description": "IdentitySettings is the external identity setting.", - "properties": { - "kind": { - "$ref": "#/definitions/IdentitySettingKind", - "description": "kind of identity setting" - }, - "oidcIssuer": { - "type": "string", - "description": "The URI for your compute platform's OIDC issuer" - }, - "resource": { - "type": "string", - "description": "The resource ID of the provisioned identity" - } - }, - "required": [ - "kind" - ] - }, - "KubernetesCompute": { - "type": "object", - "description": "The Kubernetes compute configuration", - "properties": { - "namespace": { - "type": "string", - "description": "The namespace to use for the environment." - } - }, - "required": [ - "namespace" - ], - "allOf": [ - { - "$ref": "#/definitions/EnvironmentCompute" - } - ], - "x-ms-discriminator-value": "kubernetes" - }, - "OutputResource": { - "type": "object", - "description": "Properties of an output resource.", - "properties": { - "localId": { - "type": "string", - "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." - }, - "id": { - "type": "string", - "description": "The UCP resource ID of the underlying resource." - }, - "radiusManaged": { - "type": "boolean", - "description": "Determines whether Radius manages the lifecycle of the underlying resource." - } - } - }, - "ProvisioningState": { - "type": "string", - "description": "Provisioning state of the portable resource at the time the operation was called", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true, - "values": [ - { - "name": "Succeeded", - "value": "Succeeded", - "description": "Resource has been created." - }, - { - "name": "Failed", - "value": "Failed", - "description": "Resource creation failed." - }, - { - "name": "Canceled", - "value": "Canceled", - "description": "Resource creation was canceled." - }, - { - "name": "Provisioning", - "value": "Provisioning", - "description": "The resource is being provisioned" - }, - { - "name": "Updating", - "value": "Updating", - "description": "The resource is updating" - }, - { - "name": "Deleting", - "value": "Deleting", - "description": "The resource is being deleted" - }, - { - "name": "Accepted", - "value": "Accepted", - "description": "The resource create request has been accepted" - } - ] - }, - "readOnly": true - }, - "RabbitMQListSecretsResult": { - "type": "object", - "description": "The secret values for the given RabbitMQMessageQueue resource", - "properties": { - "password": { - "type": "string", - "description": "The password used to connect to the RabbitMQ instance" - }, - "uri": { - "type": "string", - "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" - } - } - }, - "RabbitMQQueueProperties": { - "type": "object", - "description": "RabbitMQQueue portable resource properties", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" - }, - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the asynchronous operation.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "secrets": { - "$ref": "#/definitions/RabbitMQSecrets", - "description": "Secrets provided by resources," - }, - "queue": { - "type": "string", - "description": "The name of the queue" - }, - "host": { - "type": "string", - "description": "The hostname of the RabbitMQ instance" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port of the RabbitMQ instance. Defaults to 5672" - }, - "vHost": { - "type": "string", - "description": "The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost." - }, - "username": { - "type": "string", - "description": "The username to use when connecting to the RabbitMQ instance" - }, - "resources": { - "type": "array", - "description": "List of the resource IDs that support the rabbitMQ resource", - "items": { - "$ref": "#/definitions/ResourceReference" - } - }, - "tls": { - "type": "boolean", - "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" - }, - "recipe": { - "$ref": "#/definitions/Recipe", - "description": "The recipe used to automatically deploy underlying infrastructure for the resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - } - }, - "required": [ - "environment" - ] - }, - "RabbitMQQueueResource": { - "type": "object", - "description": "RabbitMQQueue portable resource", - "properties": { - "properties": { - "$ref": "#/definitions/RabbitMQQueueProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "RabbitMQQueueResourceListResult": { - "type": "object", - "description": "The response of a RabbitMQQueueResource list operation.", - "properties": { - "value": { - "type": "array", - "description": "The RabbitMQQueueResource items on this page", - "items": { - "$ref": "#/definitions/RabbitMQQueueResource" - } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "RabbitMQQueueResourceUpdate": { - "type": "object", - "description": "The type used for update operations of the RabbitMQQueueResource.", - "properties": { - "tags": { - "type": "object", - "description": "Resource tags.", - "additionalProperties": { - "type": "string" - } - }, - "properties": { - "$ref": "#/definitions/RabbitMQQueueResourceUpdateProperties", - "x-ms-client-flatten": true - } - } - }, - "RabbitMQQueueResourceUpdateProperties": { - "type": "object", - "description": "The updatable properties of the RabbitMQQueueResource.", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)" - }, - "secrets": { - "$ref": "#/definitions/RabbitMQSecrets", - "description": "Secrets provided by resources," - }, - "queue": { - "type": "string", - "description": "The name of the queue" - }, - "host": { - "type": "string", - "description": "The hostname of the RabbitMQ instance" - }, - "port": { - "type": "integer", - "format": "int32", - "description": "The port of the RabbitMQ instance. Defaults to 5672" - }, - "vHost": { - "type": "string", - "description": "The RabbitMQ virtual host (vHost) the client will connect to. Defaults to no vHost." - }, - "username": { - "type": "string", - "description": "The username to use when connecting to the RabbitMQ instance" - }, - "resources": { - "type": "array", - "description": "List of the resource IDs that support the rabbitMQ resource", - "items": { - "$ref": "#/definitions/ResourceReference" - } - }, - "tls": { - "type": "boolean", - "description": "Specifies whether to use SSL when connecting to the RabbitMQ instance" - }, - "recipe": { - "$ref": "#/definitions/RecipeUpdate", - "description": "The recipe used to automatically deploy underlying infrastructure for the resource" - }, - "resourceProvisioning": { - "$ref": "#/definitions/ResourceProvisioning", - "description": "Specifies how the underlying service/resource is provisioned and managed." - } - } - }, - "RabbitMQSecrets": { - "type": "object", - "description": "The secret values for the given RabbitMQMessageQueue resource", - "properties": { - "password": { - "type": "string", - "description": "The password used to connect to the RabbitMQ instance" - }, - "uri": { - "type": "string", - "description": "The connection URI of the RabbitMQ instance. Generated automatically from host, port, SSL, username, password, and vhost. Can be overridden with a custom value" - } - } - }, - "Recipe": { - "type": "object", - "description": "The recipe used to automatically deploy underlying infrastructure for a link", - "properties": { - "name": { - "type": "string", - "description": "The name of the recipe within the environment to use" - }, - "parameters": { - "type": "object", - "description": "Key/value parameters to pass into the recipe at deployment", - "properties": {} - } - }, - "required": [ - "name" - ] - }, - "RecipeUpdate": { - "type": "object", - "description": "The recipe used to automatically deploy underlying infrastructure for a link", - "properties": { - "name": { - "type": "string", - "description": "The name of the recipe within the environment to use" - }, - "parameters": { - "type": "object", - "description": "Key/value parameters to pass into the recipe at deployment", - "properties": {} - } - } - }, - "ResourceProvisioning": { - "type": "string", - "description": "Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.", - "enum": [ - "recipe", - "manual" - ], - "x-ms-enum": { - "name": "ResourceProvisioning", - "modelAsString": true, - "values": [ - { - "name": "recipe", - "value": "recipe", - "description": "The resource lifecycle will be managed by Radius" - }, - { - "name": "manual", - "value": "manual", - "description": "The resource lifecycle will be managed by the user" - } - ] - } - }, - "ResourceReference": { - "type": "object", - "description": "Describes a reference to an existing resource", - "properties": { - "id": { - "type": "string", - "description": "Resource id of an existing resource" - } - }, - "required": [ - "id" - ] - }, - "ResourceStatus": { - "type": "object", - "description": "Status of a resource.", - "properties": { - "compute": { - "$ref": "#/definitions/EnvironmentCompute", - "description": "The compute resource associated with the resource." - }, - "outputResources": { - "type": "array", - "description": "Properties of an output resource", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [] - } - } - }, - "Versions": { - "type": "string", - "description": "Supported API versions for the Applications.Messagging resource provider.", - "enum": [ - "2022-03-15-privatepreview" - ], - "x-ms-enum": { - "name": "Versions", - "modelAsString": true, - "values": [ - { - "name": "v2022_03_15_privatepreview", - "value": "2022-03-15-privatepreview", - "description": "2022-03-15-privatepreview" - } - ] - } - } - }, - "parameters": { - "RootScopeParameter": { - "name": "rootScope", - "in": "path", - "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", - "required": true, - "type": "string", - "minLength": 1, - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - } -} diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_CreateOrUpdate.json new file mode 100644 index 0000000000..cdec52a79e --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_CreateOrUpdate.json @@ -0,0 +1,59 @@ +{ + "operationId": "RabbitMqQueues_CreateOrUpdate", + "title": "Create Or Update a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "rabbitMQQueueName": "rabbitmq0", + "api-version": "2022-03-15-privatepreview", + "RabbitMQQueueParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Delete.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Delete.json new file mode 100644 index 0000000000..03da6f1c26 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "RabbitMqQueues_Delete", + "title": "Delete a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "rabbitMQQueueName": "rabbitmq0", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Get.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Get.json new file mode 100644 index 0000000000..d3e9364fc3 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Get.json @@ -0,0 +1,29 @@ +{ + "operationId": "RabbitMqQueues_Get", + "title": "Get a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview", + "rabbitMQQueueName": "rabbitmq0" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_List.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_List.json new file mode 100644 index 0000000000..3e1c12abe3 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_List.json @@ -0,0 +1,47 @@ +{ + "operationId": "RabbitMqQueues_ListByScope", + "title": "List RabbitMQQueue resources by resource group", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0" + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues?api-version=2022-01-25-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListByRootScope.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListByRootScope.json new file mode 100644 index 0000000000..d24590182c --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListByRootScope.json @@ -0,0 +1,50 @@ +{ + "operationId": "RabbitMqQueues_ListByScope", + "title": "List RabbitMQQueue resources by rootScope", + "parameters": { + "rootScope": "/planes/radius/local", + "api-version": "2022-03-15-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + }, + { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "recipe": { + "name": "sqldb", + "parameters": { + "foo": "bar" + } + } + } + } + ], + "nextLink": "https://serviceRoot/00000000-0000-0000-0000-000000000000/providers/Applications.Messaging/rabbitMQQueues?api-version=2022-03-15-privatepreview&$skiptoken=X'12345'" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListSecrets.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListSecrets.json new file mode 100644 index 0000000000..e0d24405c6 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_ListSecrets.json @@ -0,0 +1,17 @@ +{ + "operationId": "RabbitMqQueues_ListSecrets", + "title": "List the secrets of a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "resourceGroupName": "testGroup", + "api-version": "2022-03-15-privatepreview", + "rabbitMQQueueName": "rabbitmq0" + }, + "responses": { + "200": { + "body": { + "connectionString": "connection://string" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Update.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Update.json new file mode 100644 index 0000000000..a845925ed0 --- /dev/null +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/examples/RabbitMQQueues_Update.json @@ -0,0 +1,59 @@ +{ + "operationId": "RabbitMqQueues_Update", + "title": "Update a RabbitMQQueue resource", + "parameters": { + "rootScope": "/planes/radius/local/resourceGroups/testGroup", + "rabbitMQQueueName": "rabbitmq0", + "api-version": "2022-03-15-privatepreview", + "rabbitMQQueueParameters": { + "location": "global", + "properties": { + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq0", + "name": "rabbitmq0", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Succeeded", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + }, + "201": { + "body": { + "id": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Messaging/rabbitMQQueues/rabbitmq1", + "name": "rabbitmq1", + "type": "Applications.Messaging/rabbitMQQueues", + "location": "global", + "properties": { + "provisioningState": "Accepted", + "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/testApplication", + "environment": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/environments/env0", + "resourceProvisioning": "manual", + "queue": "rabbitmq0", + "secrets": { + "connectionString": "connection://string" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json index 4622b0b394..6d094818df 100644 --- a/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Messaging/preview/2022-03-15-privatepreview/openapi.json @@ -76,6 +76,14 @@ } } }, + "x-ms-examples": { + "List RabbitMQQueue resources by resource group": { + "$ref": "./examples/RabbitMQQueues_List.json" + }, + "List RabbitMQQueue resources by rootScope": { + "$ref": "./examples/RabbitMQQueues_ListByRootScope.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -118,6 +126,11 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a RabbitMQQueue resource": { + "$ref": "./examples/RabbitMQQueues_Get.json" + } } }, "put": { @@ -179,6 +192,11 @@ } } }, + "x-ms-examples": { + "Create Or Update a RabbitMQQueue resource": { + "$ref": "./examples/RabbitMQQueues_CreateOrUpdate.json" + } + }, "x-ms-long-running-operation-options": { "final-state-via": "azure-async-operation" }, @@ -244,6 +262,11 @@ } } }, + "x-ms-examples": { + "Update a RabbitMQQueue resource": { + "$ref": "./examples/RabbitMQQueues_Update.json" + } + }, "x-ms-long-running-operation-options": { "final-state-via": "location" }, @@ -300,6 +323,11 @@ } } }, + "x-ms-examples": { + "Delete a RabbitMQQueue resource": { + "$ref": "./examples/RabbitMQQueues_Delete.json" + } + }, "x-ms-long-running-operation-options": { "final-state-via": "location" }, @@ -353,6 +381,11 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "List the secrets of a RabbitMQQueue resource": { + "$ref": "./examples/RabbitMQQueues_ListSecrets.json" + } } } }, diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json deleted file mode 100644 index 4b6cf1b500..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_CreateOrUpdate.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "operationId": "TestAsyncResources_CreateOrUpdate", - "title": "Create or Update TestAsyncResource resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testAsyncResourceName": "resource0", - "api-version": "2022-08-19-preview", - "TestAsyncResource": { - "location": "global", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json deleted file mode 100644 index dc4fd265ef..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Delete.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "operationId": "TestAsyncResources_Delete", - "title": "Delete a TestAsyncResource resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testAsyncResourceName": "resource0", - "api-version": "2022-08-19-preview" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json deleted file mode 100644 index 8c4f351bc3..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Get.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "operationId": "TestAsyncResources_Get", - "title": "Get a TestAsyncResource resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testAsyncResourceName": "resource0", - "api-version": "2022-08-19-preview" - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json deleted file mode 100644 index bb7f6f5eff..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_List.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "TestAsyncResources_ListByScope", - "title": "List TestAsyncResource resources by resourcegroup", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", - "name": "resource1", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2022-08-19-preview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json deleted file mode 100644 index 37e52d2155..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_ListByScope.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "TestAsyncResources_ListByScope", - "title": "List TestAsyncResource resources at root scope", - "parameters": { - "rootScope": "/planes/radius/local", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", - "name": "resource1", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2022-08-19-preview&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json deleted file mode 100644 index e23e021d59..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/examples/TestAsyncResource_Update.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "operationId": "TestAsyncResources_Update", - "title": "Update TestAsyncResource resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testSyncResourceName": "resource0", - "api-version": "2022-08-19-preview", - "TestSyncResource": { - "location": "global", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json b/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json deleted file mode 100644 index 0479c3f953..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/preview/2022-08-19-preview/openapi.json +++ /dev/null @@ -1,744 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Test.Resource Resource Management APIs", - "version": "2022-08-19-preview", - "description": "REST APIs for Test.Resource", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "tags": [ - { - "name": "Operations" - }, - { - "name": "TestAsyncResources" - } - ], - "paths": { - "/{rootScope}/providers/Test.Resource/testAsyncResources": { - "get": { - "operationId": "TestAsyncResources_ListByScope", - "tags": [ - "TestAsyncResources" - ], - "description": "List TestAsyncResource resources by Scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestAsyncResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List TestAsyncResource resources by resourcegroup": { - "$ref": "./examples/TestAsyncResource_List.json" - }, - "List TestAsyncResource resources at root scope": { - "$ref": "./examples/TestAsyncResource_ListByScope.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Test.Resource/testAsyncResources/{testAsyncResourceName}": { - "get": { - "operationId": "TestAsyncResources_Get", - "tags": [ - "TestAsyncResources" - ], - "description": "Get a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get a TestAsyncResource resource": { - "$ref": "./examples/TestAsyncResource_Get.json" - } - } - }, - "put": { - "operationId": "TestAsyncResources_CreateOrUpdate", - "tags": [ - "TestAsyncResources" - ], - "description": "Create a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "resource", - "in": "body", - "description": "Resource create parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - } - ], - "responses": { - "200": { - "description": "Resource 'TestAsyncResource' update operation succeeded", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "201": { - "description": "Resource 'TestAsyncResource' create operation succeeded", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - }, - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Create or Update TestAsyncResource resources": { - "$ref": "./examples/TestAsyncResource_CreateOrUpdate.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "operationId": "TestAsyncResources_Update", - "tags": [ - "TestAsyncResources" - ], - "description": "Update a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "properties", - "in": "body", - "description": "The resource properties to be updated.", - "required": true, - "schema": { - "$ref": "#/definitions/TestAsyncResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "202": { - "description": "Resource update request accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Update TestAsyncResource resources": { - "$ref": "./examples/TestAsyncResource_Update.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - }, - "delete": { - "operationId": "TestAsyncResources_Delete", - "tags": [ - "TestAsyncResources" - ], - "description": "Delete a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Delete a TestAsyncResource resource": { - "$ref": "./examples/TestAsyncResource_Delete.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - } - }, - "/providers/Test.Resource/operations": { - "get": { - "operationId": "Operations_List", - "tags": [ - "Operations" - ], - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "EnvironmentCompute": { - "type": "object", - "description": "Represents backing compute resource", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for EnvironmentCompute." - }, - "resourceId": { - "type": "string", - "description": "The resource id of the compute resource for application environment." - }, - "identity": { - "$ref": "#/definitions/IdentitySettings", - "description": "Configuration for supported external identity providers" - } - }, - "discriminator": "kind", - "required": [ - "kind" - ] - }, - "IdentitySettingKind": { - "type": "string", - "description": "IdentitySettingKind is the kind of supported external identity setting", - "enum": [ - "undefined", - "azure.com.workload" - ], - "x-ms-enum": { - "name": "IdentitySettingKind", - "modelAsString": true, - "values": [ - { - "name": "undefined", - "value": "undefined", - "description": "undefined identity" - }, - { - "name": "azure.com.workload", - "value": "azure.com.workload", - "description": "azure ad workload identity" - } - ] - } - }, - "IdentitySettings": { - "type": "object", - "description": "IdentitySettings is the external identity setting.", - "properties": { - "kind": { - "$ref": "#/definitions/IdentitySettingKind", - "description": "kind of identity setting" - }, - "oidcIssuer": { - "type": "string", - "description": "The URI for your compute platform's OIDC issuer" - }, - "resource": { - "type": "string", - "description": "The resource ID of the provisioned identity" - } - }, - "required": [ - "kind" - ] - }, - "KubernetesCompute": { - "type": "object", - "description": "The Kubernetes compute configuration", - "properties": { - "namespace": { - "type": "string", - "description": "The namespace to use for the environment." - } - }, - "required": [ - "namespace" - ], - "allOf": [ - { - "$ref": "#/definitions/EnvironmentCompute" - } - ], - "x-ms-discriminator-value": "kubernetes" - }, - "OutputResource": { - "type": "object", - "description": "Properties of an output resource.", - "properties": { - "localId": { - "type": "string", - "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." - }, - "id": { - "type": "string", - "description": "The UCP resource ID of the underlying resource." - }, - "radiusManaged": { - "type": "boolean", - "description": "Determines whether Radius manages the lifecycle of the underlying resource." - } - } - }, - "ProvisioningState": { - "type": "string", - "description": "Provisioning state of the portable resource at the time the operation was called", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true, - "values": [ - { - "name": "Succeeded", - "value": "Succeeded", - "description": "Resource has been created." - }, - { - "name": "Failed", - "value": "Failed", - "description": "Resource creation failed." - }, - { - "name": "Canceled", - "value": "Canceled", - "description": "Resource creation was canceled." - }, - { - "name": "Provisioning", - "value": "Provisioning", - "description": "The resource is being provisioned" - }, - { - "name": "Updating", - "value": "Updating", - "description": "The resource is updating" - }, - { - "name": "Deleting", - "value": "Deleting", - "description": "The resource is being deleted" - }, - { - "name": "Accepted", - "value": "Accepted", - "description": "The resource create request has been accepted" - } - ] - }, - "readOnly": true - }, - "ResourceStatus": { - "type": "object", - "description": "Status of a resource.", - "properties": { - "compute": { - "$ref": "#/definitions/EnvironmentCompute", - "description": "The compute resource associated with the resource." - }, - "outputResources": { - "type": "array", - "description": "Properties of an output resource", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [] - } - } - }, - "TestAsyncResource": { - "type": "object", - "description": "The TestAsyncResource which implements asynchornous API.", - "properties": { - "properties": { - "$ref": "#/definitions/TestAsyncResourceProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "TestAsyncResourceListResult": { - "type": "object", - "description": "The response of a TestAsyncResource list operation.", - "properties": { - "value": { - "type": "array", - "description": "The TestAsyncResource items on this page", - "items": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "TestAsyncResourceProperties": { - "type": "object", - "description": "TestAsyncResource properties", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the asynchronous operation.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "property1": { - "type": "string", - "description": "The property1 of TestASyncResource" - } - }, - "required": [ - "application", - "property1" - ] - }, - "TestAsyncResourceUpdate": { - "type": "object", - "description": "The type used for update operations of the TestAsyncResource.", - "properties": { - "tags": { - "type": "object", - "description": "Resource tags.", - "additionalProperties": { - "type": "string" - } - }, - "properties": { - "$ref": "#/definitions/TestAsyncResourceUpdateProperties", - "x-ms-client-flatten": true - } - } - }, - "TestAsyncResourceUpdateProperties": { - "type": "object", - "description": "The updatable properties of the TestAsyncResource.", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "property1": { - "type": "string", - "description": "The property1 of TestASyncResource" - } - } - }, - "TestSyncResource": { - "type": "object", - "description": "The TestSyncResource type.", - "properties": { - "properties": { - "$ref": "#/definitions/TestSyncResourceProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "TestSyncResourceProperties": { - "type": "object", - "description": "TestSyncResource properties", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the asynchronous operation.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "property1": { - "type": "string", - "description": "The property1 of TestSyncResource" - } - }, - "required": [ - "application", - "property1" - ] - }, - "Versions": { - "type": "string", - "description": "Supported API versions for the Test.Resource resource provider.", - "enum": [ - "2022-08-19-preview", - "2023-08-19" - ], - "x-ms-enum": { - "name": "Versions", - "modelAsString": true, - "values": [ - { - "name": "v2022_08_19_preview", - "value": "2022-08-19-preview", - "description": "2022-08-19-preview" - }, - { - "name": "v2023_08_19", - "value": "2023-08-19", - "description": "2023-08-19" - } - ] - } - } - }, - "parameters": { - "RootScopeParameter": { - "name": "rootScope", - "in": "path", - "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", - "required": true, - "type": "string", - "minLength": 1, - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json deleted file mode 100644 index ab9354729d..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_CreateOrUpdate.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "operationId": "TestAsyncResources_CreateOrUpdate", - "title": "Create or Update TestAsyncResource resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testAsyncResourceName": "resource0", - "api-version": "2023-08-19", - "TestAsyncResource": { - "location": "global", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json deleted file mode 100644 index bf27a5e050..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Delete.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "operationId": "TestAsyncResources_Delete", - "title": "Delete a TestAsyncResource resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testAsyncResourceName": "resource0", - "api-version": "2023-08-19" - }, - "responses": { - "200": {}, - "202": {}, - "204": {} - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json deleted file mode 100644 index be851ac706..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Get.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "operationId": "TestAsyncResources_Get", - "title": "Get a TestAsyncResource resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testAsyncResourceName": "resource0", - "api-version": "2023-08-19" - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json deleted file mode 100644 index a3b3f205ed..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_List.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "TestAsyncResources_ListByScope", - "title": "List TestAsyncResource resources by resourcegroup", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", - "name": "resource1", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2023-08-19&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json deleted file mode 100644 index 07fde44c99..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_ListByScope.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "TestAsyncResources_ListByScope", - "title": "List TestAsyncResource resources at root scope", - "parameters": { - "rootScope": "/planes/radius/local", - "api-version": "2022-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource1", - "name": "resource1", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testAsyncResources?api-version=2023-08-19&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json deleted file mode 100644 index 2c1ff5c348..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestAsyncResource_Update.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "operationId": "TestAsyncResources_Update", - "title": "Update TestAsyncResource resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testSyncResourceName": "resource0", - "api-version": "2023-08-19", - "TestSyncResource": { - "location": "global", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testAsyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testAsyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json deleted file mode 100644 index d449d53a12..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_CreateOrUpdate.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "operationId": "TestSyncResources_CreateOrUpdate", - "title": "Create or Update TestSyncResource resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testSyncResourceName": "resource0", - "api-version": "2023-08-19", - "TestSyncResource": { - "location": "global", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json deleted file mode 100644 index a3b3d18932..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Get.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "operationId": "TestSyncResources_Get", - "title": "Get a TestSyncResources resource", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testSyncResourceName": "resource0", - "api-version": "2023-08-19" - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json deleted file mode 100644 index 2738f17a34..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_List.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "TestSyncResources_ListByScope", - "title": "List TestSyncResource resources by resourcegroup", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "api-version": "2023-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource1", - "name": "resource1", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testSyncResources?api-version=2023-08-19&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json deleted file mode 100644 index 78a0e58803..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_ListByScope.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "operationId": "TestSyncResources_ListByScope", - "title": "List TestSyncResource resources at root scope", - "parameters": { - "rootScope": "/planes/radius/local", - "api-version": "2023-03-15-privatepreview" - }, - "responses": { - "200": { - "body": { - "value": [ - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - }, - { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource1", - "name": "resource1", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0" - } - } - ], - "nextLink": "https://serviceRoot/planes/radius/local/providers/Test.Resource/testSyncResources?api-version=2023-08-19&$skiptoken=X'12345'" - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json deleted file mode 100644 index f710358466..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/examples/TestSyncResource_Update.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "operationId": "TestSyncResources_Update", - "title": "Update TestSyncResource resources", - "parameters": { - "rootScope": "/planes/radius/local/resourceGroups/testGroup", - "testSyncResourceName": "resource0", - "api-version": "2023-08-19", - "TestSyncResource": { - "location": "global", - "properties": { - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - }, - "responses": { - "200": { - "body": { - "id": "/planes/radius/local/resourceGroups/testGroup/providers/Test.Resource/testSyncResources/resource0", - "name": "resource0", - "type": "Test.Resource/testSyncResources", - "properties": { - "provisioningState": "Succeeded", - "application": "/planes/radius/local/resourceGroups/testGroup/providers/Applications.Core/applications/app0", - "property1": "test" - } - } - } - } -} diff --git a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json b/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json deleted file mode 100644 index 0cd70b56f6..0000000000 --- a/swagger/specification/applications/resource-manager/Test.Resource/stable/2023-08-19/openapi.json +++ /dev/null @@ -1,1038 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "Test.Resource Resource Management APIs", - "version": "2023-08-19", - "description": "REST APIs for Test.Resource", - "x-typespec-generated": [ - { - "emitter": "@azure-tools/typespec-autorest" - } - ] - }, - "schemes": [ - "https" - ], - "host": "management.azure.com", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "description": "Azure Active Directory OAuth2 Flow.", - "flow": "implicit", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "tags": [ - { - "name": "Operations" - }, - { - "name": "TestSyncResources" - }, - { - "name": "TestAsyncResources" - } - ], - "paths": { - "/{rootScope}/providers/Test.Resource/testAsyncResources": { - "get": { - "operationId": "TestAsyncResources_ListByScope", - "tags": [ - "TestAsyncResources" - ], - "description": "List TestAsyncResource resources by Scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestAsyncResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List TestAsyncResource resources by resourcegroup": { - "$ref": "./examples/TestAsyncResource_List.json" - }, - "List TestAsyncResource resources at root scope": { - "$ref": "./examples/TestAsyncResource_ListByScope.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Test.Resource/testAsyncResources/{testAsyncResourceName}": { - "get": { - "operationId": "TestAsyncResources_Get", - "tags": [ - "TestAsyncResources" - ], - "description": "Get a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get a TestAsyncResource resource": { - "$ref": "./examples/TestAsyncResource_Get.json" - } - } - }, - "put": { - "operationId": "TestAsyncResources_CreateOrUpdate", - "tags": [ - "TestAsyncResources" - ], - "description": "Create a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "resource", - "in": "body", - "description": "Resource create parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - } - ], - "responses": { - "200": { - "description": "Resource 'TestAsyncResource' update operation succeeded", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "201": { - "description": "Resource 'TestAsyncResource' create operation succeeded", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - }, - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Create or Update TestAsyncResource resources": { - "$ref": "./examples/TestAsyncResource_CreateOrUpdate.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "azure-async-operation" - }, - "x-ms-long-running-operation": true - }, - "patch": { - "operationId": "TestAsyncResources_Update", - "tags": [ - "TestAsyncResources" - ], - "description": "Update a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "properties", - "in": "body", - "description": "The resource properties to be updated.", - "required": true, - "schema": { - "$ref": "#/definitions/TestAsyncResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "202": { - "description": "Resource update request accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Update TestAsyncResource resources": { - "$ref": "./examples/TestAsyncResource_Update.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - }, - "delete": { - "operationId": "TestAsyncResources_Delete", - "tags": [ - "TestAsyncResources" - ], - "description": "Delete a TestAsyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testAsyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "type": "integer", - "format": "int32", - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." - }, - "Location": { - "type": "string", - "description": "The Location header contains the URL where the status of the long running operation can be checked." - } - } - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Delete a TestAsyncResource resource": { - "$ref": "./examples/TestAsyncResource_Delete.json" - } - }, - "x-ms-long-running-operation-options": { - "final-state-via": "location" - }, - "x-ms-long-running-operation": true - } - }, - "/{rootScope}/providers/Test.Resource/testSyncResources": { - "get": { - "operationId": "TestSyncResources_ListByScope", - "tags": [ - "TestSyncResources" - ], - "description": "List TestSyncResource resources by Scope", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestSyncResourceListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "List TestSyncResource resources by resourcegroup": { - "$ref": "./examples/TestSyncResource_List.json" - }, - "List TestSyncResource resources at root scope": { - "$ref": "./examples/TestSyncResource_ListByScope.json" - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/{rootScope}/providers/Test.Resource/testSyncResources/{testSyncResourceName}": { - "get": { - "operationId": "TestSyncResources_Get", - "tags": [ - "TestSyncResources" - ], - "description": "Get a TestSyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testSyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestSyncResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get a TestSyncResources resource": { - "$ref": "./examples/TestSyncResource_Get.json" - } - } - }, - "put": { - "operationId": "TestSyncResources_CreateOrUpdate", - "tags": [ - "TestSyncResources" - ], - "description": "Create a TestSyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testSyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "resource", - "in": "body", - "description": "Resource create parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/TestSyncResource" - } - } - ], - "responses": { - "200": { - "description": "Resource 'TestSyncResource' update operation succeeded", - "schema": { - "$ref": "#/definitions/TestSyncResource" - } - }, - "201": { - "description": "Resource 'TestSyncResource' create operation succeeded", - "schema": { - "$ref": "#/definitions/TestSyncResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Create or Update TestSyncResource resources": { - "$ref": "./examples/TestSyncResource_CreateOrUpdate.json" - } - } - }, - "patch": { - "operationId": "TestSyncResources_Update", - "tags": [ - "TestSyncResources" - ], - "description": "Update a TestSyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testSyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - }, - { - "name": "properties", - "in": "body", - "description": "The resource properties to be updated.", - "required": true, - "schema": { - "$ref": "#/definitions/TestSyncResourceUpdate" - } - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "#/definitions/TestSyncResource" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Update TestSyncResource resources": { - "$ref": "./examples/TestSyncResource_Update.json" - } - } - }, - "delete": { - "operationId": "TestSyncResources_Delete", - "tags": [ - "TestSyncResources" - ], - "description": "Delete a TestSyncResource", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/RootScopeParameter" - }, - { - "name": "testSyncResourceName", - "in": "path", - "description": "The name of TestSyncResource", - "required": true, - "type": "string", - "maxLength": 63, - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" - } - ], - "responses": { - "200": { - "description": "Resource deleted successfully." - }, - "204": { - "description": "Resource deleted successfully." - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } - } - }, - "/providers/Test.Resource/operations": { - "get": { - "operationId": "Operations_List", - "tags": [ - "Operations" - ], - "description": "List the operations for the provider", - "parameters": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "ARM operation completed successfully.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - } - }, - "definitions": { - "EnvironmentCompute": { - "type": "object", - "description": "Represents backing compute resource", - "properties": { - "kind": { - "type": "string", - "description": "Discriminator property for EnvironmentCompute." - }, - "resourceId": { - "type": "string", - "description": "The resource id of the compute resource for application environment." - }, - "identity": { - "$ref": "#/definitions/IdentitySettings", - "description": "Configuration for supported external identity providers" - } - }, - "discriminator": "kind", - "required": [ - "kind" - ] - }, - "IdentitySettingKind": { - "type": "string", - "description": "IdentitySettingKind is the kind of supported external identity setting", - "enum": [ - "undefined", - "azure.com.workload" - ], - "x-ms-enum": { - "name": "IdentitySettingKind", - "modelAsString": true, - "values": [ - { - "name": "undefined", - "value": "undefined", - "description": "undefined identity" - }, - { - "name": "azure.com.workload", - "value": "azure.com.workload", - "description": "azure ad workload identity" - } - ] - } - }, - "IdentitySettings": { - "type": "object", - "description": "IdentitySettings is the external identity setting.", - "properties": { - "kind": { - "$ref": "#/definitions/IdentitySettingKind", - "description": "kind of identity setting" - }, - "oidcIssuer": { - "type": "string", - "description": "The URI for your compute platform's OIDC issuer" - }, - "resource": { - "type": "string", - "description": "The resource ID of the provisioned identity" - } - }, - "required": [ - "kind" - ] - }, - "KubernetesCompute": { - "type": "object", - "description": "The Kubernetes compute configuration", - "properties": { - "namespace": { - "type": "string", - "description": "The namespace to use for the environment." - } - }, - "required": [ - "namespace" - ], - "allOf": [ - { - "$ref": "#/definitions/EnvironmentCompute" - } - ], - "x-ms-discriminator-value": "kubernetes" - }, - "OutputResource": { - "type": "object", - "description": "Properties of an output resource.", - "properties": { - "localId": { - "type": "string", - "description": "The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships." - }, - "id": { - "type": "string", - "description": "The UCP resource ID of the underlying resource." - }, - "radiusManaged": { - "type": "boolean", - "description": "Determines whether Radius manages the lifecycle of the underlying resource." - } - } - }, - "ProvisioningState": { - "type": "string", - "description": "Provisioning state of the portable resource at the time the operation was called", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Provisioning", - "Updating", - "Deleting", - "Accepted" - ], - "x-ms-enum": { - "name": "ProvisioningState", - "modelAsString": true, - "values": [ - { - "name": "Succeeded", - "value": "Succeeded", - "description": "Resource has been created." - }, - { - "name": "Failed", - "value": "Failed", - "description": "Resource creation failed." - }, - { - "name": "Canceled", - "value": "Canceled", - "description": "Resource creation was canceled." - }, - { - "name": "Provisioning", - "value": "Provisioning", - "description": "The resource is being provisioned" - }, - { - "name": "Updating", - "value": "Updating", - "description": "The resource is updating" - }, - { - "name": "Deleting", - "value": "Deleting", - "description": "The resource is being deleted" - }, - { - "name": "Accepted", - "value": "Accepted", - "description": "The resource create request has been accepted" - } - ] - }, - "readOnly": true - }, - "ResourceStatus": { - "type": "object", - "description": "Status of a resource.", - "properties": { - "compute": { - "$ref": "#/definitions/EnvironmentCompute", - "description": "The compute resource associated with the resource." - }, - "outputResources": { - "type": "array", - "description": "Properties of an output resource", - "items": { - "$ref": "#/definitions/OutputResource" - }, - "x-ms-identifiers": [] - } - } - }, - "TestAsyncResource": { - "type": "object", - "description": "The TestAsyncResource which implements asynchornous API.", - "properties": { - "properties": { - "$ref": "#/definitions/TestAsyncResourceProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "TestAsyncResourceListResult": { - "type": "object", - "description": "The response of a TestAsyncResource list operation.", - "properties": { - "value": { - "type": "array", - "description": "The TestAsyncResource items on this page", - "items": { - "$ref": "#/definitions/TestAsyncResource" - } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "TestAsyncResourceProperties": { - "type": "object", - "description": "TestAsyncResource properties", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the asynchronous operation.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "property1": { - "type": "string", - "description": "The property1 of TestASyncResource" - } - }, - "required": [ - "application", - "property1" - ] - }, - "TestAsyncResourceUpdate": { - "type": "object", - "description": "The type used for update operations of the TestAsyncResource.", - "properties": { - "tags": { - "type": "object", - "description": "Resource tags.", - "additionalProperties": { - "type": "string" - } - }, - "properties": { - "$ref": "#/definitions/TestAsyncResourceUpdateProperties", - "x-ms-client-flatten": true - } - } - }, - "TestAsyncResourceUpdateProperties": { - "type": "object", - "description": "The updatable properties of the TestAsyncResource.", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "property1": { - "type": "string", - "description": "The property1 of TestASyncResource" - } - } - }, - "TestSyncResource": { - "type": "object", - "description": "The TestSyncResource type.", - "properties": { - "properties": { - "$ref": "#/definitions/TestSyncResourceProperties", - "description": "The resource-specific properties for this resource.", - "x-ms-client-flatten": true, - "x-ms-mutability": [ - "read", - "create" - ] - } - }, - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" - } - ] - }, - "TestSyncResourceListResult": { - "type": "object", - "description": "The response of a TestSyncResource list operation.", - "properties": { - "value": { - "type": "array", - "description": "The TestSyncResource items on this page", - "items": { - "$ref": "#/definitions/TestSyncResource" - } - }, - "nextLink": { - "type": "string", - "format": "uri", - "description": "The link to the next page of items" - } - }, - "required": [ - "value" - ] - }, - "TestSyncResourceProperties": { - "type": "object", - "description": "TestSyncResource properties", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "The status of the asynchronous operation.", - "readOnly": true - }, - "status": { - "$ref": "#/definitions/ResourceStatus", - "description": "Status of a resource.", - "readOnly": true - }, - "property1": { - "type": "string", - "description": "The property1 of TestSyncResource" - } - }, - "required": [ - "application", - "property1" - ] - }, - "TestSyncResourceUpdate": { - "type": "object", - "description": "The type used for update operations of the TestSyncResource.", - "properties": { - "tags": { - "type": "object", - "description": "Resource tags.", - "additionalProperties": { - "type": "string" - } - }, - "properties": { - "$ref": "#/definitions/TestSyncResourceUpdateProperties", - "x-ms-client-flatten": true - } - } - }, - "TestSyncResourceUpdateProperties": { - "type": "object", - "description": "The updatable properties of the TestSyncResource.", - "properties": { - "environment": { - "type": "string", - "description": "Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)" - }, - "application": { - "type": "string", - "description": "Fully qualified resource ID for the application that the portable resource is consumed by" - }, - "property1": { - "type": "string", - "description": "The property1 of TestSyncResource" - } - } - }, - "Versions": { - "type": "string", - "description": "Supported API versions for the Test.Resource resource provider.", - "enum": [ - "2022-08-19-preview", - "2023-08-19" - ], - "x-ms-enum": { - "name": "Versions", - "modelAsString": true, - "values": [ - { - "name": "v2022_08_19_preview", - "value": "2022-08-19-preview", - "description": "2022-08-19-preview" - }, - { - "name": "v2023_08_19", - "value": "2023-08-19", - "description": "2023-08-19" - } - ] - } - } - }, - "parameters": { - "RootScopeParameter": { - "name": "rootScope", - "in": "path", - "description": "The scope in which the resource is present. UCP Scope is /planes/{planeType}/{planeName}/resourceGroup/{resourcegroupID} and Azure resource scope is /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}", - "required": true, - "type": "string", - "minLength": 1, - "x-ms-parameter-location": "client", - "x-ms-skip-url-encoding": true - } - } -} diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json index c60399c934..cdec52a79e 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_CreateOrUpdate.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_CreateOrUpdate", + "operationId": "RabbitMqQueues_CreateOrUpdate", "title": "Create Or Update a RabbitMQQueue resource", "parameters": { "rootScope": "/planes/radius/local/resourceGroups/testGroup", diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json index 7e6d3f6569..03da6f1c26 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Delete.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_Delete", + "operationId": "RabbitMqQueues_Delete", "title": "Delete a RabbitMQQueue resource", "parameters": { "rootScope": "/planes/radius/local/resourceGroups/testGroup", diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json index 891b0e32bf..d3e9364fc3 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Get.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_Get", + "operationId": "RabbitMqQueues_Get", "title": "Get a RabbitMQQueue resource", "parameters": { "rootScope": "/planes/radius/local/resourceGroups/testGroup", diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json index 7c9cb9e8dc..3e1c12abe3 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_List.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_ListByScope", + "operationId": "RabbitMqQueues_ListByScope", "title": "List RabbitMQQueue resources by resource group", "parameters": { "rootScope": "/planes/radius/local/resourceGroups/testGroup", diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json index 8937ce7e5d..d24590182c 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListByRootScope.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_ListByScope", + "operationId": "RabbitMqQueues_ListByScope", "title": "List RabbitMQQueue resources by rootScope", "parameters": { "rootScope": "/planes/radius/local", diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json index 10bbe289fa..e0d24405c6 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_ListSecrets.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_ListSecrets", + "operationId": "RabbitMqQueues_ListSecrets", "title": "List the secrets of a RabbitMQQueue resource", "parameters": { "rootScope": "/planes/radius/local/resourceGroups/testGroup", diff --git a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json index 3391d2a046..a845925ed0 100644 --- a/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json +++ b/typespec/Applications.Messaging/examples/2022-03-15-privatepreview/RabbitMQQueues_Update.json @@ -1,5 +1,5 @@ { - "operationId": "RabbitMQQueues_Update", + "operationId": "RabbitMqQueues_Update", "title": "Update a RabbitMQQueue resource", "parameters": { "rootScope": "/planes/radius/local/resourceGroups/testGroup", From 8c995185b4b077b1e639ed02d0afcf878771e81e Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 31 Aug 2023 16:30:14 -0700 Subject: [PATCH 32/57] Rename `e2e test on Azure` to `Long-running test on Azure` (#6182) --- .../{e2e-test-azure.yaml => long-running-azure.yaml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{e2e-test-azure.yaml => long-running-azure.yaml} (99%) diff --git a/.github/workflows/e2e-test-azure.yaml b/.github/workflows/long-running-azure.yaml similarity index 99% rename from .github/workflows/e2e-test-azure.yaml rename to .github/workflows/long-running-azure.yaml index bab559610b..df2cda0952 100644 --- a/.github/workflows/e2e-test-azure.yaml +++ b/.github/workflows/long-running-azure.yaml @@ -36,7 +36,7 @@ # # Grafana dashboard URL: https://radiuse2e00-dashboard-audycmffgberbghy.wus3.grafana.azure.com/ -name: E2E test on Azure +name: Long-running test on Azure on: schedule: # Run every 1 hours @@ -45,7 +45,7 @@ on: branches: - main paths: - - '.github/workflows/e2e-test-azure.yaml' + - '.github/workflows/long-running-azure.yaml' env: # Go version @@ -86,7 +86,7 @@ env: jobs: build: name: Build Radius for test - runs-on: ubuntu-latest + runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] outputs: SKIP_BUILD: ${{ steps.skip-build.outputs.SKIP_BUILD }} REL_VERSION: ${{ steps.gen-id.outputs.REL_VERSION }} @@ -272,7 +272,7 @@ jobs: tests: name: Run functional tests needs: build - runs-on: ubuntu-latest + runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] env: SKIP_BUILD: ${{ needs.build.outputs.SKIP_BUILD }} UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }} From 35f63aee2d4039601eb296d278f2211e14d4bee7 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 31 Aug 2023 19:24:01 -0700 Subject: [PATCH 33/57] Use hosted pool for functional tests. (#6190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is to use hosted pool for functional tests. for datastorerp, action will use larger VM, ubuntu-latest-m. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at d15642d ### Summary 🏃🔀🧹 The pull request refactors the GitHub Actions workflows for functional testing by switching to GitHub-hosted runners and consolidating the `build` and `run-functional-tests` jobs in the `functional-test.yaml` file. This improves the reliability and efficiency of the testing process. > _We break the chains of self-hosted runners_ > _We unleash the power of GitHub's machines_ > _We simplify the workflows of doom_ > _We depend on each other to survive_ ### Walkthrough * Consolidate `build` and `run-functional-tests` jobs from `long-running-azure.yaml` to `functional-test.yaml` workflow to avoid duplication ([link](https://github.com/radius-project/radius/pull/6190/files?diff=unified&w=0#diff-85cd86e7ae6da973e4808fe57f4fea7892ab78a499ba5aec72c0b3751a2cc226L89-R89), [link](https://github.com/radius-project/radius/pull/6190/files?diff=unified&w=0#diff-85cd86e7ae6da973e4808fe57f4fea7892ab78a499ba5aec72c0b3751a2cc226L275-R275)) * Switch from self-hosted runners to GitHub-hosted runners for `build`, `tests`, and `report-failure` jobs in `functional-test.yaml` workflow to reduce dependency ([link](https://github.com/radius-project/radius/pull/6190/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL80-R80), [link](https://github.com/radius-project/radius/pull/6190/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL294-R302), [link](https://github.com/radius-project/radius/pull/6190/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL569-R573)) * Use custom runner with more memory for `datastoresrp` test in `functional-test.yaml` workflow to accommodate its requirements ([link](https://github.com/radius-project/radius/pull/6190/files?diff=unified&w=0#diff-c79f364a9293abaaa8595776b74674e24bec6287834e63ab8aa7aec6a42f0dbcL294-R302)) --- .github/workflows/functional-test.yaml | 13 +++++++++---- .github/workflows/long-running-azure.yaml | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/functional-test.yaml b/.github/workflows/functional-test.yaml index 174ec46541..b4bcfe42a1 100644 --- a/.github/workflows/functional-test.yaml +++ b/.github/workflows/functional-test.yaml @@ -77,7 +77,7 @@ env: jobs: build: name: Build Radius for test - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest env: DE_IMAGE: 'radius.azurecr.io/deployment-engine' DE_TAG: 'latest' @@ -291,11 +291,16 @@ jobs: tests: name: Run ${{ matrix.name }} functional tests needs: build - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] strategy: fail-fast: true matrix: - name: [ucp,shared,msgrp,daprrp,datastoresrp,samples] + os: [ubuntu-latest] + name: [ucp,shared,msgrp,daprrp,samples] + include: + # datastorerp functional tests need the larger VM. + - os: ubuntu-latest-m + name: datastoresrp + runs-on: ${{ matrix.os }} env: UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }} REL_VERSION: ${{ needs.build.outputs.REL_VERSION }} @@ -566,7 +571,7 @@ jobs: report-failure: name: Report test failure needs: [build, tests] - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest if: failure() && github.event_name == 'schedule' steps: - name: Create failure issue for failing scheduled run diff --git a/.github/workflows/long-running-azure.yaml b/.github/workflows/long-running-azure.yaml index df2cda0952..306638a6b6 100644 --- a/.github/workflows/long-running-azure.yaml +++ b/.github/workflows/long-running-azure.yaml @@ -39,8 +39,8 @@ name: Long-running test on Azure on: schedule: - # Run every 1 hours - - cron: "0 * * * *" + # Run every 2 hours + - cron: "0 */2 * * *" pull_request: branches: - main @@ -86,7 +86,7 @@ env: jobs: build: name: Build Radius for test - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest outputs: SKIP_BUILD: ${{ steps.skip-build.outputs.SKIP_BUILD }} REL_VERSION: ${{ steps.gen-id.outputs.REL_VERSION }} @@ -272,7 +272,7 @@ jobs: tests: name: Run functional tests needs: build - runs-on: [ self-hosted, 1ES.Pool=1ES-Radius ] + runs-on: ubuntu-latest env: SKIP_BUILD: ${{ needs.build.outputs.SKIP_BUILD }} UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }} From 5c7774f1269d7565fb122148e1efe5e8ac85ca2a Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 31 Aug 2023 19:50:49 -0700 Subject: [PATCH 34/57] Use GVK for resource key in manifest (#6184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is to use GroupVersionKind for resource key in Resource manifest map. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at ec59bf3 ### Summary 🛠️🧪🚀 The pull request refactors and updates the code for working with Kubernetes manifests in the `pkg/corerp` and `pkg/kubeutil` packages. It uses the `GroupVersionKind` and `SchemeGroupVersion` structs from the k8s.io/api packages to identify and validate the resources, and introduces a common function for creating base resources. It also fixes some import aliases and label names, and removes an unused file. > _`manifest.go` refactored_ > _base resources share function_ > _code is more concise_ ### Walkthrough * Change import alias for `k8s.io/api/apps/v1` from `appv1` to `appsv1` in all files to avoid confusion ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-80e493ed37805d0b774c94c28eee4f7e12a6956d34217e486d49085aa49a3027L23-R23), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-817a1b5acc2fc8f9693a0268aba2bd25d2d0c4b730b78ebebaba92d02e641dd9L85-R85), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-464b567399407ca08de3c0341b37b7f7a9eb047020323802dba3bc90acc63613L157-R157), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-321e51624b98ecb16fbaed04509d80a4ca52ec5f2d2ece1e23faaa8cbe87548eR23-R25)) * Use `GroupVersionKind` struct instead of string constants for validating and parsing Kubernetes resources in `pkg/corerp/frontend/controller/containers/validator.go`, `pkg/corerp/renderers/container/manifest.go`, `pkg/corerp/renderers/container/manifest_test.go` and `pkg/kubeutil/manifest.go` ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-80e493ed37805d0b774c94c28eee4f7e12a6956d34217e486d49085aa49a3027L120-R129), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-80e493ed37805d0b774c94c28eee4f7e12a6956d34217e486d49085aa49a3027L138-R138), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-80e493ed37805d0b774c94c28eee4f7e12a6956d34217e486d49085aa49a3027L147-R147), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-80e493ed37805d0b774c94c28eee4f7e12a6956d34217e486d49085aa49a3027L163-R164), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-817a1b5acc2fc8f9693a0268aba2bd25d2d0c4b730b78ebebaba92d02e641dd9L135-R135), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-817a1b5acc2fc8f9693a0268aba2bd25d2d0c4b730b78ebebaba92d02e641dd9L153-R153), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-817a1b5acc2fc8f9693a0268aba2bd25d2d0c4b730b78ebebaba92d02e641dd9L196-R198), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-464b567399407ca08de3c0341b37b7f7a9eb047020323802dba3bc90acc63613L279-R279), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-464b567399407ca08de3c0341b37b7f7a9eb047020323802dba3bc90acc63613L368-R368), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL21-R34), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL44-R44), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL53-R57), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL86-R74), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-321e51624b98ecb16fbaed04509d80a4ca52ec5f2d2ece1e23faaa8cbe87548eL122-R125), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-321e51624b98ecb16fbaed04509d80a4ca52ec5f2d2ece1e23faaa8cbe87548eL128-R133), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-321e51624b98ecb16fbaed04509d80a4ca52ec5f2d2ece1e23faaa8cbe87548eL137-R142), [link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-321e51624b98ecb16fbaed04509d80a4ca52ec5f2d2ece1e23faaa8cbe87548eL171-R177)) * Change type assertion for deployment resource from `appv1.Deployment` to `appsv1.Deployment` in `pkg/corerp/renderers/container/manifest.go` ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-817a1b5acc2fc8f9693a0268aba2bd25d2d0c4b730b78ebebaba92d02e641dd9L85-R85)) * Add import for `k8s.io/apimachinery/pkg/runtime/schema` to use `GroupVersionKind` struct in `pkg/kubeutil/manifest_test.go` ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-321e51624b98ecb16fbaed04509d80a4ca52ec5f2d2ece1e23faaa8cbe87548eR23-R25)) * Change import for `k8s.io/client-go/kubernetes/scheme` to `k8s.io/client-go/kubernetes/clientscheme` to avoid name collision in `pkg/kubeutil/manifest.go` ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL21-R34)) * Remove `GetObjectKey` function as it is no longer needed in `pkg/kubeutil/manifest.go` ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-f9b077d07140be2998931dcccf02b6c9c260ae4f77ff90e75de34f012e05e97eL53-R57)) * Delete file `pkg/kubeutil/types.go` as it is no longer needed ([link](https://github.com/radius-project/radius/pull/6184/files?diff=unified&w=0#diff-7157a4351c3db4bba3eaf3871e68dece7f0417278f860fc18594d15d0fd3137c)) --- .../controller/containers/validator.go | 18 +++++----- pkg/corerp/renderers/container/manifest.go | 10 +++--- .../renderers/container/manifest_test.go | 6 ++-- pkg/kubeutil/manifest.go | 34 ++++++------------- pkg/kubeutil/manifest_test.go | 25 ++++++++------ pkg/kubeutil/types.go | 34 ------------------- 6 files changed, 42 insertions(+), 85 deletions(-) delete mode 100644 pkg/kubeutil/types.go diff --git a/pkg/corerp/frontend/controller/containers/validator.go b/pkg/corerp/frontend/controller/containers/validator.go index 57693a7135..738ccb7e56 100644 --- a/pkg/corerp/frontend/controller/containers/validator.go +++ b/pkg/corerp/frontend/controller/containers/validator.go @@ -20,7 +20,7 @@ import ( "context" "fmt" - appv1 "k8s.io/api/apps/v1" + appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -117,16 +117,16 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou } switch k { - case kubeutil.DeploymentV1: + case appsv1.SchemeGroupVersion.WithKind("Deployment"): if len(resources) != 1 { errDetails = append(errDetails, errMultipleResources("Deployment", len(resources))) } - deployment := resources[0].(*appv1.Deployment) + deployment := resources[0].(*appsv1.Deployment) if deployment.Name != newResource.Name { errDetails = append(errDetails, errUnmatchedName(deployment, newResource.Name)) } - case kubeutil.ServiceV1: + case corev1.SchemeGroupVersion.WithKind("Service"): if len(resources) != 1 { errDetails = append(errDetails, errMultipleResources("Service", len(resources))) } @@ -135,7 +135,7 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou errDetails = append(errDetails, errUnmatchedName(srv, newResource.Name)) } - case kubeutil.ServiceAccountV1: + case corev1.SchemeGroupVersion.WithKind("ServiceAccount"): if len(resources) != 1 { errDetails = append(errDetails, errMultipleResources("ServiceAccount", len(resources))) } @@ -144,13 +144,13 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou errDetails = append(errDetails, errUnmatchedName(sa, newResource.Name)) } - deployment := resourceMap.GetFirst(kubeutil.DeploymentV1) + deployment := resourceMap.GetFirst(appsv1.SchemeGroupVersion.WithKind("Deployment")) if deployment == nil { // skip if there is no deployment. continue } - podSA := deployment.(*appv1.Deployment).Spec.Template.Spec.ServiceAccountName + podSA := deployment.(*appsv1.Deployment).Spec.Template.Spec.ServiceAccountName if podSA != sa.Name { errDetails = append(errDetails, v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, @@ -160,8 +160,8 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou } // No limitations for ConfigMap and Secret resources. - case kubeutil.SecretV1: - case kubeutil.ConfigMapV1: + case corev1.SchemeGroupVersion.WithKind("Secret"): + case corev1.SchemeGroupVersion.WithKind("ConfigMap"): default: errDetails = append(errDetails, v1.ErrorDetails{ diff --git a/pkg/corerp/renderers/container/manifest.go b/pkg/corerp/renderers/container/manifest.go index bb1a8ffa1b..9efb3c592c 100644 --- a/pkg/corerp/renderers/container/manifest.go +++ b/pkg/corerp/renderers/container/manifest.go @@ -82,7 +82,7 @@ func getDeploymentBase(manifest kubeutil.ObjectManifest, appName string, r *data }, } - if resource := manifest.GetFirst(kubeutil.DeploymentV1); resource != nil { + if resource := manifest.GetFirst(appsv1.SchemeGroupVersion.WithKind("Deployment")); resource != nil { defaultDeployment = resource.(*appsv1.Deployment) } @@ -132,7 +132,7 @@ func getServiceBase(manifest kubeutil.ObjectManifest, appName string, r *datamod Type: corev1.ServiceTypeClusterIP, }, } - if resource := manifest.GetFirst(kubeutil.ServiceV1); resource != nil { + if resource := manifest.GetFirst(corev1.SchemeGroupVersion.WithKind("Service")); resource != nil { defaultService = resource.(*corev1.Service) } defaultService.ObjectMeta = getObjectMeta(defaultService.ObjectMeta, appName, r.Name, r.ResourceTypeName(), *options) @@ -150,7 +150,7 @@ func getServiceAccountBase(manifest kubeutil.ObjectManifest, appName string, r * }, } - if resource := manifest.GetFirst(kubeutil.ServiceAccountV1); resource != nil { + if resource := manifest.GetFirst(corev1.SchemeGroupVersion.WithKind("ServiceAccount")); resource != nil { defaultAccount = resource.(*corev1.ServiceAccount) } @@ -193,9 +193,9 @@ func populateAllBaseResources(ctx context.Context, base kubeutil.ObjectManifest, localIDPrefix := "" switch k { - case kubeutil.SecretV1: + case corev1.SchemeGroupVersion.WithKind("Secret"): localIDPrefix = rpv1.LocalIDSecret - case kubeutil.ConfigMapV1: + case corev1.SchemeGroupVersion.WithKind("ConfigMap"): localIDPrefix = rpv1.LocalIDConfigMap default: diff --git a/pkg/corerp/renderers/container/manifest_test.go b/pkg/corerp/renderers/container/manifest_test.go index 67a9dd9936..c27604d59d 100644 --- a/pkg/corerp/renderers/container/manifest_test.go +++ b/pkg/corerp/renderers/container/manifest_test.go @@ -154,7 +154,7 @@ func TestGetDeploymentBase(t *testing.T) { { name: "with base manifest", manifest: kubeutil.ObjectManifest{ - kubeutil.DeploymentV1: []runtime.Object{ + appsv1.SchemeGroupVersion.WithKind("Deployment"): []runtime.Object{ &appsv1.Deployment{ TypeMeta: metav1.TypeMeta{ Kind: "Deployment", @@ -276,7 +276,7 @@ func TestGetServiceBase(t *testing.T) { { name: "with base manifest", manifest: kubeutil.ObjectManifest{ - kubeutil.ServiceV1: []runtime.Object{ + corev1.SchemeGroupVersion.WithKind("Service"): []runtime.Object{ &corev1.Service{ TypeMeta: metav1.TypeMeta{ Kind: "Service", @@ -365,7 +365,7 @@ func TestGetServiceAccountBase(t *testing.T) { { name: "with base manifest", manifest: kubeutil.ObjectManifest{ - kubeutil.ServiceAccountV1: []runtime.Object{ + corev1.SchemeGroupVersion.WithKind("ServiceAccount"): []runtime.Object{ &corev1.ServiceAccount{ TypeMeta: metav1.TypeMeta{ Kind: "ServiceAccount", diff --git a/pkg/kubeutil/manifest.go b/pkg/kubeutil/manifest.go index 4a05cfc6fa..73991e348a 100644 --- a/pkg/kubeutil/manifest.go +++ b/pkg/kubeutil/manifest.go @@ -18,21 +18,20 @@ package kubeutil import ( "bytes" - "fmt" "io" - "strings" "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/yaml" - scheme "k8s.io/client-go/kubernetes/scheme" + clientscheme "k8s.io/client-go/kubernetes/scheme" ) -// ObjectManifest is a map of runtime.Object slice where the key is in the format of "group/version/kind". -type ObjectManifest map[string][]runtime.Object +// ObjectManifest is a map of runtime.Object slice where the key is GroupVersionKind for the resource. +type ObjectManifest map[schema.GroupVersionKind][]runtime.Object // Get returns a runtime.Object slice for the given key. -func (m ObjectManifest) Get(key string) []runtime.Object { - obj, ok := m[key] +func (m ObjectManifest) Get(gvk schema.GroupVersionKind) []runtime.Object { + obj, ok := m[gvk] if ok { return obj } else { @@ -41,8 +40,8 @@ func (m ObjectManifest) Get(key string) []runtime.Object { } // GetFirst returns the first runtime.Object for the given key. -func (m ObjectManifest) GetFirst(key string) runtime.Object { - obj, ok := m[key] +func (m ObjectManifest) GetFirst(gvk schema.GroupVersionKind) runtime.Object { + obj, ok := m[gvk] if ok { return obj[0] } else { @@ -50,23 +49,12 @@ func (m ObjectManifest) GetFirst(key string) runtime.Object { } } -// GetObjectKey returns a object key that uniquely identifies the given Kubernetes object. -// The returned key is in the format of "group/version/kind". -func GetObjectKey(obj runtime.Object) string { - gvk := obj.GetObjectKind().GroupVersionKind() - group := gvk.Group - if group == "" { - group = "core" - } - return strings.ToLower(fmt.Sprintf("%s/%s/%s", group, gvk.Version, gvk.Kind)) -} - // ParseManifest parses the given manifest and returns a map of runtime.Object slice where -// the key is in the format of "group/version/kind". +// the key is GroupVersionKind for the resource. // It returns an error if the given manifest is invalid. func ParseManifest(data []byte) (ObjectManifest, error) { decoder := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(data), 4096) - deser := scheme.Codecs.UniversalDeserializer() + deser := clientscheme.Codecs.UniversalDeserializer() objects := ObjectManifest{} for { @@ -83,7 +71,7 @@ func ParseManifest(data []byte) (ObjectManifest, error) { return nil, err } - key := GetObjectKey(obj) + key := obj.GetObjectKind().GroupVersionKind() if v, ok := objects[key]; ok { objects[key] = append(v, obj) } else { diff --git a/pkg/kubeutil/manifest_test.go b/pkg/kubeutil/manifest_test.go index b1a7942c97..c4137005fc 100644 --- a/pkg/kubeutil/manifest_test.go +++ b/pkg/kubeutil/manifest_test.go @@ -20,6 +20,9 @@ import ( "testing" "github.com/stretchr/testify/require" + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime/schema" ) const validManifest = ` @@ -119,24 +122,24 @@ func TestParseManifest(t *testing.T) { manifestTests := []struct { name string manifest string - types map[string]int + types map[schema.GroupVersionKind]int errString string }{ { name: "valid manifest with deployments and services", manifest: validManifest, - types: map[string]int{ - "apps/v1/deployment": 1, - "core/v1/service": 1, + types: map[schema.GroupVersionKind]int{ + appsv1.SchemeGroupVersion.WithKind("Deployment"): 1, + corev1.SchemeGroupVersion.WithKind("Service"): 1, }, errString: "", }, { name: "valid manifest with deployments and secrets", manifest: validManifestWithSecrets, - types: map[string]int{ - "apps/v1/deployment": 1, - "core/v1/secret": 2, + types: map[schema.GroupVersionKind]int{ + appsv1.SchemeGroupVersion.WithKind("Deployment"): 1, + corev1.SchemeGroupVersion.WithKind("Secret"): 2, }, errString: "", }, @@ -168,8 +171,8 @@ func TestObjectManifest(t *testing.T) { base, err := ParseManifest([]byte(validManifestWithSecrets)) require.NoError(t, err) - require.Len(t, base.Get("apps/v1/deployment"), 1) - require.Len(t, base.Get("core/v1/configmap"), 0) - require.Equal(t, base.GetFirst("apps/v1/deployment").GetObjectKind().GroupVersionKind().Kind, "Deployment") - require.Nil(t, base.GetFirst("core/v1/configmap")) + require.Len(t, base.Get(appsv1.SchemeGroupVersion.WithKind("Deployment")), 1) + require.Len(t, base.Get(corev1.SchemeGroupVersion.WithKind("ConfigMap")), 0) + require.Equal(t, base.GetFirst(appsv1.SchemeGroupVersion.WithKind("Deployment")).GetObjectKind().GroupVersionKind().Kind, "Deployment") + require.Nil(t, base.GetFirst(corev1.SchemeGroupVersion.WithKind("ConfigMap"))) } diff --git a/pkg/kubeutil/types.go b/pkg/kubeutil/types.go deleted file mode 100644 index 799998800b..0000000000 --- a/pkg/kubeutil/types.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package kubeutil - -const ( - // DeploymentV1 represents V1 Deployment Kubernetes resource type. - DeploymentV1 = "apps/v1/deployment" - - // DaemonSetV1 represents V1 DaemonSet Kubernetes resource type. - ServiceV1 = "core/v1/service" - - // ServiceAccountV1 represents V1 ServiceAccount Kubernetes resource type. - ServiceAccountV1 = "core/v1/serviceaccount" - - // SecretV1 represents V1 Secret Kubernetes resource type. - SecretV1 = "core/v1/secret" - - // ConfigMapV1 represents V1 ConfigMap Kubernetes resource type. - ConfigMapV1 = "core/v1/configmap" -) From 30945cc12fb38788625cb2b22130b7da87f4eb85 Mon Sep 17 00:00:00 2001 From: Karishma Chawla Date: Fri, 1 Sep 2023 10:45:55 -0700 Subject: [PATCH 35/57] Add Terraform Recipe output functional tests (#6171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding functional tests for Terraform recipe outputs. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ---- Adds new e2e tests. Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 48dd9e1 ### Summary 🧪🌎🚫 This pull request adds new test cases and test data for Terraform recipe validation using the `recipes` package. It covers scenarios where a recipe has a wrong output schema or uses invalid parameters. It also renames a test file to match the convention for Terraform variables. > _`Terraform` recipe_ > _Testing wrong output schema_ > _Autumn leaves fall fast_ ### Walkthrough * Import `recipes` package for recipe validation and execution ([link](https://github.com/project-radius/radius/pull/6171/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995R40)) * Add test function to check Terraform recipe with invalid output schema ([link](https://github.com/project-radius/radius/pull/6171/files?diff=unified&w=0#diff-94178e873ad0fe96b700c75fe85d086b4ad1a4dae5f448e6f5bcc5f706b89995R258-R323)) * Use testdata template `corerp-resources-terraform-redis-new-format.bicep` to define Radius resources with Terraform recipe ([link](https://github.com/project-radius/radius/pull/6171/files?diff=unified&w=0#diff-2bc2b1375b821540256739ad6a16f90f7e520aa57f1135716115e02fb0ecc40dR1-R70)) * Use Terraform module `wrong-output` with invalid output field `error` to trigger recipe error ([link](https://github.com/project-radius/radius/pull/6171/files?diff=unified&w=0#diff-cd3af63125102b35f3a56f15d0580929a28fbc11d5d73a2cbe66227b3f0cf835L1-R6)) * Rename `radius.tf` to `variables.tf` in `k8ssecret-context` module for consistency ([link](https://github.com/project-radius/radius/pull/6171/files?diff=unified&w=0#diff-92e223710e40ef1a1237cd2221e0c6a2ce24ae04bd3e6e68ac4bb05bea0003bb)) --------- Co-authored-by: karishma-chawla <74574173+karishma-chawla@users.noreply.github.com> --- pkg/recipes/driver/terraform.go | 2 +- pkg/recipes/driver/terraform_test.go | 2 +- .../shared/resources/recipe_terraform_test.go | 116 ++++++++++++++++++ ...resources-terraform-recipe-terraform.bicep | 67 ++++++++++ .../{radius.tf => variables.tf} | 0 .../parameter-outputs/output.tf | 13 ++ .../parameter-outputs/variables.tf | 17 +++ .../wrong-output/output.tf | 7 ++ 8 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 test/functional/shared/resources/testdata/corerp-resources-terraform-recipe-terraform.bicep rename test/functional/shared/resources/testdata/recipes/test-terraform-recipes/k8ssecret-context/{radius.tf => variables.tf} (100%) create mode 100644 test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/output.tf create mode 100644 test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/variables.tf create mode 100644 test/functional/shared/resources/testdata/recipes/test-terraform-recipes/wrong-output/output.tf diff --git a/pkg/recipes/driver/terraform.go b/pkg/recipes/driver/terraform.go index f421c2cdc8..aff7e0fade 100644 --- a/pkg/recipes/driver/terraform.go +++ b/pkg/recipes/driver/terraform.go @@ -89,7 +89,7 @@ func (d *terraformDriver) Execute(ctx context.Context, opts ExecuteOptions) (*re recipeOutputs, err := d.prepareRecipeResponse(tfState) if err != nil { - return nil, recipes.NewRecipeError(recipes.InvalidRecipeOutputs, err.Error(), recipes.GetRecipeErrorDetails(err)) + return nil, recipes.NewRecipeError(recipes.InvalidRecipeOutputs, fmt.Sprintf("failed to read the recipe output %q: %s", recipes.ResultPropertyName, err.Error()), recipes.GetRecipeErrorDetails(err)) } return recipeOutputs, nil diff --git a/pkg/recipes/driver/terraform_test.go b/pkg/recipes/driver/terraform_test.go index f564f76f36..5748a15466 100644 --- a/pkg/recipes/driver/terraform_test.go +++ b/pkg/recipes/driver/terraform_test.go @@ -202,7 +202,7 @@ func Test_Terraform_Execute_OutputsFailure(t *testing.T) { recipeError := recipes.RecipeError{ ErrorDetails: v1.ErrorDetails{ Code: recipes.InvalidRecipeOutputs, - Message: "json: unknown field \"invalid\"", + Message: "failed to read the recipe output \"result\": json: unknown field \"invalid\"", }, } tfExecutor.EXPECT().Deploy(ctx, options).Times(1).Return(expectedTFState, nil) diff --git a/test/functional/shared/resources/recipe_terraform_test.go b/test/functional/shared/resources/recipe_terraform_test.go index 4318e3b5f9..ea4368c500 100644 --- a/test/functional/shared/resources/recipe_terraform_test.go +++ b/test/functional/shared/resources/recipe_terraform_test.go @@ -28,6 +28,7 @@ import ( "context" "crypto/sha1" "encoding/base64" + "encoding/json" "fmt" "strings" "testing" @@ -37,6 +38,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/radius-project/radius/pkg/recipes" "github.com/radius-project/radius/pkg/ucp/resources" resources_radius "github.com/radius-project/radius/pkg/ucp/resources/radius" "github.com/radius-project/radius/test/functional" @@ -254,6 +256,120 @@ func Test_TerraformRecipe_AzureStorage(t *testing.T) { test.Test(t) } +// Test_TerraformRecipe_ParametersAndOutputs Validates input parameters correctly set and output values/secrets are populated. +func Test_TerraformRecipe_ParametersAndOutputs(t *testing.T) { + template := "testdata/corerp-resources-terraform-recipe-terraform.bicep" + name := "corerp-resources-terraform-parametersandoutputs" + + // Best way to pass complex parameters is to use JSON. + parametersFilePath := functional.WriteBicepParameterFile(t, map[string]any{ + // These will be set on the environment as part of the recipe + "environmentParameters": map[string]any{ + "a": "environment", + "d": "environment", + }, + + // These will be set on the extender resource + "resourceParameters": map[string]any{ + "c": 42, + "d": "resource", + }, + }) + + parameters := []string{ + functional.GetTerraformRecipeModuleServerURL(), + fmt.Sprintf("basename=%s", name), + fmt.Sprintf("moduleName=%s", "parameter-outputs"), + "@" + parametersFilePath, + } + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor(template, parameters...), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: name, + Type: validation.EnvironmentsResource, + }, + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: name, + Type: validation.ExtendersResource, + }, + }, + }, + K8sObjects: &validation.K8sObjectSet{}, + PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { + resource, err := test.Options.ManagementClient.ShowResource(ctx, "Applications.Core/extenders", name) + require.NoError(t, err) + + text, err := json.MarshalIndent(resource, "", " ") + require.NoError(t, err) + t.Logf("resource data:\n %s", text) + + require.Equal(t, "environment", resource.Properties["a"]) + require.Equal(t, "default value", resource.Properties["b"]) + require.Equal(t, 42.0, resource.Properties["c"]) + require.Equal(t, "resource", resource.Properties["d"]) + + response, err := test.Options.CustomAction.InvokeCustomAction(ctx, *resource.ID, "2022-03-15-privatepreview", "listSecrets") + require.NoError(t, err) + + expected := map[string]any{"e": "secret value"} + require.Equal(t, expected, response.Body) + }, + }, + }) + test.Test(t) +} + +// Test_TerraformRecipe_WrongOutput validates that a Terraform recipe with invalid "result" output schema returns an error. +func Test_TerraformRecipe_WrongOutput(t *testing.T) { + template := "testdata/corerp-resources-terraform-recipe-terraform.bicep" + name := "corerp-resources-terraform-wrong-output" + + parameters := []string{ + functional.GetTerraformRecipeModuleServerURL(), + fmt.Sprintf("basename=%s", name), + fmt.Sprintf("moduleName=%s", "wrong-output"), + } + + validate := step.ValidateSingleDetail("DeploymentFailed", step.DeploymentErrorDetail{ + Code: "ResourceDeploymentFailure", + Details: []step.DeploymentErrorDetail{ + { + Code: recipes.InvalidRecipeOutputs, + MessageContains: "failed to read the recipe output \"result\": json: unknown field \"error\"", + }, + }, + }) + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployErrorExecutor(template, validate, parameters...), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: name, + Type: validation.EnvironmentsResource, + }, + { + Name: name, + Type: validation.ApplicationsResource, + }, + }, + }, + SkipObjectValidation: true, + }, + }) + + test.Test(t) +} + func testSecretDeletion(t *testing.T, ctx context.Context, test shared.RPTest, appName, envName, resourceID string) { secretSuffix, err := getSecretSuffix(resourceID, envName, appName) require.NoError(t, err) diff --git a/test/functional/shared/resources/testdata/corerp-resources-terraform-recipe-terraform.bicep b/test/functional/shared/resources/testdata/corerp-resources-terraform-recipe-terraform.bicep new file mode 100644 index 0000000000..dea8afd4df --- /dev/null +++ b/test/functional/shared/resources/testdata/corerp-resources-terraform-recipe-terraform.bicep @@ -0,0 +1,67 @@ +import radius as radius + +@description('The URL of the server hosting test Terraform modules.') +param moduleServer string + +@description('The Terraform recipe module to test. eg: kubernetes-redis') +param moduleName string + +@description('The base name of the test, used to qualify resources and namespaces. eg: corerp-resources-terraform-helloworld') +param basename string + +@description('The recipe name used to register the recipe. eg: default') +param environmentRecipeName string = 'default' + +@description('The recipe name used to invoke the recipe. eg: default') +param resourceRecipeName string = 'default' + +@description('The environment parameters to pass to the recipe. eg: {"message": "Hello World"}') +param environmentParameters object = {} + +@description('The resource parameters to pass to the recipe. eg: {"name": "hello-world"}') +param resourceParameters object = {} + +resource env 'Applications.Core/environments@2022-03-15-privatepreview' = { + name: basename + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: '${basename}-env' + } + recipes: { + 'Applications.Core/extenders': { + '${environmentRecipeName}': { + templateKind: 'terraform' + templatePath: '${moduleServer}/${moduleName}.zip' + parameters: environmentParameters + } + } + } + } +} + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: basename + properties: { + environment: env.id + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: '${basename}-app' + } + ] + } +} + +resource webapp 'Applications.Core/extenders@2022-03-15-privatepreview' = { + name: basename + properties: { + application: app.id + environment: env.id + recipe: { + name: resourceRecipeName + parameters: resourceParameters + } + } +} diff --git a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/k8ssecret-context/radius.tf b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/k8ssecret-context/variables.tf similarity index 100% rename from test/functional/shared/resources/testdata/recipes/test-terraform-recipes/k8ssecret-context/radius.tf rename to test/functional/shared/resources/testdata/recipes/test-terraform-recipes/k8ssecret-context/variables.tf diff --git a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/output.tf b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/output.tf new file mode 100644 index 0000000000..5626bb1d38 --- /dev/null +++ b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/output.tf @@ -0,0 +1,13 @@ +output "result" { + value = { + values = { + a = var.a + b = var.b + c = var.c + d = var.d + } + secrets = { + e = "secret value" + } + } +} \ No newline at end of file diff --git a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/variables.tf b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/variables.tf new file mode 100644 index 0000000000..6600d3db7a --- /dev/null +++ b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/parameter-outputs/variables.tf @@ -0,0 +1,17 @@ +variable "a" { + type = string +} + +variable "b" { + type = string + default = "default value" +} + +variable "c" { + type = number +} + +variable "d" { + type = string + default = "default value" +} diff --git a/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/wrong-output/output.tf b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/wrong-output/output.tf new file mode 100644 index 0000000000..38e2767a9e --- /dev/null +++ b/test/functional/shared/resources/testdata/recipes/test-terraform-recipes/wrong-output/output.tf @@ -0,0 +1,7 @@ +output "result" { + value = { + error = { + message = "error is not a valid recipe output" + } + } +} \ No newline at end of file From c0133d6e07655f1f328cce3d445918f73d79dbca Mon Sep 17 00:00:00 2001 From: Shruthi Kumar Date: Fri, 1 Sep 2023 11:19:21 -0700 Subject: [PATCH 36/57] Add terraform support for rad recipe show (#6139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This adds Terraform support for rad recipe show. This also abstracts the GetRecipeMetadata controller to use the Engine and driver-specific implementations for Bicep and Terraform ## Type of change - This pull request adds or changes features of Radius and has an approved issue (part of work for #4446) Fixes: partially addresses #4446 ## Auto-generated summary ### 🤖 Generated by Copilot at 538042f ### Summary 🚀🛠️🧪 This pull request adds a new feature to the recipe engine and the controller packages to get recipe metadata from Bicep or Terraform templates. It defines new methods and functions in the `Driver`, `Engine`, and `Controller` interfaces and their implementations, and updates the tests and the service code to use them. It also adds a new test input file and fixes some minor issues in the existing code. > _We're sailing on the code sea, with recipes and drivers_ > _We're fetching metadata from the Bicep and Terraform hives_ > _We're testing and refactoring, with mocks and fixtures too_ > _We're heaving on the pull request, on the count of three, we do_ ### Walkthrough * Add `GetRecipeMetadata` method to `Engine` interface and implement it in `engine` struct ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59R151-R172), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-11be7ca47327363d5edeaff3c6ac6389a462ff9111e1fc03ccb3a98123cd939fR33-R34)) * Add `GetRecipeMetadata` method to `Driver` interface and implement it in `bicepDriver` and `terraformDriver` structs ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0R176-R185), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-1b98bc9b02b96687752860c11c68d87d99ad99f24ecdfc5497fda6823abc0612R176-R202), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-a95d80e21fb522c60702dad150fe92099ac96749fd90a452abd92867b40d069dR33-R35)) * Refactor `generateConfig` function in `executor` struct to extract `downloadAndInspect` and `getTerraformConfig` functions ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482L185-R228)) * Add `GetRecipeMetadata` function to `executor` struct and use `downloadAndInspect` and `getTerraformConfig` functions ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482R169-R206)) * Modify `getRecipeMetadataFromRegistry` function in `GetRecipeMetadata` controller to use `r.Options().Engine` field ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-bcda78402ab93b01aeec72741f0cf3732642cd9f2feccf79d75579e77e079ceeL82-R82), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-bcda78402ab93b01aeec72741f0cf3732642cd9f2feccf79d75579e77e079ceeL101-R113)) * Pass the recipe engine as an option to the controller constructors in `controller` and `frontend` packages ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-02f644f0b91f28040a46a2b213fca0f77f300773b24c244317b09caa4d94a54fR71-R73), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-2bdfa10a8abd451bfb18e729290e9182d1b8e6280d8a9e47dd0ce70f6e8d48d6L165-R171), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-7ea25eedbaa97be92839b34529ce6c828e50f74b8845eaefc02832c23cd6d833L61-R106)) * Create the recipe engine and its dependencies in the `Run` function of the `Service` struct in `frontend` package ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-7ea25eedbaa97be92839b34529ce6c828e50f74b8845eaefc02832c23cd6d833R66-R96)) * Modify the function call `clients.NewResourceDeploymentsClient` in the `Run` function of the `Service` struct in `backend` package to reuse the same `clientOptions` variable ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-70568e8e08320d6f442af8eb869c4a070d87c66f0139988d2c3ca969b49f8573L94-R94)) * Modify the import statement in `environments` package to use the `recipes` package instead of the `util` package ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-bcda78402ab93b01aeec72741f0cf3732642cd9f2feccf79d75579e77e079ceeL31-R31)) * Modify the function call `environment.Properties.Recipes[resource.Type()][recipeName]` in `getRecipeDefinition` function in `configloader` package to use the `resourceType` variable that can be overridden by the `recipe.ResourceType` value ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-0b45f6a08490c2a47c6ead052f97e5b5be965617c8ab927d9b0a297088a92a6eL135-R139)) * Add test functions for `GetRecipeMetadata` function of the `engine`, `bicepDriver`, and `terraformDriver` structs ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-a0a208a111e71713a21b404fdb3b31fd13f668e5716ab4331584027cc3d98debR431-R508), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-ae6e6fdc3b9219f2f1b2dbfd1cfaff3ff2d941a2a4d58fd33b910bd1fbf31e92R311-R396), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528R434-R482)) * Add test functions for `GetRecipeMetadata` controller with a terraform input and a mock engine ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-b0b2e17db6a713c000a5f3843b75bc43896032e2aed99b0a99a4279aca3713e1R94-R141), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-b0b2e17db6a713c000a5f3843b75bc43896032e2aed99b0a99a4279aca3713e1L150-R254)) * Add test models for the terraform input and the environment data model in `environments` package ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-b0b2e17db6a713c000a5f3843b75bc43896032e2aed99b0a99a4279aca3713e1R32-R33), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-b0b2e17db6a713c000a5f3843b75bc43896032e2aed99b0a99a4279aca3713e1L40-R47), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-b0b2e17db6a713c000a5f3843b75bc43896032e2aed99b0a99a4279aca3713e1L59-R80), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-65b4a3a6b2482bca618d94791287132ec134e5ccb062da1cfcb3025345f58b87L47-R55), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-65b4a3a6b2482bca618d94791287132ec134e5ccb062da1cfcb3025345f58b87L60-R64)) * Add fixture file `environmentgetrecipemetadata20220315privatepreview_input_terraform.json` for testing the `GetRecipeMetadata` controller with a terraform input ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-bf0fccac39d0cf80e459794847c74ef9de984a76ffb325ca0c8f90fd78b9ee2aL1-R3)) * Add `Name` field to the `recipeMetadata` variable in `buildTestInputs` function in `terraform` package ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-ae6e6fdc3b9219f2f1b2dbfd1cfaff3ff2d941a2a4d58fd33b910bd1fbf31e92R68)) * Generate mock methods for `GetRecipeMetadata` method of the `Engine` and `Driver` interfaces using the `mockgen` tool ([link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-ede26839223dbf77d6c86d51fd2eea9bf3720aabf7d404d331f1a0ff4e359f64R66-R80), [link](https://github.com/project-radius/radius/pull/6139/files?diff=unified&w=0#diff-2dee9fa8b594b7a0e0783bd6587b452223eb5f7ba7c28a1dc0178c121a2509f0R67-R81)) --- .../environments/getrecipemetadata.go | 41 +++--- .../environments/getrecipemetadata_test.go | 116 ++++++++++++++-- ...adata20220315privatepreview_datamodel.json | 2 +- ...0220315privatepreview_input_terraform.json | 4 + ...220315privatepreview_output_terraform.json | 17 +++ .../v20220315privatepreview_test.go | 16 +++ pkg/corerp/frontend/handler/routes.go | 15 +- pkg/corerp/frontend/handler/routes_test.go | 6 +- pkg/corerp/frontend/service.go | 19 ++- pkg/portableresources/backend/service.go | 2 +- pkg/recipes/driver/bicep.go | 28 ++++ pkg/recipes/driver/bicep_test.go | 50 +++++++ pkg/recipes/driver/mock_driver.go | 15 ++ pkg/recipes/driver/terraform.go | 26 ++++ pkg/recipes/driver/terraform_test.go | 83 +++++++++++ pkg/recipes/driver/types.go | 3 + pkg/recipes/engine/engine.go | 57 ++++++-- pkg/recipes/engine/engine_test.go | 55 +++++++- pkg/recipes/engine/mock_engine.go | 15 ++ pkg/recipes/engine/types.go | 4 + pkg/recipes/errorcodes.go | 3 + pkg/recipes/terraform/config/config_test.go | 11 ++ pkg/recipes/terraform/execute.go | 129 +++++++++++++----- pkg/recipes/terraform/execute_test.go | 59 ++++++++ pkg/recipes/terraform/mock_executor.go | 15 ++ pkg/recipes/terraform/module.go | 19 ++- pkg/recipes/terraform/module_test.go | 24 +++- pkg/recipes/terraform/types.go | 3 + test/functional/shared/cli/cli_test.go | 20 +++ 29 files changed, 752 insertions(+), 105 deletions(-) create mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json create mode 100644 pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_output_terraform.json diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go index 67824220f8..0511bc32ff 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go @@ -28,7 +28,8 @@ import ( "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/radius-project/radius/pkg/corerp/datamodel/converter" pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" - "github.com/radius-project/radius/pkg/rp/util" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/engine" "golang.org/x/exp/maps" ) @@ -37,10 +38,11 @@ var _ ctrl.Controller = (*GetRecipeMetadata)(nil) // GetRecipeMetadata is the controller implementation to get recipe metadata such as parameters and the details of those parameters(type/minValue/etc.). type GetRecipeMetadata struct { ctrl.Operation[*datamodel.Environment, datamodel.Environment] + engine.Engine } // NewGetRecipeMetadata creates a new controller for retrieving recipe metadata from an environment. -func NewGetRecipeMetadata(opts ctrl.Options) (ctrl.Controller, error) { +func NewGetRecipeMetadata(opts ctrl.Options, engine engine.Engine) (ctrl.Controller, error) { return &GetRecipeMetadata{ ctrl.NewOperation(opts, ctrl.ResourceOptions[datamodel.Environment]{ @@ -48,6 +50,7 @@ func NewGetRecipeMetadata(opts ctrl.Options) (ctrl.Controller, error) { ResponseConverter: converter.EnvironmentDataModelToVersioned, }, ), + engine, }, nil } @@ -79,7 +82,7 @@ func (r *GetRecipeMetadata) Run(ctx context.Context, w http.ResponseWriter, req return rest.NewNotFoundMessageResponse(fmt.Sprintf("Either recipe with name %q or resource type %q not found on environment with id %q", recipeDatamodel.Name, recipeDatamodel.LinkType, serviceCtx.ResourceID)), nil } - recipeParams, err := getRecipeMetadataFromRegistry(ctx, recipeProperties.TemplatePath, recipeDatamodel.Name) + recipeParams, err := r.GetRecipeMetadataFromRegistry(ctx, recipeProperties, recipeDatamodel) if err != nil { return nil, err } @@ -98,10 +101,18 @@ func (r *GetRecipeMetadata) Run(ctx context.Context, w http.ResponseWriter, req return rest.NewOKResponse(versioned), nil } -func getRecipeMetadataFromRegistry(ctx context.Context, templatePath string, recipeName string) (recipeParameters map[string]any, err error) { +func (r *GetRecipeMetadata) GetRecipeMetadataFromRegistry(ctx context.Context, recipeProperties datamodel.EnvironmentRecipeProperties, recipeDataModel *datamodel.Recipe) (recipeParameters map[string]any, err error) { + recipeDefinition := recipes.EnvironmentDefinition{ + Name: recipeDataModel.Name, + Driver: recipeProperties.TemplateKind, + Parameters: recipeProperties.Parameters, + TemplatePath: recipeProperties.TemplatePath, + TemplateVersion: recipeProperties.TemplateVersion, + ResourceType: recipeDataModel.LinkType, + } + recipeParameters = make(map[string]any) - recipeData := make(map[string]any) - err = util.ReadFromRegistry(ctx, templatePath, &recipeData) + recipeData, err := r.Engine.GetRecipeMetadata(ctx, recipeDefinition) if err != nil { return recipeParameters, err } @@ -115,24 +126,6 @@ func getRecipeMetadataFromRegistry(ctx context.Context, templatePath string, rec } func parseAndFormatRecipeParams(recipeData map[string]any, recipeParameters map[string]any) error { - // Recipe parameters can be found in the recipe data pulled from the registry in the following format: - // { - // "parameters": { - // : { - // : - // } - // } - // } - // For example: - // { - // "parameters": { - // "location": { - // "type": "string", - // "defaultValue" : "[resourceGroup().location]" - // } - // } - // } - if recipeData["parameters"] == nil { return nil } diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go index cec49101e1..35bbe040f0 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go @@ -19,6 +19,7 @@ package environments import ( "context" "encoding/json" + "fmt" "io" "net/http/httptest" "testing" @@ -28,6 +29,8 @@ import ( ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/rpctest" "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/engine" "github.com/radius-project/radius/pkg/ucp/store" "github.com/radius-project/radius/test/testutil" "github.com/stretchr/testify/require" @@ -37,8 +40,8 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { mctrl := gomock.NewController(t) defer mctrl.Finish() mStorageClient := store.NewMockStorageClient(mctrl) + mEngine := engine.NewMockEngine(mctrl) ctx := context.Background() - t.Parallel() t.Run("get recipe metadata run", func(t *testing.T) { envInput, envDataModel, expectedOutput := getTestModelsGetRecipeMetadata20220315privatepreview() @@ -56,11 +59,75 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { }, nil }) ctx := rpctest.NewARMRequestContext(req) + recipeDefinition := recipes.EnvironmentDefinition{ + Name: *envInput.Name, + Parameters: nil, + TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0", + TemplateVersion: "", + Driver: "bicep", + ResourceType: *envInput.LinkType, + } + recipeData := map[string]any{ + "parameters": map[string]any{ + "documentdbName": map[string]any{"type": "string"}, + "location": map[string]any{"defaultValue": "[resourceGroup().location]", "type": "string"}, + "mongodbName": map[string]any{"type": "string"}, + }, + } + mEngine.EXPECT().GetRecipeMetadata(ctx, recipeDefinition).Return(recipeData, nil) opts := ctrl.Options{ StorageClient: mStorageClient, } - ctl, err := NewGetRecipeMetadata(opts) + ctl, err := NewGetRecipeMetadata(opts, mEngine) + require.NoError(t, err) + resp, err := ctl.Run(ctx, w, req) + require.NoError(t, err) + _ = resp.Apply(ctx, w, req) + require.Equal(t, 200, w.Result().StatusCode) + + actualOutput := &v20220315privatepreview.RecipeGetMetadataResponse{} + _ = json.Unmarshal(w.Body.Bytes(), actualOutput) + require.Equal(t, expectedOutput, actualOutput) + }) + + t.Run("get recipe metadata run -- terraform", func(t *testing.T) { + envInput, envDataModel, expectedOutput := getTestModelsGetTFRecipeMetadata20220315privatepreview() + w := httptest.NewRecorder() + req, err := rpctest.NewHTTPRequestFromJSON(ctx, v1.OperationPost.HTTPMethod(), testHeaderfilegetrecipemetadata, envInput) + require.NoError(t, err) + + mStorageClient. + EXPECT(). + Get(gomock.Any(), gomock.Any()). + DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { + return &store.Object{ + Metadata: store.Metadata{ID: id, ETag: "etag"}, + Data: envDataModel, + }, nil + }) + ctx := rpctest.NewARMRequestContext(req) + recipeDefinition := recipes.EnvironmentDefinition{ + Name: *envInput.Name, + Parameters: nil, + TemplatePath: "Azure/cosmosdb/azurerm", + TemplateVersion: "1.1.0", + Driver: "terraform", + ResourceType: *envInput.LinkType, + } + recipeData := map[string]any{ + "parameters": map[string]any{ + "documentdbName": map[string]any{"type": "string"}, + "location": map[string]any{"defaultValue": "[resourceGroup().location]", "type": "string"}, + "mongodbName": map[string]any{"type": "string"}, + }, + } + mEngine.EXPECT().GetRecipeMetadata(ctx, recipeDefinition).Return(recipeData, nil) + + opts := ctrl.Options{ + StorageClient: mStorageClient, + } + ctl, err := NewGetRecipeMetadata(opts, mEngine) require.NoError(t, err) resp, err := ctl.Run(ctx, w, req) require.NoError(t, err) @@ -87,7 +154,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { opts := ctrl.Options{ StorageClient: mStorageClient, } - ctl, err := NewGetRecipeMetadata(opts) + ctl, err := NewGetRecipeMetadata(opts, mEngine) require.NoError(t, err) resp, err := ctl.Run(ctx, w, req) require.NoError(t, err) @@ -128,7 +195,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { opts := ctrl.Options{ StorageClient: mStorageClient, } - ctl, err := NewGetRecipeMetadata(opts) + ctl, err := NewGetRecipeMetadata(opts, mEngine) require.NoError(t, err) resp, err := ctl.Run(ctx, w, req) require.NoError(t, err) @@ -147,15 +214,42 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { require.Equal(t, v1.CodeNotFound, armerr.Error.Code) require.Contains(t, armerr.Error.Message, "Either recipe with name \"mongodb\" or resource type \"Applications.Datastores/mongoDatabases\" not found on environment with id") }) -} -func TestGetRecipeMetadataFromRegistry(t *testing.T) { - ctx := context.Background() + t.Run("get recipe metadata engine failure", func(t *testing.T) { + envInput, envDataModel, _ := getTestModelsGetRecipeMetadata20220315privatepreview() + w := httptest.NewRecorder() + req, err := rpctest.NewHTTPRequestFromJSON(ctx, v1.OperationPost.HTTPMethod(), testHeaderfilegetrecipemetadata, envInput) + require.NoError(t, err) + + mStorageClient. + EXPECT(). + Get(gomock.Any(), gomock.Any()). + DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { + return &store.Object{ + Metadata: store.Metadata{ID: id, ETag: "etag"}, + Data: envDataModel, + }, nil + }) + ctx := rpctest.NewARMRequestContext(req) + recipeDefinition := recipes.EnvironmentDefinition{ + Name: *envInput.Name, + Parameters: nil, + TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0", + TemplateVersion: "", + Driver: "bicep", + ResourceType: *envInput.LinkType, + } + engineErr := fmt.Errorf("could not find driver %s", "invalidDriver") + mEngine.EXPECT().GetRecipeMetadata(ctx, recipeDefinition).Return(nil, engineErr) - t.Run("get recipe metadata from registry with invalid path", func(t *testing.T) { - templatePath := "radiusdev.azurecr.io/recipes/functionaltest/test/mongodatabases/azure:1.0" - _, err := getRecipeMetadataFromRegistry(ctx, templatePath, "mongodb") - require.ErrorContains(t, err, "failed to fetch repository from the path \"radiusdev.azurecr.io/recipes/functionaltest/test/mongodatabases/azure:1.0\": radiusdev.azurecr.io/recipes/functionaltest/test/mongodatabases/azure:1.0: not found") + opts := ctrl.Options{ + StorageClient: mStorageClient, + } + ctl, err := NewGetRecipeMetadata(opts, mEngine) + require.NoError(t, err) + _, err = ctl.Run(ctx, w, req) + require.Error(t, err) + require.Equal(t, err, engineErr) }) } diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json index e34bf9d96a..8fddd740f6 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_datamodel.json @@ -32,7 +32,7 @@ "templateVersion": "1.1.0" } }, - "Applications.Datastores/redisCaches":{ + "Applications.Datastores/redisCache":{ "redis": { "templateKind": "bicep", "templatePath": "radiusdev.azurecr.io/redis:1.0" diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json new file mode 100644 index 0000000000..1331658ada --- /dev/null +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json @@ -0,0 +1,4 @@ +{ + "name":"mongo-terraform", + "linkType":"Applications.Datastores/mongoDatabases" +} \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_output_terraform.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_output_terraform.json new file mode 100644 index 0000000000..d032b18270 --- /dev/null +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_output_terraform.json @@ -0,0 +1,17 @@ +{ + "templateKind": "terraform", + "templatePath": "Azure/cosmosdb/azurerm", + "templateVersion": "1.1.0", + "parameters": { + "mongodbName": { + "type" : "string" + }, + "documentdbName": { + "type" : "string" + }, + "location": { + "type" : "string", + "defaultValue" : "[resourceGroup().location]" + } + } + } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go index 9a4f17f9da..8cfc30b3a5 100644 --- a/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go +++ b/pkg/corerp/frontend/controller/environments/v20220315privatepreview_test.go @@ -60,6 +60,22 @@ func getTestModelsGetRecipeMetadata20220315privatepreview() (*v20220315privatepr return envInput, envExistingDataModel, expectedOutput } +func getTestModelsGetTFRecipeMetadata20220315privatepreview() (*v20220315privatepreview.RecipeGetMetadata, *datamodel.Environment, *v20220315privatepreview.RecipeGetMetadataResponse) { + rawInput := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_input_terraform.json") + envInput := &v20220315privatepreview.RecipeGetMetadata{} + _ = json.Unmarshal(rawInput, envInput) + + rawExistingDataModel := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_datamodel.json") + envExistingDataModel := &datamodel.Environment{} + _ = json.Unmarshal(rawExistingDataModel, envExistingDataModel) + + rawExpectedOutput := testutil.ReadFixture("environmentgetrecipemetadata20220315privatepreview_output_terraform.json") + expectedOutput := &v20220315privatepreview.RecipeGetMetadataResponse{} + _ = json.Unmarshal(rawExpectedOutput, expectedOutput) + + return envInput, envExistingDataModel, expectedOutput +} + func getTestModelsGetRecipeMetadataForNonExistingRecipe20220315privatepreview() (*v20220315privatepreview.RecipeGetMetadata, *datamodel.Environment) { rawInput := testutil.ReadFixture("environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json") envInput := &v20220315privatepreview.RecipeGetMetadata{} diff --git a/pkg/corerp/frontend/handler/routes.go b/pkg/corerp/frontend/handler/routes.go index 12066478af..8c7051b80f 100644 --- a/pkg/corerp/frontend/handler/routes.go +++ b/pkg/corerp/frontend/handler/routes.go @@ -26,6 +26,7 @@ import ( frontend_ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/recipes/engine" rp_frontend "github.com/radius-project/radius/pkg/rp/frontend" "github.com/radius-project/radius/pkg/validator" "github.com/radius-project/radius/swagger" @@ -52,7 +53,7 @@ const ( // AddRoutes registers handlers for Container, Application, Gateway, Volume and Secret Store resources, allowing for // operations such as List, Get, Put, Patch and Delete. -func AddRoutes(ctx context.Context, r chi.Router, isARM bool, ctrlOpts frontend_ctrl.Options) error { +func AddRoutes(ctx context.Context, r chi.Router, isARM bool, ctrlOpts frontend_ctrl.Options, engine engine.Engine) error { rootScopePath := ctrlOpts.PathBase if isARM { rootScopePath += "/subscriptions/{subscriptionID}" @@ -162,11 +163,13 @@ func AddRoutes(ctx context.Context, r chi.Router, isARM bool, ctrlOpts frontend_ }, }, { - ParentRouter: envResourceRouter, - Path: "/getmetadata", - ResourceType: env_ctrl.ResourceTypeName, - Method: env_ctrl.OperationGetRecipeMetadata, - ControllerFactory: env_ctrl.NewGetRecipeMetadata, + ParentRouter: envResourceRouter, + Path: "/getmetadata", + ResourceType: env_ctrl.ResourceTypeName, + Method: env_ctrl.OperationGetRecipeMetadata, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return env_ctrl.NewGetRecipeMetadata(opt, engine) + }, }, } diff --git a/pkg/corerp/frontend/handler/routes_test.go b/pkg/corerp/frontend/handler/routes_test.go index 0338838b99..22ab8b1392 100644 --- a/pkg/corerp/frontend/handler/routes_test.go +++ b/pkg/corerp/frontend/handler/routes_test.go @@ -26,6 +26,7 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/recipes/engine" "github.com/radius-project/radius/pkg/ucp/dataprovider" "github.com/radius-project/radius/pkg/ucp/store" @@ -231,6 +232,7 @@ func TestHandlers(t *testing.T) { mockSP := dataprovider.NewMockDataStorageProvider(mctrl) mockSC := store.NewMockStorageClient(mctrl) + mockEngine := engine.NewMockEngine(mctrl) mockSC.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.Object{}, nil).AnyTimes() mockSC.EXPECT().Save(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() @@ -240,7 +242,7 @@ func TestHandlers(t *testing.T) { // Test handlers for UCP resources. rpctest.AssertRouters(t, handlerTests, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { r := chi.NewRouter() - return r, AddRoutes(ctx, r, false, ctrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}) + return r, AddRoutes(ctx, r, false, ctrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}, mockEngine) }) }) @@ -257,7 +259,7 @@ func TestHandlers(t *testing.T) { // Test handlers for Azure resources rpctest.AssertRouters(t, azureHandlerTests, "", "/subscriptions/00000000-0000-0000-0000-000000000000", func(ctx context.Context) (chi.Router, error) { r := chi.NewRouter() - return r, AddRoutes(ctx, r, true, ctrl.Options{PathBase: "", DataProvider: mockSP}) + return r, AddRoutes(ctx, r, true, ctrl.Options{PathBase: "", DataProvider: mockSP}, mockEngine) }) }) } diff --git a/pkg/corerp/frontend/service.go b/pkg/corerp/frontend/service.go index f628ecba9c..07125565ab 100644 --- a/pkg/corerp/frontend/service.go +++ b/pkg/corerp/frontend/service.go @@ -25,6 +25,11 @@ import ( "github.com/radius-project/radius/pkg/armrpc/frontend/server" "github.com/radius-project/radius/pkg/armrpc/hostoptions" "github.com/radius-project/radius/pkg/corerp/frontend/handler" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/driver" + "github.com/radius-project/radius/pkg/recipes/engine" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/ucp/secret/provider" ) type Service struct { @@ -52,6 +57,18 @@ func (s *Service) Run(ctx context.Context) error { return err } + // Creates a new engine with the drivers. The engine will be used to fetch Recipe parameter information from the template path. + clientOptions := sdk.NewClientOptions(s.Options.UCPConnection) + engine := engine.NewEngine(engine.Options{ + Drivers: map[string]driver.Driver{ + recipes.TemplateKindBicep: driver.NewBicepDriver(clientOptions, nil, nil), + recipes.TemplateKindTerraform: driver.NewTerraformDriver(s.Options.UCPConnection, provider.NewSecretProvider(s.Options.Config.SecretProvider), + driver.TerraformOptions{ + Path: s.Options.Config.Terraform.Path, + }, nil), + }, + }) + opts := ctrl.Options{ Address: fmt.Sprintf("%s:%d", s.Options.Config.Server.Host, s.Options.Config.Server.Port), PathBase: s.Options.Config.Server.PathBase, @@ -69,7 +86,7 @@ func (s *Service) Run(ctx context.Context) error { ArmCertMgr: s.ARMCertManager, EnableArmAuth: s.Options.Config.Server.EnableArmAuth, // when enabled the client cert validation will be done Configure: func(router chi.Router) error { - err := handler.AddRoutes(ctx, router, !hostoptions.IsSelfHosted(), opts) + err := handler.AddRoutes(ctx, router, !hostoptions.IsSelfHosted(), opts, engine) if err != nil { return err } diff --git a/pkg/portableresources/backend/service.go b/pkg/portableresources/backend/service.go index 9c8c0177e2..72e40542a4 100644 --- a/pkg/portableresources/backend/service.go +++ b/pkg/portableresources/backend/service.go @@ -82,7 +82,7 @@ func (s *Service) Run(ctx context.Context) error { deploymentEngineClient, err := clients.NewResourceDeploymentsClient(&clients.Options{ Cred: &aztoken.AnonymousCredential{}, BaseURI: s.Options.UCPConnection.Endpoint(), - ARMClientOptions: sdk.NewClientOptions(s.Options.UCPConnection), + ARMClientOptions: clientOptions, }) if err != nil { return err diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index e01a8dabb9..c110194a7b 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -185,6 +185,34 @@ func (d *bicepDriver) Delete(ctx context.Context, opts DeleteOptions) error { return nil } +// GetRecipeMetadata gets the Bicep recipe parameters information from the container registry +func (d *bicepDriver) GetRecipeMetadata(ctx context.Context, opts BaseOptions) (map[string]any, error) { + // Recipe parameters can be found in the recipe data pulled from the registry in the following format: + // { + // "parameters": { + // : { + // : + // } + // } + // } + // For example: + // { + // "parameters": { + // "location": { + // "type": "string", + // "defaultValue" : "[resourceGroup().location]" + // } + // } + // } + recipeData := make(map[string]any) + err := util.ReadFromRegistry(ctx, opts.Definition.TemplatePath, &recipeData) + if err != nil { + return nil, err + } + + return recipeData, nil +} + func hasContextParameter(recipeData map[string]any) bool { parametersAny, ok := recipeData[recipeParameters] if !ok { diff --git a/pkg/recipes/driver/bicep_test.go b/pkg/recipes/driver/bicep_test.go index 2276caff55..d950813d03 100644 --- a/pkg/recipes/driver/bicep_test.go +++ b/pkg/recipes/driver/bicep_test.go @@ -430,6 +430,56 @@ func Test_Bicep_Delete_Error(t *testing.T) { require.Equal(t, err, &recipeError) } +func Test_Bicep_GetRecipeMetadata_Success(t *testing.T) { + ctx := testcontext.New(t) + driver := bicepDriver{} + recipeDefinition := recipes.EnvironmentDefinition{ + Name: "mongo-azure", + Driver: recipes.TemplateKindBicep, + TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0", + ResourceType: "Applications.Datastores/mongoDatabases", + } + + expectedOutput := map[string]any{ + "documentdbName": map[string]any{"type": "string"}, + "location": map[string]any{"defaultValue": "[resourceGroup().location]", "type": "string"}, + "mongodbName": map[string]any{"type": "string"}, + } + + recipeData, err := driver.GetRecipeMetadata(ctx, BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: recipeDefinition, + }) + + require.NoError(t, err) + require.Equal(t, expectedOutput, recipeData["parameters"]) +} + +func Test_Bicep_GetRecipeMetadata_Error(t *testing.T) { + ctx := testcontext.New(t) + driver := bicepDriver{} + recipeDefinition := recipes.EnvironmentDefinition{ + Name: "mongo-azure", + Driver: recipes.TemplateKindBicep, + TemplatePath: "radiusdev.azurecr.io/test-non-existent-recipe", + ResourceType: "Applications.Datastores/mongoDatabases", + } + + _, err := driver.GetRecipeMetadata(ctx, BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: recipeDefinition, + }) + expErr := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeLanguageFailure, + Message: "failed to fetch repository from the path \"radiusdev.azurecr.io/test-non-existent-recipe\": radiusdev.azurecr.io/test-non-existent-recipe:latest: not found", + }, + } + + require.Error(t, err) + require.Equal(t, err, &expErr) +} + func Test_GetGCOutputResources(t *testing.T) { d := &bicepDriver{} before := []string{ diff --git a/pkg/recipes/driver/mock_driver.go b/pkg/recipes/driver/mock_driver.go index 7643d65348..4eb4ca869b 100644 --- a/pkg/recipes/driver/mock_driver.go +++ b/pkg/recipes/driver/mock_driver.go @@ -63,3 +63,18 @@ func (mr *MockDriverMockRecorder) Execute(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockDriver)(nil).Execute), arg0, arg1) } + +// GetRecipeMetadata mocks base method. +func (m *MockDriver) GetRecipeMetadata(arg0 context.Context, arg1 BaseOptions) (map[string]interface{}, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRecipeMetadata", arg0, arg1) + ret0, _ := ret[0].(map[string]interface{}) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRecipeMetadata indicates an expected call of GetRecipeMetadata. +func (mr *MockDriverMockRecorder) GetRecipeMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockDriver)(nil).GetRecipeMetadata), arg0, arg1) +} diff --git a/pkg/recipes/driver/terraform.go b/pkg/recipes/driver/terraform.go index aff7e0fade..cc0cbb6639 100644 --- a/pkg/recipes/driver/terraform.go +++ b/pkg/recipes/driver/terraform.go @@ -173,3 +173,29 @@ func (d *terraformDriver) createExecutionDirectory(ctx context.Context, recipe r return requestDirPath, nil } + +// GetRecipeMetadata returns the Terraform Recipe parameters by downloading the module and retrieving variable information +func (d *terraformDriver) GetRecipeMetadata(ctx context.Context, opts BaseOptions) (map[string]any, error) { + logger := ucplog.FromContextOrDiscard(ctx) + + requestDirPath, err := d.createExecutionDirectory(ctx, opts.Recipe, opts.Definition) + if err != nil { + return nil, recipes.NewRecipeError(recipes.RecipeGetMetadataFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) + } + defer func() { + if err := os.RemoveAll(requestDirPath); err != nil { + logger.Info(fmt.Sprintf("Failed to cleanup Terraform execution directory %q. Err: %s", requestDirPath, err.Error())) + } + }() + + recipeData, err := d.terraformExecutor.GetRecipeMetadata(ctx, terraform.Options{ + RootDir: requestDirPath, + ResourceRecipe: &opts.Recipe, + EnvRecipe: &opts.Definition, + }) + if err != nil { + return nil, err + } + + return recipeData, nil +} diff --git a/pkg/recipes/driver/terraform_test.go b/pkg/recipes/driver/terraform_test.go index 5748a15466..7e1184ef9a 100644 --- a/pkg/recipes/driver/terraform_test.go +++ b/pkg/recipes/driver/terraform_test.go @@ -65,6 +65,7 @@ func buildTestInputs() (recipes.Configuration, recipes.ResourceMetadata, recipes } envRecipe := recipes.EnvironmentDefinition{ + Name: "redis-azure", Driver: recipes.TemplateKindBicep, TemplatePath: "Azure/redis/azurerm", ResourceType: "Applications.Datastores/redisCaches", @@ -307,6 +308,88 @@ func Test_Terraform_Execute_MissingARMRequestContext_Panics(t *testing.T) { }) } +func TestTerraformDriver_GetRecipeMetadata_Success(t *testing.T) { + ctx := testcontext.New(t) + armCtx := &v1.ARMRequestContext{ + OperationID: uuid.New(), + } + ctx = v1.WithARMRequestContext(ctx, armCtx) + + tfExecutor, driver := setup(t) + _, _, envRecipe := buildTestInputs() + + tfDir := filepath.Join(driver.options.Path, armCtx.OperationID.String()) + expectedOutput := map[string]any{ + "parameters": map[string]any{ + "redis_cache_name": "redis-test", + }, + } + options := terraform.Options{ + RootDir: tfDir, + ResourceRecipe: &recipes.ResourceMetadata{}, + EnvRecipe: &envRecipe, + } + tfExecutor.EXPECT().GetRecipeMetadata(ctx, options).Times(1).Return(expectedOutput, nil) + + recipeData, err := driver.GetRecipeMetadata(ctx, BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: envRecipe, + }) + require.NoError(t, err) + require.Equal(t, expectedOutput, recipeData) + // Verify directory cleanup + _, err = os.Stat(tfDir) + require.True(t, os.IsNotExist(err), "Expected directory %s to be removed, but it still exists", tfDir) +} + +func Test_Terraform_GetRecipeMetadata_EmptyPath(t *testing.T) { + _, driver := setup(t) + driver.options.Path = "" + _, _, envRecipe := buildTestInputs() + + expErr := recipes.RecipeError{ + ErrorDetails: v1.ErrorDetails{ + Code: recipes.RecipeGetMetadataFailed, + Message: "path is a required option for Terraform driver", + }, + } + + _, err := driver.GetRecipeMetadata(testcontext.New(t), BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: envRecipe, + }) + require.Error(t, err) + require.Equal(t, err, &expErr) +} + +func TestTerraformDriver_GetRecipeMetadata_Failure(t *testing.T) { + ctx := testcontext.New(t) + armCtx := &v1.ARMRequestContext{ + OperationID: uuid.New(), + } + ctx = v1.WithARMRequestContext(ctx, armCtx) + + tfExecutor, driver := setup(t) + _, _, envRecipe := buildTestInputs() + + tfDir := filepath.Join(driver.options.Path, armCtx.OperationID.String()) + options := terraform.Options{ + RootDir: tfDir, + ResourceRecipe: &recipes.ResourceMetadata{}, + EnvRecipe: &envRecipe, + } + + expErr := errors.New("Failed to download module") + tfExecutor.EXPECT().GetRecipeMetadata(ctx, options).Times(1).Return(nil, expErr) + + _, err := driver.GetRecipeMetadata(ctx, BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: envRecipe, + }) + require.Error(t, err) + require.Equal(t, expErr, err) +} + func Test_Terraform_Delete_Success(t *testing.T) { ctx := testcontext.New(t) ctx = v1.WithARMRequestContext(ctx, &v1.ARMRequestContext{}) diff --git a/pkg/recipes/driver/types.go b/pkg/recipes/driver/types.go index 94006e374d..bd64199ca2 100644 --- a/pkg/recipes/driver/types.go +++ b/pkg/recipes/driver/types.go @@ -30,6 +30,9 @@ type Driver interface { // Delete handles deletion of output resources for the recipe deployment. Delete(ctx context.Context, opts DeleteOptions) error + + // Gets the Recipe metadata and parameters from Recipe's template path + GetRecipeMetadata(ctx context.Context, opts BaseOptions) (map[string]any, error) } // BaseOptions is the base options for the driver operations. diff --git a/pkg/recipes/engine/engine.go b/pkg/recipes/engine/engine.go index 345a128515..658b4b544b 100644 --- a/pkg/recipes/engine/engine.go +++ b/pkg/recipes/engine/engine.go @@ -67,17 +67,11 @@ func (e *engine) Execute(ctx context.Context, recipe recipes.ResourceMetadata, p // executeCore function is the core logic of the Execute function. // Any changes to the core logic of the Execute function should be made here. func (e *engine) executeCore(ctx context.Context, recipe recipes.ResourceMetadata, prevState []string) (*recipes.RecipeOutput, *recipes.EnvironmentDefinition, error) { - // Load Recipe Definition from the environment. - definition, err := e.options.ConfigurationLoader.LoadRecipe(ctx, &recipe) + definition, driver, err := e.getDriver(ctx, recipe) if err != nil { return nil, nil, err } - driver, ok := e.options.Drivers[definition.Driver] - if !ok { - return nil, definition, fmt.Errorf("could not find driver %s", definition.Driver) - } - configuration, err := e.options.ConfigurationLoader.LoadConfiguration(ctx, recipe) if err != nil { return nil, definition, err @@ -118,18 +112,11 @@ func (e *engine) Delete(ctx context.Context, recipe recipes.ResourceMetadata, ou // deleteCore function is the core logic of the Delete function. // Any changes to the core logic of the Delete function should be made here. func (e *engine) deleteCore(ctx context.Context, recipe recipes.ResourceMetadata, outputResources []rpv1.OutputResource) (*recipes.EnvironmentDefinition, error) { - // Load Recipe Definition from the environment. - definition, err := e.options.ConfigurationLoader.LoadRecipe(ctx, &recipe) + definition, driver, err := e.getDriver(ctx, recipe) if err != nil { return nil, err } - // Determine Recipe driver type - driver, ok := e.options.Drivers[definition.Driver] - if !ok { - return definition, fmt.Errorf("could not find driver %s", definition.Driver) - } - configuration, err := e.options.ConfigurationLoader.LoadConfiguration(ctx, recipe) if err != nil { return definition, err @@ -149,3 +136,43 @@ func (e *engine) deleteCore(ctx context.Context, recipe recipes.ResourceMetadata return definition, nil } + +// Gets the Recipe metadata and parameters from Recipe's template path. +func (e *engine) GetRecipeMetadata(ctx context.Context, recipeDefinition recipes.EnvironmentDefinition) (map[string]any, error) { + recipeData, err := e.getRecipeMetadataCore(ctx, recipeDefinition) + if err != nil { + return nil, err + } + + return recipeData, nil +} + +// getRecipeMetadataCore function is the core logic of the GetRecipeMetadata function. +// Any changes to the core logic of the GetRecipeMetadata function should be made here. +func (e *engine) getRecipeMetadataCore(ctx context.Context, recipeDefinition recipes.EnvironmentDefinition) (map[string]any, error) { + // Determine Recipe driver type + driver, ok := e.options.Drivers[recipeDefinition.Driver] + if !ok { + return nil, fmt.Errorf("could not find driver %s", recipeDefinition.Driver) + } + + return driver.GetRecipeMetadata(ctx, recipedriver.BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: recipeDefinition, + }) +} + +func (e *engine) getDriver(ctx context.Context, recipeMetadata recipes.ResourceMetadata) (*recipes.EnvironmentDefinition, recipedriver.Driver, error) { + // Load Recipe Definition from the environment. + definition, err := e.options.ConfigurationLoader.LoadRecipe(ctx, &recipeMetadata) + if err != nil { + return nil, nil, err + } + + // Determine Recipe driver type + driver, ok := e.options.Drivers[definition.Driver] + if !ok { + return nil, nil, fmt.Errorf("could not find driver %s", definition.Driver) + } + return definition, driver, nil +} diff --git a/pkg/recipes/engine/engine_test.go b/pkg/recipes/engine/engine_test.go index 2063e9f48d..ccf6805939 100644 --- a/pkg/recipes/engine/engine_test.go +++ b/pkg/recipes/engine/engine_test.go @@ -332,7 +332,7 @@ func Test_Engine_Load_Error(t *testing.T) { } func Test_Engine_Delete_Success(t *testing.T) { - recipeMetadata, recipeDefinition, outputResources := getDeleteInputs() + recipeMetadata, recipeDefinition, outputResources := getRecipeInputs() envConfig := &recipes.Configuration{ Runtime: recipes.RuntimeConfiguration{ @@ -377,7 +377,7 @@ func Test_Engine_Delete_Success(t *testing.T) { } func Test_Engine_Delete_Error(t *testing.T) { - recipeMetadata, recipeDefinition, outputResources := getDeleteInputs() + recipeMetadata, recipeDefinition, outputResources := getRecipeInputs() envConfig := &recipes.Configuration{ Runtime: recipes.RuntimeConfiguration{ @@ -423,7 +423,7 @@ func Test_Engine_Delete_Error(t *testing.T) { } func Test_Delete_InvalidDriver(t *testing.T) { - recipeMetadata, recipeDefinition, outputResources := getDeleteInputs() + recipeMetadata, recipeDefinition, outputResources := getRecipeInputs() recipeDefinition.Driver = "invalid" ctx := testcontext.New(t) @@ -441,7 +441,7 @@ func Test_Delete_InvalidDriver(t *testing.T) { func Test_Delete_Lookup_Error(t *testing.T) { ctx := testcontext.New(t) engine, configLoader, _ := setup(t) - recipeMetadata, _, outputResources := getDeleteInputs() + recipeMetadata, _, outputResources := getRecipeInputs() configLoader.EXPECT(). LoadRecipe(ctx, &recipeMetadata). @@ -451,7 +451,52 @@ func Test_Delete_Lookup_Error(t *testing.T) { require.Error(t, err) } -func getDeleteInputs() (recipes.ResourceMetadata, recipes.EnvironmentDefinition, []rpv1.OutputResource) { +func Test_Engine_GetRecipeMetadata_Success(t *testing.T) { + _, recipeDefinition, _ := getRecipeInputs() + + ctx := testcontext.New(t) + engine, _, driver := setup(t) + outputParams := map[string]any{"parameters": recipeDefinition.Parameters} + + driver.EXPECT().GetRecipeMetadata(ctx, recipedriver.BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: recipeDefinition, + }).Times(1).Return(outputParams, nil) + + recipeData, err := engine.GetRecipeMetadata(ctx, recipeDefinition) + require.NoError(t, err) + require.Equal(t, outputParams, recipeData) +} + +func Test_GetRecipeMetadata_Driver_Error(t *testing.T) { + _, recipeDefinition, _ := getRecipeInputs() + + ctx := testcontext.New(t) + engine, _, driver := setup(t) + + driver.EXPECT().GetRecipeMetadata(ctx, recipedriver.BaseOptions{ + Recipe: recipes.ResourceMetadata{}, + Definition: recipeDefinition, + }).Times(1).Return(nil, errors.New("driver failure")) + + _, err := engine.GetRecipeMetadata(ctx, recipeDefinition) + require.Error(t, err) + require.Contains(t, err.Error(), "driver failure") +} + +func Test_GetRecipeMetadata_Driver_InvalidDriver(t *testing.T) { + _, recipeDefinition, _ := getRecipeInputs() + recipeDefinition.Driver = "invalid" + + ctx := testcontext.New(t) + engine, _, _ := setup(t) + + _, err := engine.GetRecipeMetadata(ctx, recipeDefinition) + require.Error(t, err) + require.Contains(t, err.Error(), "could not find driver invalid") +} + +func getRecipeInputs() (recipes.ResourceMetadata, recipes.EnvironmentDefinition, []rpv1.OutputResource) { recipeMetadata := recipes.ResourceMetadata{ Name: "mongo-azure", ApplicationID: "/planes/radius/local/resourcegroups/test-rg/providers/applications.core/applications/app1", diff --git a/pkg/recipes/engine/mock_engine.go b/pkg/recipes/engine/mock_engine.go index 615a397ee0..cf1c1da32a 100644 --- a/pkg/recipes/engine/mock_engine.go +++ b/pkg/recipes/engine/mock_engine.go @@ -64,3 +64,18 @@ func (mr *MockEngineMockRecorder) Execute(arg0, arg1, arg2 interface{}) *gomock. mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockEngine)(nil).Execute), arg0, arg1, arg2) } + +// GetRecipeMetadata mocks base method. +func (m *MockEngine) GetRecipeMetadata(arg0 context.Context, arg1 recipes.EnvironmentDefinition) (map[string]interface{}, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRecipeMetadata", arg0, arg1) + ret0, _ := ret[0].(map[string]interface{}) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRecipeMetadata indicates an expected call of GetRecipeMetadata. +func (mr *MockEngineMockRecorder) GetRecipeMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockEngine)(nil).GetRecipeMetadata), arg0, arg1) +} diff --git a/pkg/recipes/engine/types.go b/pkg/recipes/engine/types.go index b917d4d644..3079e015a1 100644 --- a/pkg/recipes/engine/types.go +++ b/pkg/recipes/engine/types.go @@ -29,6 +29,10 @@ type Engine interface { // Execute gathers environment configuration, recipe definition and calls the driver to deploy the recipe. // prevState is added to the driver execute options, which is used to get the obsolete resources for cleanup. It consists list of recipe output resource IDs that were created in the previous deployment. Execute(ctx context.Context, recipe recipes.ResourceMetadata, prevState []string) (*recipes.RecipeOutput, error) + // Delete handles deletion of output resources for the recipe deployment. Delete(ctx context.Context, recipe recipes.ResourceMetadata, outputResources []rpv1.OutputResource) error + + // Gets the Recipe metadata and parameters from Recipe's template path + GetRecipeMetadata(ctx context.Context, recipeDefinition recipes.EnvironmentDefinition) (map[string]any, error) } diff --git a/pkg/recipes/errorcodes.go b/pkg/recipes/errorcodes.go index 04f7ea5505..d5c53c1d90 100644 --- a/pkg/recipes/errorcodes.go +++ b/pkg/recipes/errorcodes.go @@ -31,4 +31,7 @@ const ( // Used for errors encountered while cleaning up of obsolete resources during patch operation. RecipeGarbageCollectionFailed = "RecipeGarbageCollectionFailed" + + // Used for errors encountered when getting recipe parameters. + RecipeGetMetadataFailed = "RecipeGetMetadataFailed" ) diff --git a/pkg/recipes/terraform/config/config_test.go b/pkg/recipes/terraform/config/config_test.go index e86f7870c2..0f43323e33 100644 --- a/pkg/recipes/terraform/config/config_test.go +++ b/pkg/recipes/terraform/config/config_test.go @@ -158,6 +158,17 @@ func Test_AddRecipeContext(t *testing.T) { recipeContext: getTestRecipeContext(), expectedConfigFile: "testdata/main-noparams.tf.json", }, + { + name: "recipe context with empty resource metadata", + envdef: &recipes.EnvironmentDefinition{ + Name: testRecipeName, + TemplatePath: testTemplatePath, + TemplateVersion: testTemplateVersion, + }, + metadata: &recipes.ResourceMetadata{}, + recipeContext: getTestRecipeContext(), + expectedConfigFile: "testdata/main-noparams.tf.json", + }, { name: "recipe context and env params are given", envdef: &recipes.EnvironmentDefinition{ diff --git a/pkg/recipes/terraform/execute.go b/pkg/recipes/terraform/execute.go index 7753f38386..59075e5707 100644 --- a/pkg/recipes/terraform/execute.go +++ b/pkg/recipes/terraform/execute.go @@ -166,6 +166,44 @@ func (e *executor) Delete(ctx context.Context, options Options) error { Delete(ctx, terraformStateKubernetesPrefix+secretSuffix, metav1.DeleteOptions{}) } +func (e *executor) GetRecipeMetadata(ctx context.Context, options Options) (map[string]any, error) { + logger := ucplog.FromContextOrDiscard(ctx) + + // Install Terraform + i := install.NewInstaller() + execPath, err := Install(ctx, i, options.RootDir) + // The terraform zip for installation is downloaded in a location outside of the install directory and is only accessible through the installer.Remove function - + // stored in latestVersion.pathsToRemove. So this needs to be called for complete cleanup even if the root terraform directory is deleted. + defer func() { + if err := i.Remove(ctx); err != nil { + logger.Info(fmt.Sprintf("Failed to cleanup Terraform installation: %s", err.Error())) + } + }() + if err != nil { + return nil, err + } + + // Create Working Directory + workingDir, err := createWorkingDir(ctx, options.RootDir) + if err != nil { + return nil, err + } + + _, err = getTerraformConfig(ctx, workingDir, options) + if err != nil { + return nil, err + } + + result, err := downloadAndInspect(ctx, workingDir, execPath, options) + if err != nil { + return nil, err + } + + return map[string]any{ + "parameters": result.Parameters, + }, nil +} + func createWorkingDir(ctx context.Context, tfDir string) (string, error) { logger := ucplog.FromContextOrDiscard(ctx) @@ -182,42 +220,12 @@ func createWorkingDir(ctx context.Context, tfDir string) (string, error) { func (e *executor) generateConfig(ctx context.Context, workingDir, execPath string, options Options) (string, error) { logger := ucplog.FromContextOrDiscard(ctx) - // Generate Terraform json config in the working directory - // Use recipe name as a local reference to the module. - // Modules are downloaded in a subdirectory in the working directory. Name of the module specified in the - // configuration is used as subdirectory name under .terraform/modules directory. - // https://developer.hashicorp.com/terraform/tutorials/modules/module-use#understand-how-modules-work - localModuleName := options.EnvRecipe.Name - if localModuleName == "" { - return "", ErrRecipeNameEmpty - } - - // Create Terraform configuration containing module information with the given recipe parameters. - tfConfig := config.New(localModuleName, options.EnvRecipe, options.ResourceRecipe) - - // Before downloading the module, Teraform configuration needs to be persisted in the working directory. - // Terraform Get command uses this config file to download module from the source specified in the config. - if err := tfConfig.Save(ctx, workingDir); err != nil { + tfConfig, err := getTerraformConfig(ctx, workingDir, options) + if err != nil { return "", err } - // Download the Terraform module to the working directory. - logger.Info(fmt.Sprintf("Downloading Terraform module: %s", options.EnvRecipe.TemplatePath)) - downloadStartTime := time.Now() - if err := downloadModule(ctx, workingDir, execPath); err != nil { - metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, - metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, - options.EnvRecipe, metrics.FailedOperationState)) - return "", recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) - } - metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, - metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, - options.EnvRecipe, metrics.SuccessfulOperationState)) - - // Load the downloaded module to retrieve providers and variables required by the module. - // This is needed to add the appropriate providers config and populate the value of recipe context variable. - logger.Info(fmt.Sprintf("Inspecting the downloaded Terraform module: %s", options.EnvRecipe.TemplatePath)) - loadedModule, err := inspectModule(workingDir, localModuleName) + loadedModule, err := downloadAndInspect(ctx, workingDir, execPath, options) if err != nil { return "", err } @@ -254,12 +262,12 @@ func (e *executor) generateConfig(ctx context.Context, workingDir, execPath stri return "", err } - if err = tfConfig.AddRecipeContext(ctx, localModuleName, recipectx); err != nil { + if err = tfConfig.AddRecipeContext(ctx, options.EnvRecipe.Name, recipectx); err != nil { return "", err } } if loadedModule.ResultOutputExists { - if err = tfConfig.AddOutputs(localModuleName); err != nil { + if err = tfConfig.AddOutputs(options.EnvRecipe.Name); err != nil { return "", err } } @@ -274,6 +282,57 @@ func (e *executor) generateConfig(ctx context.Context, workingDir, execPath stri return secretSuffix, nil } +// downloadAndInspect handles downloading the TF module and retrieving the necessary information +func downloadAndInspect(ctx context.Context, workingDir string, execPath string, options Options) (*moduleInspectResult, error) { + logger := ucplog.FromContextOrDiscard(ctx) + + // Download the Terraform module to the working directory. + logger.Info(fmt.Sprintf("Downloading Terraform module: %s", options.EnvRecipe.TemplatePath)) + downloadStartTime := time.Now() + if err := downloadModule(ctx, workingDir, execPath); err != nil { + metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, + metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, + options.EnvRecipe, metrics.FailedOperationState)) + return nil, recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) + } + metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, + metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, + options.EnvRecipe, metrics.SuccessfulOperationState)) + + // Load the downloaded module to retrieve providers and variables required by the module. + // This is needed to add the appropriate providers config and populate the value of recipe context variable. + logger.Info(fmt.Sprintf("Inspecting the downloaded Terraform module: %s", options.EnvRecipe.TemplatePath)) + loadedModule, err := inspectModule(workingDir, options.EnvRecipe.Name) + if err != nil { + return nil, err + } + + return loadedModule, nil +} + +// getTerraformConfig generates the Terraform json config and saves it +func getTerraformConfig(ctx context.Context, workingDir string, options Options) (*config.TerraformConfig, error) { + // Generate Terraform json config in the working directory + // Use recipe name as a local reference to the module. + // Modules are downloaded in a subdirectory in the working directory. Name of the module specified in the + // configuration is used as subdirectory name under .terraform/modules directory. + // https://developer.hashicorp.com/terraform/tutorials/modules/module-use#understand-how-modules-work + localModuleName := options.EnvRecipe.Name + if localModuleName == "" { + return nil, ErrRecipeNameEmpty + } + + // Create Terraform configuration containing module information with the given recipe parameters. + tfConfig := config.New(localModuleName, options.EnvRecipe, options.ResourceRecipe) + + // Before downloading the module, Teraform configuration needs to be persisted in the working directory. + // Terraform Get command uses this config file to download module from the source specified in the config. + if err := tfConfig.Save(ctx, workingDir); err != nil { + return nil, err + } + return tfConfig, nil +} + // initAndApply runs Terraform init and apply in the provided working directory. func initAndApply(ctx context.Context, workingDir, execPath string) (*tfjson.State, error) { logger := ucplog.FromContextOrDiscard(ctx) diff --git a/pkg/recipes/terraform/execute_test.go b/pkg/recipes/terraform/execute_test.go index 9b8aaa4391..c38c8d939f 100644 --- a/pkg/recipes/terraform/execute_test.go +++ b/pkg/recipes/terraform/execute_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/terraform/config" "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) @@ -119,3 +120,61 @@ func TestGeneratedConfig(t *testing.T) { }) } } + +func Test_GetTerraformConfig(t *testing.T) { + // Create a temporary directory for testing. + testDir := t.TempDir() + + workingDir, err := createWorkingDir(testcontext.New(t), testDir) + require.NoError(t, err) + options := Options{ + EnvRecipe: &recipes.EnvironmentDefinition{ + Name: "test-recipe", + TemplatePath: "test/module/source", + }, + ResourceRecipe: &recipes.ResourceMetadata{}, + } + + expectedConfig := config.TerraformConfig{ + Module: map[string]config.TFModuleConfig{ + "test-recipe": {"source": "test/module/source"}}, + } + tfConfig, err := getTerraformConfig(testcontext.New(t), workingDir, options) + require.NoError(t, err) + require.Equal(t, &expectedConfig, tfConfig) +} + +func Test_GetTerraformConfig_EmptyRecipeName(t *testing.T) { + // Create a temporary directory for testing. + testDir := t.TempDir() + + workingDir, err := createWorkingDir(testcontext.New(t), testDir) + require.NoError(t, err) + options := Options{ + EnvRecipe: &recipes.EnvironmentDefinition{ + Name: "", + TemplatePath: "test/module/source", + }, + ResourceRecipe: &recipes.ResourceMetadata{}, + } + + _, err = getTerraformConfig(testcontext.New(t), workingDir, options) + require.Error(t, err) + require.Equal(t, err, ErrRecipeNameEmpty) +} + +func Test_GetTerraformConfig_InvalidDirectory(t *testing.T) { + // Create a temporary directory for testing. + workingDir := "invalid directory" + options := Options{ + EnvRecipe: &recipes.EnvironmentDefinition{ + Name: "test-recipe", + TemplatePath: "test/module/source", + }, + ResourceRecipe: &recipes.ResourceMetadata{}, + } + + _, err := getTerraformConfig(testcontext.New(t), workingDir, options) + require.Error(t, err) + require.Contains(t, err.Error(), "error creating file: open invalid directory/main.tf.json: no such file or directory") +} diff --git a/pkg/recipes/terraform/mock_executor.go b/pkg/recipes/terraform/mock_executor.go index da8b286811..0203850e60 100644 --- a/pkg/recipes/terraform/mock_executor.go +++ b/pkg/recipes/terraform/mock_executor.go @@ -63,3 +63,18 @@ func (mr *MockTerraformExecutorMockRecorder) Deploy(arg0, arg1 interface{}) *gom mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deploy", reflect.TypeOf((*MockTerraformExecutor)(nil).Deploy), arg0, arg1) } + +// GetRecipeMetadata mocks base method. +func (m *MockTerraformExecutor) GetRecipeMetadata(arg0 context.Context, arg1 Options) (map[string]interface{}, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRecipeMetadata", arg0, arg1) + ret0, _ := ret[0].(map[string]interface{}) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRecipeMetadata indicates an expected call of GetRecipeMetadata. +func (mr *MockTerraformExecutorMockRecorder) GetRecipeMetadata(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecipeMetadata", reflect.TypeOf((*MockTerraformExecutor)(nil).GetRecipeMetadata), arg0, arg1) +} diff --git a/pkg/recipes/terraform/module.go b/pkg/recipes/terraform/module.go index cb07993b58..b3de1a8969 100644 --- a/pkg/recipes/terraform/module.go +++ b/pkg/recipes/terraform/module.go @@ -41,6 +41,9 @@ type moduleInspectResult struct { // ResultOutputExists is true if the module contains an output named "result". ResultOutputExists bool + // The parameter variables defined by the recipe + Parameters map[string]any + // Any other module information required in the future can be added here. } @@ -50,7 +53,7 @@ type moduleInspectResult struct { // It uses terraform-config-inspect to load the module from the directory. An error is returned if the module // could not be loaded. func inspectModule(workingDir, localModuleName string) (*moduleInspectResult, error) { - result := &moduleInspectResult{ContextVarExists: false, RequiredProviders: []string{}, ResultOutputExists: false} + result := &moduleInspectResult{ContextVarExists: false, RequiredProviders: []string{}, ResultOutputExists: false, Parameters: map[string]any{}} // Modules are downloaded in a subdirectory in the working directory. // Name of the module specified in the configuration is used as subdirectory name. @@ -75,6 +78,20 @@ func inspectModule(workingDir, localModuleName string) (*moduleInspectResult, er result.ResultOutputExists = true } + // Extract the list of parameters. + for variable, value := range mod.Variables { + tfVar := map[string]any{ + "name": value.Name, + "type": value.Type, + "description": value.Description, + "defaultValue": value.Default, + "required": value.Required, + "sensitive": value.Sensitive, + "pos": value.Pos, + } + result.Parameters[variable] = tfVar + } + return result, nil } diff --git a/pkg/recipes/terraform/module_test.go b/pkg/recipes/terraform/module_test.go index 72a29c0649..8688059ef3 100644 --- a/pkg/recipes/terraform/module_test.go +++ b/pkg/recipes/terraform/module_test.go @@ -20,6 +20,7 @@ import ( "path/filepath" "testing" + "github.com/hashicorp/terraform-config-inspect/tfconfig" "github.com/radius-project/radius/test/testcontext" "github.com/stretchr/testify/require" ) @@ -40,17 +41,34 @@ func Test_InspectTFModuleConfig(t *testing.T) { ContextVarExists: false, RequiredProviders: []string{"aws"}, ResultOutputExists: false, + Parameters: map[string]any{}, }, - }, { - name: "aws provider with recipe context variable and output", + }, + { + name: "aws provider with recipe context variable, output and parameters", workingDir: "testdata", moduleName: "test-module-recipe-context-outputs", result: &moduleInspectResult{ ContextVarExists: true, RequiredProviders: []string{"aws"}, ResultOutputExists: true, + Parameters: map[string]any{ + "context": map[string]any{ + "name": "context", + "type": "object({\n resource = object({\n name = string\n id = string\n type = string\n })\n\n application = object({\n name = string\n id = string\n })\n\n environment = object({\n name = string\n id = string\n })\n\n runtime = object({\n kubernetes = optional(object({\n namespace = string\n environmentNamespace = string\n }))\n })\n\n azure = optional(object({\n resourceGroup = object({\n name = string\n id = string\n })\n subscription = object({\n subscriptionId = string\n id = string\n })\n }))\n \n aws = optional(object({\n region = string\n account = string\n }))\n })", + "description": "This variable contains Radius recipe context.", + "defaultValue": nil, + "required": true, + "sensitive": false, + "pos": tfconfig.SourcePos{ + Filename: "testdata/.terraform/modules/test-module-recipe-context-outputs/variables.tf", + Line: 1, + }, + }, + }, }, - }, { + }, + { name: "invalid module name - non existent module directory", workingDir: "testdata", moduleName: "invalid-module", diff --git a/pkg/recipes/terraform/types.go b/pkg/recipes/terraform/types.go index 6074caea0c..7753caef3d 100644 --- a/pkg/recipes/terraform/types.go +++ b/pkg/recipes/terraform/types.go @@ -35,6 +35,9 @@ type TerraformExecutor interface { // Delete installs terraform and runs terraform destroy on the terraform module referenced by the recipe using terraform-exec, // and deletes the Kubernetes secret created for terraform state store. Delete(ctx context.Context, options Options) error + + // GetRecipeMetadata installs terraform and runs terraform get to retrieve information on the terraform module + GetRecipeMetadata(ctx context.Context, options Options) (map[string]any, error) } // Options represents the options required to build inputs to interact with Terraform. diff --git a/test/functional/shared/cli/cli_test.go b/test/functional/shared/cli/cli_test.go index f9338f20bd..ac075f5ce5 100644 --- a/test/functional/shared/cli/cli_test.go +++ b/test/functional/shared/cli/cli_test.go @@ -104,6 +104,26 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { require.Contains(t, output, "resourceGroup().location]") }) + t.Run("Validate rad recipe show - terraform recipe", func(t *testing.T) { + showRecipeName := "redistesttf" + moduleServer := os.Getenv("TF_RECIPE_MODULE_SERVER_URL") + if moduleServer == "" { + moduleServer = "http://localhost:8999" + } + showRecipeTemplate := fmt.Sprintf("%s/kubernetes-redis.zip", moduleServer) + showRecipeLinkType := "Applications.Datastores/redisCaches" + output, err := cli.RecipeRegister(ctx, envName, showRecipeName, "terraform", showRecipeTemplate, showRecipeLinkType) + require.NoError(t, err) + require.Contains(t, output, "Successfully linked recipe") + output, err = cli.RecipeShow(ctx, envName, showRecipeName, showRecipeLinkType) + require.NoError(t, err) + require.Contains(t, output, showRecipeName) + require.Contains(t, output, showRecipeTemplate) + require.Contains(t, output, showRecipeLinkType) + require.Contains(t, output, "redis_cache_name") + require.Contains(t, output, "string") + }) + t.Run("Validate `rad bicep publish` is publishing the file to the given target", func(t *testing.T) { output, err := cli.BicepPublish(ctx, file, target) require.NoError(t, err) From b5310bc433529747e3bba810373e47b7df78670f Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 1 Sep 2023 12:14:34 -0700 Subject: [PATCH 37/57] Improvements and tests for UCP proxy (#6194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This change refactors and adds tests for the UCP proxy functionality. This is the kernel of our controllers that proxy requests to either the Azure or the Radius plane. I wrote this code a long time ago during the early days of creating UCP, and have gotten better at Go since then. I'm most of the way through enabling tracked resources and resource group deletion for Radius. This PR is part of a series taht will be split off from that functionality. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 398f798 ### Summary 🔄🚀🧹 Refactored the proxy package and its tests to simplify the code, improve the naming and handle the async operation headers. Renamed `ProxyPlane` to `ProxyController` and removed unused types and functions. Added `async.go`, `kubernetes.go` and `logging.go` to handle the header rewriting, filtering and logging logic. Added `async_test.go` and test data files to test the header processing scenarios. Updated the route handlers and controller factories to use the new proxy functions. > _The proxy code needed some changes_ > _To handle async headers and ranges_ > _They renamed `ProxyPlane`_ > _And simplified `NewARMProxy`_ > _And added some tests for the exchanges_ ### Walkthrough * Rename `ProxyPlane` type and function to `ProxyController` and update references in `routes.go` files ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-c93ff36d2c9bd07a997732d8ad4c5047f6dcf81cb265b0d36d593e4f2de4ae4dL114-R114), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-c8b433357e1b615716c00d5c04690a6743c6f0dd73f772da9a981c86bd509c5eL111-R111), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-c8b433357e1b615716c00d5c04690a6743c6f0dd73f772da9a981c86bd509c5eL118-R118), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-6fcd02dbe61c1a98326f638cdd42c10d8920fc111b340e2478d4f81330e09fceL40-R50), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-6fcd02dbe61c1a98326f638cdd42c10d8920fc111b340e2478d4f81330e09fceL57-R57)) * Simplify `NewARMProxy` function to only take `ReverseProxyOptions`, `downstream` and `configure` parameters and use `configure` to customize `ReverseProxyBuilder` ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-6fcd02dbe61c1a98326f638cdd42c10d8920fc111b340e2478d4f81330e09fceL156-R165), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-6fcd02dbe61c1a98326f638cdd42c10d8920fc111b340e2478d4f81330e09fceL187-R184), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-275037103c572241af699f4fdc18f7120729c157ad6682ca8f37a00aeb2ea1f5L23-R29), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-3a47b7075479edee5e4b07bf51f6286a5bc868a841239e0bf8218fa67d432cf0L64-R55)) * Remove unused variables and types from `proxyplane.go` and `arm.go` files ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-6fcd02dbe61c1a98326f638cdd42c10d8920fc111b340e2478d4f81330e09fceL65-L70), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-6fcd02dbe61c1a98326f638cdd42c10d8920fc111b340e2478d4f81330e09fceR191-R204), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-275037103c572241af699f4fdc18f7120729c157ad6682ca8f37a00aeb2ea1f5L23-R29), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-3a47b7075479edee5e4b07bf51f6286a5bc868a841239e0bf8218fa67d432cf0L20), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-3a47b7075479edee5e4b07bf51f6286a5bc868a841239e0bf8218fa67d432cf0L34-L44)) * Add `async.go` file with `ProcessAsyncOperationHeaders` and `rewriteHeader` functions to rewrite async operation headers based on referrer URL, path base and planes prefix ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-ef91256c1c85d4b6ab11cc7bd718179c625194c66f5e3ac4eb94ef30a9b8f924R1-R140)) * Add `kubernetes.go` file with `filterKubernetesAPIServerHeaders` function to remove headers set by Kubernetes API server from request ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-89138b0de2afcc7c1495c70786004e9b991a4212bc1190f5559af870e6b83b61R1-R33)) * Add `logging.go` file with functions to log proxy requests and responses using `ucplog` package ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-c604f18e04f31527b17dde0c4126926c4a1eded4f153705e279ea04d25df0b82R1-R54)) * Add `async_test.go` file with unit tests for `ProcessAsyncOperationHeaders` and `rewriteHeader` functions ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-4245c8bc616ae5c4112d93170052afba1191b919990fd64a79b8198db16577cfR1-R242)) * Add test data files for async operation headers with and without path base ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-db20fcae466f91e916b9f4cf13a9d7befb071ce5eb035c4e8e0eb2d77cf601d5L1-R7), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-dece8bdcb75e6cc15cf8c1a6f92d7d0773a072de6f24fd9f637f729db4204f05L1-R7), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-fc15a0d368743be69ab056ff01fba2faff3bbfac0cab8398023791010293082eL1-R6), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-eac409161cffad5a326b777a932756139893d6d5c6efb99e0c7161429dcfc9fdL1-R7), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-8a2069d18b0840571f4d3838ce93800cf71ed3bc8a8181aa7d2d3483c6a1a20eL1-R7), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-06417a3da9c31c59a1377f874867d9b9448720873b3666bc37c4a7d32f24eb99L1-R7), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-4db75473f49181277446a2ff37765d85f1f05fa6e972c6bf76ffc2982c96a045L1-R6), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-3aa164e943dfc15bcc3f9874ff0b18eed51281f97e6c4bfa1ba837d2ccd76ceeL1-R7)) * Delete `policy.go` file and test data files for async operation headers that are no longer used ([link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-f8904eab9647f146f750e78ddcabd5db631805f3422c5819787f60a1908f6207), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-7baa7e24c18b4377d5f228806ba4dc75fd20c166ad55fa757d015f8eff3670c3), [link](https://github.com/radius-project/radius/pull/6194/files?diff=unified&w=0#diff-288157ce7f46574681dbbef65e801257df3ba3dcec592eba1f0cda81aaccf96b)) Co-authored-by: Young Bu Park --- pkg/ucp/frontend/azure/routes.go | 2 +- .../{proxyplane.go => proxycontroller.go} | 72 +-- pkg/ucp/frontend/radius/routes.go | 4 +- pkg/ucp/proxy/arm.go | 24 +- pkg/ucp/proxy/arm_test.go | 14 - pkg/ucp/proxy/async.go | 140 ++++++ pkg/ucp/proxy/async_test.go | 242 ++++++++++ pkg/ucp/proxy/kubernetes.go | 33 ++ pkg/ucp/proxy/logging.go | 54 +++ pkg/ucp/proxy/policy.go | 93 ---- .../downstream-request.json | 8 + .../downstream-response.json | 8 + .../upstream-request.json | 7 + .../upstream-response.json | 8 + .../downstream-request.json | 8 + .../downstream-response.json | 8 + .../upstream-request.json | 7 + .../upstream-response.json | 8 + .../downstream-request.json | 7 - .../downstream-response.json | 9 - .../upstream-request.json | 6 - .../upstream-response.json | 9 - .../downstream-request.json | 7 - .../downstream-response.json | 9 - .../upstream-request.json | 6 - .../upstream-response.json | 9 - pkg/ucp/proxy/types.go | 220 +++------ pkg/ucp/proxy/types_test.go | 435 ++++++++---------- pkg/ucp/proxy/util.go | 55 --- 29 files changed, 847 insertions(+), 665 deletions(-) rename pkg/ucp/frontend/controller/planes/{proxyplane.go => proxycontroller.go} (76%) create mode 100644 pkg/ucp/proxy/async.go create mode 100644 pkg/ucp/proxy/async_test.go create mode 100644 pkg/ucp/proxy/kubernetes.go create mode 100644 pkg/ucp/proxy/logging.go delete mode 100644 pkg/ucp/proxy/policy.go create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-request.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-response.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-request.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-response.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-request.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-response.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-request.json create mode 100644 pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-response.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-request.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-response.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-request.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-response.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-request.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-response.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-request.json delete mode 100644 pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-response.json delete mode 100644 pkg/ucp/proxy/util.go diff --git a/pkg/ucp/frontend/azure/routes.go b/pkg/ucp/frontend/azure/routes.go index c0c45b6d80..50fb08e7d1 100644 --- a/pkg/ucp/frontend/azure/routes.go +++ b/pkg/ucp/frontend/azure/routes.go @@ -111,7 +111,7 @@ func (m *Module) Initialize(ctx context.Context) (http.Handler, error) { ParentRouter: baseRouter, Path: server.CatchAllPath, OperationType: &v1.OperationType{Type: OperationTypeUCPAzureProxy, Method: v1.OperationProxy}, - ControllerFactory: planes_ctrl.NewProxyPlane, + ControllerFactory: planes_ctrl.NewProxyController, }, } diff --git a/pkg/ucp/frontend/controller/planes/proxyplane.go b/pkg/ucp/frontend/controller/planes/proxycontroller.go similarity index 76% rename from pkg/ucp/frontend/controller/planes/proxyplane.go rename to pkg/ucp/frontend/controller/planes/proxycontroller.go index 52ed462f7d..947db5956c 100644 --- a/pkg/ucp/frontend/controller/planes/proxyplane.go +++ b/pkg/ucp/frontend/controller/planes/proxycontroller.go @@ -37,24 +37,24 @@ const ( PlanesPath = "/planes" ) -var _ armrpc_controller.Controller = (*ProxyPlane)(nil) +var _ armrpc_controller.Controller = (*ProxyController)(nil) -// ProxyPlane is the controller implementation to proxy requests to appropriate RP or URL. -type ProxyPlane struct { +// ProxyController is the controller implementation to proxy requests to appropriate RP or URL. +type ProxyController struct { armrpc_controller.Operation[*datamodel.Plane, datamodel.Plane] } -// NewProxyPlane creates a new ProxyPlane controller with the given options and returns it, or returns an error if the +// NewProxyController creates a new ProxyPlane controller with the given options and returns it, or returns an error if the // controller cannot be created. -func NewProxyPlane(opts armrpc_controller.Options) (armrpc_controller.Controller, error) { - return &ProxyPlane{ +func NewProxyController(opts armrpc_controller.Options) (armrpc_controller.Controller, error) { + return &ProxyController{ Operation: armrpc_controller.NewOperation(opts, armrpc_controller.ResourceOptions[datamodel.Plane]{}), }, nil } // Run() takes in a request object and context, looks up the plane and resource provider associated with the // request, and proxies the request to the appropriate resource provider. -func (p *ProxyPlane) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (armrpc_rest.Response, error) { +func (p *ProxyController) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (armrpc_rest.Response, error) { logger := ucplog.FromContextOrDiscard(ctx) logger.Info("starting proxy request") @@ -62,12 +62,6 @@ func (p *ProxyPlane) Run(ctx context.Context, w http.ResponseWriter, req *http.R logger.V(ucplog.LevelDebug).Info("incoming request header", "key", key, "value", value) } - refererURL := url.URL{ - Host: req.Host, - Path: req.URL.Path, - RawQuery: req.URL.RawQuery, - } - // Make a copy of the incoming URL and trim the base path newURL := *req.URL newURL.Path = middleware.GetRelativePath(p.Options().PathBase, req.URL.Path) @@ -153,27 +147,20 @@ func (p *ProxyPlane) Run(ctx context.Context, w http.ResponseWriter, req *http.R } options := proxy.ReverseProxyOptions{ - RoundTripper: otelhttp.NewTransport(http.DefaultTransport), - ProxyAddress: p.Options().Address, - TrimPlanesPrefix: (plane.Properties.Kind != rest.PlaneKindUCPNative), + RoundTripper: otelhttp.NewTransport(http.DefaultTransport), + } + + refererURL := url.URL{ + Scheme: "http", + Host: req.Host, + Path: req.URL.Path, + RawQuery: req.URL.RawQuery, } // As per https://github.com/golang/go/issues/28940#issuecomment-441749380, the way to check // for http vs https is check the TLS field - httpScheme := "http" if req.TLS != nil { - httpScheme = "https" - } - refererURL.Scheme = httpScheme - - requestInfo := proxy.UCPRequestInfo{ - PlaneURL: proxyURL, - PlaneKind: string(plane.Properties.Kind), - PlaneID: planePath, - HTTPScheme: httpScheme, - // The Host field in the request that the client makes to UCP contains the UCP Host address - // That address will be used to construct the URL for reverse proxying - UCPHost: req.Host + p.Options().PathBase, + refererURL.Scheme = "https" } uri, err := url.Parse(newURL.Path) @@ -184,17 +171,34 @@ func (p *ProxyPlane) Run(ctx context.Context, w http.ResponseWriter, req *http.R // Preserving the query strings on the incoming url on the newly constructed url uri.RawQuery = newURL.Query().Encode() req.URL = uri - req.Header.Set("X-Forwarded-Proto", httpScheme) + req.Header.Set("X-Forwarded-Proto", refererURL.Scheme) + logger.Info("setting referer header", "value", refererURL.String()) req.Header.Set(v1.RefererHeader, refererURL.String()) - logger = ucplog.FromContextOrDiscard(ctx) - logger.Info(fmt.Sprintf("Referer Header: %s", req.Header.Get(v1.RefererHeader))) - ctx = context.WithValue(ctx, proxy.UCPRequestInfoField, requestInfo) - sender := proxy.NewARMProxy(options, downstream, nil) + sender := proxy.NewARMProxy(options, downstream, func(builder *proxy.ReverseProxyBuilder) { + if plane.Properties.Kind != rest.PlaneKindUCPNative { + // If we're proxying to Azure then remove the planes prefix. + builder.Directors = append(builder.Directors, trimPlanesPrefix) + } + }) logger.Info(fmt.Sprintf("proxying request target: %s", proxyURL)) sender.ServeHTTP(w, req.WithContext(ctx)) // The upstream response has already been sent at this point. Therefore, return nil response here return nil, nil } + +// trimPlanesPrefix trims the planes prefix from the request URL path. +func trimPlanesPrefix(r *http.Request) { + _, _, remainder, err := resources.ExtractPlanesPrefixFromURLPath(r.URL.Path) + if err != nil { + // Invalid case like path: /planes/foo - do nothing + // If we see an invalid URL here we don't have a good way to report an error at this point + // we expect the error to have been handled before calling into this code. + return + } + + // Success -- truncate the planes prefix + r.URL.Path = remainder +} diff --git a/pkg/ucp/frontend/radius/routes.go b/pkg/ucp/frontend/radius/routes.go index 7fa6e70284..1c5a17be29 100644 --- a/pkg/ucp/frontend/radius/routes.go +++ b/pkg/ucp/frontend/radius/routes.go @@ -108,14 +108,14 @@ func (m *Module) Initialize(ctx context.Context) (http.Handler, error) { ParentRouter: resourceGroupResourceRouter, Path: server.CatchAllPath, OperationType: &v1.OperationType{Type: OperationTypeUCPRadiusProxy, Method: v1.OperationProxy}, - ControllerFactory: planes_ctrl.NewProxyPlane, + ControllerFactory: planes_ctrl.NewProxyController, }, { // Proxy request should use CatchAllPath(/*) to process all requests under /planes/azure/{planeName}/. ParentRouter: baseRouter, Path: server.CatchAllPath, OperationType: &v1.OperationType{Type: OperationTypeUCPRadiusProxy, Method: v1.OperationProxy}, - ControllerFactory: planes_ctrl.NewProxyPlane, + ControllerFactory: planes_ctrl.NewProxyController, }, } diff --git a/pkg/ucp/proxy/arm.go b/pkg/ucp/proxy/arm.go index 596e2d1ea4..b74d7d4bcb 100644 --- a/pkg/ucp/proxy/arm.go +++ b/pkg/ucp/proxy/arm.go @@ -20,33 +20,13 @@ import ( "net/url" ) -type Options struct { -} -type armProxy struct { - ProxyAddress string -} - // NewARMProxy creates a ReverseProxy with custom directors, transport and responders to process requests and responses. func NewARMProxy(options ReverseProxyOptions, downstream *url.URL, configure func(builder *ReverseProxyBuilder)) ReverseProxy { - p := armProxy{ - ProxyAddress: options.ProxyAddress, - } - - directors := []DirectorFunc{} - if options.TrimPlanesPrefix { - // Remove the UCP Planes prefix for non-native planes that do not - // understand UCP IDs - directors = []DirectorFunc{trimPlanesPrefix} - } - builder := ReverseProxyBuilder{ Downstream: downstream, EnableLogging: true, - Directors: directors, - Transport: Transport{ - roundTripper: options.RoundTripper, - }, - Responders: []ResponderFunc{p.processAsyncResponse}, + Transport: options.RoundTripper, + Responders: []ResponderFunc{ProcessAsyncOperationHeaders}, } if configure != nil { diff --git a/pkg/ucp/proxy/arm_test.go b/pkg/ucp/proxy/arm_test.go index ded859148a..de25e8ca55 100644 --- a/pkg/ucp/proxy/arm_test.go +++ b/pkg/ucp/proxy/arm_test.go @@ -17,7 +17,6 @@ limitations under the License. package proxy import ( - "context" "net/http/httptest" "net/url" "os" @@ -31,17 +30,6 @@ import ( "github.com/stretchr/testify/require" ) -func createTestContext(ctx context.Context, planeURL string, planeID string, planeKind string, httpScheme string, ucpHost string) context.Context { - ctx = context.WithValue(ctx, UCPRequestInfoField, UCPRequestInfo{ - PlaneURL: planeURL, - PlaneID: planeID, - PlaneKind: planeKind, - HTTPScheme: httpScheme, - UCPHost: ucpHost, - }) - return ctx -} - func Test_ARM_Baselines(t *testing.T) { baselines, err := readBaselines() require.NoError(t, err) @@ -61,12 +49,10 @@ func Test_ARM_Baselines(t *testing.T) { capture := baseline.DownstreamResponse.CreateRoundTripper() options := ReverseProxyOptions{ RoundTripper: capture, - ProxyAddress: "localhost:9443", } pp := NewARMProxy(options, downstream, nil) w := httptest.NewRecorder() - ctx = createTestContext(ctx, "http://example.com", "/planes/example/local", "Azure", "http", "localhost:9443") req := baseline.UpstreamRequest.ToTestRequest(ctx) // Send the request diff --git a/pkg/ucp/proxy/async.go b/pkg/ucp/proxy/async.go new file mode 100644 index 0000000000..886ab651bf --- /dev/null +++ b/pkg/ucp/proxy/async.go @@ -0,0 +1,140 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package proxy + +import ( + "fmt" + "net/http" + "net/url" + "strings" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/ucplog" +) + +const ( + // locationHeader is the name of the Location header. + locationHeader = "Location" + + // azureAsyncOperationHeader is the name of the Azure-AsyncOperation header. + // + // This value has manually been canonizalized to speed up processing. DO NOT modify + // the casing of this value. + azureAsyncOperationHeader = "Azure-Asyncoperation" +) + +// ProcessAsyncOperationHeaders is a ResponderFunc that processes the Azure-AsyncOperation header and +// Location header to match the UCP hostname and scheme based on the Referrer header. +// +// Users of this director should ensure the referrer header is set on the request before proxying. +// The referrer header should contain the original UCP request URL. +// +// The values of the Azure-AsyncOperation and Location headers are rewritten to point to the UCP endpoint. +// If the result header values omit the plane-prefix (eg: /subscriptions/...), then the plane-prefix is +// prepended to the header value. The query string returned by the downstream are preserved. +func ProcessAsyncOperationHeaders(resp *http.Response) error { + ctx := resp.Request.Context() + logger := ucplog.FromContextOrDiscard(ctx) + + // If the response is not a 200, 201 or 202, then we don't need to process the headers + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated && resp.StatusCode != http.StatusAccepted { + logger.V(ucplog.LevelDebug).Info("response status code is not 200, 201 or 202, skipping async operation headers") + return nil + } + + // We process the response based on the Referrer header. If the referrer header is not present, then we don't + // need to process the headers because we don't know how. + referrer := resp.Request.Header.Get(v1.RefererHeader) + if referrer == "" { + logger.V(ucplog.LevelDebug).Info("request has no referrer header, skipping async operation headers") + return nil + } + + referrerURL, err := url.Parse(referrer) + if err != nil { + logger.V(ucplog.LevelDebug).Info("referrer header is not a URL, skipping async operation headers") + return nil + } + + // If the referrer is not a UCP request, then we don't need to process the headers + // + // We also need to extract a "path base". This is the path prefix that was trimmed from the UCP prefix + // when the request was proxied. We need to re-add this path base to the header values. + originalPath := referrerURL.Path + pathBase := "" + planesIndex := strings.Index(strings.ToLower(originalPath), "/"+resources.PlanesSegment+"/") + if planesIndex != -1 && planesIndex != 0 { + logger.V(ucplog.LevelDebug).Info("referrer header has path base", "pathBase", originalPath[:planesIndex]) + pathBase = originalPath[:planesIndex] + originalPath = originalPath[planesIndex:] + } + + planeType, planeName, _, err := resources.ExtractPlanesPrefixFromURLPath(originalPath) + if err != nil { + logger.V(ucplog.LevelDebug).Info("referrer header is not a UCP request, skipping async operation headers") + return nil + } + + planesPrefix := fmt.Sprintf("/%s/%s/%s", resources.PlanesSegment, planeType, planeName) + + // As per https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations, + // rewrite both the Azure-AsyncOperation and Location headers to point to the UCP endpoint. + for _, header := range []string{azureAsyncOperationHeader, locationHeader} { + if value, ok := resp.Header[header]; ok { + result, err := rewriteHeader(value[0], referrerURL, pathBase, planesPrefix) + if err == nil { + resp.Header.Set(header, result) + logger.V(ucplog.LevelDebug).Info("rewrote header", "header", header, "before", value, "after", result, "referrer", referrerURL) + } else { + logger.Error(err, "failed to rewrite header", "header", header, "value", value, "referrer", referrerURL) + } + } + } + + return nil +} + +func rewriteHeader(header string, referrerURL *url.URL, pathBase string, planesPrefix string) (string, error) { + // COPY the original URL so that we can modify it + builder := *referrerURL + + headerURL, err := url.Parse(header) + if err != nil { + return "", fmt.Errorf("header value is not a valid URL: %w", err) + } + + // Some downstreams are *aware* of the UCP path and will return a URL with the UCP path in it. + // + // However they are generally not aware of the "path base" that's trimmed from the UCP prefix. We need + // to fixup the URL they return no matter what. + if pathBase != "" && strings.HasPrefix(strings.ToLower(headerURL.Path), strings.ToLower(pathBase+planesPrefix)) { + // Value has same basepath + planes prefix as the referrer, so we can just return the value as-is + builder.Path = headerURL.Path + } else if strings.HasPrefix(strings.ToLower(headerURL.Path), strings.ToLower(planesPrefix)) { + // Value has same planes prefix as the referrer, so we can just return the value with path base. + builder.Path = pathBase + headerURL.Path + } else { + // Value does not have path base or planes prefix, so we need to add the planes prefix and path base. + builder.Path = pathBase + planesPrefix + headerURL.Path + } + + builder.RawFragment = "" + builder.RawQuery = headerURL.RawQuery + + return builder.String(), nil +} diff --git a/pkg/ucp/proxy/async_test.go b/pkg/ucp/proxy/async_test.go new file mode 100644 index 0000000000..d06a933c68 --- /dev/null +++ b/pkg/ucp/proxy/async_test.go @@ -0,0 +1,242 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package proxy + +import ( + "fmt" + "net/http" + "net/http/httptest" + "net/url" + "testing" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/test/testcontext" + "github.com/stretchr/testify/require" +) + +func Test_ProcessAsyncOperationHeaders(t *testing.T) { + originalAsyncOperationHeader := "http://localhost:7443/async-operation-url?query=yeah" + originalLocationHeader := "http://localhost:7443/location-url?query=yeah" + createTestRequest := func(t *testing.T) *http.Request { + req := httptest.NewRequest(http.MethodGet, "http://localhost:9443/downstream-url", nil) + req.Header.Set(v1.RefererHeader, "http://localhost:9443/planes/test/local/downstream-url") + + ctx := testcontext.New(t) + req = req.WithContext(ctx) + return req + } + createTestResponse := func(t *testing.T, req *http.Request) *http.Response { + return &http.Response{ + StatusCode: http.StatusAccepted, + Request: req, + Header: http.Header{ + azureAsyncOperationHeader: []string{originalAsyncOperationHeader}, + locationHeader: []string{originalLocationHeader}, + }, + } + } + + t.Run("positive", func(t *testing.T) { + req := createTestRequest(t) + resp := createTestResponse(t, req) + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, "http://localhost:9443/planes/test/local/async-operation-url?query=yeah", resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, "http://localhost:9443/planes/test/local/location-url?query=yeah", resp.Header.Get(locationHeader)) + }) + + t.Run("positive path base", func(t *testing.T) { + req := createTestRequest(t) + req.Header.Set(v1.RefererHeader, "http://localhost:9443/path/base/planes/test/local/downstream-url") + resp := createTestResponse(t, req) + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, "http://localhost:9443/path/base/planes/test/local/async-operation-url?query=yeah", resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, "http://localhost:9443/path/base/planes/test/local/location-url?query=yeah", resp.Header.Get(locationHeader)) + }) + + t.Run("wrong-status-code", func(t *testing.T) { + req := createTestRequest(t) + resp := createTestResponse(t, req) + resp.StatusCode = http.StatusNoContent + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, originalAsyncOperationHeader, resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, originalLocationHeader, resp.Header.Get(locationHeader)) + }) + + t.Run("no referrer", func(t *testing.T) { + req := createTestRequest(t) + req.Header.Del(v1.RefererHeader) + resp := createTestResponse(t, req) + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, originalAsyncOperationHeader, resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, originalLocationHeader, resp.Header.Get(locationHeader)) + }) + + t.Run("invalid referrer", func(t *testing.T) { + req := createTestRequest(t) + req.Header.Set(v1.RefererHeader, "\ninvalid-referrer") + resp := createTestResponse(t, req) + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, originalAsyncOperationHeader, resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, originalLocationHeader, resp.Header.Get(locationHeader)) + }) + + t.Run("non-UCP referrer", func(t *testing.T) { + req := createTestRequest(t) + req.Header.Set(v1.RefererHeader, "http://example.com") + resp := createTestResponse(t, req) + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, originalAsyncOperationHeader, resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, originalLocationHeader, resp.Header.Get(locationHeader)) + }) + + t.Run("invalid response header", func(t *testing.T) { + req := createTestRequest(t) + resp := createTestResponse(t, req) + resp.Header.Set(azureAsyncOperationHeader, "\ninvalid-header") + resp.Header.Set(locationHeader, "\ninvalid-header") + err := ProcessAsyncOperationHeaders(resp) + require.NoError(t, err) + + require.Equal(t, "\ninvalid-header", resp.Header.Get(azureAsyncOperationHeader)) + require.Equal(t, "\ninvalid-header", resp.Header.Get(locationHeader)) + }) +} + +func Test_rewriteHeader(t *testing.T) { + t.Run("positive", func(t *testing.T) { + type positiveTest []struct { + header string + referrer string + pathBase string + expected string + } + positiveTestData := positiveTest{ + // Downsteam header is the original request path without the planes prefix. + { + header: "http://localhost:7443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + referrer: "http://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + expected: "http://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + }, + + // Downsteam header is the original request path with the planes prefix. + { + header: "http://localhost:7443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + referrer: "http://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + expected: "http://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + }, + + // (path base) Downsteam header is the original request path without the planes prefix. + { + header: "http://localhost:7443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + referrer: "http://localhost:9443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + pathBase: "/path/base", + expected: "http://localhost:9443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + }, + + // (path base) Downsteam header is the original request path with the planes prefix. + { + header: "http://localhost:7443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + referrer: "http://localhost:9443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + pathBase: "/path/base", + expected: "http://localhost:9443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + }, + + // (path base) Downsteam header is the original request path with the path base planes prefix. + { + header: "http://localhost:7443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + referrer: "http://localhost:9443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + pathBase: "/path/base", + expected: "http://localhost:9443/path/base/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", + }, + + // Downsteam header has a query string and fragment + { + header: "http://localhost:7443/abcd?efgh=value#ijkl", + referrer: "http://localhost:9443/planes/test/local/abcd", + expected: "http://localhost:9443/planes/test/local/abcd?efgh=value", + }, + + // Downsteam header has a different scheme + { + header: "http://localhost:7443/abcd", + referrer: "https://localhost:9443/planes/test/local/abcd", + expected: "https://localhost:9443/planes/test/local/abcd", + }, + + // Downsteam header has an empty path + { + header: "http://localhost:7443", + referrer: "https://localhost:9443/planes/test/local/abcd", + expected: "https://localhost:9443/planes/test/local", + }, + } + for _, datum := range positiveTestData { + referrerURL, err := url.Parse(datum.referrer) + require.NoError(t, err) + + planeType, planeName, _, err := resources.ExtractPlanesPrefixFromURLPath(referrerURL.Path[len(datum.pathBase):]) + require.NoError(t, err) + + result, err := rewriteHeader(datum.header, referrerURL, datum.pathBase, fmt.Sprintf("/%s/%s/%s", resources.PlanesSegment, planeType, planeName)) + require.NoError(t, err, "%q should have not have failed", datum) + require.Equal(t, datum.expected, result) + } + }) + + t.Run("negative", func(t *testing.T) { + type negativeTest []struct { + header string + referrer string + expectedErr string + } + negativeTestData := negativeTest{ + // It's actually HARD to construct an invalid URL in Go. + // + // Most of the error handling for the header rewrite logic is done before calling rewriteHeader. + { + header: "\n?not-a-url-http://////", + referrer: "https://localhost:9443/planes/test/local/abcd", + expectedErr: "header value is not a valid URL: parse \"\\n?not-a-url-http://////\": net/url: invalid control character in URL", + }, + } + for _, datum := range negativeTestData { + referrerURL, err := url.Parse(datum.referrer) + require.NoError(t, err) + + planeType, planeName, _, err := resources.ExtractPlanesPrefixFromURLPath(referrerURL.Path) + require.NoError(t, err) + + result, err := rewriteHeader(datum.header, referrerURL, "", fmt.Sprintf("/%s/%s/%s", resources.PlanesSegment, planeType, planeName)) + require.Errorf(t, err, "%q should have failed", datum) + require.Equal(t, "", result) + require.Equal(t, datum.expectedErr, err.Error()) + } + }) +} diff --git a/pkg/ucp/proxy/kubernetes.go b/pkg/ucp/proxy/kubernetes.go new file mode 100644 index 0000000000..ad46e20dd8 --- /dev/null +++ b/pkg/ucp/proxy/kubernetes.go @@ -0,0 +1,33 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package proxy + +import ( + "net/http" + "strings" +) + +// filterKubernetesAPIServerHeaders filters out headers that APIServer sets on the request. +func filterKubernetesAPIServerHeaders(r *http.Request) { + for k := range r.Header { + header := strings.ToLower(k) + // https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authenticating-proxy + if header == "x-remote-user" || header == "x-remote-group" || strings.HasPrefix(header, "x-remote-extra-") { + r.Header.Del(k) + } + } +} diff --git a/pkg/ucp/proxy/logging.go b/pkg/ucp/proxy/logging.go new file mode 100644 index 0000000000..df1ee08b61 --- /dev/null +++ b/pkg/ucp/proxy/logging.go @@ -0,0 +1,54 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package proxy + +import ( + "fmt" + "net/http" + + "github.com/radius-project/radius/pkg/ucp/ucplog" +) + +func logUpstreamRequest(r *http.Request) { + logger := ucplog.FromContextOrDiscard(r.Context()) + logger.Info("preparing proxy request") +} + +func logDownstreamRequest(r *http.Request) { + logger := ucplog.FromContextOrDiscard(r.Context()) + logger.Info("sending proxy request to downstream") +} + +func logDownstreamResponse(r *http.Response) error { + logger := ucplog.FromContextOrDiscard(r.Request.Context()) + logger.Info(fmt.Sprintf("received proxy response HTTP status code from downstream %d", r.StatusCode)) + return nil +} + +func logUpstreamResponse(r *http.Response) error { + logger := ucplog.FromContextOrDiscard(r.Request.Context()) + logger.Info(fmt.Sprintf("sending proxy response %d to upstream", r.StatusCode)) + return nil +} + +func logConnectionError(original ErrorHandlerFunc) ErrorHandlerFunc { + return func(w http.ResponseWriter, r *http.Request, err error) { + logger := ucplog.FromContextOrDiscard(r.Context()) + logger.Error(err, "connection failed to downstream") + original(w, r, err) + } +} diff --git a/pkg/ucp/proxy/policy.go b/pkg/ucp/proxy/policy.go deleted file mode 100644 index f3f6503e60..0000000000 --- a/pkg/ucp/proxy/policy.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package proxy - -import ( - "fmt" - "net/http" - "strings" - - "github.com/radius-project/radius/pkg/ucp/resources" - "github.com/radius-project/radius/pkg/ucp/ucplog" -) - -func workaround28169(r *http.Request) { - // See: https://github.com/golang/go/issues/28168 - // - // The built-in support will get the Host header wrong, which is a big problem. Almost every - // significant service validates its Host header. - r.Host = r.URL.Host -} - -func trimPlanesPrefix(r *http.Request) { - _, _, remainder, err := resources.ExtractPlanesPrefixFromURLPath(r.URL.Path) - if err != nil { - // Invalid case like path: /planes/foo - do nothing - // If we see an invalid URL here we don't have a good way to report an error at this point - // we expect the error to have been handled before calling into this code. - return - } - - // Success -- truncate the planes prefix - r.URL.Path = remainder -} - -// filterKubernetesAPIServerHeaders filters out headers that APIServer sets on the request. -func filterKubernetesAPIServerHeaders(r *http.Request) { - for k := range r.Header { - header := strings.ToLower(k) - // https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authenticating-proxy - if header == "x-remote-user" || header == "x-remote-group" || strings.HasPrefix(header, "x-remote-extra-") { - r.Header.Del(k) - } - } -} - -func defaultErrorHandler(w http.ResponseWriter, r *http.Request, err error) { - w.WriteHeader(http.StatusBadGateway) -} - -func noopResponder(r *http.Response) error { - return nil -} - -func logUpstreamRequest(r *http.Request) { - logger := ucplog.FromContextOrDiscard(r.Context()) - logger.Info("preparing proxy request") -} - -func logDownstreamRequest(r *http.Request) { - logger := ucplog.FromContextOrDiscard(r.Context()) - logger.Info("sending proxy request to downstream") -} - -func logDownstreamResponse(r *http.Response) error { - logger := ucplog.FromContextOrDiscard(r.Request.Context()) - logger.Info(fmt.Sprintf("received proxy response HTTP status code from downstream %d", r.StatusCode)) - return nil -} - -func logUpstreamResponse(r *http.Response) error { - logger := ucplog.FromContextOrDiscard(r.Request.Context()) - logger.Info(fmt.Sprintf("sending proxy response %d to upstream ", r.StatusCode)) - return nil -} - -func logConnectionError(w http.ResponseWriter, r *http.Request, err error) { - logger := ucplog.FromContextOrDiscard(r.Context()) - logger.Error(err, "connection failed to downstream") -} diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-request.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-request.json new file mode 100644 index 0000000000..7fd227e476 --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-request.json @@ -0,0 +1,8 @@ +{ + "url": "http://example.com/planes/example/local/some-path?query=yes", + "method": "PUT", + "headers": { + "Referer": ["http://ucp.example.com/path/base/planes/example/local/some-path?query=yes"] + }, + "body": "" +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-response.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-response.json new file mode 100644 index 0000000000..af9419e286 --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/downstream-response.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "body": "{}", + "headers": { + "Azure-Asyncoperation": ["http://localhost:9443/planes/example/local/asyncresponseID"], + "Location": ["http://localhost:9443/planes/example/local/asyncresponseID"] + } +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-request.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-request.json new file mode 100644 index 0000000000..c90960ba9a --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-request.json @@ -0,0 +1,7 @@ +{ + "url": "http://ucp.example.com/planes/example/local/some-path?query=yes", + "headers": { + "Referer": ["http://ucp.example.com/path/base/planes/example/local/some-path?query=yes"] + }, + "method": "PUT" +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-response.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-response.json new file mode 100644 index 0000000000..36bad624a4 --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip-pathbase/upstream-response.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "Azure-Asyncoperation": ["http://ucp.example.com/path/base/planes/example/local/asyncresponseID"], + "Location": ["http://ucp.example.com/path/base/planes/example/local/asyncresponseID"] + }, + "body": "" +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-request.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-request.json new file mode 100644 index 0000000000..f51674e861 --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-request.json @@ -0,0 +1,8 @@ +{ + "url": "http://example.com/planes/example/local/some-path?query=yes", + "method": "PUT", + "headers": { + "Referer": ["http://ucp.example.com/planes/example/local/some-path?query=yes"] + }, + "body": "" +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-response.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-response.json new file mode 100644 index 0000000000..af9419e286 --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/downstream-response.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "body": "{}", + "headers": { + "Azure-Asyncoperation": ["http://localhost:9443/planes/example/local/asyncresponseID"], + "Location": ["http://localhost:9443/planes/example/local/asyncresponseID"] + } +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-request.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-request.json new file mode 100644 index 0000000000..eed5f00e23 --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-request.json @@ -0,0 +1,7 @@ +{ + "url": "http://ucp.example.com/planes/example/local/some-path?query=yes", + "headers": { + "Referer": ["http://ucp.example.com/planes/example/local/some-path?query=yes"] + }, + "method": "PUT" +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-response.json b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-response.json new file mode 100644 index 0000000000..bb52ae109e --- /dev/null +++ b/pkg/ucp/proxy/testdata/arm/async-header-roundtrip/upstream-response.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "Azure-Asyncoperation": ["http://ucp.example.com/planes/example/local/asyncresponseID"], + "Location": ["http://ucp.example.com/planes/example/local/asyncresponseID"] + }, + "body": "" +} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-request.json b/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-request.json deleted file mode 100644 index 14eb68ab2f..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "url": "http://example.com/some-path?query=yes", - "method": "PUT", - "headers": { - }, - "body": "" -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-response.json b/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-response.json deleted file mode 100644 index 8f95327dce..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/downstream-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "statusCode": 200, - "body": "{}", - "headers": { - "Azure-Asyncoperation": [ - "http://localhost:9443/planes/example/local/asyncresponseID" - ] - } -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-request.json b/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-request.json deleted file mode 100644 index 85a190cbe3..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "url": "http://ucp.example.com/some-path?query=yes", - "headers": { - }, - "method": "PUT" -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-response.json b/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-response.json deleted file mode 100644 index 82898b29ec..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-azureasyncoperationheader-roundtrip/upstream-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Azure-Asyncoperation": [ - "http://localhost:9443/planes/example/local/asyncresponseID" - ] - }, - "body": "" -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-request.json b/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-request.json deleted file mode 100644 index 14eb68ab2f..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "url": "http://example.com/some-path?query=yes", - "method": "PUT", - "headers": { - }, - "body": "" -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-response.json b/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-response.json deleted file mode 100644 index 24018d9641..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/downstream-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "statusCode": 200, - "body": "{}", - "headers": { - "Location": [ - "http://localhost:9443/planes/example/local/asyncresponseID" - ] - } -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-request.json b/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-request.json deleted file mode 100644 index 85a190cbe3..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-request.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "url": "http://ucp.example.com/some-path?query=yes", - "headers": { - }, - "method": "PUT" -} \ No newline at end of file diff --git a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-response.json b/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-response.json deleted file mode 100644 index fd0a187fa2..0000000000 --- a/pkg/ucp/proxy/testdata/arm/asyncop-locationheader-roundtrip/upstream-response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Location": [ - "http://localhost:9443/planes/example/local/asyncresponseID" - ] - }, - "body": "" -} \ No newline at end of file diff --git a/pkg/ucp/proxy/types.go b/pkg/ucp/proxy/types.go index e3f7485d3c..989b84f3e2 100644 --- a/pkg/ucp/proxy/types.go +++ b/pkg/ucp/proxy/types.go @@ -17,201 +17,125 @@ limitations under the License. package proxy import ( - "context" - "fmt" "net/http" "net/http/httputil" "net/url" - "strings" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - "github.com/radius-project/radius/pkg/ucp/rest" - "github.com/radius-project/radius/pkg/ucp/ucplog" -) - -type UCPRequestInfo struct { - PlaneURL string - PlaneKind string - PlaneID string - HTTPScheme string - UCPHost string -} - -type PlaneUrlFieldType string -type PlaneIdFieldType string -type HttpSchemeType string -type UCPHostType string -type UCPRequestInfoFieldType string - -const ( - LocationHeader = "Location" - AzureAsyncOperationHeader = "Azure-Asyncoperation" - UCPRequestInfoField UCPRequestInfoFieldType = "ucprequestinfo" ) +// DirectorFunc is a function that modifies the request before it is sent to the downstream server. type DirectorFunc = func(r *http.Request) + +// ResponderFunc is a function that modifies the response before it is sent to the client. type ResponderFunc = func(r *http.Response) error + +// ErrorHandlerFunc is a function that handles errors that occur during the request. type ErrorHandlerFunc = func(w http.ResponseWriter, r *http.Request, err error) +// ReverseProxy defines the interface for a reverse proxy. type ReverseProxy interface { http.Handler } +// ReverseProxyOptions defines the options for creating a reverse proxy. type ReverseProxyOptions struct { - RoundTripper http.RoundTripper - ProxyAddress string - TrimPlanesPrefix bool + // RoundTripper is the round tripper used by the reverse proxy to send requests. + RoundTripper http.RoundTripper } type ReverseProxyBuilder struct { - Downstream *url.URL + // Downstream is the URL of the downstream server. This is the URL of the destination. + // + // The downstream URL will replace the request URL's scheme, host, and port. If the downstream + // URL contains a path, it will be pre-pended to the request URL's path. + Downstream *url.URL + + // EnableLogging enables a set of logging middleware for the proxy. EnableLogging bool - Directors []DirectorFunc - Responders []ResponderFunc - ErrorHandler ErrorHandlerFunc - // Transport is the transport set on the created httputil.ReverseProxy. - Transport Transport -} + // Directors is the set of director functions to be applied to the reverse proxy. + // Directors are applied in order and modify the request before it is sent to the downstream server. + Directors []DirectorFunc -type Transport struct { - roundTripper http.RoundTripper -} + // Responders is the set of responder functions to be applied to the reverse proxy. + // Responses are applied in REVERSE order and modify the response before it is sent to the client. + Responders []ResponderFunc -// The RoundTrip function in the Transport struct uses the roundTripper field to make a request and returns the response -// or an error if one occurs. -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - resp, err := t.roundTripper.RoundTrip(req) - if err != nil { - return nil, err - } + // ErrorHandler is the error handler function to be applied to the reverse proxy. + // The error handler is called when an Golang error. This is NOT called for HTTP errors such + // as 404 or 500. + ErrorHandler ErrorHandlerFunc - return resp, nil + // Transport is the transport set on the created httputil.ReverseProxy. + Transport http.RoundTripper } // Build configures a ReverseProxy with the given parameters and returns a http.HandlerFunc. func (builder *ReverseProxyBuilder) Build() ReverseProxy { rp := httputil.NewSingleHostReverseProxy(builder.Downstream) - rp.Transport = &builder.Transport - // We don consider workaround28169 required :-/ the default behavior is just broken. + // NOTE: there's a built-in director. We prepend it here. // - // There's always a default director so this is safe. - rp.Director = appendDirector(rp.Director, workaround28169) - rp.Director = appendDirector(rp.Director, filterKubernetesAPIServerHeaders) - rp.Director = appendDirector(rp.Director, builder.Directors...) + // We don't consider workaround28169 optional :-/ the default behavior is just broken. + // + // We don't want to propagate the Kubernetes authentication headers to the downstream server. + directors := []DirectorFunc{rp.Director, workaround28169, filterKubernetesAPIServerHeaders} + directors = append(directors, builder.Directors...) - // There's never a default responder. - rp.ModifyResponse = appendResponder(noopResponder, builder.Responders...) + responders := builder.Responders - rp.ErrorHandler = builder.ErrorHandler - if rp.ErrorHandler == nil { - rp.ErrorHandler = defaultErrorHandler + errorHandler := defaultErrorHandler + if builder.ErrorHandler != nil { + errorHandler = builder.ErrorHandler } if builder.EnableLogging { // Insert handlers before AND after for logging. - rp.Director = appendDirector(logUpstreamRequest, rp.Director, logDownstreamRequest) - rp.ModifyResponse = appendResponder(logDownstreamResponse, rp.ModifyResponse, logUpstreamResponse) - rp.ErrorHandler = appendErrorHandler(logConnectionError, rp.ErrorHandler) - } - - return http.HandlerFunc(rp.ServeHTTP) -} - -func (p *armProxy) processAsyncResponse(resp *http.Response) error { - ctx := resp.Request.Context() - if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusAccepted { - // As per https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations, - // first check for Azure-AsyncOperation header and if not found, check for LocationHeader - if header, ok := resp.Header[AzureAsyncOperationHeader]; ok { - if err := convertHeaderToUCPIDs(ctx, AzureAsyncOperationHeader, header, resp); err != nil { - return err - } - } - if header, ok := resp.Header[LocationHeader]; ok { - if err := convertHeaderToUCPIDs(ctx, LocationHeader, header, resp); err != nil { - return err - } - } - } - return nil -} - -func convertHeaderToUCPIDs(ctx context.Context, headerName string, header []string, resp *http.Response) error { - segments := strings.Split(strings.TrimSuffix(strings.TrimPrefix(header[0], "/"), "/"), "/") - // segment 0 -> http - // segment 1 -> "" - // segment 2 -> hostname + port - key := segments[0] + "//" + segments[2] + directors = append([]DirectorFunc{logUpstreamRequest}, directors...) + directors = append(directors, logDownstreamRequest) - if ctx.Value(UCPRequestInfoField) == nil { - return fmt.Errorf("Could not find ucp request data in %s header", headerName) - } - requestInfo := ctx.Value(UCPRequestInfoField).(UCPRequestInfo) - ucpHost, err := hasUCPHost(requestInfo, headerName, header) - if err != nil { - return err - } - if ucpHost { - return nil - } + responders = append([]ResponderFunc{logUpstreamResponse}, responders...) + responders = append(responders, logDownstreamResponse) - // Doing a reverse lookup of the URL of the responding server to find the corresponding plane ID - if requestInfo.PlaneURL == "" { - return fmt.Errorf("Could not find plane URL data in %s header", headerName) + errorHandler = logConnectionError(errorHandler) } - // Match the Plane URL but without the HTTP Scheme since the RP can return a https location/azure-asyncoperation header - // based on the protocol scheme - requestInfoPlaneID := strings.TrimSuffix(strings.Split(requestInfo.PlaneURL, "//")[1], "/") - headerPlaneID := strings.TrimSuffix(strings.Split(key, "//")[1], "/") - if !strings.EqualFold(requestInfoPlaneID, headerPlaneID) { - return fmt.Errorf("PlaneURL: %s received in the request context does not match the url found in %s header: %s", requestInfo.PlaneURL, headerName, header[0]) - } + rp.Transport = builder.Transport + rp.Director = director(directors) + rp.ModifyResponse = responder(responders) + rp.ErrorHandler = errorHandler - if requestInfo.UCPHost == "" { - return fmt.Errorf("UCP Host Address unknown. Cannot convert response header") - } + return rp +} - if requestInfo.PlaneKind == "" { - return fmt.Errorf("Plane Kind unknown. Cannot convert response header") +func director(directors []DirectorFunc) DirectorFunc { + return func(r *http.Request) { + for _, director := range directors { + director(r) + } } +} - var planeID string - if requestInfo.PlaneKind != rest.PlaneKindUCPNative { - if requestInfo.PlaneID == "" { - return fmt.Errorf("Could not find plane ID data in %s header", headerName) +func responder(directors []ResponderFunc) ResponderFunc { + return func(r *http.Response) error { + for i := len(directors) - 1; i >= 0; i-- { + err := directors[i](r) + if err != nil { + return err + } } - // Doing this only for non UCP Native planes. For UCP Native planes, the request URL will have the plane ID in it and therefore no need to - // add the plane ID - planeID = requestInfo.PlaneID - } - if requestInfo.HTTPScheme == "" { - return fmt.Errorf("Could not find http scheme data in %s header", headerName) + return nil } - - // Found a plane matching the URL in the location header - // Convert to UCP ID using the planeID corresponding to the URL of the server from where the response was received - val := requestInfo.HTTPScheme + "://" + requestInfo.UCPHost + planeID + "/" + strings.Join(segments[3:], "/") - - // Replace the header with the computed value. - // Do not use the Del/Set methods on header as it can change the header casing to canonical form - resp.Header[headerName] = []string{val} - - logger := ucplog.FromContextOrDiscard(ctx) - logger.Info(fmt.Sprintf("Converting %s header from %s to %s", headerName, header[0], val)) - return nil } -func hasUCPHost(requestInfo UCPRequestInfo, headerName string, header []string) (bool, error) { - uri, err := url.Parse(header[0]) - if err != nil { - return false, err - } - pathBase := v1.ParsePathBase(uri.Path) - uriHost := uri.Host + pathBase +func workaround28169(r *http.Request) { + // See: https://github.com/golang/go/issues/28168 + // + // The built-in support will get the Host header wrong, which is a big problem. Almost every + // significant service validates its Host header. + r.Host = r.URL.Host +} - return strings.EqualFold(uriHost, requestInfo.UCPHost), nil +func defaultErrorHandler(w http.ResponseWriter, r *http.Request, err error) { + w.WriteHeader(http.StatusBadGateway) } diff --git a/pkg/ucp/proxy/types_test.go b/pkg/ucp/proxy/types_test.go index 8f901c13a3..55aefff594 100644 --- a/pkg/ucp/proxy/types_test.go +++ b/pkg/ucp/proxy/types_test.go @@ -17,250 +17,217 @@ limitations under the License. package proxy import ( - "context" - "fmt" + "errors" "net/http" - "net/textproto" + "net/http/httptest" + "net/http/httputil" + "net/url" "testing" - "github.com/radius-project/radius/pkg/ucp/rest" + "github.com/radius-project/radius/test/testcontext" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func Test_ConvertHeaderToUCPIDs(t *testing.T) { - type data []struct { - name string - header []string - planeURL string - planeID string - planeKind string - httpScheme string - ucpHost string - expectedHeader string - } - positiveTestData := data{ - { - name: LocationHeader, - header: []string{"http://localhost:7443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - expectedHeader: "http://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", - planeURL: "http://localhost:7443", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "http", - ucpHost: "localhost:9443", - }, - { - name: AzureAsyncOperationHeader, - header: []string{"http://localhost:7443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - expectedHeader: "http://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", - planeURL: "http://localhost:7443", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "http", - ucpHost: "localhost:9443", - }, - { - name: LocationHeader, - header: []string{"https://localhost:7443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - expectedHeader: "https://localhost:9443/planes/test/local/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test", - planeURL: "https://localhost:7443", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "https", - ucpHost: "localhost:9443", - }, - { - name: AzureAsyncOperationHeader, - header: []string{"https://example.com"}, - expectedHeader: "https://localhost:9443/planes/test/local/", - planeURL: "https://example.com", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "https", - ucpHost: "localhost:9443", - }, - { - name: AzureAsyncOperationHeader, - header: []string{"https://example.com/"}, - expectedHeader: "https://localhost:9443/planes/test/local/", - planeURL: "https://example.com", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "https", - ucpHost: "localhost:9443", - }, - { - name: AzureAsyncOperationHeader, - header: []string{"https://example.com"}, - expectedHeader: "https://localhost:9443/planes/test/local/", - planeURL: "https://example.com/", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "https", - ucpHost: "localhost:9443", - }, - { - name: LocationHeader, - header: []string{"https://localhost:7443/planes/radius/local/resourceGroups/rg/providers/Applications.Core/Containers/test"}, - expectedHeader: "https://localhost:9443/planes/radius/local/resourceGroups/rg/providers/Applications.Core/Containers/test", - planeURL: "https://localhost:7443", - planeKind: rest.PlaneKindUCPNative, - planeID: "/planes/radius/local", - httpScheme: "https", - ucpHost: "localhost:9443", - }, - } - for _, datum := range positiveTestData { - response := http.Response{ - Header: http.Header{}, - } - ctx := createTestContext(context.Background(), datum.planeURL, datum.planeID, datum.planeKind, datum.httpScheme, datum.ucpHost) - err := convertHeaderToUCPIDs(ctx, datum.name, datum.header, &response) - require.NoError(t, err, "%q should have not have failed", datum) - // response.SetHeader converts the header into CanonicalMIME format - require.Equal(t, datum.expectedHeader, response.Header[textproto.CanonicalMIMEHeaderKey(datum.name)][0]) - } - - negativeTestData := data{ - { - name: AzureAsyncOperationHeader, - header: []string{"http://example.com/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - expectedHeader: "", - planeURL: "https://localhost:7443", - }, - { - name: LocationHeader, - header: []string{"http://example.com/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - expectedHeader: "", - planeURL: "http://localhost:7443", - }, - } - for _, datum := range negativeTestData { - response := http.Response{ - Header: http.Header{}, - } - ctx := createTestContext(context.Background(), datum.planeURL, datum.planeID, datum.planeKind, datum.httpScheme, datum.ucpHost) - err := convertHeaderToUCPIDs(ctx, datum.name, datum.header, &response) - require.Error(t, err, "%q should have have failed", datum) - require.Equal(t, fmt.Sprintf("PlaneURL: %s received in the request context does not match the url found in %s header: %s", datum.planeURL, datum.name, datum.header[0]), err.Error()) - } +type transportFunc struct { + Func func(req *http.Request) (*http.Response, error) } -func Test_ConvertHeaderToUCPIDs_NoContextDataSet(t *testing.T) { - response := http.Response{ - Header: http.Header{}, - } - err := convertHeaderToUCPIDs(context.Background(), AzureAsyncOperationHeader, []string{"http://example.com/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, &response) - require.Error(t, err, "Should have have failed") - require.Equal(t, "Could not find ucp request data in Azure-Asyncoperation header", err.Error()) - err = convertHeaderToUCPIDs(context.Background(), LocationHeader, []string{"http://example.com/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, &response) - require.Error(t, err, "Should have have failed") - require.Equal(t, "Could not find ucp request data in Location header", err.Error()) +func (t *transportFunc) RoundTrip(req *http.Request) (*http.Response, error) { + return t.Func(req) } -func Test_ConvertHeaderToUCPIDs_WithUCPHost(t *testing.T) { - type data []struct { - name string - header []string - planeURL string - planeID string - planeKind string - httpScheme string - ucpHost string - } - testData := data{ - { - name: LocationHeader, - header: []string{"http://localhost:9443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - planeURL: "http://localhost:7443", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "http", - ucpHost: "localhost:9443", - }, - } - - for _, datum := range testData { - response := http.Response{ - Header: http.Header{}, +// These tests test the mechanics of the proxy builder, and verify that the configurations +// we build work correctly. +// +// We're not testing the actual request proxying functionality since that's part of the Go std library. +func Test_ReverseProxyBuilder_Build(t *testing.T) { + downstream, err := url.Parse("http://localhost") + require.NoError(t, err) + + t.Run("empty", func(t *testing.T) { + builder := &ReverseProxyBuilder{Downstream: downstream} + proxy := builder.Build() + + require.IsType(t, &httputil.ReverseProxy{}, proxy) + real := proxy.(*httputil.ReverseProxy) + + t.Run("correctly created", func(t *testing.T) { + assert.Nil(t, real.Transport) + + // No good way to assert the contents of these as they are funcs. + assert.NotNil(t, real.Director) + assert.NotNil(t, real.ModifyResponse) + assert.NotNil(t, real.ErrorHandler) + }) + + t.Run("successful request", func(t *testing.T) { + real.Transport = &transportFunc{ + Func: func(req *http.Request) (*http.Response, error) { + return &http.Response{StatusCode: http.StatusOK, Body: http.NoBody, Request: req}, nil + }, + } + + req := httptest.NewRequest(http.MethodGet, "http://localhost", nil) + req = req.WithContext(testcontext.New(t)) + w := httptest.NewRecorder() + real.ServeHTTP(w, req) + + assert.Equal(t, http.StatusOK, w.Code) + }) + + t.Run("connection error", func(t *testing.T) { + real.Transport = &transportFunc{ + Func: func(req *http.Request) (*http.Response, error) { + return nil, errors.New("connection error") + }, + } + + req := httptest.NewRequest(http.MethodGet, "http://localhost", nil) + req = req.WithContext(testcontext.New(t)) + w := httptest.NewRecorder() + real.ServeHTTP(w, req) + + assert.Equal(t, http.StatusBadGateway, w.Code) + }) + }) + + t.Run("with logging", func(t *testing.T) { + builder := &ReverseProxyBuilder{Downstream: downstream, EnableLogging: true} + proxy := builder.Build() + + require.IsType(t, &httputil.ReverseProxy{}, proxy) + real := proxy.(*httputil.ReverseProxy) + + t.Run("correctly created", func(t *testing.T) { + assert.Nil(t, real.Transport) + + // No good way to assert the contents of these as they are funcs. + assert.NotNil(t, real.Director) + assert.NotNil(t, real.ModifyResponse) + assert.NotNil(t, real.ErrorHandler) + }) + + t.Run("successful request", func(t *testing.T) { + real.Transport = &transportFunc{ + Func: func(req *http.Request) (*http.Response, error) { + return &http.Response{StatusCode: http.StatusOK, Body: http.NoBody, Request: req}, nil + }, + } + + req := httptest.NewRequest(http.MethodGet, "http://localhost", nil) + req = req.WithContext(testcontext.New(t)) + w := httptest.NewRecorder() + real.ServeHTTP(w, req) + + assert.Equal(t, http.StatusOK, w.Code) + }) + + t.Run("connection error", func(t *testing.T) { + real.Transport = &transportFunc{ + Func: func(req *http.Request) (*http.Response, error) { + return nil, errors.New("connection error") + }, + } + + req := httptest.NewRequest(http.MethodGet, "http://localhost", nil) + req = req.WithContext(testcontext.New(t)) + w := httptest.NewRecorder() + real.ServeHTTP(w, req) + + assert.Equal(t, http.StatusBadGateway, w.Code) + }) + }) + + t.Run("with custom", func(t *testing.T) { + builder := &ReverseProxyBuilder{Downstream: downstream} + + builder.Directors = append(builder.Directors, func(req *http.Request) { + value := append(req.Header["Director"], "A") + req.Header["Director"] = value + }) + builder.Directors = append(builder.Directors, func(req *http.Request) { + value := append(req.Header["Director"], "B") + req.Header["Director"] = value + }) + builder.Directors = append(builder.Directors, func(req *http.Request) { + value := append(req.Header["Director"], "C") + req.Header["Director"] = value + }) + + builder.Responders = append(builder.Responders, func(resp *http.Response) error { + value := append(resp.Header["Responder"], "A") + resp.Header["Responder"] = value + return nil + }) + builder.Responders = append(builder.Responders, func(resp *http.Response) error { + value := append(resp.Header["Responder"], "B") + resp.Header["Responder"] = value + return nil + }) + builder.Responders = append(builder.Responders, func(resp *http.Response) error { + value := append(resp.Header["Responder"], "C") + resp.Header["Responder"] = value + return nil + }) + + builder.Transport = &transportFunc{} + builder.ErrorHandler = func(w http.ResponseWriter, req *http.Request, err error) { + w.WriteHeader(http.StatusTeapot) } - response.Header.Set(LocationHeader, "http://localhost:9443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test") - ctx := createTestContext(context.Background(), datum.planeURL, datum.planeID, datum.planeKind, datum.httpScheme, datum.ucpHost) - err := convertHeaderToUCPIDs(ctx, datum.name, datum.header, &response) - require.NoError(t, err, "%q should have not have failed", datum) - // response.SetHeader converts the header into CanonicalMIME format - require.Equal(t, datum.header[0], response.Header[textproto.CanonicalMIMEHeaderKey(datum.name)][0]) - } -} -func Test_HasUCPHost(t *testing.T) { - type data []struct { - name string - header []string - planeURL string - planeID string - planeKind string - httpScheme string - ucpHost string - result bool - } - testData := data{ - { - name: AzureAsyncOperationHeader, - header: []string{"http://localhost:9443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - planeURL: "http://localhost:9443", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "http", - ucpHost: "localhost:9443", - result: true, - }, - { - name: LocationHeader, - header: []string{"https://localhost:9443/planes/radius/local/resourceGroups/rg/providers/Applications.Core/Containers/test"}, - planeURL: "https://localhost:9443", - planeKind: rest.PlaneKindUCPNative, - planeID: "/planes/radius/local", - httpScheme: "https", - ucpHost: "localhost:9443", - result: true, - }, - { - name: AzureAsyncOperationHeader, - header: []string{"http://bicep-de.radius-system:6443/subscriptions/sid/resourceGroups/rg/providers/Microsoft.CustomProviders/resourceProviders/radiusv3/Application/testApp/Container/test"}, - planeURL: "http://localhost:9443", - planeKind: rest.PlaneKindAzure, - planeID: "/planes/test/local", - httpScheme: "http", - ucpHost: "localhost:9443", - result: false, - }, - { - name: LocationHeader, - header: []string{"https://bicep-de.radius-system:6443/planes/radius/local/resourceGroups/rg/providers/Applications.Core/Containers/test"}, - planeURL: "https://localhost:9443", - planeKind: rest.PlaneKindUCPNative, - planeID: "/planes/radius/local", - httpScheme: "https", - ucpHost: "localhost:9443", - result: false, - }, - { - name: LocationHeader, - header: []string{"https://localhost:9443/apis/api.ucp.dev/v1alpha3/planes/radius/local/resourceGroups/rg/providers/Applications.Core/Containers/test"}, - planeURL: "https://localhost:9443", - planeKind: rest.PlaneKindUCPNative, - planeID: "/planes/radius/local", - httpScheme: "https", - ucpHost: "localhost:9443/apis/api.ucp.dev/v1alpha3", - result: true, - }, - } - for _, datum := range testData { - - ctx := createTestContext(context.Background(), datum.planeURL, datum.planeID, datum.planeKind, datum.httpScheme, datum.ucpHost) - hasUCPHost, err := hasUCPHost(ctx.Value(UCPRequestInfoField).(UCPRequestInfo), datum.name, datum.header) - require.NoError(t, err, "%q should have not have failed", datum) - require.Equal(t, datum.result, hasUCPHost) - } + proxy := builder.Build() + + require.IsType(t, &httputil.ReverseProxy{}, proxy) + real := proxy.(*httputil.ReverseProxy) + + t.Run("correctly created", func(t *testing.T) { + assert.NotNil(t, real.Transport) + assert.IsType(t, &transportFunc{}, real.Transport) + + // No good way to assert the contents of these as they are funcs. + assert.NotNil(t, real.Director) + assert.NotNil(t, real.ModifyResponse) + assert.NotNil(t, real.ErrorHandler) + }) + + t.Run("successful request", func(t *testing.T) { + real.Transport = &transportFunc{ + Func: func(req *http.Request) (*http.Response, error) { + response := &http.Response{ + StatusCode: http.StatusOK, + Header: http.Header{"Director": req.Header["Director"]}, + Body: http.NoBody, + Request: req, + } + + return response, nil + }, + } + + req := httptest.NewRequest(http.MethodGet, "http://localhost", nil) + req = req.WithContext(testcontext.New(t)) + w := httptest.NewRecorder() + real.ServeHTTP(w, req) + + assert.Equal(t, http.StatusOK, w.Code) + assert.Equal(t, []string{"A", "B", "C"}, w.Header()["Director"]) + assert.Equal(t, []string{"C", "B", "A"}, w.Header()["Responder"]) + }) + + t.Run("connection error", func(t *testing.T) { + real.Transport = &transportFunc{ + Func: func(req *http.Request) (*http.Response, error) { + return nil, errors.New("connection error") + }, + } + + req := httptest.NewRequest(http.MethodGet, "http://localhost", nil) + req = req.WithContext(testcontext.New(t)) + w := httptest.NewRecorder() + real.ServeHTTP(w, req) + + assert.Equal(t, http.StatusTeapot, w.Code) + }) + }) } diff --git a/pkg/ucp/proxy/util.go b/pkg/ucp/proxy/util.go deleted file mode 100644 index 7df889bb25..0000000000 --- a/pkg/ucp/proxy/util.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package proxy - -import "net/http" - -func appendDirector(original DirectorFunc, added ...DirectorFunc) DirectorFunc { - return func(r *http.Request) { - original(r) - for _, director := range added { - director(r) - } - } -} - -func appendResponder(original ResponderFunc, added ...ResponderFunc) ResponderFunc { - return func(r *http.Response) error { - err := original(r) - if err != nil { - return err - } - - for _, director := range added { - err := director(r) - if err != nil { - return err - } - } - - return nil - } -} - -func appendErrorHandler(original ErrorHandlerFunc, added ...ErrorHandlerFunc) ErrorHandlerFunc { - return func(w http.ResponseWriter, r *http.Request, err error) { - original(w, r, err) - for _, director := range added { - director(w, r, err) - } - } -} From f5f6bc9ebff8631490fb04cc55f5208f8843ec67 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Fri, 1 Sep 2023 13:00:40 -0700 Subject: [PATCH 38/57] Enable Samples repo test in radius functional tests (#6193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Enabling test in radius repo which had been skipped to help coordinate merging of PRs for splitnamespace work across repos. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: Part of #3499 ## Auto-generated summary ### 🤖 Generated by Copilot at 3536a0c ### Summary 🚫✅🧪 Removed a temporary test skip statement from the `samples` package. The statement was used to bypass a test that depended on a deprecated resource that was removed in another pull request. > _`TestSamples` runs_ > _No more `t.Skipf` needed_ > _Winter of old code_ ### Walkthrough * Remove temporary skip statement from `TestSamples` function ([link](https://github.com/radius-project/radius/pull/6193/files?diff=unified&w=0#diff-a6eb33222335c5ca5618a71aa2c65413c4baafa31c91ed3523dd19ea43839a4eL55-L58)) --- test/functional/samples/tutorial_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/functional/samples/tutorial_test.go b/test/functional/samples/tutorial_test.go index f5fc904876..eee017a112 100644 --- a/test/functional/samples/tutorial_test.go +++ b/test/functional/samples/tutorial_test.go @@ -52,10 +52,6 @@ var samplesRepoAbsPath, samplesRepoEnvVarSet = os.LookupEnv("RADIUS_SAMPLES_REPO // You can set the variables used by vscode codelens (e.g. 'debug test', 'run test') using 'go.testEnvVars' in vscode settings.json // Ex: export PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH=/home/uname/src/samples func Test_FirstApplicationSample(t *testing.T) { - // TODO: Remove the following statement - // LJ: Skipping this test to test pipeline for this PR: https://github.com/radius-project/radius/pull/6130 - t.Skipf("Temporary: Skip samples test execution, samples repo still contains Applications.Links resources, which is deprecated in this PR") - if !samplesRepoEnvVarSet { t.Skipf("Skip samples test execution, to enable you must set env var PROJECT_RADIUS_SAMPLES_REPO_ABS_PATH to the absolute path of the radius-project/samples repository") } From d6d45ecb4938c1da5d6759fdecbcaa63e4e2195e Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Fri, 1 Sep 2023 13:38:47 -0700 Subject: [PATCH 39/57] Migrate UCP CADL to TypeSpec (#6191) --- .github/workflows/lint.yaml | 5 - .github/workflows/publish-bicep.yaml | 5 - build/generate.mk | 10 +- cadl/README.md | 67 - cadl/UCP/cadl-project.yaml | 5 - cadl/UCP/customPlaneScope.cadl | 138 -- cadl/UCP/main.cadl | 9 - cadl/UCP/ucp.cadl | 284 --- cadl/aksrootscope.cadl | 39 - cadl/armrootscope.cadl | 32 - cadl/common.cadl | 78 - cadl/customRootScope.cadl | 140 -- cadl/package-lock.json | 1873 ----------------- cadl/package.json | 23 - .../contributing-code-organization/README.md | 2 +- .../contributing-code-prerequisites/README.md | 2 +- .../README.md | 12 +- pkg/cli/clients/management.go | 4 +- pkg/cli/cmd/credential/register/aws/aws.go | 6 +- .../cmd/credential/register/aws/aws_test.go | 6 +- .../cmd/credential/register/azure/azure.go | 4 +- .../credential/register/azure/azure_test.go | 4 +- pkg/cli/cmd/radinit/init.go | 10 +- pkg/cli/cmd/radinit/init_test.go | 6 +- pkg/cli/connections/factory.go | 4 +- .../credential/aws_credential_management.go | 14 +- .../credential/azure_credential_management.go | 6 +- pkg/cli/credential/credential_management.go | 4 +- .../credential/credential_management_test.go | 10 +- .../mock_aws_credential_management.go | 2 +- .../mock_credentialmanagementclient.go | 2 +- .../aws_credential_conversion.go | 21 +- .../aws_credential_conversion_test.go | 14 +- .../azure_credential_conversion.go | 4 +- .../azure_credential_conversion_test.go | 4 +- .../zz_generated_awscredential_client.go | 277 --- .../zz_generated_awscredentials_client.go | 309 +++ .../zz_generated_azurecredential_client.go | 277 --- .../zz_generated_azurecredentials_client.go | 310 +++ .../zz_generated_client_factory.go | 13 +- .../zz_generated_constants.go | 32 +- .../zz_generated_interfaces.go | 12 +- .../zz_generated_models.go | 119 +- .../zz_generated_models_serde.go | 202 +- .../zz_generated_options.go | 83 +- .../zz_generated_planes_client.go | 262 ++- .../zz_generated_planetypes_client.go | 92 - .../zz_generated_polymorphic_helpers.go | 14 +- .../zz_generated_resourcegroups_client.go | 137 +- .../zz_generated_response_types.go | 118 +- pkg/ucp/credentials/aws.go | 8 +- pkg/ucp/credentials/azure.go | 6 +- .../converter/awscredential_converter.go | 4 +- .../aws/createorupdateawscredential_test.go | 10 +- .../createorupdateazurecredential_test.go | 4 +- pkg/ucp/integrationtests/radius/proxy_test.go | 2 +- .../AWSCredential_CreateOrUpdate.json | 53 + ...lDelete.json => AWSCredential_Delete.json} | 2 + ...dentialGet.json => AWSCredential_Get.json} | 2 + ...ntialList.json => AWSCredential_List.json} | 2 + ...tialPut.json => AWSCredential_Update.json} | 2 + .../AzureCredential_CreateOrUpdate.json | 57 + ...elete.json => AzureCredential_Delete.json} | 2 + ...ntialGet.json => AzureCredential_Get.json} | 2 + ...ialList.json => AzureCredential_List.json} | 2 + ...alPut.json => AzureCredential_Update.json} | 2 + .../examples/Planes_CreateOrUpdate.json | 34 + ...letePlaneLocal.json => Planes_Delete.json} | 2 + ...neLocal.json => Planes_GetPlaneLocal.json} | 4 +- .../{PlanesList.json => Planes_List.json} | 4 +- ...List.json => Planes_ListPlanesByType.json} | 4 +- ...sPutPlaneLocal.json => Planes_Update.json} | 2 + .../ResourceGroups_CreateOrUpdate.json | 22 + .../examples/ResourceGroups_Delete.json | 14 + ...eGroupRG1.json => ResourceGroups_Get.json} | 2 + ...oupsList.json => ResourceGroups_List.json} | 2 + ...oupRG1.json => ResourceGroups_Update.json} | 2 + .../2022-09-01-privatepreview/openapi.json | 974 ++++++--- test/functional/ucp/aws_credential_test.go | 38 +- test/functional/ucp/azure_credential_test.go | 8 +- typespec/UCP/aws-credentials.tsp | 133 ++ typespec/UCP/azure-credentials.tsp | 137 ++ typespec/UCP/common.tsp | 66 + .../AWSCredential_CreateOrUpdate.json | 53 + .../AWSCredential_Delete.json | 14 + .../AWSCredential_Get.json | 27 + .../AWSCredential_List.json | 30 + .../AWSCredential_Update.json | 53 + .../AzureCredential_CreateOrUpdate.json | 57 + .../AzureCredential_Delete.json | 14 + .../AzureCredential_Get.json | 29 + .../AzureCredential_List.json | 32 + .../AzureCredential_Update.json | 57 + .../Planes_CreateOrUpdate.json | 34 + .../Planes_Delete.json | 3 +- .../Planes_GetPlaneLocal.json | 26 + .../Planes_List.json | 29 + .../Planes_ListPlanesByType.json | 29 + .../Planes_Update.json | 34 + .../ResourceGroups_CreateOrUpdate.json | 22 + .../ResourceGroups_Delete.json | 14 + .../ResourceGroups_Get.json | 19 + .../ResourceGroups_List.json | 27 + .../ResourceGroups_Update.json | 22 + typespec/UCP/main.tsp | 44 + typespec/UCP/planes.tsp | 130 ++ typespec/UCP/resourcegroups.tsp | 93 + typespec/UCP/tspconfig.yaml | 10 + typespec/UCP/ucp-operations.tsp | 159 ++ 109 files changed, 3698 insertions(+), 4077 deletions(-) delete mode 100644 cadl/README.md delete mode 100644 cadl/UCP/cadl-project.yaml delete mode 100644 cadl/UCP/customPlaneScope.cadl delete mode 100644 cadl/UCP/main.cadl delete mode 100644 cadl/UCP/ucp.cadl delete mode 100644 cadl/aksrootscope.cadl delete mode 100644 cadl/armrootscope.cadl delete mode 100644 cadl/common.cadl delete mode 100644 cadl/customRootScope.cadl delete mode 100644 cadl/package-lock.json delete mode 100644 cadl/package.json delete mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go create mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_awscredentials_client.go delete mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go create mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredentials_client.go delete mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go create mode 100644 swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_CreateOrUpdate.json rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AWSCredentialDelete.json => AWSCredential_Delete.json} (74%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AWSCredentialGet.json => AWSCredential_Get.json} (90%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AWSCredentialList.json => AWSCredential_List.json} (91%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AWSCredentialPut.json => AWSCredential_Update.json} (94%) create mode 100644 swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_CreateOrUpdate.json rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AzureCredentialDelete.json => AzureCredential_Delete.json} (71%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AzureCredentialGet.json => AzureCredential_Get.json} (90%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AzureCredentialList.json => AzureCredential_List.json} (91%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{AzureCredentialPut.json => AzureCredential_Update.json} (94%) create mode 100644 swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_CreateOrUpdate.json rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{PlanesDeletePlaneLocal.json => Planes_Delete.json} (73%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{PlanesGetPlaneLocal.json => Planes_GetPlaneLocal.json} (81%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{PlanesList.json => Planes_List.json} (83%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{PlanesTypeList.json => Planes_ListPlanesByType.json} (80%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{PlanesPutPlaneLocal.json => Planes_Update.json} (91%) create mode 100644 swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_CreateOrUpdate.json create mode 100644 swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Delete.json rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{ResourceGroupsGetResourceGroupRG1.json => ResourceGroups_Get.json} (81%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{ResourceGroupsList.json => ResourceGroups_List.json} (87%) rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/{ResourceGroupsPutResourceGroupRG1.json => ResourceGroups_Update.json} (82%) create mode 100644 typespec/UCP/aws-credentials.tsp create mode 100644 typespec/UCP/azure-credentials.tsp create mode 100644 typespec/UCP/common.tsp create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_CreateOrUpdate.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Delete.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Get.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_List.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Update.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_CreateOrUpdate.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Delete.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Get.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_List.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Update.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/Planes_CreateOrUpdate.json rename swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsDeleteResourceGroupRG1.json => typespec/UCP/examples/2022-09-01-privatepreview/Planes_Delete.json (73%) create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/Planes_Update.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_CreateOrUpdate.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Delete.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Get.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_List.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Update.json create mode 100644 typespec/UCP/main.tsp create mode 100644 typespec/UCP/planes.tsp create mode 100644 typespec/UCP/resourcegroups.tsp create mode 100644 typespec/UCP/tspconfig.yaml create mode 100644 typespec/UCP/ucp-operations.tsp diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e0e12820ee..4e3ff81bcb 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -46,11 +46,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: '18' - - name: Install cadl compiler - run: | - pushd cadl - npm ci - popd - name: Install TypeSpec compiler run: | pushd typespec diff --git a/.github/workflows/publish-bicep.yaml b/.github/workflows/publish-bicep.yaml index 60ffc2ca08..46939f7cb3 100644 --- a/.github/workflows/publish-bicep.yaml +++ b/.github/workflows/publish-bicep.yaml @@ -38,11 +38,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16' - - name: Install cadl compiler - run: | - pushd cadl - npm ci - popd - name: Install TypeSpec compiler run: | pushd typespec diff --git a/build/generate.mk b/build/generate.mk index 1d26d7959c..f7417df5b6 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -25,12 +25,6 @@ endif .PHONY: generate generate: generate-genericcliclient generate-rad-corerp-client generate-rad-datastoresrp-client generate-rad-messagingrp-client generate-rad-daprrp-client generate-rad-ucp-client generate-go generate-bicep-types generate-ucp-crd ## Generates all targets. -.PHONY: generate-cadl-installed -generate-cadl-installed: - @echo "$(ARROW) Detecting cadl..." - cd cadl/Applications.UCP && npx$(CMD_EXT) -q cadl --help > /dev/null || { echo "cadl is a required dependency"; exit 1; } - @echo "$(ARROW) OK" - .PHONY: generate-tsp-installed generate-tsp-installed: @echo "$(ARROW) Detecting tsp..." @@ -39,10 +33,8 @@ generate-tsp-installed: .PHONY: generate-openapi-spec generate-openapi-spec: - @echo "Generating openapi specs from cadl models." - cd cadl/UCP && npx$(CMD_EXT) cadl compile . - @echo "Generating openapi specs from typespec models." + cd typespec/UCP && npx$(CMD_EXT) tsp compile . cd typespec/Applications.Core && npx$(CMD_EXT) tsp compile . cd typespec/Applications.Dapr && npx$(CMD_EXT) tsp compile . cd typespec/Applications.Messaging && npx$(CMD_EXT) tsp compile . diff --git a/cadl/README.md b/cadl/README.md deleted file mode 100644 index 66ba17c31c..0000000000 --- a/cadl/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Cadl-fying Radius -Cadl is a language for describing cloud service APIs and generating other API description languages, client and service code, documentation, and other assets. Cadl provides highly extensible core language primitives that can describe API shapes common among REST, GraphQL, gRPC, and other protocols. - -You can try a work-in-progress build of the compiler by following the steps in the Getting Started section in the Cadl repository. If you have more in depth questions about Cadl, Brian Terlson, Mark Colishaw and the Cadl Discussion channel on Teams as a whole are a great resource. - -## Important Resources -- [Cadl Repository](https://github.com/microsoft/cadl "Cadl Repository") -- [Cadl Tutorial](https://github.com/microsoft/cadl/blob/main/docs/tutorial.md) -- [Cadl for the OpenAPI developer](https://github.com/microsoft/cadl/blob/34eaea96bb2e355d4df5bed0b3a1eeeee34a03bf/docs/cadl-for-openapi-dev.md) -- [Cadl Azure Playground](https://cadlplayground.z22.web.core.windows.net/cadl-azure/ "Cadl Azure Playground") -- [Cadl Discussion Teams Channel](https://teams.microsoft.com/l/channel/19%3a906c1efbbec54dc8949ac736633e6bdf%40thread.skype/Cadl%2520Discussion%2520%25F0%259F%2590%25AE?groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47) (Note: After clicking into this link you may need to request access to the channel by following the prompts in Teams) - -## Recommended Dependencies -- @azure-tools/cadl-autorest -- @azure-tools/cadl-azure-core -- @azure-tools/cadl-azure-resource-manager -- @azure-tools/cadl-providerhub -- @cadl-lang/compiler -- @cadl-lang/openapi3 -- @cadl-lang/rest -- @cadl-lang/versioning - -## Tracked Resources -Currently all of our resources are tracked resources. That means that when writing a new resource, each file will have the following: - -```TypeScript -model ResourceProperties {} - -model Resource is TrackedResource { - name: string; -} - -@armResourceOperations -interface InterfaceName - extends Radius.RootScopeResourceOperations -``` -There may be more or less depending on the resource being modeled - -## {rootScope} -At the time of writing this, the Radius team's spec has not been approved by ARM. As a result, the Cadl team has created a custom `RootScopeResourceOperations` object. This makes it so that the paths generated for resources are prepended by `{rootScope}` as required in Radius. - -To utilize this object, do the following: -1. Import `customRootScope.cadl` into the resource file. -2. When creating the `@armResourceOperations` use the `RootScopeResourceOperations` object under the Radius namespace instead of the standard `ResourceOperations` object: -```TypeScript -@armResourceOperations -interface InterfaceName - extends Radius.RootScopeResourceOperations -``` - -## Emitting and Compiling -In the `cadl-project.yaml` the emitter is set to `"@azure-tools/cadl-autorest": true`. This means that it compiles to swagger instead of OpenApi3. If you want to compile to OpenApi3, set the emitter to `"@cadl-lang/openapi3": true`. - -To compile with {rootScope} to a custom file, import `aksrootscope.cadl` into the resource file and run the following command in the terminal: -```TypeScript -cadl compile {fileName}.cadl --option "@azure-tools/cadl-autorest.output-file={fileName}.json" -``` - -To compile with the ARM compliant spec to a custom file, import `armrootscope.cadl` into the resource file and run the following command in the terminal: -```TypeScript -cadl compile {fileName}.cadl --option "@azure-tools/cadl-autorest.output-file={fileName}.json" -``` - -In both cases replace {fileName} with the file you want to compile. - -## Formatting -Run `cadl compile .` to format all files. diff --git a/cadl/UCP/cadl-project.yaml b/cadl/UCP/cadl-project.yaml deleted file mode 100644 index fd97954896..0000000000 --- a/cadl/UCP/cadl-project.yaml +++ /dev/null @@ -1,5 +0,0 @@ -emit: - - "@azure-tools/cadl-autorest" -options: - "@azure-tools/cadl-autorest": - emitter-output-dir: "{project-root}/../../swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/" \ No newline at end of file diff --git a/cadl/UCP/customPlaneScope.cadl b/cadl/UCP/customPlaneScope.cadl deleted file mode 100644 index c38bb49460..0000000000 --- a/cadl/UCP/customPlaneScope.cadl +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Currently, our spec is not approved by ARM so this is a workaround that the CADL team gave us -// so that we can preface our paths with {rootScope} -// To generate {rootScope} in the path, use the tag --import "./aksrootscope.cadl" while compiling - -import "@cadl-lang/openapi"; -import "@cadl-lang/rest"; -import "@azure-tools/cadl-autorest"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-azure-core"; - -namespace Azure.ResourceManager.Radius; - -using Cadl.Http; -using Cadl.Rest; -using OpenAPI; -using Autorest; -using Azure.Core; -using Azure.ResourceManager.Foundations; - -// Skip generation of ListBySubscription -interface PlaneResourceListBySubscription {} - -model CommonParameters { - ...ApiVersionParameter; -} - -model PlaneParentScope { - ...CommonParameters; - ...ParentKeysOf; -} - -model ResourceParentScope { - ...CommonParameters; - ...ParentKeysOf; - ...TRootParams; -} - -model PlaneInstanceParameters { - ...CommonParameters; - ...KeysOf; - ...TRootParams; -} - -model ResourceGroupInstanceParameters { - ...CommonParameters; - ...TRootParams; - ...KeysOf; -} - -interface CommonResourceOperations< - TResource extends ArmResource, - TProperties extends object, - TRootParams -> - extends Azure.ResourceManager.Radius.ResourceRead< - TResource, - ResourceGroupInstanceParameters - >, - Azure.ResourceManager.Radius.ResourceCreate< - TResource, - ResourceGroupInstanceParameters - >, - Azure.ResourceManager.Radius.ResourceDelete< - TResource, - ResourceGroupInstanceParameters - >, - ListByParent {} - -interface PlaneResourceOperations< - TResource extends ArmResource, - TProperties extends object, - TRootParams -> - extends Azure.ResourceManager.Radius.ResourceRead< - TResource, - PlaneInstanceParameters - >, - Azure.ResourceManager.Radius.ResourceCreate< - TResource, - PlaneInstanceParameters - >, - Azure.ResourceManager.Radius.ResourceDelete< - TResource, - PlaneInstanceParameters - >, - PlaneListByParent {} - -interface PlaneTypeOperations< - TResource extends ArmResource, - TProperties extends object, - TRootParams -> - extends Azure.ResourceManager.Radius.ResourceRead< - TResource, - PlaneInstanceParameters - > {} - -interface ListByParent { - @get - //@pageable - @doc("Lists information about all {name}", TResource) - @autoRoute - @list(TResource) - @segmentOf(TResource) - @armResourceList(TResource) - ListByRootScope( - ...ResourceParentScope - ): ArmResponse> | ErrorResponse; -} - -interface PlaneListByParent { - @get - //@pageable - @doc("Lists information about all {name}s in the given plane", TResource) - @autoRoute - @list(TResource) - @segmentOf(TResource) - @armResourceList(TResource) - ListByRootScope( - ...PlaneParentScope - ): ArmResponse> | ErrorResponse; -} diff --git a/cadl/UCP/main.cadl b/cadl/UCP/main.cadl deleted file mode 100644 index 34bbb43f66..0000000000 --- a/cadl/UCP/main.cadl +++ /dev/null @@ -1,9 +0,0 @@ -import "@cadl-lang/rest"; -import "@cadl-lang/openapi"; -import "@azure-tools/cadl-autorest"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; - -import "./ucp.cadl"; -import "./customPlaneScope.cadl"; - diff --git a/cadl/UCP/ucp.cadl b/cadl/UCP/ucp.cadl deleted file mode 100644 index 6f914528aa..0000000000 --- a/cadl/UCP/ucp.cadl +++ /dev/null @@ -1,284 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@cadl-lang/versioning"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; - -import "@cadl-lang/openapi"; - -import "../aksrootscope.cadl"; -import "../customRootScope.cadl"; - -using Cadl.Http; -using Cadl.Rest; -using Cadl.Versioning; -using Azure.ResourceManager; -using Azure.ResourceManager.Radius; -using Azure.ResourceManager.Foundations; -using OpenAPI; - -// Don't need operation APIs. -#suppress "@azure-tools/cadl-azure-resource-manager/missing-operations-endpoint" -@armProviderNamespace -@service({ - title: "UCP Management APIs", - version: "2022-09-01-privatepreview", -}) -@doc("REST APIs for UCP") -@versionedDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) -namespace Ucp; - -@doc("UCP ResourceGroup.") -model ResourceGroupResource is TrackedResource { - @doc("UCP resourcegroup name") - @maxLength(63) - @pattern("^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$") - @key("resourceGroupName") - @path - @segment("resourcegroups") - @extension("x-ms-parameter-location", "method") - name: string; -} - -@doc("Basic properties of a UCP resource.") -model BasicResourceProperties { - @doc("Provisioning state of the resource at the time the operation was called") - @visibility("read") - provisioningState?: ProvisioningState; -} - -@doc("UCP PlaneResource.") -model PlaneResource is TrackedResource { - @key("planeType") - @doc("The plane type.") - @segment("planes") - @path - name: string; -} - -@doc("Plane kinds supported.") -enum PlaneKind { - UCPNative, - Azure, - AWS, -} - -@doc("Credential store kinds supported.") -enum CredentialStorageKind { - Internal, -} - -@doc("AWS credential kinds supported.") -enum AWSCredentialKind { - AccessKey, -} - -@doc("Azure credential kinds supported.") -enum AzureCredentialKind { - ServicePrincipal, -} - -@doc("Plane properties.") -model PlaneResourceProperties extends BasicResourceProperties { - @doc("The kind of plane") - kind: PlaneKind; - - @doc("URL to forward requests to for non UCP Native Plane") - url?: string; - // TODO try record here - - @doc("Resource Providers for UCP Native Plane") - resourceProviders?: Record; -} - -@discriminator("kind") -@doc("Azure Credential properties") -model AzureCredentialProperties extends BasicResourceProperties {} - -@doc("Service Principal credential storage properties") -model AzureServicePrincipalProperties extends AzureCredentialProperties { - @doc("Service principal kind") - kind: "ServicePrincipal"; - - @doc("clientId for ServicePrincipal") - clientId: string; - - @doc("secret for ServicePrincipal") - @extension("x-ms-secret", true) - clientSecret: string; - - @doc("tenantId for ServicePrincipal") - tenantId: string; - - @doc("The storage properties") - storage: CredentialStorageProperties; -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCaseCadl()" -@discriminator("kind") -@doc("AWS Credential properties") -model AWSCredentialProperties extends BasicResourceProperties {} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCaseCadl()" -@doc("AWS credential storage properties") -model AWSAccessKeyCredentialProperties extends AWSCredentialProperties { - @doc("Access Key kind") - kind: "AccessKey"; - - @doc("Access key ID for AWS identity") - @extension("x-ms-secret", true) - accessKeyId: string; - - @doc("Secret Access Key for AWS identity") - @extension("x-ms-secret", true) - secretAccessKey: string; - - @doc("The storage properties") - storage: CredentialStorageProperties; -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCaseCadl()" -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-path-segment-invalid-chars" -model AWSCredentialResource is TrackedResource { - @key("credentialName") - @doc("The AWS credential name.") - @path - @segment("providers/System.AWS/credentials") - @pattern("^[a-z]([-a-z0-9]*[a-z0-9])?$") - @maxLength(63) - name: string; -} - -#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-path-segment-invalid-chars" -model AzureCredentialResource is TrackedResource { - @key("credentialName") - @doc("The Azure credential name.") - @path - @segment("providers/System.Azure/credentials") - @pattern("^[a-z]([-a-z0-9]*[a-z0-9])?$") - @maxLength(63) - name: string; -} - -@doc("Credential storage properties") -@discriminator("kind") -model CredentialStorageProperties {} - -@doc("Internal credential storage properties") -model InternalCredentialStorageProperties extends CredentialStorageProperties { - @doc("Internal kind") - kind: "Internal"; - - @doc("The name of secret stored.") - @visibility("read") - secretName: string; -} - -@doc("Custom root scope") -model PlaneNameParameter { - @doc("The name of the plane") - @maxLength(63) - @path - @pattern("^[a-z]([-a-z0-9]*[a-z0-9])?$") - @extension("x-ms-skip-url-encoding", true) - @extension("x-ms-parameter-location", "method") - planeName: string; -} - -@doc("Provisioning state of the link at the time the operation was called") -enum ProvisioningState { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, -} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCaseCadl()" -@doc("Custom root scope") -model AWSPlaneNameParameter { - @doc("The name of the plane") - @maxLength(63) - @path - @pattern("^[a-z]([-a-z0-9]*[a-z0-9])?$") - @segment("planes/aws") - @extension("x-ms-skip-url-encoding", true) - @extension("x-ms-parameter-location", "method") - planeName: string; -} - -@doc("Custom root scope") -model AzurePlaneNameParameter { - @doc("The name of the plane") - @maxLength(63) - @path - @pattern("^[a-z]([-a-z0-9]*[a-z0-9])?$") - @segment("planes/azure") - @extension("x-ms-skip-url-encoding", true) - @extension("x-ms-parameter-location", "method") - planeName: string; -} - -@armResourceOperations -interface Planes - extends Radius.PlaneResourceOperations< - PlaneResource, - PlaneResourceProperties, - PlaneNameParameter - > {} - -@armResourceOperations -interface PlaneTypes - extends Radius.PlaneTypeOperations< - PlaneResource, - PlaneResourceProperties, - {} - > {} - -model Root { - ...KeysOf; - ...PlaneNameParameter; -} - -@armResourceOperations -interface ResourceGroups - extends CommonResourceOperations< - ResourceGroupResource, - BasicResourceProperties, - Root - > {} - -@armResourceOperations -interface AzureCredential - extends CommonResourceOperations< - AzureCredentialResource, - AzureCredentialProperties, - AzurePlaneNameParameter - > {} - -#suppress "@azure-tools/cadl-azure-core/casing-style" "The names of Interface types must use PascalCaseCadl()" -@armResourceOperations -interface AWSCredential - extends CommonResourceOperations< - AWSCredentialResource, - AWSCredentialProperties, - AWSPlaneNameParameter - > {} diff --git a/cadl/aksrootscope.cadl b/cadl/aksrootscope.cadl deleted file mode 100644 index 47f097a425..0000000000 --- a/cadl/aksrootscope.cadl +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@cadl-lang/rest"; -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-providerhub"; -import "@cadl-lang/openapi"; - -using OpenAPI; -using Cadl.Http; -using Cadl.Rest; -using Azure.ResourceManager; - -@doc("Custom root scope") -model RootScopeParam { - @doc("The scope in which the resource is present. For Azure resource this would be /subscriptions/{subscriptionID}/resourceGroup/{resourcegroupID}") - @minLength(1) - @path - @extension("x-ms-skip-url-encoding", true) - @extension("x-ms-parameter-location", "client") - rootScope: string; -} - -// Skip generation of ListBySubscription -interface RootScopeResourceListBySubscription {} diff --git a/cadl/armrootscope.cadl b/cadl/armrootscope.cadl deleted file mode 100644 index a394678ba0..0000000000 --- a/cadl/armrootscope.cadl +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import "@azure-tools/cadl-azure-core"; -import "@azure-tools/cadl-azure-resource-manager"; - -using Cadl.Http; -using Cadl.Rest; -using Azure.Core; -using Azure.ResourceManager; - -// /subscription/{id}/rg/{rgname}... -@doc("Root scope param") -model RootScopeParam { - ...SubscriptionId; - ...ResourceGroup; -} - -alias RootScopeResourceListBySubscription = ResourceListBySubscription; diff --git a/cadl/common.cadl b/cadl/common.cadl deleted file mode 100644 index 268b53b3c2..0000000000 --- a/cadl/common.cadl +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2023 The Radius Authors. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using OpenAPI; - -@doc("Basic properties of a Radius resource.") -model BasicResourceProperties { - @doc("Status of a resource.") - @visibility("read") - status?: ResourceStatus; - - @doc("Fully qualified resource ID for the environment that the portable resource is linked to") - environment: string; - - @doc("Fully qualified resource ID for the application that the portable resource is consumed by") - application?: Application -} - -@doc("Basic properties of a Dapr component object.") -model BasicDaprResourceProperties extends BasicResourceProperties{ - @doc("The name of the Dapr component object. Use this value in your code when interacting with the Dapr client to use the Dapr component.") - @visibility("read") - componentName?: string; -} - -@doc("Status of a resource.") -model ResourceStatus { - @doc("Properties of an output resource") - @extension("x-ms-identifiers", []) - outputResources?: OutputResource[]; -} - -@doc("Properties of an output resource.") -model OutputResource {} - -@doc("Fully qualified resource ID for the application that the portable resource is consumed by") -scalar Application extends string; - -@doc("Describes a reference to an existing resource") -model ResourceReference { - @doc("Resource id of an existing resource") - id: string -} - -@doc("Provisioning state of the portable resource at the time the operation was called") -enum ProvisioningState { - Succeeded, - Failed, - Canceled, - Provisioning, - Updating, - Deleting, - Accepted, -} - -@doc("Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values.") -enum ResourceProvisioning { - recipe, - manual, -} - -@doc("The recipe used to automatically deploy underlying infrastructure for a portable resource") -model Recipe{ - @doc("The name of the recipe within the environment to use") - name: string; - @doc("Key/value parameters to pass into the recipe at deployment") - parameters?: Parameters; -} -@doc("Key/value parameters to pass into the recipe at deployment") -model Parameters{} \ No newline at end of file diff --git a/cadl/customRootScope.cadl b/cadl/customRootScope.cadl deleted file mode 100644 index 3faa8157d6..0000000000 --- a/cadl/customRootScope.cadl +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Currently, our spec is not approved by ARM so this is a workaround that the CADL team gave us -// so that we can preface our paths with {rootScope} -// To generate {rootScope} in the path, use the tag --import "./aksrootscope.cadl" while compiling - -import "@cadl-lang/openapi"; -import "@cadl-lang/rest"; -import "@azure-tools/cadl-autorest"; -import "@azure-tools/cadl-azure-resource-manager"; -import "@azure-tools/cadl-azure-core"; - -namespace Azure.ResourceManager.Radius; - -using Cadl.Http; -using Cadl.Rest; -using OpenAPI; -using Autorest; -using Azure.Core; -using Azure.ResourceManager.Foundations; - -model RootScopeParentScope { - ...RootScopeResourceCommonParameters; - ...ParentKeysOf; -} - -model RootScopeResourceCommonParameters { - ...ApiVersionParameter; - ...TRootParams; - ...ProviderNamespace; -} - -model RootScopeResourceInstanceParameters { - ...RootScopeResourceCommonParameters; - ...KeysOf; -} - -interface ResourceRead { - @autoRoute - @doc("Retrieves information about a {name}", TResource) - @get - @armResourceRead(TResource) - Get(...TRootParams): ArmResponse | ErrorResponse; -} - -interface ResourceCreate { - @autoRoute - @doc("Creates or updates a {name}", TResource) - @armResourceCreateOrUpdate(TResource) - @put - CreateOrUpdate( - ...TRootParams, - - @doc("Resource create parameters.") - @body - resource: TResource - ): ArmResponse | ArmCreatedResponse | ErrorResponse; -} -interface ResourceDelete { - @autoRoute - @doc("Deletes an existing {name}", TResource) - @armResourceDelete(TResource) - @delete - Delete(...TRootParams): - | ArmDeletedResponse - | ArmDeleteAcceptedResponse - | ArmDeletedNoContentResponse - | ErrorResponse; -} - -interface ResourceDeleteAsync { - @autoRoute - @doc("Deletes an existing {name}", TResource) - @extension("x-ms-long-running-operation", true) - @asyncOperationOptions("azure-async-operation") - @armResourceDelete(TResource) - @delete - Delete(...TRootParams): - | ArmDeletedResponse - | ArmDeleteAcceptedResponse - | ArmDeletedNoContentResponse - | ErrorResponse; -} - -interface ResourceListByParent { - @get - //@pageable - @doc("Lists information about all {name}s in the given root scope", TResource) - @autoRoute - @list(TResource) - @segmentOf(TResource) - @armResourceList(TResource) - ListByRootScope( - ...RootScopeParentScope, - ): ArmResponse> | ErrorResponse; -} - -interface RootScopeResourceOperations - extends ResourceRead< - TResource, - RootScopeResourceInstanceParameters - >, - ResourceCreate< - TResource, - RootScopeResourceInstanceParameters - >, - ResourceListByParent {} - -// ResourceOperationWithSyncDelete, ResourceOperationWithAsyncDelete intersfaces will be moved into RootScopeResourceOperations when we have async delete support for all link resources. -interface ResourceOperationWithSyncDelete - extends RootScopeResourceOperations< - TResource, TProperties, TRootParams - >, - ResourceDelete< - TResource, - RootScopeResourceInstanceParameters - >{} - -interface ResourceOperationWithAsyncDelete - extends RootScopeResourceOperations< - TResource, TProperties, TRootParams - >, - ResourceDeleteAsync< - TResource, - RootScopeResourceInstanceParameters - >{} diff --git a/cadl/package-lock.json b/cadl/package-lock.json deleted file mode 100644 index 2e6a0bbef3..0000000000 --- a/cadl/package-lock.json +++ /dev/null @@ -1,1873 +0,0 @@ -{ - "name": "cadl-project", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "cadl-project", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@azure-tools/cadl-autorest": "^0.24.0", - "@azure-tools/cadl-azure-core": "^0.24.0", - "@azure-tools/cadl-azure-resource-manager": "^0.24.0", - "@azure-tools/cadl-providerhub": "^0.24.0", - "@cadl-lang/compiler": "^0.38.5", - "@cadl-lang/openapi3": "^0.38.0", - "@cadl-lang/rest": "^0.38.0", - "@cadl-lang/versioning": "^0.38.0" - } - }, - "node_modules/@azure-tools/cadl-autorest": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-autorest/-/cadl-autorest-0.24.0.tgz", - "integrity": "sha512-q8A3GRlwyQJ+/8cJs3dzyB4sRSVORItVS27NOraOwaXMudk9W6wW4uwBpyR07B3iHUanC8ZECe6CaCDUUttbtg==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@azure-tools/cadl-azure-core": "~0.24.0", - "@cadl-lang/compiler": "~0.38.0", - "@cadl-lang/openapi": "~0.38.0", - "@cadl-lang/rest": "~0.38.0", - "@cadl-lang/versioning": "~0.38.0" - } - }, - "node_modules/@azure-tools/cadl-azure-core": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.24.0.tgz", - "integrity": "sha512-Pzs1uC03Rbd783dAN8yvsFEWKJIBpV7zKf+Mj2S2x7F9IsR+KS1nlPmifIAtSCeSRPVkU21xD1WmzXvB1GR59w==", - "dependencies": { - "@cadl-lang/lint": "~0.38.0" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.38.0", - "@cadl-lang/rest": "~0.38.0" - } - }, - "node_modules/@azure-tools/cadl-azure-resource-manager": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-resource-manager/-/cadl-azure-resource-manager-0.24.0.tgz", - "integrity": "sha512-ufuDnjRp4bShMKKeMIYa07cKZCKLs4ofbB6bbYPihP9lodwgSCF444Hi76Qz+GiSv0nyS/ySJdH0kQPiVcsz8A==", - "dependencies": { - "@cadl-lang/lint": "~0.38.0" - }, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@azure-tools/cadl-autorest": "~0.24.0", - "@azure-tools/cadl-azure-core": "~0.24.0", - "@cadl-lang/compiler": "~0.38.0", - "@cadl-lang/openapi": "~0.38.0", - "@cadl-lang/rest": "~0.38.0", - "@cadl-lang/versioning": "~0.38.0" - } - }, - "node_modules/@azure-tools/cadl-providerhub": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-providerhub/-/cadl-providerhub-0.24.0.tgz", - "integrity": "sha512-VCXW/cDGTf8KB84oFm9LtQIItLOol7A3CFf9PpI+mrPWDBlhsTNvI2aaj8hlPBqQ4e+mwUmk0EXRPwzFfL3ipQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@azure-tools/cadl-autorest": "~0.24.0", - "@azure-tools/cadl-azure-core": "~0.24.0", - "@azure-tools/cadl-azure-resource-manager": "~0.24.0", - "@cadl-lang/compiler": "~0.38.0", - "@cadl-lang/openapi": "~0.38.0", - "@cadl-lang/rest": "~0.38.0", - "@cadl-lang/versioning": "~0.38.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "dependencies": { - "@babel/highlight": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@cadl-lang/compiler": { - "version": "0.38.5", - "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.38.5.tgz", - "integrity": "sha512-jd6a8TEp9ApBzekTb39aBPocYrkuqzsQbLTDcc/c6tA47Wmr87463MAXpeB80ziEsr15sccI01j3g63jt5W0Aw==", - "dependencies": { - "@babel/code-frame": "~7.18.6", - "ajv": "~8.11.2", - "change-case": "~4.1.2", - "globby": "~13.1.1", - "js-yaml": "~4.1.0", - "mkdirp": "~1.0.4", - "mustache": "~4.2.0", - "node-fetch": "3.2.8", - "node-watch": "~0.7.1", - "picocolors": "~1.0.0", - "prettier": "~2.7.1", - "prompts": "~2.4.1", - "vscode-languageserver": "~8.0.2", - "vscode-languageserver-textdocument": "~1.0.1", - "yargs": "~17.6.2" - }, - "bin": { - "cadl": "cmd/cadl.js", - "cadl-server": "cmd/cadl-server.js" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@cadl-lang/lint": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.38.0.tgz", - "integrity": "sha512-6g4yoXeaNnTYxEWA0QywN3HkTCINPTHI56IsDKp6JhLOiROj1NvoufUzX438vdTqDqNyHg2t08fRmLMJP4GsCQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.38.0" - } - }, - "node_modules/@cadl-lang/openapi": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.38.0.tgz", - "integrity": "sha512-lFmU5AsZtw7Ofcnq3lg18Ieg21iuS73NOb+549BxPZX2j70vEqqfRT3CCCFmpGCK2sAUy2x2qD+pVUBcQIXeHQ==", - "peer": true, - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.38.0", - "@cadl-lang/rest": "~0.38.0" - } - }, - "node_modules/@cadl-lang/openapi3": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.38.0.tgz", - "integrity": "sha512-l7000SmmTTqQsnoNunbpKHNemfcUyPt6EBLW9F0vpzVHK4YTC40biVu/6EIYF4KeKq2mTtbC4akRH3kLrpQoKQ==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.38.0", - "@cadl-lang/openapi": "~0.38.0", - "@cadl-lang/rest": "~0.38.0", - "@cadl-lang/versioning": "~0.38.0" - } - }, - "node_modules/@cadl-lang/rest": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.38.0.tgz", - "integrity": "sha512-DvLLoUaG3//nf4HC4BhFFNK8cotYbwtL35cb6Nko8MYruLCuxQn0vZKtAMLnlvZWXc65qfbnTz1W/EI0NQh8+w==", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@cadl-lang/compiler": "~0.38.0" - } - }, - "node_modules/@cadl-lang/versioning": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.38.0.tgz", - "integrity": "sha512-7ECvYQShLu80eyQzRgRH1Lu/P1lrjnHpnEcNZK8bVoHoy+QT+DkY/c22OoBRwcb5kux9/T1/CMF61WqfrKC8jQ==", - "dependencies": { - "@cadl-lang/compiler": "~0.38.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/ajv": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", - "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "dependencies": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "node_modules/constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - } - }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==", - "engines": { - "node": ">= 12" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "dependencies": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "engines": { - "node": ">=6" - } - }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "bin": { - "mustache": "bin/mustache" - } - }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", - "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==", - "engines": { - "node": ">=6" - } - }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/vscode-jsonrpc": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz", - "integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/vscode-languageserver": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2.tgz", - "integrity": "sha512-bpEt2ggPxKzsAOZlXmCJ50bV7VrxwCS5BI4+egUmure/oI/t4OlFzi/YNtVvY24A2UDOZAgwFGgnZPwqSJubkA==", - "dependencies": { - "vscode-languageserver-protocol": "3.17.2" - }, - "bin": { - "installServerIntoExtension": "bin/installServerIntoExtension" - } - }, - "node_modules/vscode-languageserver-protocol": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz", - "integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==", - "dependencies": { - "vscode-jsonrpc": "8.0.2", - "vscode-languageserver-types": "3.17.2" - } - }, - "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.5.tgz", - "integrity": "sha512-1ah7zyQjKBudnMiHbZmxz5bYNM9KKZYz+5VQLj+yr8l+9w3g+WAhCkUkWbhMEdC5u0ub4Ndiye/fDyS8ghIKQg==" - }, - "node_modules/vscode-languageserver-types": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", - "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" - }, - "node_modules/web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - } - }, - "dependencies": { - "@azure-tools/cadl-autorest": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-autorest/-/cadl-autorest-0.24.0.tgz", - "integrity": "sha512-q8A3GRlwyQJ+/8cJs3dzyB4sRSVORItVS27NOraOwaXMudk9W6wW4uwBpyR07B3iHUanC8ZECe6CaCDUUttbtg==", - "requires": {} - }, - "@azure-tools/cadl-azure-core": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-core/-/cadl-azure-core-0.24.0.tgz", - "integrity": "sha512-Pzs1uC03Rbd783dAN8yvsFEWKJIBpV7zKf+Mj2S2x7F9IsR+KS1nlPmifIAtSCeSRPVkU21xD1WmzXvB1GR59w==", - "requires": { - "@cadl-lang/lint": "~0.38.0" - } - }, - "@azure-tools/cadl-azure-resource-manager": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-azure-resource-manager/-/cadl-azure-resource-manager-0.24.0.tgz", - "integrity": "sha512-ufuDnjRp4bShMKKeMIYa07cKZCKLs4ofbB6bbYPihP9lodwgSCF444Hi76Qz+GiSv0nyS/ySJdH0kQPiVcsz8A==", - "requires": { - "@cadl-lang/lint": "~0.38.0" - } - }, - "@azure-tools/cadl-providerhub": { - "version": "0.24.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-providerhub/-/cadl-providerhub-0.24.0.tgz", - "integrity": "sha512-VCXW/cDGTf8KB84oFm9LtQIItLOol7A3CFf9PpI+mrPWDBlhsTNvI2aaj8hlPBqQ4e+mwUmk0EXRPwzFfL3ipQ==", - "requires": {} - }, - "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", - "requires": { - "@babel/highlight": "^7.18.6" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==" - }, - "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", - "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@cadl-lang/compiler": { - "version": "0.38.5", - "resolved": "https://registry.npmjs.org/@cadl-lang/compiler/-/compiler-0.38.5.tgz", - "integrity": "sha512-jd6a8TEp9ApBzekTb39aBPocYrkuqzsQbLTDcc/c6tA47Wmr87463MAXpeB80ziEsr15sccI01j3g63jt5W0Aw==", - "requires": { - "@babel/code-frame": "~7.18.6", - "ajv": "~8.11.2", - "change-case": "~4.1.2", - "globby": "~13.1.1", - "js-yaml": "~4.1.0", - "mkdirp": "~1.0.4", - "mustache": "~4.2.0", - "node-fetch": "3.2.8", - "node-watch": "~0.7.1", - "picocolors": "~1.0.0", - "prettier": "~2.7.1", - "prompts": "~2.4.1", - "vscode-languageserver": "~8.0.2", - "vscode-languageserver-textdocument": "~1.0.1", - "yargs": "~17.6.2" - } - }, - "@cadl-lang/lint": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/lint/-/lint-0.38.0.tgz", - "integrity": "sha512-6g4yoXeaNnTYxEWA0QywN3HkTCINPTHI56IsDKp6JhLOiROj1NvoufUzX438vdTqDqNyHg2t08fRmLMJP4GsCQ==", - "requires": {} - }, - "@cadl-lang/openapi": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi/-/openapi-0.38.0.tgz", - "integrity": "sha512-lFmU5AsZtw7Ofcnq3lg18Ieg21iuS73NOb+549BxPZX2j70vEqqfRT3CCCFmpGCK2sAUy2x2qD+pVUBcQIXeHQ==", - "peer": true, - "requires": {} - }, - "@cadl-lang/openapi3": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/openapi3/-/openapi3-0.38.0.tgz", - "integrity": "sha512-l7000SmmTTqQsnoNunbpKHNemfcUyPt6EBLW9F0vpzVHK4YTC40biVu/6EIYF4KeKq2mTtbC4akRH3kLrpQoKQ==", - "requires": {} - }, - "@cadl-lang/rest": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/rest/-/rest-0.38.0.tgz", - "integrity": "sha512-DvLLoUaG3//nf4HC4BhFFNK8cotYbwtL35cb6Nko8MYruLCuxQn0vZKtAMLnlvZWXc65qfbnTz1W/EI0NQh8+w==", - "requires": {} - }, - "@cadl-lang/versioning": { - "version": "0.38.0", - "resolved": "https://registry.npmjs.org/@cadl-lang/versioning/-/versioning-0.38.0.tgz", - "integrity": "sha512-7ECvYQShLu80eyQzRgRH1Lu/P1lrjnHpnEcNZK8bVoHoy+QT+DkY/c22OoBRwcb5kux9/T1/CMF61WqfrKC8jQ==", - "requires": { - "@cadl-lang/compiler": "~0.38.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "ajv": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", - "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "requires": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "requires": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" - }, - "constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - } - }, - "data-uri-to-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz", - "integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==" - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - } - }, - "dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "requires": { - "reusify": "^1.0.4" - } - }, - "fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "requires": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "requires": { - "fetch-blob": "^3.1.2" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "requires": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" - }, - "header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "requires": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - } - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" - }, - "lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" - }, - "no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "requires": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==" - }, - "node-fetch": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.8.tgz", - "integrity": "sha512-KtpD1YhGszhntMpBDyp5lyagk8KIMopC1LEb7cQUAh7zcosaX5uK8HnbNb2i3NTQK3sIawCItS0uFC3QzcLHdg==", - "requires": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - } - }, - "node-watch": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.3.tgz", - "integrity": "sha512-3l4E8uMPY1HdMMryPRUAl+oIHtXtyiTlIiESNSVSNxcPfzAFzeTbXFQkZfAwBbo0B1qMSG8nUABx+Gd+YrbKrQ==" - }, - "param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, - "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" - }, - "prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "requires": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" - }, - "slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" - }, - "snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "requires": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "requires": { - "tslib": "^2.0.3" - } - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "vscode-jsonrpc": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz", - "integrity": "sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==" - }, - "vscode-languageserver": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.0.2.tgz", - "integrity": "sha512-bpEt2ggPxKzsAOZlXmCJ50bV7VrxwCS5BI4+egUmure/oI/t4OlFzi/YNtVvY24A2UDOZAgwFGgnZPwqSJubkA==", - "requires": { - "vscode-languageserver-protocol": "3.17.2" - } - }, - "vscode-languageserver-protocol": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz", - "integrity": "sha512-8kYisQ3z/SQ2kyjlNeQxbkkTNmVFoQCqkmGrzLH6A9ecPlgTbp3wDTnUNqaUxYr4vlAcloxx8zwy7G5WdguYNg==", - "requires": { - "vscode-jsonrpc": "8.0.2", - "vscode-languageserver-types": "3.17.2" - } - }, - "vscode-languageserver-textdocument": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.5.tgz", - "integrity": "sha512-1ah7zyQjKBudnMiHbZmxz5bYNM9KKZYz+5VQLj+yr8l+9w3g+WAhCkUkWbhMEdC5u0ub4Ndiye/fDyS8ghIKQg==" - }, - "vscode-languageserver-types": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.2.tgz", - "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" - }, - "web-streams-polyfill": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==" - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - } - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", - "requires": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" - } - } -} diff --git a/cadl/package.json b/cadl/package.json deleted file mode 100644 index ed0008258a..0000000000 --- a/cadl/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "cadl-project", - "dependencies": { - "@azure-tools/cadl-autorest": "^0.24.0", - "@azure-tools/cadl-azure-core": "^0.24.0", - "@azure-tools/cadl-azure-resource-manager": "^0.24.0", - "@azure-tools/cadl-providerhub": "^0.24.0", - "@cadl-lang/compiler": "^0.38.5", - "@cadl-lang/openapi3": "^0.38.0", - "@cadl-lang/rest": "^0.38.0", - "@cadl-lang/versioning": "^0.38.0" - }, - "private": true, - "description": "Cadl is a language for describing cloud service APIs and generating other API description languages, client and service code, documentation, and other assets. Cadl provides highly extensible core language primitives that can describe API shapes common among REST, GraphQL, gRPC, and other protocols.", - "version": "1.0.0", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/docs/contributing/contributing-code/contributing-code-organization/README.md b/docs/contributing/contributing-code/contributing-code-organization/README.md index 3b58d39164..4784b79b29 100644 --- a/docs/contributing/contributing-code/contributing-code-organization/README.md +++ b/docs/contributing/contributing-code/contributing-code-organization/README.md @@ -10,7 +10,7 @@ In general you should ask for guidance before creating a new top-level folder in | ---------- | --------------------------------------------------------------------------------------| | `build/` | Makefiles and scripts referenced from the root Makefile | | `cmd/` | Entry points for executables built in the repository | -| `cadl/` | Definitions for generating Radius swagger files. | +| `typespec/` | Definitions for generating Radius swagger files. | | `deploy/` | Assets used to package, deploy, and install Radius | | `docs/` | All project documentation | | `hack/` | Utility code to generate Radius bicep types | diff --git a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md index 342206e6e2..1c46a696ff 100644 --- a/docs/contributing/contributing-code/contributing-code-prerequisites/README.md +++ b/docs/contributing/contributing-code/contributing-code-prerequisites/README.md @@ -111,7 +111,7 @@ If you were trying to run `make generate` and ran into an error, then one of the Enter the following commands to install all of the required tools. ```sh -cd cadl && npm ci +cd typespec && npm ci npm install -g autorest npm install -g oav go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.1 diff --git a/docs/contributing/contributing-code/contributing-code-schema-changes/README.md b/docs/contributing/contributing-code/contributing-code-schema-changes/README.md index caafa5826e..5c8e73330b 100644 --- a/docs/contributing/contributing-code/contributing-code-schema-changes/README.md +++ b/docs/contributing/contributing-code/contributing-code-schema-changes/README.md @@ -1,11 +1,11 @@ # Contributing schema changes -This page will explain the process to make a change to Radius' REST API (eg: adding a new property, or adding a new resource type).The Radius application model and API are defined via a OpenAPI specification. Instead of manually defining each OpenAPI spec, [CADL](https://microsoft.github.io/typespec/) is used to generate the OpenAPI JSON files. You should read and follow these steps to make REST API changes. +This page will explain the process to make a change to Radius' REST API (eg: adding a new property, or adding a new resource type).The Radius application model and API are defined via a OpenAPI specification. Instead of manually defining each OpenAPI spec, [TypeSpec](https://microsoft.github.io/typespec/) is used to generate the OpenAPI JSON files. You should read and follow these steps to make REST API changes. -## Step 1: Update CADL and generate Bicep types and API client +## Step 1: Update TypeSpec and generate Bicep types and API client In order to update or create a new schema follow these steps: -1. Create or update the applicable CADL files (named after resource type) within the `cadl` directory in the root of the radius repo +1. Create or update the applicable TypeSpec files (named after resource type) within the `typespec` directory in the root of the radius repo 2. Run `make generate` to generate the OpenAPI spec and API clients: ```bash make generate @@ -17,13 +17,13 @@ In order to update or create a new schema follow these steps: 1. Run the following command to generate the OpenAPI spec with the newly added changes ```bash - npx cadl compile . + npx tsp compile . ``` 2. Generate the client code by running autorest - For example, to generate the portable resources run: + For example, to generate the `Applications.Core` resources run: ```bash - autorest pkg/linkrp/api/README.md --tag=link-2022-03-15-privatepreview + autorest pkg/corerp/api/README.md --tag=link-2022-03-15-privatepreview ``` The autotrest configuration file (_i.e README.md_) is generally found in `pkg//api/` directory and has details on which tag to use. diff --git a/pkg/cli/clients/management.go b/pkg/cli/clients/management.go index 189da916fd..25963b3b8b 100644 --- a/pkg/cli/clients/management.go +++ b/pkg/cli/clients/management.go @@ -587,14 +587,14 @@ func (amc *UCPApplicationsManagementClient) ShowUCPGroup(ctx context.Context, pl // ListUCPGroup is a function that retrieves a list of resource groups from the UCP API and returns them as a slice of // ResourceGroupResource objects. It may return an error if there is an issue with the API request. func (amc *UCPApplicationsManagementClient) ListUCPGroup(ctx context.Context, planeType string, planeName string) ([]ucpv20220901.ResourceGroupResource, error) { - var resourceGroupOptions *ucpv20220901.ResourceGroupsClientListByRootScopeOptions + var resourceGroupOptions *ucpv20220901.ResourceGroupsClientListOptions resourceGroupResources := []ucpv20220901.ResourceGroupResource{} resourcegroupClient, err := ucpv20220901.NewResourceGroupsClient(&aztoken.AnonymousCredential{}, amc.ClientOptions) if err != nil { return resourceGroupResources, err } - pager := resourcegroupClient.NewListByRootScopePager(planeType, planeName, resourceGroupOptions) + pager := resourcegroupClient.NewListPager(planeType, planeName, resourceGroupOptions) for pager.More() { resp, err := pager.NextPage(ctx) diff --git a/pkg/cli/cmd/credential/register/aws/aws.go b/pkg/cli/cmd/credential/register/aws/aws.go index 97affe817e..d2ee2cf37d 100644 --- a/pkg/cli/cmd/credential/register/aws/aws.go +++ b/pkg/cli/cmd/credential/register/aws/aws.go @@ -148,12 +148,12 @@ func (r *Runner) Run(ctx context.Context) error { if err != nil { return err } - credential := ucp.AWSCredentialResource{ + credential := ucp.AwsCredentialResource{ Location: to.Ptr(v1.LocationGlobal), Type: to.Ptr(cli_credential.AWSCredential), - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, AccessKeyID: &r.AccessKeyID, SecretAccessKey: &r.SecretAccessKey, diff --git a/pkg/cli/cmd/credential/register/aws/aws_test.go b/pkg/cli/cmd/credential/register/aws/aws_test.go index 71e70a2fe7..b9ce45a16a 100644 --- a/pkg/cli/cmd/credential/register/aws/aws_test.go +++ b/pkg/cli/cmd/credential/register/aws/aws_test.go @@ -100,12 +100,12 @@ func Test_Run(t *testing.T) { t.Run("Create aws provider", func(t *testing.T) { t.Run("Success", func(t *testing.T) { ctrl := gomock.NewController(t) - expectedPut := ucp.AWSCredentialResource{ + expectedPut := ucp.AwsCredentialResource{ Location: to.Ptr(v1.LocationGlobal), Type: to.Ptr(cli_credential.AWSCredential), - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, AccessKeyID: to.Ptr(testAccessKeyId), SecretAccessKey: to.Ptr(testSecretAccessKey), diff --git a/pkg/cli/cmd/credential/register/azure/azure.go b/pkg/cli/cmd/credential/register/azure/azure.go index 4e5150aac6..986f9129c4 100644 --- a/pkg/cli/cmd/credential/register/azure/azure.go +++ b/pkg/cli/cmd/credential/register/azure/azure.go @@ -168,12 +168,12 @@ func (r *Runner) Run(ctx context.Context) error { ID: to.Ptr(fmt.Sprintf(common.AzureCredentialID, "default")), Properties: &ucp.AzureServicePrincipalProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, TenantID: &r.TenantID, ClientID: &r.ClientID, ClientSecret: &r.ClientSecret, - Kind: to.Ptr("ServicePrincipal"), + Kind: to.Ptr(ucp.AzureCredentialKindServicePrincipal), }, } diff --git a/pkg/cli/cmd/credential/register/azure/azure_test.go b/pkg/cli/cmd/credential/register/azure/azure_test.go index 2488fa3ceb..37ce67558a 100644 --- a/pkg/cli/cmd/credential/register/azure/azure_test.go +++ b/pkg/cli/cmd/credential/register/azure/azure_test.go @@ -166,12 +166,12 @@ func Test_Run(t *testing.T) { ID: to.Ptr(fmt.Sprintf(common.AzureCredentialID, "default")), Properties: &ucp.AzureServicePrincipalProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, ClientID: to.Ptr("cool-client-id"), ClientSecret: to.Ptr("cool-client-secret"), TenantID: to.Ptr("cool-tenant-id"), - Kind: to.Ptr("ServicePrincipal"), + Kind: to.Ptr(ucp.AzureCredentialKindServicePrincipal), }, } diff --git a/pkg/cli/cmd/radinit/init.go b/pkg/cli/cmd/radinit/init.go index a9d2f22963..dccff63d8d 100644 --- a/pkg/cli/cmd/radinit/init.go +++ b/pkg/cli/cmd/radinit/init.go @@ -345,7 +345,7 @@ func (r *Runner) getAzureCredential() ucp.AzureCredentialResource { Type: to.Ptr(cli_credential.AzureCredential), Properties: &ucp.AzureServicePrincipalProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, TenantID: &r.Options.CloudProviders.Azure.ServicePrincipal.TenantID, ClientID: &r.Options.CloudProviders.Azure.ServicePrincipal.ClientID, @@ -354,13 +354,13 @@ func (r *Runner) getAzureCredential() ucp.AzureCredentialResource { } } -func (r *Runner) getAWSCredential() ucp.AWSCredentialResource { - return ucp.AWSCredentialResource{ +func (r *Runner) getAWSCredential() ucp.AwsCredentialResource { + return ucp.AwsCredentialResource{ Location: to.Ptr(v1.LocationGlobal), Type: to.Ptr(cli_credential.AWSCredential), - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, AccessKeyID: &r.Options.CloudProviders.AWS.AccessKeyID, SecretAccessKey: &r.Options.CloudProviders.AWS.SecretAccessKey, diff --git a/pkg/cli/cmd/radinit/init_test.go b/pkg/cli/cmd/radinit/init_test.go index e051ca678c..609c58ec71 100644 --- a/pkg/cli/cmd/radinit/init_test.go +++ b/pkg/cli/cmd/radinit/init_test.go @@ -712,12 +712,12 @@ func Test_Run_InstallAndCreateEnvironment(t *testing.T) { } if tc.awsProvider != nil { credentialManagementClient.EXPECT(). - PutAWS(context.Background(), ucp.AWSCredentialResource{ + PutAWS(context.Background(), ucp.AwsCredentialResource{ Location: to.Ptr(v1.LocationGlobal), Type: to.Ptr(cli_credential.AWSCredential), - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, AccessKeyID: to.Ptr(tc.awsProvider.AccessKeyID), SecretAccessKey: to.Ptr(tc.awsProvider.SecretAccessKey), diff --git a/pkg/cli/connections/factory.go b/pkg/cli/connections/factory.go index 35ed3f54f3..afb24877b5 100644 --- a/pkg/cli/connections/factory.go +++ b/pkg/cli/connections/factory.go @@ -208,12 +208,12 @@ func (*impl) CreateCredentialManagementClient(ctx context.Context, workspace wor clientOptions := sdk.NewClientOptions(connection) - azureCredentialClient, err := v20220901privatepreview.NewAzureCredentialClient(&aztoken.AnonymousCredential{}, clientOptions) + azureCredentialClient, err := v20220901privatepreview.NewAzureCredentialsClient(&aztoken.AnonymousCredential{}, clientOptions) if err != nil { return nil, err } - awsCredentialClient, err := v20220901privatepreview.NewAwsCredentialClient(&aztoken.AnonymousCredential{}, clientOptions) + awsCredentialClient, err := v20220901privatepreview.NewAwsCredentialsClient(&aztoken.AnonymousCredential{}, clientOptions) if err != nil { return nil, err } diff --git a/pkg/cli/credential/aws_credential_management.go b/pkg/cli/credential/aws_credential_management.go index 119b221ab1..bec1bec632 100644 --- a/pkg/cli/credential/aws_credential_management.go +++ b/pkg/cli/credential/aws_credential_management.go @@ -30,7 +30,7 @@ import ( // AWSCredentialManagementClient is used to interface with cloud provider configuration and credentials. type AWSCredentialManagementClient struct { - AWSCredentialClient ucp.AwsCredentialClient + AWSCredentialClient ucp.AwsCredentialsClient } const ( @@ -53,7 +53,7 @@ type AWSCredentialManagementClientInterface interface { // List lists the credentials registered with all ucp provider planes. List(ctx context.Context) ([]CloudProviderStatus, error) // Put registers an AWS credential with the respective ucp provider plane. - Put(ctx context.Context, credential_config ucp.AWSCredentialResource) error + Put(ctx context.Context, credential_config ucp.AwsCredentialResource) error // Delete unregisters credential from the given ucp provider plane. Delete(ctx context.Context, name string) (bool, error) } @@ -63,7 +63,7 @@ type AWSCredentialManagementClientInterface interface { // "Put" checks if the credential type is "AWSCredential" and if so, creates or updates the credential in the AWS plane, // otherwise it returns an error. -func (cpm *AWSCredentialManagementClient) Put(ctx context.Context, credential ucp.AWSCredentialResource) error { +func (cpm *AWSCredentialManagementClient) Put(ctx context.Context, credential ucp.AwsCredentialResource) error { if strings.EqualFold(*credential.Type, AWSCredential) { _, err := cpm.AWSCredentialClient.CreateOrUpdate(ctx, AWSPlaneName, defaultSecretName, credential, nil) return err @@ -84,7 +84,7 @@ func (cpm *AWSCredentialManagementClient) Get(ctx context.Context, credentialNam if err != nil { return ProviderCredentialConfiguration{}, err } - awsAccessKeyCredentials, ok := resp.AWSCredentialResource.Properties.(*ucp.AWSAccessKeyCredentialProperties) + awsAccessKeyCredentials, ok := resp.AwsCredentialResource.Properties.(*ucp.AwsAccessKeyCredentialProperties) if !ok { return ProviderCredentialConfiguration{}, clierrors.Message("Unable to find credentials for cloud provider %s.", AWSCredential) } @@ -108,15 +108,15 @@ func (cpm *AWSCredentialManagementClient) Get(ctx context.Context, credentialNam // enabled status of each credential. If an error occurs, an error is returned. func (cpm *AWSCredentialManagementClient) List(ctx context.Context) ([]CloudProviderStatus, error) { // list AWS credential - var providerList []*ucp.AWSCredentialResource + var providerList []*ucp.AwsCredentialResource - pager := cpm.AWSCredentialClient.NewListByRootScopePager(AWSPlaneName, nil) + pager := cpm.AWSCredentialClient.NewListPager(AWSPlaneName, nil) for pager.More() { nextPage, err := pager.NextPage(ctx) if err != nil { return nil, err } - credList := nextPage.AWSCredentialResourceListResult.Value + credList := nextPage.AwsCredentialResourceListResult.Value providerList = append(providerList, credList...) } diff --git a/pkg/cli/credential/azure_credential_management.go b/pkg/cli/credential/azure_credential_management.go index d30239be6f..f17c63a559 100644 --- a/pkg/cli/credential/azure_credential_management.go +++ b/pkg/cli/credential/azure_credential_management.go @@ -30,7 +30,7 @@ import ( // AzureCredentialManagementClient is used to interface with cloud provider configuration and credentials. type AzureCredentialManagementClient struct { - AzureCredentialClient ucp.AzureCredentialClient + AzureCredentialClient ucp.AzureCredentialsClient } // AzureCredentialManagementClient is used to interface with cloud provider configuration and credentials. @@ -136,7 +136,7 @@ func (cpm *AzureCredentialManagementClient) Get(ctx context.Context, credentialN }, AzureCredentials: &AzureCredentialProperties{ ClientID: azureServicePrincipal.ClientID, - Kind: azureServicePrincipal.Kind, + Kind: (*string)(azureServicePrincipal.Kind), TenantID: azureServicePrincipal.TenantID, }, } @@ -153,7 +153,7 @@ func (cpm *AzureCredentialManagementClient) List(ctx context.Context) ([]CloudPr // list azure credential var providerList []*ucp.AzureCredentialResource - pager := cpm.AzureCredentialClient.NewListByRootScopePager(AzurePlaneName, nil) + pager := cpm.AzureCredentialClient.NewListPager(AzurePlaneName, nil) for pager.More() { nextPage, err := pager.NextPage(ctx) if err != nil { diff --git a/pkg/cli/credential/credential_management.go b/pkg/cli/credential/credential_management.go index edb1730366..5c53ab5418 100644 --- a/pkg/cli/credential/credential_management.go +++ b/pkg/cli/credential/credential_management.go @@ -38,7 +38,7 @@ type CredentialManagementClient interface { // List lists the credentials registered with all ucp provider planes. List(ctx context.Context) ([]CloudProviderStatus, error) // PutAWS registers an AWS credential with the respective ucp provider plane. - PutAWS(ctx context.Context, credential_config ucp.AWSCredentialResource) error + PutAWS(ctx context.Context, credential_config ucp.AwsCredentialResource) error // PutAzure registers an Azure credential with the respective ucp provider plane. PutAzure(ctx context.Context, credential_config ucp.AzureCredentialResource) error // Delete unregisters credential from the given ucp provider plane. @@ -61,7 +61,7 @@ var _ CredentialManagementClient = (*UCPCredentialManagementClient)(nil) // // PutAWS function takes in a context and an AWSCredentialResource object and returns an error if the AWSClient.Put call fails. -func (cpm *UCPCredentialManagementClient) PutAWS(ctx context.Context, credential ucp.AWSCredentialResource) error { +func (cpm *UCPCredentialManagementClient) PutAWS(ctx context.Context, credential ucp.AwsCredentialResource) error { err := cpm.AWSClient.Put(ctx, credential) return err } diff --git a/pkg/cli/credential/credential_management_test.go b/pkg/cli/credential/credential_management_test.go index 35e764cf66..894094a915 100644 --- a/pkg/cli/credential/credential_management_test.go +++ b/pkg/cli/credential/credential_management_test.go @@ -62,7 +62,7 @@ func Test_AzureCredential_Put(t *testing.T) { Type: to.Ptr(AzureCredential), Properties: &ucp.AzureServicePrincipalProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, ClientID: to.Ptr(clientID), ClientSecret: to.Ptr("cool-client-secret"), @@ -105,7 +105,7 @@ func Test_AWSCredential_Put(t *testing.T) { name string planeType string planeName string - credential ucp.AWSCredentialResource + credential ucp.AwsCredentialResource err error setupMocks func(mockAzure MockAzureCredentialManagementClientInterface, mockAWS MockAWSCredentialManagementClientInterface, planeType string, planeName string) }{ @@ -113,13 +113,13 @@ func Test_AWSCredential_Put(t *testing.T) { name: "create aws credential success", planeType: AWSPlaneType, planeName: AWSPlaneName, - credential: ucp.AWSCredentialResource{ + credential: ucp.AwsCredentialResource{ Name: to.Ptr(awsProviderName), Location: to.Ptr(v1.LocationGlobal), Type: to.Ptr(AWSCredential), - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ Storage: &ucp.CredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), }, AccessKeyID: to.Ptr("access-key-id"), SecretAccessKey: to.Ptr("secret-access-key"), diff --git a/pkg/cli/credential/mock_aws_credential_management.go b/pkg/cli/credential/mock_aws_credential_management.go index f66dd9faa5..bdb3993892 100644 --- a/pkg/cli/credential/mock_aws_credential_management.go +++ b/pkg/cli/credential/mock_aws_credential_management.go @@ -81,7 +81,7 @@ func (mr *MockAWSCredentialManagementClientInterfaceMockRecorder) List(arg0 inte } // Put mocks base method. -func (m *MockAWSCredentialManagementClientInterface) Put(arg0 context.Context, arg1 v20220901privatepreview.AWSCredentialResource) error { +func (m *MockAWSCredentialManagementClientInterface) Put(arg0 context.Context, arg1 v20220901privatepreview.AwsCredentialResource) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Put", arg0, arg1) ret0, _ := ret[0].(error) diff --git a/pkg/cli/credential/mock_credentialmanagementclient.go b/pkg/cli/credential/mock_credentialmanagementclient.go index 5e3d01bc68..cb0dd27f70 100644 --- a/pkg/cli/credential/mock_credentialmanagementclient.go +++ b/pkg/cli/credential/mock_credentialmanagementclient.go @@ -81,7 +81,7 @@ func (mr *MockCredentialManagementClientMockRecorder) List(arg0 interface{}) *go } // PutAWS mocks base method. -func (m *MockCredentialManagementClient) PutAWS(arg0 context.Context, arg1 v20220901privatepreview.AWSCredentialResource) error { +func (m *MockCredentialManagementClient) PutAWS(arg0 context.Context, arg1 v20220901privatepreview.AwsCredentialResource) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PutAWS", arg0, arg1) ret0, _ := ret[0].(error) diff --git a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go index f129b478f3..6f1fdfeeeb 100644 --- a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go +++ b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion.go @@ -19,9 +19,8 @@ package v20220901privatepreview import ( "fmt" - azto "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/go-autorest/autorest/to" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" "github.com/radius-project/radius/pkg/ucp/datamodel" ) @@ -31,7 +30,7 @@ const ( ) // ConvertTo converts from the versioned Credential resource to version-agnostic datamodel. -func (cr *AWSCredentialResource) ConvertTo() (v1.DataModelInterface, error) { +func (cr *AwsCredentialResource) ConvertTo() (v1.DataModelInterface, error) { prop, err := cr.getDataModelCredentialProperties() if err != nil { return nil, err @@ -56,13 +55,13 @@ func (cr *AWSCredentialResource) ConvertTo() (v1.DataModelInterface, error) { return converted, nil } -func (cr *AWSCredentialResource) getDataModelCredentialProperties() (*datamodel.AWSCredentialResourceProperties, error) { +func (cr *AwsCredentialResource) getDataModelCredentialProperties() (*datamodel.AWSCredentialResourceProperties, error) { if cr.Properties == nil { return nil, &v1.ErrModelConversion{PropertyName: "$.properties", ValidValue: "not nil"} } switch p := cr.Properties.(type) { - case *AWSAccessKeyCredentialProperties: + case *AwsAccessKeyCredentialProperties: var storage *datamodel.CredentialStorageProperties switch c := p.Storage.(type) { @@ -96,7 +95,7 @@ func (cr *AWSCredentialResource) getDataModelCredentialProperties() (*datamodel. } // ConvertFrom converts from version-agnostic datamodel to the versioned Credential resource. -func (dst *AWSCredentialResource) ConvertFrom(src v1.DataModelInterface) error { +func (dst *AwsCredentialResource) ConvertFrom(src v1.DataModelInterface) error { dm, ok := src.(*datamodel.AWSCredential) if !ok { return v1.ErrInvalidModelConversion @@ -112,8 +111,8 @@ func (dst *AWSCredentialResource) ConvertFrom(src v1.DataModelInterface) error { switch dm.Properties.Storage.Kind { case datamodel.InternalStorageKind: storage = &InternalCredentialStorageProperties{ - Kind: azto.Ptr(string(CredentialStorageKindInternal)), - SecretName: azto.Ptr(dm.Properties.Storage.InternalCredential.SecretName), + Kind: to.Ptr(CredentialStorageKindInternal), + SecretName: to.Ptr(dm.Properties.Storage.InternalCredential.SecretName), } default: return v1.ErrInvalidModelConversion @@ -122,9 +121,9 @@ func (dst *AWSCredentialResource) ConvertFrom(src v1.DataModelInterface) error { // DO NOT convert any secret values to versioned model. switch dm.Properties.Kind { case datamodel.AWSCredentialKind: - dst.Properties = &AWSAccessKeyCredentialProperties{ - Kind: azto.Ptr(dm.Properties.Kind), - AccessKeyID: azto.Ptr(dm.Properties.AWSCredential.AccessKeyID), + dst.Properties = &AwsAccessKeyCredentialProperties{ + Kind: to.Ptr(AWSCredentialKind(dm.Properties.Kind)), + AccessKeyID: to.Ptr(dm.Properties.AWSCredential.AccessKeyID), Storage: storage, } default: diff --git a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go index 7b82896dc5..d8a0ab8dfd 100644 --- a/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/aws_credential_conversion_test.go @@ -89,7 +89,7 @@ func TestAWSCredentialConvertVersionedToDataModel(t *testing.T) { for _, tt := range conversionTests { t.Run(tt.filename, func(t *testing.T) { rawPayload := testutil.ReadFixture(tt.filename) - r := &AWSCredentialResource{} + r := &AwsCredentialResource{} err := json.Unmarshal(rawPayload, r) require.NoError(t, err) @@ -109,12 +109,12 @@ func TestAWSCredentialConvertVersionedToDataModel(t *testing.T) { func TestAWSCredentialConvertDataModelToVersioned(t *testing.T) { conversionTests := []struct { filename string - expected *AWSCredentialResource + expected *AwsCredentialResource err error }{ { filename: "credentialresourcedatamodel-aws.json", - expected: &AWSCredentialResource{ + expected: &AwsCredentialResource{ ID: to.Ptr("/planes/aws/aws/providers/System.AWS/credentials/default"), Name: to.Ptr("default"), Type: to.Ptr("System.AWS/credentials"), @@ -122,11 +122,11 @@ func TestAWSCredentialConvertDataModelToVersioned(t *testing.T) { Tags: map[string]*string{ "env": to.Ptr("dev"), }, - Properties: &AWSAccessKeyCredentialProperties{ - Kind: to.Ptr("AccessKey"), + Properties: &AwsAccessKeyCredentialProperties{ + Kind: to.Ptr(AWSCredentialKindAccessKey), AccessKeyID: to.Ptr("00000000-0000-0000-0000-000000000000"), Storage: &InternalCredentialStorageProperties{ - Kind: to.Ptr(string(CredentialStorageKindInternal)), + Kind: to.Ptr(CredentialStorageKindInternal), SecretName: to.Ptr("aws-awscloud-default"), }, }, @@ -144,7 +144,7 @@ func TestAWSCredentialConvertDataModelToVersioned(t *testing.T) { err := json.Unmarshal(rawPayload, r) require.NoError(t, err) - versioned := &AWSCredentialResource{} + versioned := &AwsCredentialResource{} err = versioned.ConvertFrom(r) if tt.err != nil { diff --git a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go index 61fa156d69..78f7b09d2b 100644 --- a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go +++ b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion.go @@ -112,7 +112,7 @@ func (dst *AzureCredentialResource) ConvertFrom(src v1.DataModelInterface) error switch dm.Properties.Storage.Kind { case datamodel.InternalStorageKind: storage = &InternalCredentialStorageProperties{ - Kind: to.Ptr(string(CredentialStorageKindInternal)), + Kind: to.Ptr(CredentialStorageKindInternal), SecretName: to.Ptr(dm.Properties.Storage.InternalCredential.SecretName), } default: @@ -123,7 +123,7 @@ func (dst *AzureCredentialResource) ConvertFrom(src v1.DataModelInterface) error switch dm.Properties.Kind { case datamodel.AzureCredentialKind: dst.Properties = &AzureServicePrincipalProperties{ - Kind: to.Ptr(dm.Properties.Kind), + Kind: to.Ptr(AzureCredentialKind(dm.Properties.Kind)), ClientID: to.Ptr(dm.Properties.AzureCredential.ClientID), TenantID: to.Ptr(dm.Properties.AzureCredential.TenantID), Storage: storage, diff --git a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go index 11786d899b..f5e32bc9fe 100644 --- a/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go +++ b/pkg/ucp/api/v20220901privatepreview/azure_credential_conversion_test.go @@ -124,11 +124,11 @@ func TestAzureCredentialConvertDataModelToVersioned(t *testing.T) { "env": to.Ptr("dev"), }, Properties: &AzureServicePrincipalProperties{ - Kind: to.Ptr("ServicePrincipal"), + Kind: to.Ptr(AzureCredentialKindServicePrincipal), ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), Storage: &InternalCredentialStorageProperties{ - Kind: to.Ptr(string(CredentialStorageKindInternal)), + Kind: to.Ptr(CredentialStorageKindInternal), SecretName: to.Ptr("azure-azurecloud-default"), }, }, diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go deleted file mode 100644 index a29cf4884c..0000000000 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredential_client.go +++ /dev/null @@ -1,277 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220901privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// AwsCredentialClient contains the methods for the AwsCredential group. -// Don't use this type directly, use NewAwsCredentialClient() instead. -type AwsCredentialClient struct { - internal *arm.Client -} - -// NewAwsCredentialClient creates a new instance of AwsCredentialClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAwsCredentialClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AwsCredentialClient, error) { - cl, err := arm.NewClient(moduleName+".AwsCredentialClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AwsCredentialClient{ - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a AWSCredentialResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - credentialName - The AWS credential name. -// - resource - Resource create parameters. -// - options - AwsCredentialClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialClient.CreateOrUpdate -// method. -func (client *AwsCredentialClient) CreateOrUpdate(ctx context.Context, planeName string, credentialName string, resource AWSCredentialResource, options *AwsCredentialClientCreateOrUpdateOptions) (AwsCredentialClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, planeName, credentialName, resource, options) - if err != nil { - return AwsCredentialClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AwsCredentialClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return AwsCredentialClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AwsCredentialClient) createOrUpdateCreateRequest(ctx context.Context, planeName string, credentialName string, resource AWSCredentialResource, options *AwsCredentialClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - if credentialName == "" { - return nil, errors.New("parameter credentialName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AwsCredentialClient) createOrUpdateHandleResponse(resp *http.Response) (AwsCredentialClientCreateOrUpdateResponse, error) { - result := AwsCredentialClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return AwsCredentialClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.AWSCredentialResource); err != nil { - return AwsCredentialClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing AWSCredentialResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - credentialName - The AWS credential name. -// - options - AwsCredentialClientDeleteOptions contains the optional parameters for the AwsCredentialClient.Delete method. -func (client *AwsCredentialClient) Delete(ctx context.Context, planeName string, credentialName string, options *AwsCredentialClientDeleteOptions) (AwsCredentialClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, planeName, credentialName, options) - if err != nil { - return AwsCredentialClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AwsCredentialClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AwsCredentialClientDeleteResponse{}, err - } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err -} - -// deleteCreateRequest creates the Delete request. -func (client *AwsCredentialClient) deleteCreateRequest(ctx context.Context, planeName string, credentialName string, options *AwsCredentialClientDeleteOptions) (*policy.Request, error) { - urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - if credentialName == "" { - return nil, errors.New("parameter credentialName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *AwsCredentialClient) deleteHandleResponse(resp *http.Response) (AwsCredentialClientDeleteResponse, error) { - result := AwsCredentialClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return AwsCredentialClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a AWSCredentialResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - credentialName - The AWS credential name. -// - options - AwsCredentialClientGetOptions contains the optional parameters for the AwsCredentialClient.Get method. -func (client *AwsCredentialClient) Get(ctx context.Context, planeName string, credentialName string, options *AwsCredentialClientGetOptions) (AwsCredentialClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, planeName, credentialName, options) - if err != nil { - return AwsCredentialClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AwsCredentialClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AwsCredentialClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AwsCredentialClient) getCreateRequest(ctx context.Context, planeName string, credentialName string, options *AwsCredentialClientGetOptions) (*policy.Request, error) { - urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - if credentialName == "" { - return nil, errors.New("parameter credentialName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AwsCredentialClient) getHandleResponse(resp *http.Response) (AwsCredentialClientGetResponse, error) { - result := AwsCredentialClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AWSCredentialResource); err != nil { - return AwsCredentialClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all AWSCredentialResource -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - options - AwsCredentialClientListByRootScopeOptions contains the optional parameters for the AwsCredentialClient.NewListByRootScopePager -// method. -func (client *AwsCredentialClient) NewListByRootScopePager(planeName string, options *AwsCredentialClientListByRootScopeOptions) (*runtime.Pager[AwsCredentialClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[AwsCredentialClientListByRootScopeResponse]{ - More: func(page AwsCredentialClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AwsCredentialClientListByRootScopeResponse) (AwsCredentialClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, planeName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AwsCredentialClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AwsCredentialClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AwsCredentialClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *AwsCredentialClient) listByRootScopeCreateRequest(ctx context.Context, planeName string, options *AwsCredentialClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *AwsCredentialClient) listByRootScopeHandleResponse(resp *http.Response) (AwsCredentialClientListByRootScopeResponse, error) { - result := AwsCredentialClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AWSCredentialResourceListResult); err != nil { - return AwsCredentialClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredentials_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredentials_client.go new file mode 100644 index 0000000000..0f506fe5fc --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_awscredentials_client.go @@ -0,0 +1,309 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220901privatepreview + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AwsCredentialsClient contains the methods for the AwsCredentials group. +// Don't use this type directly, use NewAwsCredentialsClient() instead. +type AwsCredentialsClient struct { + internal *arm.Client +} + +// NewAwsCredentialsClient creates a new instance of AwsCredentialsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAwsCredentialsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AwsCredentialsClient, error) { + cl, err := arm.NewClient(moduleName+".AwsCredentialsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AwsCredentialsClient{ + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create or update an AWS credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of AWS plane +// - credentialName - The AWS credential name. +// - resource - Resource create parameters. +// - options - AwsCredentialsClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialsClient.CreateOrUpdate +// method. +func (client *AwsCredentialsClient) CreateOrUpdate(ctx context.Context, planeName string, credentialName string, resource AwsCredentialResource, options *AwsCredentialsClientCreateOrUpdateOptions) (AwsCredentialsClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, planeName, credentialName, resource, options) + if err != nil { + return AwsCredentialsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AwsCredentialsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AwsCredentialsClient) createOrUpdateCreateRequest(ctx context.Context, planeName string, credentialName string, resource AwsCredentialResource, options *AwsCredentialsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AwsCredentialsClient) createOrUpdateHandleResponse(resp *http.Response) (AwsCredentialsClientCreateOrUpdateResponse, error) { + result := AwsCredentialsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AwsCredentialResource); err != nil { + return AwsCredentialsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete an AWS credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of AWS plane +// - credentialName - The AWS credential name. +// - options - AwsCredentialsClientDeleteOptions contains the optional parameters for the AwsCredentialsClient.Delete method. +func (client *AwsCredentialsClient) Delete(ctx context.Context, planeName string, credentialName string, options *AwsCredentialsClientDeleteOptions) (AwsCredentialsClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, planeName, credentialName, options) + if err != nil { + return AwsCredentialsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AwsCredentialsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialsClientDeleteResponse{}, err + } + return AwsCredentialsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AwsCredentialsClient) deleteCreateRequest(ctx context.Context, planeName string, credentialName string, options *AwsCredentialsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get an AWS credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of AWS plane +// - credentialName - The AWS credential name. +// - options - AwsCredentialsClientGetOptions contains the optional parameters for the AwsCredentialsClient.Get method. +func (client *AwsCredentialsClient) Get(ctx context.Context, planeName string, credentialName string, options *AwsCredentialsClientGetOptions) (AwsCredentialsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, planeName, credentialName, options) + if err != nil { + return AwsCredentialsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AwsCredentialsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AwsCredentialsClient) getCreateRequest(ctx context.Context, planeName string, credentialName string, options *AwsCredentialsClientGetOptions) (*policy.Request, error) { + urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AwsCredentialsClient) getHandleResponse(resp *http.Response) (AwsCredentialsClientGetResponse, error) { + result := AwsCredentialsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AwsCredentialResource); err != nil { + return AwsCredentialsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List AWS credentials +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of AWS plane +// - options - AwsCredentialsClientListOptions contains the optional parameters for the AwsCredentialsClient.NewListPager method. +func (client *AwsCredentialsClient) NewListPager(planeName string, options *AwsCredentialsClientListOptions) (*runtime.Pager[AwsCredentialsClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[AwsCredentialsClientListResponse]{ + More: func(page AwsCredentialsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AwsCredentialsClientListResponse) (AwsCredentialsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, planeName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AwsCredentialsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AwsCredentialsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AwsCredentialsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AwsCredentialsClient) listCreateRequest(ctx context.Context, planeName string, options *AwsCredentialsClientListOptions) (*policy.Request, error) { + urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AwsCredentialsClient) listHandleResponse(resp *http.Response) (AwsCredentialsClientListResponse, error) { + result := AwsCredentialsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AwsCredentialResourceListResult); err != nil { + return AwsCredentialsClientListResponse{}, err + } + return result, nil +} + +// Update - Update an AWS credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of AWS plane +// - credentialName - The AWS credential name. +// - properties - The resource properties to be updated. +// - options - AwsCredentialsClientUpdateOptions contains the optional parameters for the AwsCredentialsClient.Update method. +func (client *AwsCredentialsClient) Update(ctx context.Context, planeName string, credentialName string, properties AwsCredentialResourceTagsUpdate, options *AwsCredentialsClientUpdateOptions) (AwsCredentialsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, planeName, credentialName, properties, options) + if err != nil { + return AwsCredentialsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AwsCredentialsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AwsCredentialsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *AwsCredentialsClient) updateCreateRequest(ctx context.Context, planeName string, credentialName string, properties AwsCredentialResourceTagsUpdate, options *AwsCredentialsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *AwsCredentialsClient) updateHandleResponse(resp *http.Response) (AwsCredentialsClientUpdateResponse, error) { + result := AwsCredentialsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AwsCredentialResource); err != nil { + return AwsCredentialsClientUpdateResponse{}, err + } + return result, nil +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go deleted file mode 100644 index 0ffa5c2a82..0000000000 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredential_client.go +++ /dev/null @@ -1,277 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220901privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// AzureCredentialClient contains the methods for the AzureCredential group. -// Don't use this type directly, use NewAzureCredentialClient() instead. -type AzureCredentialClient struct { - internal *arm.Client -} - -// NewAzureCredentialClient creates a new instance of AzureCredentialClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAzureCredentialClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureCredentialClient, error) { - cl, err := arm.NewClient(moduleName+".AzureCredentialClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AzureCredentialClient{ - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or updates a AzureCredentialResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - credentialName - The Azure credential name. -// - resource - Resource create parameters. -// - options - AzureCredentialClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialClient.CreateOrUpdate -// method. -func (client *AzureCredentialClient) CreateOrUpdate(ctx context.Context, planeName string, credentialName string, resource AzureCredentialResource, options *AzureCredentialClientCreateOrUpdateOptions) (AzureCredentialClientCreateOrUpdateResponse, error) { - var err error - req, err := client.createOrUpdateCreateRequest(ctx, planeName, credentialName, resource, options) - if err != nil { - return AzureCredentialClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AzureCredentialClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return AzureCredentialClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureCredentialClient) createOrUpdateCreateRequest(ctx context.Context, planeName string, credentialName string, resource AzureCredentialResource, options *AzureCredentialClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - if credentialName == "" { - return nil, errors.New("parameter credentialName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err -} - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AzureCredentialClient) createOrUpdateHandleResponse(resp *http.Response) (AzureCredentialClientCreateOrUpdateResponse, error) { - result := AzureCredentialClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return AzureCredentialClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResource); err != nil { - return AzureCredentialClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes an existing AzureCredentialResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - credentialName - The Azure credential name. -// - options - AzureCredentialClientDeleteOptions contains the optional parameters for the AzureCredentialClient.Delete method. -func (client *AzureCredentialClient) Delete(ctx context.Context, planeName string, credentialName string, options *AzureCredentialClientDeleteOptions) (AzureCredentialClientDeleteResponse, error) { - var err error - req, err := client.deleteCreateRequest(ctx, planeName, credentialName, options) - if err != nil { - return AzureCredentialClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AzureCredentialClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AzureCredentialClientDeleteResponse{}, err - } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err -} - -// deleteCreateRequest creates the Delete request. -func (client *AzureCredentialClient) deleteCreateRequest(ctx context.Context, planeName string, credentialName string, options *AzureCredentialClientDeleteOptions) (*policy.Request, error) { - urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - if credentialName == "" { - return nil, errors.New("parameter credentialName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// deleteHandleResponse handles the Delete response. -func (client *AzureCredentialClient) deleteHandleResponse(resp *http.Response) (AzureCredentialClientDeleteResponse, error) { - result := AzureCredentialClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return AzureCredentialClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a AzureCredentialResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - credentialName - The Azure credential name. -// - options - AzureCredentialClientGetOptions contains the optional parameters for the AzureCredentialClient.Get method. -func (client *AzureCredentialClient) Get(ctx context.Context, planeName string, credentialName string, options *AzureCredentialClientGetOptions) (AzureCredentialClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, planeName, credentialName, options) - if err != nil { - return AzureCredentialClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AzureCredentialClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AzureCredentialClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AzureCredentialClient) getCreateRequest(ctx context.Context, planeName string, credentialName string, options *AzureCredentialClientGetOptions) (*policy.Request, error) { - urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - if credentialName == "" { - return nil, errors.New("parameter credentialName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AzureCredentialClient) getHandleResponse(resp *http.Response) (AzureCredentialClientGetResponse, error) { - result := AzureCredentialClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResource); err != nil { - return AzureCredentialClientGetResponse{}, err - } - return result, nil -} - -// NewListByRootScopePager - Lists information about all AzureCredentialResource -// -// Generated from API version 2022-09-01-privatepreview -// - planeName - The name of the plane -// - options - AzureCredentialClientListByRootScopeOptions contains the optional parameters for the AzureCredentialClient.NewListByRootScopePager -// method. -func (client *AzureCredentialClient) NewListByRootScopePager(planeName string, options *AzureCredentialClientListByRootScopeOptions) (*runtime.Pager[AzureCredentialClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[AzureCredentialClientListByRootScopeResponse]{ - More: func(page AzureCredentialClientListByRootScopeResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AzureCredentialClientListByRootScopeResponse) (AzureCredentialClientListByRootScopeResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, planeName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return AzureCredentialClientListByRootScopeResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AzureCredentialClientListByRootScopeResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureCredentialClientListByRootScopeResponse{}, runtime.NewResponseError(resp) - } - return client.listByRootScopeHandleResponse(resp) - }, - }) -} - -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *AzureCredentialClient) listByRootScopeCreateRequest(ctx context.Context, planeName string, options *AzureCredentialClientListByRootScopeOptions) (*policy.Request, error) { - urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials" - urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *AzureCredentialClient) listByRootScopeHandleResponse(resp *http.Response) (AzureCredentialClientListByRootScopeResponse, error) { - result := AzureCredentialClientListByRootScopeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResourceListResult); err != nil { - return AzureCredentialClientListByRootScopeResponse{}, err - } - return result, nil -} - diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredentials_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredentials_client.go new file mode 100644 index 0000000000..5a281825cc --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_azurecredentials_client.go @@ -0,0 +1,310 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220901privatepreview + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AzureCredentialsClient contains the methods for the AzureCredentials group. +// Don't use this type directly, use NewAzureCredentialsClient() instead. +type AzureCredentialsClient struct { + internal *arm.Client +} + +// NewAzureCredentialsClient creates a new instance of AzureCredentialsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAzureCredentialsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureCredentialsClient, error) { + cl, err := arm.NewClient(moduleName+".AzureCredentialsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AzureCredentialsClient{ + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create or update an Azure credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - resource - Resource create parameters. +// - options - AzureCredentialsClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialsClient.CreateOrUpdate +// method. +func (client *AzureCredentialsClient) CreateOrUpdate(ctx context.Context, planeName string, credentialName string, resource AzureCredentialResource, options *AzureCredentialsClientCreateOrUpdateOptions) (AzureCredentialsClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, planeName, credentialName, resource, options) + if err != nil { + return AzureCredentialsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureCredentialsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AzureCredentialsClient) createOrUpdateCreateRequest(ctx context.Context, planeName string, credentialName string, resource AzureCredentialResource, options *AzureCredentialsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err +} + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AzureCredentialsClient) createOrUpdateHandleResponse(resp *http.Response) (AzureCredentialsClientCreateOrUpdateResponse, error) { + result := AzureCredentialsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResource); err != nil { + return AzureCredentialsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete an Azure credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - options - AzureCredentialsClientDeleteOptions contains the optional parameters for the AzureCredentialsClient.Delete method. +func (client *AzureCredentialsClient) Delete(ctx context.Context, planeName string, credentialName string, options *AzureCredentialsClientDeleteOptions) (AzureCredentialsClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, planeName, credentialName, options) + if err != nil { + return AzureCredentialsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureCredentialsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialsClientDeleteResponse{}, err + } + return AzureCredentialsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AzureCredentialsClient) deleteCreateRequest(ctx context.Context, planeName string, credentialName string, options *AzureCredentialsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get an Azure credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - options - AzureCredentialsClientGetOptions contains the optional parameters for the AzureCredentialsClient.Get method. +func (client *AzureCredentialsClient) Get(ctx context.Context, planeName string, credentialName string, options *AzureCredentialsClientGetOptions) (AzureCredentialsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, planeName, credentialName, options) + if err != nil { + return AzureCredentialsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureCredentialsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AzureCredentialsClient) getCreateRequest(ctx context.Context, planeName string, credentialName string, options *AzureCredentialsClientGetOptions) (*policy.Request, error) { + urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AzureCredentialsClient) getHandleResponse(resp *http.Response) (AzureCredentialsClientGetResponse, error) { + result := AzureCredentialsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResource); err != nil { + return AzureCredentialsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List Azure credentials +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of the plane +// - options - AzureCredentialsClientListOptions contains the optional parameters for the AzureCredentialsClient.NewListPager +// method. +func (client *AzureCredentialsClient) NewListPager(planeName string, options *AzureCredentialsClientListOptions) (*runtime.Pager[AzureCredentialsClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[AzureCredentialsClientListResponse]{ + More: func(page AzureCredentialsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureCredentialsClientListResponse) (AzureCredentialsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, planeName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureCredentialsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureCredentialsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureCredentialsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AzureCredentialsClient) listCreateRequest(ctx context.Context, planeName string, options *AzureCredentialsClientListOptions) (*policy.Request, error) { + urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AzureCredentialsClient) listHandleResponse(resp *http.Response) (AzureCredentialsClientListResponse, error) { + result := AzureCredentialsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResourceListResult); err != nil { + return AzureCredentialsClientListResponse{}, err + } + return result, nil +} + +// Update - Update an Azure credential +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeName - The name of the plane +// - credentialName - The Azure credential name. +// - properties - The resource properties to be updated. +// - options - AzureCredentialsClientUpdateOptions contains the optional parameters for the AzureCredentialsClient.Update method. +func (client *AzureCredentialsClient) Update(ctx context.Context, planeName string, credentialName string, properties AzureCredentialResourceTagsUpdate, options *AzureCredentialsClientUpdateOptions) (AzureCredentialsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, planeName, credentialName, properties, options) + if err != nil { + return AzureCredentialsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureCredentialsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureCredentialsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *AzureCredentialsClient) updateCreateRequest(ctx context.Context, planeName string, credentialName string, properties AzureCredentialResourceTagsUpdate, options *AzureCredentialsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}" + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if credentialName == "" { + return nil, errors.New("parameter credentialName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{credentialName}", url.PathEscape(credentialName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *AzureCredentialsClient) updateHandleResponse(resp *http.Response) (AzureCredentialsClientUpdateResponse, error) { + result := AzureCredentialsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureCredentialResource); err != nil { + return AzureCredentialsClientUpdateResponse{}, err + } + return result, nil +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go index 0bb90a5d64..f0fbcdc587 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go @@ -34,18 +34,13 @@ func NewClientFactory( credential azcore.TokenCredential, options *arm.ClientOpt }, nil } -func (c *ClientFactory) NewAwsCredentialClient() *AwsCredentialClient { - subClient, _ := NewAwsCredentialClient(c.credential, c.options) +func (c *ClientFactory) NewAwsCredentialsClient() *AwsCredentialsClient { + subClient, _ := NewAwsCredentialsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewAzureCredentialClient() *AzureCredentialClient { - subClient, _ := NewAzureCredentialClient(c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewPlaneTypesClient() *PlaneTypesClient { - subClient, _ := NewPlaneTypesClient(c.credential, c.options) +func (c *ClientFactory) NewAzureCredentialsClient() *AzureCredentialsClient { + subClient, _ := NewAzureCredentialsClient(c.credential, c.options) return subClient } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go index 8384d93941..0ee33593c4 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_constants.go @@ -12,10 +12,11 @@ const ( moduleVersion = "v0.0.1" ) -// AWSCredentialKind - AWS credential kinds supported. +// AWSCredentialKind - AWS credential kind type AWSCredentialKind string const ( + // AWSCredentialKindAccessKey - The AWS Access Key credential AWSCredentialKindAccessKey AWSCredentialKind = "AccessKey" ) @@ -30,6 +31,7 @@ func PossibleAWSCredentialKindValues() []AWSCredentialKind { type AzureCredentialKind string const ( + // AzureCredentialKindServicePrincipal - The Service Principal Credential AzureCredentialKindServicePrincipal AzureCredentialKind = "ServicePrincipal" ) @@ -64,6 +66,7 @@ func PossibleCreatedByTypeValues() []CreatedByType { type CredentialStorageKind string const ( + // CredentialStorageKindInternal - Internal credential storage CredentialStorageKindInternal CredentialStorageKind = "Internal" ) @@ -78,8 +81,11 @@ func PossibleCredentialStorageKindValues() []CredentialStorageKind { type PlaneKind string const ( + // PlaneKindAWS - AWS Plane PlaneKindAWS PlaneKind = "AWS" + // PlaneKindAzure - Azure Plane PlaneKindAzure PlaneKind = "Azure" + // PlaneKindUCPNative - UCP Native Plane PlaneKindUCPNative PlaneKind = "UCPNative" ) @@ -92,16 +98,23 @@ func PossiblePlaneKindValues() []PlaneKind { } } -// ProvisioningState - Provisioning state of the link at the time the operation was called +// ProvisioningState - Provisioning state of the portable resource at the time the operation was called type ProvisioningState string const ( + // ProvisioningStateAccepted - The resource create request has been accepted ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting - The resource is being deleted ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateProvisioning - The resource is being provisioned ProvisioningStateProvisioning ProvisioningState = "Provisioning" + // ProvisioningStateSucceeded - Resource has been created. ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating - The resource is updating ProvisioningStateUpdating ProvisioningState = "Updating" ) @@ -118,3 +131,18 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } +// Versions - Supported API versions for Universal Control Plane resource provider. +type Versions string + +const ( + // VersionsV20220901Privatepreview - 2022-09-01-privatepreview + VersionsV20220901Privatepreview Versions = "2022-09-01-privatepreview" +) + +// PossibleVersionsValues returns the possible values for the Versions const type. +func PossibleVersionsValues() []Versions { + return []Versions{ + VersionsV20220901Privatepreview, + } +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go index 489d86ea82..3bbf9848c0 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_interfaces.go @@ -7,13 +7,13 @@ package v20220901privatepreview -// AWSCredentialPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetAWSCredentialProperties() method to access the common type. +// 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 -type AWSCredentialPropertiesClassification interface { - // GetAWSCredentialProperties returns the AWSCredentialProperties content of the underlying type. - GetAWSCredentialProperties() *AWSCredentialProperties +// - *AwsAccessKeyCredentialProperties, *AwsCredentialProperties +type AwsCredentialPropertiesClassification interface { + // GetAwsCredentialProperties returns the AwsCredentialProperties content of the underlying type. + GetAwsCredentialProperties() *AwsCredentialProperties } // AzureCredentialPropertiesClassification provides polymorphic access to related types. diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go index 2b019ea2e7..eebab52ecf 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go @@ -9,13 +9,13 @@ package v20220901privatepreview import "time" -// AWSAccessKeyCredentialProperties - AWS credential storage properties -type AWSAccessKeyCredentialProperties struct { +// AwsAccessKeyCredentialProperties - AWS credential storage properties +type AwsAccessKeyCredentialProperties struct { // REQUIRED; Access key ID for AWS identity AccessKeyID *string - // REQUIRED; Discriminator property for AWSCredentialProperties. - Kind *string + // REQUIRED; The AWS credential kind + Kind *AWSCredentialKind // REQUIRED; Secret Access Key for AWS identity SecretAccessKey *string @@ -23,38 +23,38 @@ type AWSAccessKeyCredentialProperties struct { // REQUIRED; The storage properties Storage CredentialStoragePropertiesClassification - // READ-ONLY; Provisioning state of the resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState } -// GetAWSCredentialProperties implements the AWSCredentialPropertiesClassification interface for type AWSAccessKeyCredentialProperties. -func (a *AWSAccessKeyCredentialProperties) GetAWSCredentialProperties() *AWSCredentialProperties { - return &AWSCredentialProperties{ +// GetAwsCredentialProperties implements the AwsCredentialPropertiesClassification interface for type AwsAccessKeyCredentialProperties. +func (a *AwsAccessKeyCredentialProperties) GetAwsCredentialProperties() *AwsCredentialProperties { + return &AwsCredentialProperties{ Kind: a.Kind, ProvisioningState: a.ProvisioningState, } } -// AWSCredentialProperties - AWS Credential properties -type AWSCredentialProperties struct { - // REQUIRED; Discriminator property for AWSCredentialProperties. - Kind *string +// AwsCredentialProperties - AWS Credential properties +type AwsCredentialProperties struct { + // REQUIRED; The AWS credential kind + Kind *AWSCredentialKind - // READ-ONLY; Provisioning state of the resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState } -// GetAWSCredentialProperties implements the AWSCredentialPropertiesClassification interface for type AWSCredentialProperties. -func (a *AWSCredentialProperties) GetAWSCredentialProperties() *AWSCredentialProperties { return a } +// GetAwsCredentialProperties implements the AwsCredentialPropertiesClassification interface for type AwsCredentialProperties. +func (a *AwsCredentialProperties) GetAwsCredentialProperties() *AwsCredentialProperties { return a } -// AWSCredentialResource - Concrete tracked resource types can be created by aliasing this type using a specific property +// AwsCredentialResource - Concrete tracked resource types can be created by aliasing this type using a specific property // type. -type AWSCredentialResource struct { +type AwsCredentialResource struct { // REQUIRED; The geo-location where the resource lives Location *string // The resource-specific properties for this resource. - Properties AWSCredentialPropertiesClassification + Properties AwsCredentialPropertiesClassification // Resource tags. Tags map[string]*string @@ -72,29 +72,34 @@ type AWSCredentialResource struct { Type *string } -// AWSCredentialResourceListResult - The response of a AWSCredentialResource list operation. -type AWSCredentialResourceListResult struct { - // REQUIRED; The AWSCredentialResource items on this page - Value []*AWSCredentialResource +// AwsCredentialResourceListResult - The response of a AwsCredentialResource list operation. +type AwsCredentialResourceListResult struct { + // REQUIRED; The AwsCredentialResource items on this page + Value []*AwsCredentialResource // The link to the next page of items NextLink *string } -// AzureCredentialProperties - Azure Credential properties +// AwsCredentialResourceTagsUpdate - The type used for updating tags in AwsCredentialResource resources. +type AwsCredentialResourceTagsUpdate struct { + // Resource tags. + Tags map[string]*string +} + +// AzureCredentialProperties - The base properties of Azure Credential type AzureCredentialProperties struct { - // REQUIRED; Discriminator property for AzureCredentialProperties. - Kind *string + // REQUIRED; The kind of Azure credential + Kind *AzureCredentialKind - // READ-ONLY; Provisioning state of the resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState } // GetAzureCredentialProperties implements the AzureCredentialPropertiesClassification interface for type AzureCredentialProperties. func (a *AzureCredentialProperties) GetAzureCredentialProperties() *AzureCredentialProperties { return a } -// AzureCredentialResource - Concrete tracked resource types can be created by aliasing this type using a specific property -// type. +// AzureCredentialResource - Represents Azure Credential Resource type AzureCredentialResource struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -127,7 +132,13 @@ type AzureCredentialResourceListResult struct { NextLink *string } -// AzureServicePrincipalProperties - Service Principal credential storage properties +// AzureCredentialResourceTagsUpdate - The type used for updating tags in AzureCredentialResource resources. +type AzureCredentialResourceTagsUpdate struct { + // Resource tags. + Tags map[string]*string +} + +// AzureServicePrincipalProperties - The properties of Service Principal credential storage type AzureServicePrincipalProperties struct { // REQUIRED; clientId for ServicePrincipal ClientID *string @@ -135,8 +146,8 @@ type AzureServicePrincipalProperties struct { // REQUIRED; secret for ServicePrincipal ClientSecret *string - // REQUIRED; Discriminator property for AzureCredentialProperties. - Kind *string + // REQUIRED; The kind of Azure credential + Kind *AzureCredentialKind // REQUIRED; The storage properties Storage CredentialStoragePropertiesClassification @@ -144,7 +155,7 @@ type AzureServicePrincipalProperties struct { // REQUIRED; tenantId for ServicePrincipal TenantID *string - // READ-ONLY; Provisioning state of the resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState } @@ -156,16 +167,10 @@ func (a *AzureServicePrincipalProperties) GetAzureCredentialProperties() *AzureC } } -// BasicResourceProperties - Basic properties of a UCP resource. -type BasicResourceProperties struct { - // READ-ONLY; Provisioning state of the resource at the time the operation was called - ProvisioningState *ProvisioningState -} - -// CredentialStorageProperties - Credential storage properties +// CredentialStorageProperties - The base credential storage properties type CredentialStorageProperties struct { - // REQUIRED; Discriminator property for CredentialStorageProperties. - Kind *string + // REQUIRED; The kind of credential storage + Kind *CredentialStorageKind } // GetCredentialStorageProperties implements the CredentialStoragePropertiesClassification interface for type CredentialStorageProperties. @@ -207,8 +212,8 @@ type ErrorResponse struct { // InternalCredentialStorageProperties - Internal credential storage properties type InternalCredentialStorageProperties struct { - // REQUIRED; Discriminator property for CredentialStorageProperties. - Kind *string + // REQUIRED; The kind of credential storage + Kind *CredentialStorageKind // READ-ONLY; The name of secret stored. SecretName *string @@ -221,7 +226,7 @@ func (i *InternalCredentialStorageProperties) GetCredentialStorageProperties() * } } -// PlaneResource - UCP PlaneResource. +// PlaneResource - The plane resource type PlaneResource struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -254,7 +259,7 @@ type PlaneResourceListResult struct { NextLink *string } -// PlaneResourceProperties - Plane properties. +// PlaneResourceProperties - The Plane properties. type PlaneResourceProperties struct { // REQUIRED; The kind of plane Kind *PlaneKind @@ -265,10 +270,16 @@ type PlaneResourceProperties struct { // URL to forward requests to for non UCP Native Plane URL *string - // READ-ONLY; Provisioning state of the resource at the time the operation was called + // READ-ONLY; The status of the asynchronous operation. ProvisioningState *ProvisioningState } +// PlaneResourceTagsUpdate - The type used for updating tags in PlaneResource resources. +type PlaneResourceTagsUpdate struct { + // Resource tags. + Tags map[string]*string +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -284,13 +295,19 @@ type Resource struct { Type *string } -// ResourceGroupResource - UCP ResourceGroup. +// ResourceGroupProperties - The resource group resource properties +type ResourceGroupProperties struct { + // READ-ONLY; The status of the asynchronous operation. + ProvisioningState *ProvisioningState +} + +// ResourceGroupResource - The resource group resource type ResourceGroupResource struct { // REQUIRED; The geo-location where the resource lives Location *string // The resource-specific properties for this resource. - Properties *BasicResourceProperties + Properties *ResourceGroupProperties // Resource tags. Tags map[string]*string @@ -317,6 +334,12 @@ type ResourceGroupResourceListResult struct { NextLink *string } +// ResourceGroupResourceTagsUpdate - The type used for updating tags in ResourceGroupResource resources. +type ResourceGroupResourceTagsUpdate struct { + // Resource tags. + Tags map[string]*string +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go index d1e4245b92..8709f69fad 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go @@ -14,19 +14,19 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type AWSAccessKeyCredentialProperties. -func (a AWSAccessKeyCredentialProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsAccessKeyCredentialProperties. +func (a AwsAccessKeyCredentialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accessKeyId", a.AccessKeyID) - objectMap["kind"] = "AccessKey" + objectMap["kind"] = AWSCredentialKindAccessKey populate(objectMap, "provisioningState", a.ProvisioningState) populate(objectMap, "secretAccessKey", a.SecretAccessKey) populate(objectMap, "storage", a.Storage) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AWSAccessKeyCredentialProperties. -func (a *AWSAccessKeyCredentialProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsAccessKeyCredentialProperties. +func (a *AwsAccessKeyCredentialProperties) 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) @@ -57,16 +57,16 @@ func (a *AWSAccessKeyCredentialProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AWSCredentialProperties. -func (a AWSCredentialProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsCredentialProperties. +func (a AwsCredentialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["kind"] = a.Kind populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AWSCredentialProperties. -func (a *AWSCredentialProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCredentialProperties. +func (a *AwsCredentialProperties) 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) @@ -88,8 +88,8 @@ func (a *AWSCredentialProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AWSCredentialResource. -func (a AWSCredentialResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsCredentialResource. +func (a AwsCredentialResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) @@ -101,8 +101,8 @@ func (a AWSCredentialResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AWSCredentialResource. -func (a *AWSCredentialResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCredentialResource. +func (a *AwsCredentialResource) 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) @@ -120,7 +120,7 @@ func (a *AWSCredentialResource) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - a.Properties, err = unmarshalAWSCredentialPropertiesClassification(val) + a.Properties, err = unmarshalAwsCredentialPropertiesClassification(val) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) @@ -139,16 +139,16 @@ func (a *AWSCredentialResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AWSCredentialResourceListResult. -func (a AWSCredentialResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsCredentialResourceListResult. +func (a AwsCredentialResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AWSCredentialResourceListResult. -func (a *AWSCredentialResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCredentialResourceListResult. +func (a *AwsCredentialResourceListResult) 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) @@ -170,6 +170,33 @@ func (a *AWSCredentialResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AwsCredentialResourceTagsUpdate. +func (a AwsCredentialResourceTagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCredentialResourceTagsUpdate. +func (a *AwsCredentialResourceTagsUpdate) 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 "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 AzureCredentialProperties. func (a AzureCredentialProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -283,12 +310,39 @@ func (a *AzureCredentialResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureCredentialResourceTagsUpdate. +func (a AzureCredentialResourceTagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCredentialResourceTagsUpdate. +func (a *AzureCredentialResourceTagsUpdate) 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 "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 AzureServicePrincipalProperties. func (a AzureServicePrincipalProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientId", a.ClientID) populate(objectMap, "clientSecret", a.ClientSecret) - objectMap["kind"] = "ServicePrincipal" + objectMap["kind"] = AzureCredentialKindServicePrincipal populate(objectMap, "provisioningState", a.ProvisioningState) populate(objectMap, "storage", a.Storage) populate(objectMap, "tenantId", a.TenantID) @@ -330,33 +384,6 @@ func (a *AzureServicePrincipalProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BasicResourceProperties. -func (b BasicResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", b.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BasicResourceProperties. -func (b *BasicResourceProperties) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type CredentialStorageProperties. func (c CredentialStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -488,7 +515,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InternalCredentialStorageProperties. func (i InternalCredentialStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["kind"] = "Internal" + objectMap["kind"] = CredentialStorageKindInternal populate(objectMap, "secretName", i.SecretName) return json.Marshal(objectMap) } @@ -637,6 +664,33 @@ func (p *PlaneResourceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PlaneResourceTagsUpdate. +func (p PlaneResourceTagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlaneResourceTagsUpdate. +func (p *PlaneResourceTagsUpdate) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -676,6 +730,33 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceGroupProperties. +func (r ResourceGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupProperties. +func (r *ResourceGroupProperties) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceGroupResource. func (r ResourceGroupResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -758,6 +839,33 @@ func (r *ResourceGroupResourceListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceGroupResourceTagsUpdate. +func (r ResourceGroupResourceTagsUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", r.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGroupResourceTagsUpdate. +func (r *ResourceGroupResourceTagsUpdate) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go index 0c01e6deaa..4803307634 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go @@ -7,62 +7,74 @@ package v20220901privatepreview -// AwsCredentialClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialClient.CreateOrUpdate method. -type AwsCredentialClientCreateOrUpdateOptions struct { +// AwsCredentialsClientCreateOrUpdateOptions contains the optional parameters for the AwsCredentialsClient.CreateOrUpdate +// method. +type AwsCredentialsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// AwsCredentialClientDeleteOptions contains the optional parameters for the AwsCredentialClient.Delete method. -type AwsCredentialClientDeleteOptions struct { +// AwsCredentialsClientDeleteOptions contains the optional parameters for the AwsCredentialsClient.Delete method. +type AwsCredentialsClientDeleteOptions struct { // placeholder for future optional parameters } -// AwsCredentialClientGetOptions contains the optional parameters for the AwsCredentialClient.Get method. -type AwsCredentialClientGetOptions struct { +// AwsCredentialsClientGetOptions contains the optional parameters for the AwsCredentialsClient.Get method. +type AwsCredentialsClientGetOptions struct { // placeholder for future optional parameters } -// AwsCredentialClientListByRootScopeOptions contains the optional parameters for the AwsCredentialClient.NewListByRootScopePager -// method. -type AwsCredentialClientListByRootScopeOptions struct { +// AwsCredentialsClientListOptions contains the optional parameters for the AwsCredentialsClient.NewListPager method. +type AwsCredentialsClientListOptions struct { // placeholder for future optional parameters } -// AzureCredentialClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialClient.CreateOrUpdate -// method. -type AzureCredentialClientCreateOrUpdateOptions struct { +// AwsCredentialsClientUpdateOptions contains the optional parameters for the AwsCredentialsClient.Update method. +type AwsCredentialsClientUpdateOptions struct { // placeholder for future optional parameters } -// AzureCredentialClientDeleteOptions contains the optional parameters for the AzureCredentialClient.Delete method. -type AzureCredentialClientDeleteOptions struct { +// AzureCredentialsClientCreateOrUpdateOptions contains the optional parameters for the AzureCredentialsClient.CreateOrUpdate +// method. +type AzureCredentialsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// AzureCredentialClientGetOptions contains the optional parameters for the AzureCredentialClient.Get method. -type AzureCredentialClientGetOptions struct { +// AzureCredentialsClientDeleteOptions contains the optional parameters for the AzureCredentialsClient.Delete method. +type AzureCredentialsClientDeleteOptions struct { // placeholder for future optional parameters } -// AzureCredentialClientListByRootScopeOptions contains the optional parameters for the AzureCredentialClient.NewListByRootScopePager -// method. -type AzureCredentialClientListByRootScopeOptions struct { +// AzureCredentialsClientGetOptions contains the optional parameters for the AzureCredentialsClient.Get method. +type AzureCredentialsClientGetOptions struct { // placeholder for future optional parameters } -// PlaneTypesClientGetOptions contains the optional parameters for the PlaneTypesClient.Get method. -type PlaneTypesClientGetOptions struct { +// AzureCredentialsClientListOptions contains the optional parameters for the AzureCredentialsClient.NewListPager method. +type AzureCredentialsClientListOptions struct { // placeholder for future optional parameters } -// PlanesClientCreateOrUpdateOptions contains the optional parameters for the PlanesClient.CreateOrUpdate method. -type PlanesClientCreateOrUpdateOptions struct { +// AzureCredentialsClientUpdateOptions contains the optional parameters for the AzureCredentialsClient.Update method. +type AzureCredentialsClientUpdateOptions struct { // placeholder for future optional parameters } -// PlanesClientDeleteOptions contains the optional parameters for the PlanesClient.Delete method. -type PlanesClientDeleteOptions struct { - // placeholder for future optional parameters +// PlanesClientBeginCreateOrUpdateOptions contains the optional parameters for the PlanesClient.BeginCreateOrUpdate method. +type PlanesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PlanesClientBeginDeleteOptions contains the optional parameters for the PlanesClient.BeginDelete method. +type PlanesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PlanesClientBeginUpdateOptions contains the optional parameters for the PlanesClient.BeginUpdate method. +type PlanesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // PlanesClientGetOptions contains the optional parameters for the PlanesClient.Get method. @@ -70,8 +82,13 @@ type PlanesClientGetOptions struct { // placeholder for future optional parameters } -// PlanesClientListByRootScopeOptions contains the optional parameters for the PlanesClient.NewListByRootScopePager method. -type PlanesClientListByRootScopeOptions struct { +// PlanesClientListByTypeOptions contains the optional parameters for the PlanesClient.NewListByTypePager method. +type PlanesClientListByTypeOptions struct { + // placeholder for future optional parameters +} + +// PlanesClientListPlanesOptions contains the optional parameters for the PlanesClient.NewListPlanesPager method. +type PlanesClientListPlanesOptions struct { // placeholder for future optional parameters } @@ -91,9 +108,13 @@ type ResourceGroupsClientGetOptions struct { // placeholder for future optional parameters } -// ResourceGroupsClientListByRootScopeOptions contains the optional parameters for the ResourceGroupsClient.NewListByRootScopePager -// method. -type ResourceGroupsClientListByRootScopeOptions struct { +// ResourceGroupsClientListOptions contains the optional parameters for the ResourceGroupsClient.NewListPager method. +type ResourceGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// ResourceGroupsClientUpdateOptions contains the optional parameters for the ResourceGroupsClient.Update method. +type ResourceGroupsClientUpdateOptions struct { // placeholder for future optional parameters } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go index b45b537b29..24588b12a3 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_planes_client.go @@ -16,7 +16,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -40,34 +39,53 @@ func NewPlanesClient(credential azcore.TokenCredential, options *arm.ClientOptio return client, nil } -// CreateOrUpdate - Creates or updates a PlaneResource +// BeginCreateOrUpdate - Create or update a plane // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-09-01-privatepreview // - planeType - The plane type. // - planeName - The name of the plane // - resource - Resource create parameters. -// - options - PlanesClientCreateOrUpdateOptions contains the optional parameters for the PlanesClient.CreateOrUpdate method. -func (client *PlanesClient) CreateOrUpdate(ctx context.Context, planeType string, planeName string, resource PlaneResource, options *PlanesClientCreateOrUpdateOptions) (PlanesClientCreateOrUpdateResponse, error) { +// - options - PlanesClientBeginCreateOrUpdateOptions contains the optional parameters for the PlanesClient.BeginCreateOrUpdate +// method. +func (client *PlanesClient) BeginCreateOrUpdate(ctx context.Context, planeType string, planeName string, resource PlaneResource, options *PlanesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PlanesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, planeType, planeName, resource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PlanesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[PlanesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update a plane +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +func (client *PlanesClient) createOrUpdate(ctx context.Context, planeType string, planeName string, resource PlaneResource, options *PlanesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error req, err := client.createOrUpdateCreateRequest(ctx, planeType, planeName, resource, options) if err != nil { - return PlanesClientCreateOrUpdateResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return PlanesClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) - return PlanesClientCreateOrUpdateResponse{}, err + return nil, err } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *PlanesClient) createOrUpdateCreateRequest(ctx context.Context, planeType string, planeName string, resource PlaneResource, options *PlanesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *PlanesClient) createOrUpdateCreateRequest(ctx context.Context, planeType string, planeName string, resource PlaneResource, options *PlanesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/planes/{planeType}/{planeName}" if planeType == "" { return nil, errors.New("parameter planeType cannot be empty") @@ -88,50 +106,51 @@ func (client *PlanesClient) createOrUpdateCreateRequest(ctx context.Context, pla return req, nil } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *PlanesClient) createOrUpdateHandleResponse(resp *http.Response) (PlanesClientCreateOrUpdateResponse, error) { - result := PlanesClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) +// BeginDelete - Delete a plane +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeType - The plane type. +// - planeName - The name of the plane +// - options - PlanesClientBeginDeleteOptions contains the optional parameters for the PlanesClient.BeginDelete method. +func (client *PlanesClient) BeginDelete(ctx context.Context, planeType string, planeName string, options *PlanesClientBeginDeleteOptions) (*runtime.Poller[PlanesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, planeType, planeName, options) if err != nil { - return PlanesClientCreateOrUpdateResponse{}, err + return nil, err } - result.RetryAfter = &retryAfter - } - if err := runtime.UnmarshalAsJSON(resp, &result.PlaneResource); err != nil { - return PlanesClientCreateOrUpdateResponse{}, err + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PlanesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[PlanesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } - return result, nil } -// Delete - Deletes an existing PlaneResource +// Delete - Delete a plane // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-09-01-privatepreview -// - planeType - The plane type. -// - planeName - The name of the plane -// - options - PlanesClientDeleteOptions contains the optional parameters for the PlanesClient.Delete method. -func (client *PlanesClient) Delete(ctx context.Context, planeType string, planeName string, options *PlanesClientDeleteOptions) (PlanesClientDeleteResponse, error) { +func (client *PlanesClient) deleteOperation(ctx context.Context, planeType string, planeName string, options *PlanesClientBeginDeleteOptions) (*http.Response, error) { var err error req, err := client.deleteCreateRequest(ctx, planeType, planeName, options) if err != nil { - return PlanesClientDeleteResponse{}, err + return nil, err } httpResp, err := client.internal.Pipeline().Do(req) if err != nil { - return PlanesClientDeleteResponse{}, err + return nil, err } if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) - return PlanesClientDeleteResponse{}, err + return nil, err } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err + return httpResp, nil } // deleteCreateRequest creates the Delete request. -func (client *PlanesClient) deleteCreateRequest(ctx context.Context, planeType string, planeName string, options *PlanesClientDeleteOptions) (*policy.Request, error) { +func (client *PlanesClient) deleteCreateRequest(ctx context.Context, planeType string, planeName string, options *PlanesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/planes/{planeType}/{planeName}" if planeType == "" { return nil, errors.New("parameter planeType cannot be empty") @@ -149,21 +168,7 @@ func (client *PlanesClient) deleteCreateRequest(ctx context.Context, planeType s return req, nil } -// deleteHandleResponse handles the Delete response. -func (client *PlanesClient) deleteHandleResponse(resp *http.Response) (PlanesClientDeleteResponse, error) { - result := PlanesClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return PlanesClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a PlaneResource +// Get - Get a plane by name // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-09-01-privatepreview @@ -216,41 +221,100 @@ func (client *PlanesClient) getHandleResponse(resp *http.Response) (PlanesClient return result, nil } -// NewListByRootScopePager - Lists information about all PlaneResources in the given plane +// NewListByTypePager - List planes by type // // Generated from API version 2022-09-01-privatepreview -// - options - PlanesClientListByRootScopeOptions contains the optional parameters for the PlanesClient.NewListByRootScopePager -// method. -func (client *PlanesClient) NewListByRootScopePager(options *PlanesClientListByRootScopeOptions) (*runtime.Pager[PlanesClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[PlanesClientListByRootScopeResponse]{ - More: func(page PlanesClientListByRootScopeResponse) bool { +// - planeType - The plane type. +// - options - PlanesClientListByTypeOptions contains the optional parameters for the PlanesClient.NewListByTypePager method. +func (client *PlanesClient) NewListByTypePager(planeType string, options *PlanesClientListByTypeOptions) (*runtime.Pager[PlanesClientListByTypeResponse]) { + return runtime.NewPager(runtime.PagingHandler[PlanesClientListByTypeResponse]{ + More: func(page PlanesClientListByTypeResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PlanesClientListByTypeResponse) (PlanesClientListByTypeResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByTypeCreateRequest(ctx, planeType, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PlanesClientListByTypeResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PlanesClientListByTypeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PlanesClientListByTypeResponse{}, runtime.NewResponseError(resp) + } + return client.listByTypeHandleResponse(resp) + }, + }) +} + +// listByTypeCreateRequest creates the ListByType request. +func (client *PlanesClient) listByTypeCreateRequest(ctx context.Context, planeType string, options *PlanesClientListByTypeOptions) (*policy.Request, error) { + urlPath := "/planes/{planeType}" + if planeType == "" { + return nil, errors.New("parameter planeType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByTypeHandleResponse handles the ListByType response. +func (client *PlanesClient) listByTypeHandleResponse(resp *http.Response) (PlanesClientListByTypeResponse, error) { + result := PlanesClientListByTypeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PlaneResourceListResult); err != nil { + return PlanesClientListByTypeResponse{}, err + } + return result, nil +} + +// NewListPlanesPager - List all planes +// +// Generated from API version 2022-09-01-privatepreview +// - options - PlanesClientListPlanesOptions contains the optional parameters for the PlanesClient.NewListPlanesPager method. +func (client *PlanesClient) NewListPlanesPager(options *PlanesClientListPlanesOptions) (*runtime.Pager[PlanesClientListPlanesResponse]) { + return runtime.NewPager(runtime.PagingHandler[PlanesClientListPlanesResponse]{ + More: func(page PlanesClientListPlanesResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *PlanesClientListByRootScopeResponse) (PlanesClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *PlanesClientListPlanesResponse) (PlanesClientListPlanesResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, options) + req, err = client.listPlanesCreateRequest(ctx, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return PlanesClientListByRootScopeResponse{}, err + return PlanesClientListPlanesResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return PlanesClientListByRootScopeResponse{}, err + return PlanesClientListPlanesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return PlanesClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return PlanesClientListPlanesResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listPlanesHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *PlanesClient) listByRootScopeCreateRequest(ctx context.Context, options *PlanesClientListByRootScopeOptions) (*policy.Request, error) { +// listPlanesCreateRequest creates the ListPlanes request. +func (client *PlanesClient) listPlanesCreateRequest(ctx context.Context, options *PlanesClientListPlanesOptions) (*policy.Request, error) { urlPath := "/planes" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -263,12 +327,78 @@ func (client *PlanesClient) listByRootScopeCreateRequest(ctx context.Context, op return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *PlanesClient) listByRootScopeHandleResponse(resp *http.Response) (PlanesClientListByRootScopeResponse, error) { - result := PlanesClientListByRootScopeResponse{} +// listPlanesHandleResponse handles the ListPlanes response. +func (client *PlanesClient) listPlanesHandleResponse(resp *http.Response) (PlanesClientListPlanesResponse, error) { + result := PlanesClientListPlanesResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PlaneResourceListResult); err != nil { - return PlanesClientListByRootScopeResponse{}, err + return PlanesClientListPlanesResponse{}, err } return result, nil } +// BeginUpdate - Update a plane +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeType - The plane type. +// - planeName - The name of the plane +// - properties - The resource properties to be updated. +// - options - PlanesClientBeginUpdateOptions contains the optional parameters for the PlanesClient.BeginUpdate method. +func (client *PlanesClient) BeginUpdate(ctx context.Context, planeType string, planeName string, properties PlaneResourceTagsUpdate, options *PlanesClientBeginUpdateOptions) (*runtime.Poller[PlanesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, planeType, planeName, properties, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PlanesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[PlanesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Update a plane +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +func (client *PlanesClient) update(ctx context.Context, planeType string, planeName string, properties PlaneResourceTagsUpdate, options *PlanesClientBeginUpdateOptions) (*http.Response, error) { + var err error + req, err := client.updateCreateRequest(ctx, planeType, planeName, properties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PlanesClient) updateCreateRequest(ctx context.Context, planeType string, planeName string, properties PlaneResourceTagsUpdate, options *PlanesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/planes/{planeType}/{planeName}" + if planeType == "" { + return nil, errors.New("parameter planeType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go deleted file mode 100644 index 7e21bebaba..0000000000 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_planetypes_client.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220901privatepreview - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// PlaneTypesClient contains the methods for the PlaneTypes group. -// Don't use this type directly, use NewPlaneTypesClient() instead. -type PlaneTypesClient struct { - internal *arm.Client -} - -// NewPlaneTypesClient creates a new instance of PlaneTypesClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewPlaneTypesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PlaneTypesClient, error) { - cl, err := arm.NewClient(moduleName+".PlaneTypesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &PlaneTypesClient{ - internal: cl, - } - return client, nil -} - -// Get - Retrieves information about a PlaneResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-09-01-privatepreview -// - planeType - The plane type. -// - options - PlaneTypesClientGetOptions contains the optional parameters for the PlaneTypesClient.Get method. -func (client *PlaneTypesClient) Get(ctx context.Context, planeType string, options *PlaneTypesClientGetOptions) (PlaneTypesClientGetResponse, error) { - var err error - req, err := client.getCreateRequest(ctx, planeType, options) - if err != nil { - return PlaneTypesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return PlaneTypesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return PlaneTypesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *PlaneTypesClient) getCreateRequest(ctx context.Context, planeType string, options *PlaneTypesClientGetOptions) (*policy.Request, error) { - urlPath := "/planes/{planeType}" - if planeType == "" { - return nil, errors.New("parameter planeType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-09-01-privatepreview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *PlaneTypesClient) getHandleResponse(resp *http.Response) (PlaneTypesClientGetResponse, error) { - result := PlaneTypesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PlaneResource); err != nil { - return PlaneTypesClientGetResponse{}, err - } - return result, nil -} - diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go index 2927839360..60dcc7c4fc 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_polymorphic_helpers.go @@ -9,7 +9,7 @@ package v20220901privatepreview import "encoding/json" -func unmarshalAWSCredentialPropertiesClassification(rawMsg json.RawMessage) (AWSCredentialPropertiesClassification, error) { +func unmarshalAwsCredentialPropertiesClassification(rawMsg json.RawMessage) (AwsCredentialPropertiesClassification, error) { if rawMsg == nil { return nil, nil } @@ -17,12 +17,12 @@ func unmarshalAWSCredentialPropertiesClassification(rawMsg json.RawMessage) (AWS if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } - var b AWSCredentialPropertiesClassification + var b AwsCredentialPropertiesClassification switch m["kind"] { - case "AccessKey": - b = &AWSAccessKeyCredentialProperties{} + case string(AWSCredentialKindAccessKey): + b = &AwsAccessKeyCredentialProperties{} default: - b = &AWSCredentialProperties{} + b = &AwsCredentialProperties{} } if err := json.Unmarshal(rawMsg, b); err != nil { return nil, err @@ -40,7 +40,7 @@ func unmarshalAzureCredentialPropertiesClassification(rawMsg json.RawMessage) (A } var b AzureCredentialPropertiesClassification switch m["kind"] { - case "ServicePrincipal": + case string(AzureCredentialKindServicePrincipal): b = &AzureServicePrincipalProperties{} default: b = &AzureCredentialProperties{} @@ -61,7 +61,7 @@ func unmarshalCredentialStoragePropertiesClassification(rawMsg json.RawMessage) } var b CredentialStoragePropertiesClassification switch m["kind"] { - case "Internal": + case string(CredentialStorageKindInternal): b = &InternalCredentialStorageProperties{} default: b = &CredentialStorageProperties{} diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go index 5e6065b8c8..f4bb8885b4 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_resourcegroups_client.go @@ -16,7 +16,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" - "strconv" "strings" ) @@ -40,13 +39,13 @@ func NewResourceGroupsClient(credential azcore.TokenCredential, options *arm.Cli return client, nil } -// CreateOrUpdate - Creates or updates a ResourceGroupResource +// CreateOrUpdate - Create or update a resource group // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-09-01-privatepreview // - planeType - The plane type. // - planeName - The name of the plane -// - resourceGroupName - UCP resourcegroup name +// - resourceGroupName - The name of resource group // - resource - Resource create parameters. // - options - ResourceGroupsClientCreateOrUpdateOptions contains the optional parameters for the ResourceGroupsClient.CreateOrUpdate // method. @@ -97,27 +96,19 @@ func (client *ResourceGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ResourceGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ResourceGroupsClientCreateOrUpdateResponse, error) { result := ResourceGroupsClientCreateOrUpdateResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return ResourceGroupsClientCreateOrUpdateResponse{}, err - } - result.RetryAfter = &retryAfter - } if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroupResource); err != nil { return ResourceGroupsClientCreateOrUpdateResponse{}, err } return result, nil } -// Delete - Deletes an existing ResourceGroupResource +// Delete - Delete a resource group // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-09-01-privatepreview // - planeType - The plane type. // - planeName - The name of the plane -// - resourceGroupName - UCP resourcegroup name +// - resourceGroupName - The name of resource group // - options - ResourceGroupsClientDeleteOptions contains the optional parameters for the ResourceGroupsClient.Delete method. func (client *ResourceGroupsClient) Delete(ctx context.Context, planeType string, planeName string, resourceGroupName string, options *ResourceGroupsClientDeleteOptions) (ResourceGroupsClientDeleteResponse, error) { var err error @@ -129,12 +120,11 @@ func (client *ResourceGroupsClient) Delete(ctx context.Context, planeType string if err != nil { return ResourceGroupsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { err = runtime.NewResponseError(httpResp) return ResourceGroupsClientDeleteResponse{}, err } - resp, err := client.deleteHandleResponse(httpResp) - return resp, err + return ResourceGroupsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -160,27 +150,13 @@ func (client *ResourceGroupsClient) deleteCreateRequest(ctx context.Context, pla return req, nil } -// deleteHandleResponse handles the Delete response. -func (client *ResourceGroupsClient) deleteHandleResponse(resp *http.Response) (ResourceGroupsClientDeleteResponse, error) { - result := ResourceGroupsClientDeleteResponse{} - if val := resp.Header.Get("Retry-After"); val != "" { - retryAfter32, err := strconv.ParseInt(val, 10, 32) - retryAfter := int32(retryAfter32) - if err != nil { - return ResourceGroupsClientDeleteResponse{}, err - } - result.RetryAfter = &retryAfter - } - return result, nil -} - -// Get - Retrieves information about a ResourceGroupResource +// Get - Get a resource group // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-09-01-privatepreview // - planeType - The plane type. // - planeName - The name of the plane -// - resourceGroupName - UCP resourcegroup name +// - resourceGroupName - The name of resource group // - options - ResourceGroupsClientGetOptions contains the optional parameters for the ResourceGroupsClient.Get method. func (client *ResourceGroupsClient) Get(ctx context.Context, planeType string, planeName string, resourceGroupName string, options *ResourceGroupsClientGetOptions) (ResourceGroupsClientGetResponse, error) { var err error @@ -232,43 +208,42 @@ func (client *ResourceGroupsClient) getHandleResponse(resp *http.Response) (Reso return result, nil } -// NewListByRootScopePager - Lists information about all ResourceGroupResource +// NewListPager - List resource groups // // Generated from API version 2022-09-01-privatepreview // - planeType - The plane type. // - planeName - The name of the plane -// - options - ResourceGroupsClientListByRootScopeOptions contains the optional parameters for the ResourceGroupsClient.NewListByRootScopePager -// method. -func (client *ResourceGroupsClient) NewListByRootScopePager(planeType string, planeName string, options *ResourceGroupsClientListByRootScopeOptions) (*runtime.Pager[ResourceGroupsClientListByRootScopeResponse]) { - return runtime.NewPager(runtime.PagingHandler[ResourceGroupsClientListByRootScopeResponse]{ - More: func(page ResourceGroupsClientListByRootScopeResponse) bool { +// - options - ResourceGroupsClientListOptions contains the optional parameters for the ResourceGroupsClient.NewListPager method. +func (client *ResourceGroupsClient) NewListPager(planeType string, planeName string, options *ResourceGroupsClientListOptions) (*runtime.Pager[ResourceGroupsClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[ResourceGroupsClientListResponse]{ + More: func(page ResourceGroupsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *ResourceGroupsClientListByRootScopeResponse) (ResourceGroupsClientListByRootScopeResponse, error) { + Fetcher: func(ctx context.Context, page *ResourceGroupsClientListResponse) (ResourceGroupsClientListResponse, error) { var req *policy.Request var err error if page == nil { - req, err = client.listByRootScopeCreateRequest(ctx, planeType, planeName, options) + req, err = client.listCreateRequest(ctx, planeType, planeName, options) } else { req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) } if err != nil { - return ResourceGroupsClientListByRootScopeResponse{}, err + return ResourceGroupsClientListResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return ResourceGroupsClientListByRootScopeResponse{}, err + return ResourceGroupsClientListResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceGroupsClientListByRootScopeResponse{}, runtime.NewResponseError(resp) + return ResourceGroupsClientListResponse{}, runtime.NewResponseError(resp) } - return client.listByRootScopeHandleResponse(resp) + return client.listHandleResponse(resp) }, }) } -// listByRootScopeCreateRequest creates the ListByRootScope request. -func (client *ResourceGroupsClient) listByRootScopeCreateRequest(ctx context.Context, planeType string, planeName string, options *ResourceGroupsClientListByRootScopeOptions) (*policy.Request, error) { +// listCreateRequest creates the List request. +func (client *ResourceGroupsClient) listCreateRequest(ctx context.Context, planeType string, planeName string, options *ResourceGroupsClientListOptions) (*policy.Request, error) { urlPath := "/planes/{planeType}/{planeName}/resourcegroups" if planeType == "" { return nil, errors.New("parameter planeType cannot be empty") @@ -286,11 +261,73 @@ func (client *ResourceGroupsClient) listByRootScopeCreateRequest(ctx context.Con return req, nil } -// listByRootScopeHandleResponse handles the ListByRootScope response. -func (client *ResourceGroupsClient) listByRootScopeHandleResponse(resp *http.Response) (ResourceGroupsClientListByRootScopeResponse, error) { - result := ResourceGroupsClientListByRootScopeResponse{} +// listHandleResponse handles the List response. +func (client *ResourceGroupsClient) listHandleResponse(resp *http.Response) (ResourceGroupsClientListResponse, error) { + result := ResourceGroupsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroupResourceListResult); err != nil { - return ResourceGroupsClientListByRootScopeResponse{}, err + return ResourceGroupsClientListResponse{}, err + } + return result, nil +} + +// Update - Update a resource group +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-09-01-privatepreview +// - planeType - The plane type. +// - planeName - The name of the plane +// - resourceGroupName - The name of resource group +// - properties - The resource properties to be updated. +// - options - ResourceGroupsClientUpdateOptions contains the optional parameters for the ResourceGroupsClient.Update method. +func (client *ResourceGroupsClient) Update(ctx context.Context, planeType string, planeName string, resourceGroupName string, properties ResourceGroupResourceTagsUpdate, options *ResourceGroupsClientUpdateOptions) (ResourceGroupsClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, planeType, planeName, resourceGroupName, properties, options) + if err != nil { + return ResourceGroupsClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ResourceGroupsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceGroupsClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ResourceGroupsClient) updateCreateRequest(ctx context.Context, planeType string, planeName string, resourceGroupName string, properties ResourceGroupResourceTagsUpdate, options *ResourceGroupsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/planes/{planeType}/{planeName}/resourcegroups/{resourceGroupName}" + if planeType == "" { + return nil, errors.New("parameter planeType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err +} + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ResourceGroupsClient) updateHandleResponse(resp *http.Response) (ResourceGroupsClientUpdateResponse, error) { + result := ResourceGroupsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceGroupResource); err != nil { + return ResourceGroupsClientUpdateResponse{}, err } return result, nil } diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go index 2fa1dc8547..8ff262c9ad 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go @@ -7,117 +7,125 @@ package v20220901privatepreview -// AwsCredentialClientCreateOrUpdateResponse contains the response from method AwsCredentialClient.CreateOrUpdate. -type AwsCredentialClientCreateOrUpdateResponse struct { +// AwsCredentialsClientCreateOrUpdateResponse contains the response from method AwsCredentialsClient.CreateOrUpdate. +type AwsCredentialsClientCreateOrUpdateResponse struct { // Concrete tracked resource types can be created by aliasing this type using a specific property type. - AWSCredentialResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 + AwsCredentialResource } -// AwsCredentialClientDeleteResponse contains the response from method AwsCredentialClient.Delete. -type AwsCredentialClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 +// AwsCredentialsClientDeleteResponse contains the response from method AwsCredentialsClient.Delete. +type AwsCredentialsClientDeleteResponse struct { + // placeholder for future response values } -// AwsCredentialClientGetResponse contains the response from method AwsCredentialClient.Get. -type AwsCredentialClientGetResponse struct { +// AwsCredentialsClientGetResponse contains the response from method AwsCredentialsClient.Get. +type AwsCredentialsClientGetResponse struct { // Concrete tracked resource types can be created by aliasing this type using a specific property type. - AWSCredentialResource + AwsCredentialResource } -// AwsCredentialClientListByRootScopeResponse contains the response from method AwsCredentialClient.NewListByRootScopePager. -type AwsCredentialClientListByRootScopeResponse struct { - // The response of a AWSCredentialResource list operation. - AWSCredentialResourceListResult +// AwsCredentialsClientListResponse contains the response from method AwsCredentialsClient.NewListPager. +type AwsCredentialsClientListResponse struct { + // The response of a AwsCredentialResource list operation. + AwsCredentialResourceListResult } -// AzureCredentialClientCreateOrUpdateResponse contains the response from method AzureCredentialClient.CreateOrUpdate. -type AzureCredentialClientCreateOrUpdateResponse struct { +// AwsCredentialsClientUpdateResponse contains the response from method AwsCredentialsClient.Update. +type AwsCredentialsClientUpdateResponse struct { // Concrete tracked resource types can be created by aliasing this type using a specific property type. - AzureCredentialResource + AwsCredentialResource +} - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 +// AzureCredentialsClientCreateOrUpdateResponse contains the response from method AzureCredentialsClient.CreateOrUpdate. +type AzureCredentialsClientCreateOrUpdateResponse struct { + // Represents Azure Credential Resource + AzureCredentialResource } -// AzureCredentialClientDeleteResponse contains the response from method AzureCredentialClient.Delete. -type AzureCredentialClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 +// AzureCredentialsClientDeleteResponse contains the response from method AzureCredentialsClient.Delete. +type AzureCredentialsClientDeleteResponse struct { + // placeholder for future response values } -// AzureCredentialClientGetResponse contains the response from method AzureCredentialClient.Get. -type AzureCredentialClientGetResponse struct { - // Concrete tracked resource types can be created by aliasing this type using a specific property type. +// AzureCredentialsClientGetResponse contains the response from method AzureCredentialsClient.Get. +type AzureCredentialsClientGetResponse struct { + // Represents Azure Credential Resource AzureCredentialResource } -// AzureCredentialClientListByRootScopeResponse contains the response from method AzureCredentialClient.NewListByRootScopePager. -type AzureCredentialClientListByRootScopeResponse struct { +// AzureCredentialsClientListResponse contains the response from method AzureCredentialsClient.NewListPager. +type AzureCredentialsClientListResponse struct { // The response of a AzureCredentialResource list operation. AzureCredentialResourceListResult } -// PlaneTypesClientGetResponse contains the response from method PlaneTypesClient.Get. -type PlaneTypesClientGetResponse struct { - // UCP PlaneResource. - PlaneResource +// AzureCredentialsClientUpdateResponse contains the response from method AzureCredentialsClient.Update. +type AzureCredentialsClientUpdateResponse struct { + // Represents Azure Credential Resource + AzureCredentialResource } -// PlanesClientCreateOrUpdateResponse contains the response from method PlanesClient.CreateOrUpdate. +// PlanesClientCreateOrUpdateResponse contains the response from method PlanesClient.BeginCreateOrUpdate. type PlanesClientCreateOrUpdateResponse struct { - // UCP PlaneResource. + // The plane resource PlaneResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } -// PlanesClientDeleteResponse contains the response from method PlanesClient.Delete. +// PlanesClientDeleteResponse contains the response from method PlanesClient.BeginDelete. type PlanesClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 + // placeholder for future response values } // PlanesClientGetResponse contains the response from method PlanesClient.Get. type PlanesClientGetResponse struct { - // UCP PlaneResource. + // The plane resource PlaneResource } -// PlanesClientListByRootScopeResponse contains the response from method PlanesClient.NewListByRootScopePager. -type PlanesClientListByRootScopeResponse struct { +// PlanesClientListByTypeResponse contains the response from method PlanesClient.NewListByTypePager. +type PlanesClientListByTypeResponse struct { // The response of a PlaneResource list operation. PlaneResourceListResult } +// PlanesClientListPlanesResponse contains the response from method PlanesClient.NewListPlanesPager. +type PlanesClientListPlanesResponse struct { + // The response of a PlaneResource list operation. + PlaneResourceListResult +} + +// PlanesClientUpdateResponse contains the response from method PlanesClient.BeginUpdate. +type PlanesClientUpdateResponse struct { + // The plane resource + PlaneResource +} + // ResourceGroupsClientCreateOrUpdateResponse contains the response from method ResourceGroupsClient.CreateOrUpdate. type ResourceGroupsClientCreateOrUpdateResponse struct { - // UCP ResourceGroup. + // The resource group resource ResourceGroupResource - - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 } // ResourceGroupsClientDeleteResponse contains the response from method ResourceGroupsClient.Delete. type ResourceGroupsClientDeleteResponse struct { - // RetryAfter contains the information returned from the Retry-After header response. - RetryAfter *int32 + // placeholder for future response values } // ResourceGroupsClientGetResponse contains the response from method ResourceGroupsClient.Get. type ResourceGroupsClientGetResponse struct { - // UCP ResourceGroup. + // The resource group resource ResourceGroupResource } -// ResourceGroupsClientListByRootScopeResponse contains the response from method ResourceGroupsClient.NewListByRootScopePager. -type ResourceGroupsClientListByRootScopeResponse struct { +// ResourceGroupsClientListResponse contains the response from method ResourceGroupsClient.NewListPager. +type ResourceGroupsClientListResponse struct { // The response of a ResourceGroupResource list operation. ResourceGroupResourceListResult } +// ResourceGroupsClientUpdateResponse contains the response from method ResourceGroupsClient.Update. +type ResourceGroupsClientUpdateResponse struct { + // The resource group resource + ResourceGroupResource +} + diff --git a/pkg/ucp/credentials/aws.go b/pkg/ucp/credentials/aws.go index 3c08d14737..fe7411eab0 100644 --- a/pkg/ucp/credentials/aws.go +++ b/pkg/ucp/credentials/aws.go @@ -34,13 +34,13 @@ var _ CredentialProvider[AWSCredential] = (*AWSCredentialProvider)(nil) // AWSCredentialProvider is UCP credential provider for Azure. type AWSCredentialProvider struct { secretProvider *provider.SecretProvider - client *ucpapi.AwsCredentialClient + client *ucpapi.AwsCredentialsClient } // NewAWSCredentialProvider creates a new AWSCredentialProvider struct using the given SecretProvider, UCP connection and // TokenCredential, and returns it or an error if one occurs. func NewAWSCredentialProvider(provider *provider.SecretProvider, ucpConn sdk.Connection, credential azcore.TokenCredential) (*AWSCredentialProvider, error) { - cli, err := ucpapi.NewAwsCredentialClient(credential, sdk.NewClientOptions(ucpConn)) + cli, err := ucpapi.NewAwsCredentialsClient(credential, sdk.NewClientOptions(ucpConn)) if err != nil { return nil, err } @@ -55,7 +55,7 @@ func NewAWSCredentialProvider(provider *provider.SecretProvider, ucpConn sdk.Con // Kubernetes secret store). It returns an AWSCredential struct or an error if the fetch fails. func (p *AWSCredentialProvider) Fetch(ctx context.Context, planeName, name string) (*AWSCredential, error) { // 1. Fetch the secret name of AWS IAM access keys from UCP. - cred, err := p.client.Get(ctx, planeName, name, &ucpapi.AwsCredentialClientGetOptions{}) + cred, err := p.client.Get(ctx, planeName, name, &ucpapi.AwsCredentialsClientGetOptions{}) if err != nil { return nil, err } @@ -64,7 +64,7 @@ func (p *AWSCredentialProvider) Fetch(ctx context.Context, planeName, name strin var storage *ucpapi.InternalCredentialStorageProperties switch p := cred.Properties.(type) { - case *ucpapi.AWSAccessKeyCredentialProperties: + case *ucpapi.AwsAccessKeyCredentialProperties: switch c := p.Storage.(type) { case *ucpapi.InternalCredentialStorageProperties: storage = c diff --git a/pkg/ucp/credentials/azure.go b/pkg/ucp/credentials/azure.go index a2490a274a..cba582b5d7 100644 --- a/pkg/ucp/credentials/azure.go +++ b/pkg/ucp/credentials/azure.go @@ -34,13 +34,13 @@ var _ CredentialProvider[AzureCredential] = (*AzureCredentialProvider)(nil) // AzureCredentialProvider is UCP credential provider for Azure. type AzureCredentialProvider struct { secretProvider *provider.SecretProvider - client *ucpapi.AzureCredentialClient + client *ucpapi.AzureCredentialsClient } // NewAzureCredentialProvider creates a new AzureCredentialProvider by creating a new AzureCredentialClient with the given // credential and connection, and returns an error if one occurs. func NewAzureCredentialProvider(provider *provider.SecretProvider, ucpConn sdk.Connection, credential azcore.TokenCredential) (*AzureCredentialProvider, error) { - cli, err := ucpapi.NewAzureCredentialClient(credential, sdk.NewClientOptions(ucpConn)) + cli, err := ucpapi.NewAzureCredentialsClient(credential, sdk.NewClientOptions(ucpConn)) if err != nil { return nil, err } @@ -55,7 +55,7 @@ func NewAzureCredentialProvider(provider *provider.SecretProvider, ucpConn sdk.C // Kubernetes secret store) and returns an AzureCredential struct. If an error occurs, an error is returned. func (p *AzureCredentialProvider) Fetch(ctx context.Context, planeName, name string) (*AzureCredential, error) { // 1. Fetch the secret name of Azure service principal credentials from UCP. - cred, err := p.client.Get(ctx, planeName, name, &ucpapi.AzureCredentialClientGetOptions{}) + cred, err := p.client.Get(ctx, planeName, name, &ucpapi.AzureCredentialsClientGetOptions{}) if err != nil { return nil, err } diff --git a/pkg/ucp/datamodel/converter/awscredential_converter.go b/pkg/ucp/datamodel/converter/awscredential_converter.go index 195436d6bf..ea5eec66cd 100644 --- a/pkg/ucp/datamodel/converter/awscredential_converter.go +++ b/pkg/ucp/datamodel/converter/awscredential_converter.go @@ -28,7 +28,7 @@ import ( func AWSCredentialDataModelToVersioned(model *datamodel.AWSCredential, version string) (v1.VersionedModelInterface, error) { switch version { case v20220901privatepreview.Version: - versioned := &v20220901privatepreview.AWSCredentialResource{} + versioned := &v20220901privatepreview.AwsCredentialResource{} if err := versioned.ConvertFrom(model); err != nil { return nil, err } @@ -43,7 +43,7 @@ func AWSCredentialDataModelToVersioned(model *datamodel.AWSCredential, version s func AWSCredentialDataModelFromVersioned(content []byte, version string) (*datamodel.AWSCredential, error) { switch version { case v20220901privatepreview.Version: - vm := &v20220901privatepreview.AWSCredentialResource{} + vm := &v20220901privatepreview.AwsCredentialResource{} if err := json.Unmarshal(content, vm); err != nil { return nil, err } diff --git a/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go b/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go index db47e039d2..fc4108b25c 100644 --- a/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go +++ b/pkg/ucp/frontend/controller/credentials/aws/createorupdateawscredential_test.go @@ -123,7 +123,7 @@ func Test_AWS_Credential(t *testing.T) { t.Run(tt.name, func(t *testing.T) { tt.fn(*mockStorageClient, *mockSecretClient) - credentialVersionedInput := &v20220901privatepreview.AWSCredentialResource{} + credentialVersionedInput := &v20220901privatepreview.AwsCredentialResource{} credentialInput := testutil.ReadFixture(tt.filename) err = json.Unmarshal(credentialInput, credentialVersionedInput) require.NoError(t, err) @@ -146,7 +146,7 @@ func Test_AWS_Credential(t *testing.T) { } func getAwsResponse() armrpc_rest.Response { - return armrpc_rest.NewOKResponseWithHeaders(&v20220901privatepreview.AWSCredentialResource{ + return armrpc_rest.NewOKResponseWithHeaders(&v20220901privatepreview.AwsCredentialResource{ Location: to.Ptr("West US"), ID: to.Ptr("/planes/aws/awscloud/providers/System.AWS/credentials/default"), Name: to.Ptr("default"), @@ -154,11 +154,11 @@ func getAwsResponse() armrpc_rest.Response { Tags: map[string]*string{ "env": to.Ptr("dev"), }, - Properties: &v20220901privatepreview.AWSAccessKeyCredentialProperties{ + Properties: &v20220901privatepreview.AwsAccessKeyCredentialProperties{ AccessKeyID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Kind: to.Ptr("AccessKey"), + Kind: to.Ptr(v20220901privatepreview.AWSCredentialKindAccessKey), Storage: &v20220901privatepreview.InternalCredentialStorageProperties{ - Kind: to.Ptr(string(v20220901privatepreview.CredentialStorageKindInternal)), + Kind: to.Ptr(v20220901privatepreview.CredentialStorageKindInternal), SecretName: to.Ptr("aws-awscloud-default"), }, }, diff --git a/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go b/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go index 1ee1440fd1..4785e23762 100644 --- a/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go +++ b/pkg/ucp/frontend/controller/credentials/azure/createorupdateazurecredential_test.go @@ -156,9 +156,9 @@ func getAzureCredentialResponse() armrpc_rest.Response { Properties: &v20220901privatepreview.AzureServicePrincipalProperties{ ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Kind: to.Ptr("ServicePrincipal"), + Kind: to.Ptr(v20220901privatepreview.AzureCredentialKindServicePrincipal), Storage: &v20220901privatepreview.InternalCredentialStorageProperties{ - Kind: to.Ptr(string(v20220901privatepreview.CredentialStorageKindInternal)), + Kind: to.Ptr(v20220901privatepreview.CredentialStorageKindInternal), SecretName: to.Ptr("azure-azurecloud-default"), }, }, diff --git a/pkg/ucp/integrationtests/radius/proxy_test.go b/pkg/ucp/integrationtests/radius/proxy_test.go index f24d4b704c..df4e2be573 100644 --- a/pkg/ucp/integrationtests/radius/proxy_test.go +++ b/pkg/ucp/integrationtests/radius/proxy_test.go @@ -98,7 +98,7 @@ func createRadiusPlane(ucp *testserver.TestServer, resourceProviders map[string] func createResourceGroup(ucp *testserver.TestServer, id string) { body := v20220901privatepreview.ResourceGroupResource{ Location: to.Ptr(v1.LocationGlobal), - Properties: &v20220901privatepreview.BasicResourceProperties{}, + Properties: &v20220901privatepreview.ResourceGroupProperties{}, } response := ucp.MakeTypedRequest(http.MethodPut, id+"?"+apiVersionParameter, body) response.EqualsStatusCode(http.StatusOK) diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_CreateOrUpdate.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_CreateOrUpdate.json new file mode 100644 index 0000000000..c7fef81833 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_CreateOrUpdate.json @@ -0,0 +1,53 @@ +{ + "operationId": "AwsCredentials_CreateOrUpdate", + "title": "Create or update a AWS credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "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/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialDelete.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Delete.json similarity index 74% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialDelete.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Delete.json index c60afc6aa0..30907afdbe 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialDelete.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Delete.json @@ -1,4 +1,6 @@ { + "operationId": "AwsCredentials_Delete", + "title": "Delete a AWS credential", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialGet.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Get.json similarity index 90% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialGet.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Get.json index b96132b560..1d6b3ee794 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialGet.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Get.json @@ -1,4 +1,6 @@ { + "operationId": "AwsCredentials_Get", + "title": "Get a AWS credential", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_List.json similarity index 91% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialList.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_List.json index 0ecba5c633..53baf9b1cb 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_List.json @@ -1,4 +1,6 @@ { + "operationId": "AwsCredentials_List", + "title": "List AWS credentials", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialPut.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Update.json similarity index 94% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialPut.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Update.json index 6ba724a842..f9de8aaac1 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredentialPut.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AWSCredential_Update.json @@ -1,4 +1,6 @@ { + "operationId": "AwsCredentials_Update", + "title": "Update a AWS credential", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "aws", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_CreateOrUpdate.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_CreateOrUpdate.json new file mode 100644 index 0000000000..f2aad4bdc4 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_CreateOrUpdate.json @@ -0,0 +1,57 @@ +{ + "operationId": "AzureCredentials_CreateOrUpdate", + "title": "Create or update a Azure credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "azure", + "planeName": "azurecloud", + "credentialName": "default", + "Credential": { + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "clientId": "00000000-0000-0000-0000-000000000000", + "clientSecret": "secretString", + "tenantId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal" + } + } + } + }, + "201": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal", + "secretName": "azure-azurecloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialDelete.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Delete.json similarity index 71% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialDelete.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Delete.json index a47138f890..6d034d1e3b 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialDelete.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Delete.json @@ -1,4 +1,6 @@ { + "operationId": "AzureCredentials_Delete", + "title": "Delete a Azure credential", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "azure", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialGet.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Get.json similarity index 90% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialGet.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Get.json index cff9c5853f..90eede6d4a 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialGet.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Get.json @@ -1,4 +1,6 @@ { + "operationId": "AzureCredentials_Get", + "title": "Get a Azure credential", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "azure", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_List.json similarity index 91% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialList.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_List.json index 94e104644d..4f6ab2d815 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_List.json @@ -1,4 +1,6 @@ { + "operationId": "AzureCredentials_List", + "title": "List Azure credentials", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "azure", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialPut.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Update.json similarity index 94% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialPut.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Update.json index 92779ffd52..916dff73b8 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredentialPut.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/AzureCredential_Update.json @@ -1,4 +1,6 @@ { + "operationId": "AzureCredentials_Update", + "title": "Update a Azure credential", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "azure", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_CreateOrUpdate.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_CreateOrUpdate.json new file mode 100644 index 0000000000..12de0f2d68 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_CreateOrUpdate.json @@ -0,0 +1,34 @@ +{ + "operationId": "Planes_CreateOrUpdate", + "title": "Create or update a plane", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius", + "Plane": { + "location": "global", + "properties": { + "kind": "UCPNative", + "resourceProviders": { + "Applications.Core": "http://localhost:7443" + } + } + } + }, + "responses": { + "200": { + "body": { + "location": "global", + "id": "/planes/radius/local", + "name": "local", + "type": "System.Planes/radius", + "properties": { + "kind": "UCPNative", + "resourceProviders": { + "Applications.Core": "http://localhost:7443" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesDeletePlaneLocal.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_Delete.json similarity index 73% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesDeletePlaneLocal.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_Delete.json index 44b422c728..9467f217ba 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesDeletePlaneLocal.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_Delete.json @@ -1,4 +1,6 @@ { + "operationId": "Planes_Delete", + "title": "Delete a plane", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "radius", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json similarity index 81% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json index 4968b7a07a..de4215466c 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesGetPlaneLocal.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json @@ -1,4 +1,6 @@ { + "operationId": "Planes_Get", + "title": "Get a plane", "parameters": { "api-version": "2022-09-01-privatepreview", "planeName": "local", @@ -13,7 +15,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Dapr": "http://applications-rp.radius-system:5444", + "Applications.Link": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json similarity index 83% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json index 9ca0b8af54..7a43a4d64e 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json @@ -1,4 +1,6 @@ { + "operationId": "Planes_ListPlanes", + "title": "List planes", "parameters": { "api-version": "2022-09-01-privatepreview" }, @@ -13,7 +15,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Dapr": "http://applications-rp.radius-system:5444", + "Applications.Link": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443", "Microsoft.Resources": "http://bicep-de.radius-system:6443" }, diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json similarity index 80% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json index 95df2fa484..3376f3b537 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesTypeList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json @@ -1,4 +1,6 @@ { + "operationId": "Planes_ListByType", + "title": "List planes by planeType", "parameters": { "planeType": "radius", "api-version": "2022-09-01-privatepreview" @@ -14,7 +16,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Dapr": "http://applications-rp.radius-system:5444", + "Applications.Link": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesPutPlaneLocal.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_Update.json similarity index 91% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesPutPlaneLocal.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_Update.json index 776abac3e3..08b77b42ca 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/PlanesPutPlaneLocal.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_Update.json @@ -1,4 +1,6 @@ { + "operationId": "Planes_Update", + "title": "Update a plane", "parameters": { "api-version": "2022-09-01-privatepreview", "planeName": "local", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_CreateOrUpdate.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_CreateOrUpdate.json new file mode 100644 index 0000000000..889ee27bb1 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_CreateOrUpdate.json @@ -0,0 +1,22 @@ +{ + "operationId": "ResourceGroups_CreateOrUpdate", + "title": "Create or update a resource group", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "radius", + "planeName": "local", + "resourceGroupName": "rg1", + "ResourceGroup": { + "location": "global" + } + }, + "responses": { + "200": { + "body": { + "location": "global", + "id": "/planes/radius/local/resourcegroups/rg1", + "name": "rg1" + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Delete.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Delete.json new file mode 100644 index 0000000000..df56306964 --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "ResourceGroups_Delete", + "title": "Delete a resource group", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "resourceGroupName": "rg1", + "planeType": "radius", + "planeName": "local" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsGetResourceGroupRG1.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Get.json similarity index 81% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsGetResourceGroupRG1.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Get.json index 2721aaa286..c64ec98f63 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsGetResourceGroupRG1.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Get.json @@ -1,4 +1,6 @@ { + "operationId": "ResourceGroups_Get", + "title": "Get a resource group", "parameters": { "api-version": "2022-09-01-privatepreview", "planeName": "local", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsList.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_List.json similarity index 87% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsList.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_List.json index a6e89ac3ce..3e67b7150c 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsList.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_List.json @@ -1,4 +1,6 @@ { + "operationId": "ResourceGroups_List", + "title": "List resource groups", "parameters": { "api-version": "2022-09-01-privatepreview", "planeName": "local", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsPutResourceGroupRG1.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Update.json similarity index 82% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsPutResourceGroupRG1.json rename to swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Update.json index 0bb0706a77..abcd61906a 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsPutResourceGroupRG1.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroups_Update.json @@ -1,4 +1,6 @@ { + "operationId": "ResourceGroups_Update", + "title": "Update a resource group", "parameters": { "api-version": "2022-09-01-privatepreview", "planeType": "radius", diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json index 6f7ca2f469..4960817d11 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json @@ -1,12 +1,12 @@ { "swagger": "2.0", "info": { - "title": "UCP Management APIs", + "title": "Universal Control Plane Resource Management APIs", "version": "2022-09-01-privatepreview", - "description": "REST APIs for UCP", - "x-cadl-generated": [ + "description": "REST APIs for Universal Control Plane", + "x-typespec-generated": [ { - "emitter": "@azure-tools/cadl-autorest" + "emitter": "@azure-tools/typespec-autorest" } ] }, @@ -42,27 +42,24 @@ { "name": "Planes" }, - { - "name": "PlaneTypes" - }, { "name": "ResourceGroups" }, { - "name": "AzureCredential" + "name": "AwsCredentials" }, { - "name": "AWSCredential" + "name": "AzureCredentials" } ], "paths": { "/planes": { "get": { + "operationId": "Planes_ListPlanes", "tags": [ "Planes" ], - "operationId": "Planes_ListByRootScope", - "description": "Lists information about all PlaneResources in the given plane", + "description": "List all planes", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -82,6 +79,11 @@ } } }, + "x-ms-examples": { + "List planes": { + "$ref": "./examples/Planes_List.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -89,11 +91,11 @@ }, "/planes/{planeType}": { "get": { + "operationId": "Planes_ListByType", "tags": [ - "PlaneTypes" + "Planes" ], - "operationId": "PlaneTypes_Get", - "description": "Retrieves information about a PlaneResource", + "description": "List planes by type", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -101,8 +103,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" } ], @@ -110,7 +112,7 @@ "200": { "description": "ARM operation completed successfully.", "schema": { - "$ref": "#/definitions/PlaneResource" + "$ref": "#/definitions/PlaneResourceListResult" } }, "default": { @@ -119,16 +121,24 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "List planes by planeType": { + "$ref": "./examples/Planes_ListPlanesByType.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, "/planes/{planeType}/{planeName}": { "get": { + "operationId": "Planes_Get", "tags": [ "Planes" ], - "operationId": "Planes_Get", - "description": "Retrieves information about a PlaneResource", + "description": "Get a plane by name", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -136,8 +146,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -157,14 +167,19 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a plane": { + "$ref": "./examples/Planes_GetPlaneLocal.json" + } } }, "put": { + "operationId": "Planes_CreateOrUpdate", "tags": [ "Planes" ], - "operationId": "Planes_CreateOrUpdate", - "description": "Creates or updates a PlaneResource", + "description": "Create or update a plane", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -172,8 +187,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -182,8 +197,8 @@ { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/PlaneResource" } @@ -191,38 +206,115 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'PlaneResource' update operation succeeded", "schema": { "$ref": "#/definitions/PlaneResource" } }, "201": { - "description": "ARM create operation completed successfully.", + "description": "Resource 'PlaneResource' create operation succeeded", + "schema": { + "$ref": "#/definitions/PlaneResource" + }, "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } - }, + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or update a plane": { + "$ref": "./examples/Planes_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "operationId": "Planes_Update", + "tags": [ + "Planes" + ], + "description": "Update a plane", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "planeType", + "in": "path", + "description": "The plane type.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/PlaneNameParameter" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/PlaneResourceTagsUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", "schema": { "$ref": "#/definitions/PlaneResource" } }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "type": "integer", + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." + } + } + }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Update a plane": { + "$ref": "./examples/Planes_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true }, "delete": { + "operationId": "Planes_Delete", "tags": [ "Planes" ], - "operationId": "Planes_Delete", - "description": "Deletes an existing PlaneResource", + "description": "Delete a plane", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -230,8 +322,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -246,9 +338,13 @@ "description": "Resource deletion accepted.", "headers": { "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", "type": "integer", - "format": "int32" + "format": "int32", + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." + }, + "Location": { + "type": "string", + "description": "The Location header contains the URL where the status of the long running operation can be checked." } } }, @@ -261,16 +357,25 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } - } + }, + "x-ms-examples": { + "Delete a plane": { + "$ref": "./examples/Planes_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true } }, "/planes/{planeType}/{planeName}/resourcegroups": { "get": { + "operationId": "ResourceGroups_List", "tags": [ "ResourceGroups" ], - "operationId": "ResourceGroups_ListByRootScope", - "description": "Lists information about all ResourceGroupResource", + "description": "List resource groups", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -278,8 +383,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -300,6 +405,11 @@ } } }, + "x-ms-examples": { + "List resource groups": { + "$ref": "./examples/ResourceGroups_List.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -307,11 +417,11 @@ }, "/planes/{planeType}/{planeName}/resourcegroups/{resourceGroupName}": { "get": { + "operationId": "ResourceGroups_Get", "tags": [ "ResourceGroups" ], - "operationId": "ResourceGroups_Get", - "description": "Retrieves information about a ResourceGroupResource", + "description": "Get a resource group", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -319,8 +429,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -329,12 +439,11 @@ { "name": "resourceGroupName", "in": "path", + "description": "The name of resource group", "required": true, - "description": "UCP resourcegroup name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -350,14 +459,19 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a resource group": { + "$ref": "./examples/ResourceGroups_Get.json" + } } }, "put": { + "operationId": "ResourceGroups_CreateOrUpdate", "tags": [ "ResourceGroups" ], - "operationId": "ResourceGroups_CreateOrUpdate", - "description": "Creates or updates a ResourceGroupResource", + "description": "Create or update a resource group", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -365,8 +479,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -375,18 +489,17 @@ { "name": "resourceGroupName", "in": "path", + "description": "The name of resource group", "required": true, - "description": "UCP resourcegroup name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/ResourceGroupResource" } @@ -394,20 +507,13 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'ResourceGroupResource' update operation succeeded", "schema": { "$ref": "#/definitions/ResourceGroupResource" } }, "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, + "description": "Resource 'ResourceGroupResource' create operation succeeded", "schema": { "$ref": "#/definitions/ResourceGroupResource" } @@ -418,14 +524,19 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Create or update a resource group": { + "$ref": "./examples/ResourceGroups_CreateOrUpdate.json" + } } }, - "delete": { + "patch": { + "operationId": "ResourceGroups_Update", "tags": [ "ResourceGroups" ], - "operationId": "ResourceGroups_Delete", - "description": "Deletes an existing ResourceGroupResource", + "description": "Update a resource group", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -433,8 +544,8 @@ { "name": "planeType", "in": "path", - "required": true, "description": "The plane type.", + "required": true, "type": "string" }, { @@ -443,27 +554,75 @@ { "name": "resourceGroupName", "in": "path", + "description": "The name of resource group", "required": true, - "description": "UCP resourcegroup name", - "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", + "type": "string", "maxLength": 63, - "x-ms-parameter-location": "method", - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/ResourceGroupResourceTagsUpdate" + } } ], "responses": { "200": { - "description": "Resource deleted successfully." + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/ResourceGroupResource" + } }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Update a resource group": { + "$ref": "./examples/ResourceGroups_Update.json" + } + } + }, + "delete": { + "operationId": "ResourceGroups_Delete", + "tags": [ + "ResourceGroups" + ], + "description": "Delete a resource group", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "planeType", + "in": "path", + "description": "The plane type.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/PlaneNameParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "description": "The name of resource group", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." }, "204": { "description": "Resource deleted successfully." @@ -474,29 +633,34 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Delete a resource group": { + "$ref": "./examples/ResourceGroups_Delete.json" + } } } }, "/planes/aws/{planeName}/providers/System.AWS/credentials": { "get": { + "operationId": "AwsCredentials_List", "tags": [ - "AWSCredential" + "AwsCredentials" ], - "operationId": "AwsCredential_ListByRootScope", - "description": "Lists information about all AWSCredentialResource", + "description": "List AWS credentials", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/AWSPlaneNameParameter" + "$ref": "#/parameters/AwsPlaneNameParameter" } ], "responses": { "200": { "description": "ARM operation completed successfully.", "schema": { - "$ref": "#/definitions/AWSCredentialResourceListResult" + "$ref": "#/definitions/AwsCredentialResourceListResult" } }, "default": { @@ -506,6 +670,11 @@ } } }, + "x-ms-examples": { + "List AWS credentials": { + "$ref": "./examples/AWSCredential_List.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -513,33 +682,33 @@ }, "/planes/aws/{planeName}/providers/System.AWS/credentials/{credentialName}": { "get": { + "operationId": "AwsCredentials_Get", "tags": [ - "AWSCredential" + "AwsCredentials" ], - "operationId": "AwsCredential_Get", - "description": "Retrieves information about a AWSCredentialResource", + "description": "Get an AWS credential", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/AWSPlaneNameParameter" + "$ref": "#/parameters/AwsPlaneNameParameter" }, { "name": "credentialName", "in": "path", - "required": true, "description": "The AWS credential name.", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { "200": { "description": "ARM operation completed successfully.", "schema": { - "$ref": "#/definitions/AWSCredentialResource" + "$ref": "#/definitions/AwsCredentialResource" } }, "default": { @@ -548,58 +717,56 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a AWS credential": { + "$ref": "./examples/AWSCredential_Get.json" + } } }, "put": { + "operationId": "AwsCredentials_CreateOrUpdate", "tags": [ - "AWSCredential" + "AwsCredentials" ], - "operationId": "AwsCredential_CreateOrUpdate", - "description": "Creates or updates a AWSCredentialResource", + "description": "Create or update an AWS credential", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/AWSPlaneNameParameter" + "$ref": "#/parameters/AwsPlaneNameParameter" }, { "name": "credentialName", "in": "path", - "required": true, "description": "The AWS credential name.", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { - "$ref": "#/definitions/AWSCredentialResource" + "$ref": "#/definitions/AwsCredentialResource" } } ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'AwsCredentialResource' update operation succeeded", "schema": { - "$ref": "#/definitions/AWSCredentialResource" + "$ref": "#/definitions/AwsCredentialResource" } }, "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, + "description": "Resource 'AwsCredentialResource' create operation succeeded", "schema": { - "$ref": "#/definitions/AWSCredentialResource" + "$ref": "#/definitions/AwsCredentialResource" } }, "default": { @@ -608,44 +775,91 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Create or update a AWS credential": { + "$ref": "./examples/AWSCredential_CreateOrUpdate.json" + } } }, - "delete": { + "patch": { + "operationId": "AwsCredentials_Update", "tags": [ - "AWSCredential" + "AwsCredentials" ], - "operationId": "AwsCredential_Delete", - "description": "Deletes an existing AWSCredentialResource", + "description": "Update an AWS credential", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { - "$ref": "#/parameters/AWSPlaneNameParameter" + "$ref": "#/parameters/AwsPlaneNameParameter" }, { "name": "credentialName", "in": "path", - "required": true, "description": "The AWS credential name.", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/AwsCredentialResourceTagsUpdate" + } } ], "responses": { "200": { - "description": "Resource deleted successfully." + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/AwsCredentialResource" + } }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Update a AWS credential": { + "$ref": "./examples/AWSCredential_Update.json" + } + } + }, + "delete": { + "operationId": "AwsCredentials_Delete", + "tags": [ + "AwsCredentials" + ], + "description": "Delete an AWS credential", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/AwsPlaneNameParameter" + }, + { + "name": "credentialName", + "in": "path", + "description": "The AWS credential name.", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." }, "204": { "description": "Resource deleted successfully." @@ -656,16 +870,21 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Delete a AWS credential": { + "$ref": "./examples/AWSCredential_Delete.json" + } } } }, "/planes/azure/{planeName}/providers/System.Azure/credentials": { "get": { + "operationId": "AzureCredentials_List", "tags": [ - "AzureCredential" + "AzureCredentials" ], - "operationId": "AzureCredential_ListByRootScope", - "description": "Lists information about all AzureCredentialResource", + "description": "List Azure credentials", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -688,6 +907,11 @@ } } }, + "x-ms-examples": { + "List Azure credentials": { + "$ref": "./examples/AzureCredential_List.json" + } + }, "x-ms-pageable": { "nextLinkName": "nextLink" } @@ -695,11 +919,11 @@ }, "/planes/azure/{planeName}/providers/System.Azure/credentials/{credentialName}": { "get": { + "operationId": "AzureCredentials_Get", "tags": [ - "AzureCredential" + "AzureCredentials" ], - "operationId": "AzureCredential_Get", - "description": "Retrieves information about a AzureCredentialResource", + "description": "Get an Azure credential", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -710,11 +934,11 @@ { "name": "credentialName", "in": "path", - "required": true, "description": "The Azure credential name.", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" } ], "responses": { @@ -730,14 +954,19 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Get a Azure credential": { + "$ref": "./examples/AzureCredential_Get.json" + } } }, "put": { + "operationId": "AzureCredentials_CreateOrUpdate", "tags": [ - "AzureCredential" + "AzureCredentials" ], - "operationId": "AzureCredential_CreateOrUpdate", - "description": "Creates or updates a AzureCredentialResource", + "description": "Create or update an Azure credential", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -748,17 +977,17 @@ { "name": "credentialName", "in": "path", - "required": true, "description": "The Azure credential name.", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" }, { "name": "resource", "in": "body", - "required": true, "description": "Resource create parameters.", + "required": true, "schema": { "$ref": "#/definitions/AzureCredentialResource" } @@ -766,20 +995,13 @@ ], "responses": { "200": { - "description": "ARM operation completed successfully.", + "description": "Resource 'AzureCredentialResource' update operation succeeded", "schema": { "$ref": "#/definitions/AzureCredentialResource" } }, "201": { - "description": "ARM create operation completed successfully.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } - }, + "description": "Resource 'AzureCredentialResource' create operation succeeded", "schema": { "$ref": "#/definitions/AzureCredentialResource" } @@ -790,14 +1012,19 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Create or update a Azure credential": { + "$ref": "./examples/AzureCredential_CreateOrUpdate.json" + } } }, - "delete": { + "patch": { + "operationId": "AzureCredentials_Update", "tags": [ - "AzureCredential" + "AzureCredentials" ], - "operationId": "AzureCredential_Delete", - "description": "Deletes an existing AzureCredentialResource", + "description": "Update an Azure credential", "parameters": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -808,26 +1035,68 @@ { "name": "credentialName", "in": "path", - "required": true, "description": "The Azure credential name.", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, - "type": "string" + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + { + "name": "properties", + "in": "body", + "description": "The resource properties to be updated.", + "required": true, + "schema": { + "$ref": "#/definitions/AzureCredentialResourceTagsUpdate" + } } ], "responses": { "200": { - "description": "Resource deleted successfully." + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/AzureCredentialResource" + } }, - "202": { - "description": "Resource deletion accepted.", - "headers": { - "Retry-After": { - "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", - "type": "integer", - "format": "int32" - } + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } + } + }, + "x-ms-examples": { + "Update a Azure credential": { + "$ref": "./examples/AzureCredential_Update.json" + } + } + }, + "delete": { + "operationId": "AzureCredentials_Delete", + "tags": [ + "AzureCredentials" + ], + "description": "Delete an Azure credential", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/AzurePlaneNameParameter" + }, + { + "name": "credentialName", + "in": "path", + "description": "The Azure credential name.", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." }, "204": { "description": "Resource deleted successfully." @@ -838,21 +1107,47 @@ "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } + }, + "x-ms-examples": { + "Delete a Azure credential": { + "$ref": "./examples/AzureCredential_Delete.json" + } } } } }, "definitions": { - "AWSAccessKeyCredentialProperties": { + "AWSCredentialKind": { + "type": "string", + "description": "AWS credential kind", + "enum": [ + "AccessKey" + ], + "x-ms-enum": { + "name": "AWSCredentialKind", + "modelAsString": true, + "values": [ + { + "name": "AccessKey", + "value": "AccessKey", + "description": "The AWS Access Key credential" + } + ] + } + }, + "AwsAccessKeyCredentialProperties": { "type": "object", + "description": "AWS credential storage properties", "properties": { "accessKeyId": { "type": "string", + "format": "password", "description": "Access key ID for AWS identity", "x-ms-secret": true }, "secretAccessKey": { "type": "string", + "format": "password", "description": "Secret Access Key for AWS identity", "x-ms-secret": true }, @@ -861,7 +1156,6 @@ "description": "The storage properties" } }, - "description": "AWS credential storage properties", "required": [ "accessKeyId", "secretAccessKey", @@ -869,46 +1163,36 @@ ], "allOf": [ { - "$ref": "#/definitions/AWSCredentialProperties" + "$ref": "#/definitions/AwsCredentialProperties" } ], "x-ms-discriminator-value": "AccessKey" }, - "AWSCredentialKind": { - "type": "string", - "description": "AWS credential kinds supported.", - "enum": [ - "AccessKey" - ], - "x-ms-enum": { - "name": "AWSCredentialKind", - "modelAsString": true - } - }, - "AWSCredentialProperties": { + "AwsCredentialProperties": { "type": "object", + "description": "AWS Credential properties", "properties": { "kind": { - "type": "string", - "description": "Discriminator property for AWSCredentialProperties." + "$ref": "#/definitions/AWSCredentialKind", + "description": "The AWS credential kind" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true } }, - "description": "AWS Credential properties", "discriminator": "kind", "required": [ "kind" - ], - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } ] }, - "AWSCredentialResource": { + "AwsCredentialResource": { "type": "object", + "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", "properties": { "properties": { - "$ref": "#/definitions/AWSCredentialProperties", + "$ref": "#/definitions/AwsCredentialProperties", "description": "The resource-specific properties for this resource.", "x-ms-client-flatten": true, "x-ms-mutability": [ @@ -917,40 +1201,45 @@ ] } }, - "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" } ] }, - "AWSCredentialResourceListResult": { + "AwsCredentialResourceListResult": { "type": "object", + "description": "The response of a AwsCredentialResource list operation.", "properties": { "value": { "type": "array", + "description": "The AwsCredentialResource items on this page", "items": { - "$ref": "#/definitions/AWSCredentialResource" - }, - "x-cadl-name": "AWSCredentialResource[]", - "description": "The AWSCredentialResource items on this page" + "$ref": "#/definitions/AwsCredentialResource" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a AWSCredentialResource list operation.", "required": [ "value" ] }, - "AWSPlaneNameParameter": { + "AwsCredentialResourceTagsUpdate": { "type": "object", - "properties": {}, - "description": "Custom root scope" + "description": "The type used for updating tags in AwsCredentialResource resources.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + } + } }, "AzureCredentialKind": { "type": "string", @@ -960,30 +1249,38 @@ ], "x-ms-enum": { "name": "AzureCredentialKind", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "ServicePrincipal", + "value": "ServicePrincipal", + "description": "The Service Principal Credential" + } + ] } }, "AzureCredentialProperties": { "type": "object", + "description": "The base properties of Azure Credential", "properties": { "kind": { - "type": "string", - "description": "Discriminator property for AzureCredentialProperties." + "$ref": "#/definitions/AzureCredentialKind", + "description": "The kind of Azure credential" + }, + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true } }, - "description": "Azure Credential properties", "discriminator": "kind", "required": [ "kind" - ], - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } ] }, "AzureCredentialResource": { "type": "object", + "description": "Represents Azure Credential Resource", "properties": { "properties": { "$ref": "#/definitions/AzureCredentialProperties", @@ -995,7 +1292,6 @@ ] } }, - "description": "Concrete tracked resource types can be created by aliasing this type using a specific property type.", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -1004,34 +1300,41 @@ }, "AzureCredentialResourceListResult": { "type": "object", + "description": "The response of a AzureCredentialResource list operation.", "properties": { "value": { "type": "array", + "description": "The AzureCredentialResource items on this page", "items": { "$ref": "#/definitions/AzureCredentialResource" - }, - "x-cadl-name": "AzureCredentialResource[]", - "description": "The AzureCredentialResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a AzureCredentialResource list operation.", "required": [ "value" ] }, - "AzurePlaneNameParameter": { + "AzureCredentialResourceTagsUpdate": { "type": "object", - "properties": {}, - "description": "Custom root scope" + "description": "The type used for updating tags in AzureCredentialResource resources.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + } + } }, "AzureServicePrincipalProperties": { "type": "object", + "description": "The properties of Service Principal credential storage", "properties": { "clientId": { "type": "string", @@ -1051,7 +1354,6 @@ "description": "The storage properties" } }, - "description": "Service Principal credential storage properties", "required": [ "clientId", "clientSecret", @@ -1065,17 +1367,6 @@ ], "x-ms-discriminator-value": "ServicePrincipal" }, - "BasicResourceProperties": { - "type": "object", - "properties": { - "provisioningState": { - "$ref": "#/definitions/ProvisioningState", - "description": "Provisioning state of the resource at the time the operation was called", - "readOnly": true - } - }, - "description": "Basic properties of a UCP resource." - }, "CredentialStorageKind": { "type": "string", "description": "Credential store kinds supported.", @@ -1084,18 +1375,25 @@ ], "x-ms-enum": { "name": "CredentialStorageKind", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "Internal", + "value": "Internal", + "description": "Internal credential storage" + } + ] } }, "CredentialStorageProperties": { "type": "object", + "description": "The base credential storage properties", "properties": { "kind": { - "type": "string", - "description": "Discriminator property for CredentialStorageProperties." + "$ref": "#/definitions/CredentialStorageKind", + "description": "The kind of credential storage" } }, - "description": "Credential storage properties", "discriminator": "kind", "required": [ "kind" @@ -1103,6 +1401,7 @@ }, "InternalCredentialStorageProperties": { "type": "object", + "description": "Internal credential storage properties", "properties": { "secretName": { "type": "string", @@ -1110,7 +1409,6 @@ "readOnly": true } }, - "description": "Internal credential storage properties", "required": [ "secretName" ], @@ -1131,16 +1429,29 @@ ], "x-ms-enum": { "name": "PlaneKind", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "UCPNative", + "value": "UCPNative", + "description": "UCP Native Plane" + }, + { + "name": "Azure", + "value": "Azure", + "description": "Azure Plane" + }, + { + "name": "AWS", + "value": "AWS", + "description": "AWS Plane" + } + ] } }, - "PlaneNameParameter": { - "type": "object", - "properties": {}, - "description": "Custom root scope" - }, "PlaneResource": { "type": "object", + "description": "The plane resource", "properties": { "properties": { "$ref": "#/definitions/PlaneResourceProperties", @@ -1152,7 +1463,6 @@ ] } }, - "description": "UCP PlaneResource.", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -1161,30 +1471,34 @@ }, "PlaneResourceListResult": { "type": "object", + "description": "The response of a PlaneResource list operation.", "properties": { "value": { "type": "array", + "description": "The PlaneResource items on this page", "items": { "$ref": "#/definitions/PlaneResource" - }, - "x-cadl-name": "PlaneResource[]", - "description": "The PlaneResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a PlaneResource list operation.", "required": [ "value" ] }, "PlaneResourceProperties": { "type": "object", + "description": "The Plane properties.", "properties": { + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + }, "kind": { "$ref": "#/definitions/PlaneKind", "description": "The kind of plane" @@ -1195,26 +1509,32 @@ }, "resourceProviders": { "type": "object", + "description": "Resource Providers for UCP Native Plane", "additionalProperties": { "type": "string" - }, - "x-cadl-name": "Record", - "description": "Resource Providers for UCP Native Plane" + } } }, - "description": "Plane properties.", "required": [ "kind" - ], - "allOf": [ - { - "$ref": "#/definitions/BasicResourceProperties" - } ] }, + "PlaneResourceTagsUpdate": { + "type": "object", + "description": "The type used for updating tags in PlaneResource resources.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + } + } + }, "ProvisioningState": { "type": "string", - "description": "Provisioning state of the link at the time the operation was called", + "description": "Provisioning state of the portable resource at the time the operation was called", "enum": [ "Succeeded", "Failed", @@ -1226,14 +1546,64 @@ ], "x-ms-enum": { "name": "ProvisioningState", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "name": "Succeeded", + "value": "Succeeded", + "description": "Resource has been created." + }, + { + "name": "Failed", + "value": "Failed", + "description": "Resource creation failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "Resource creation was canceled." + }, + { + "name": "Provisioning", + "value": "Provisioning", + "description": "The resource is being provisioned" + }, + { + "name": "Updating", + "value": "Updating", + "description": "The resource is updating" + }, + { + "name": "Deleting", + "value": "Deleting", + "description": "The resource is being deleted" + }, + { + "name": "Accepted", + "value": "Accepted", + "description": "The resource create request has been accepted" + } + ] + }, + "readOnly": true + }, + "ResourceGroupProperties": { + "type": "object", + "description": "The resource group resource properties", + "properties": { + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The status of the asynchronous operation.", + "readOnly": true + } } }, "ResourceGroupResource": { "type": "object", + "description": "The resource group resource", "properties": { "properties": { - "$ref": "#/definitions/BasicResourceProperties", + "$ref": "#/definitions/ResourceGroupProperties", "description": "The resource-specific properties for this resource.", "x-ms-client-flatten": true, "x-ms-mutability": [ @@ -1242,7 +1612,6 @@ ] } }, - "description": "UCP ResourceGroup.", "allOf": [ { "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" @@ -1251,61 +1620,90 @@ }, "ResourceGroupResourceListResult": { "type": "object", + "description": "The response of a ResourceGroupResource list operation.", "properties": { "value": { "type": "array", + "description": "The ResourceGroupResource items on this page", "items": { "$ref": "#/definitions/ResourceGroupResource" - }, - "x-cadl-name": "ResourceGroupResource[]", - "description": "The ResourceGroupResource items on this page" + } }, "nextLink": { "type": "string", "format": "uri", - "description": "The link to the next page of items", - "x-cadl-name": "Rest.ResourceLocation" + "description": "The link to the next page of items" } }, - "description": "The response of a ResourceGroupResource list operation.", "required": [ "value" ] + }, + "ResourceGroupResourceTagsUpdate": { + "type": "object", + "description": "The type used for updating tags in ResourceGroupResource resources.", + "properties": { + "tags": { + "type": "object", + "description": "Resource tags.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Versions": { + "type": "string", + "description": "Supported API versions for Universal Control Plane resource provider.", + "enum": [ + "2022-09-01-privatepreview" + ], + "x-ms-enum": { + "name": "Versions", + "modelAsString": true, + "values": [ + { + "name": "v2022_09_01_privatepreview", + "value": "2022-09-01-privatepreview", + "description": "2022-09-01-privatepreview" + } + ] + } } }, "parameters": { - "AWSPlaneNameParameter": { + "AwsPlaneNameParameter": { "name": "planeName", "in": "path", + "description": "The name of AWS plane", "required": true, - "description": "The name of the plane", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "type": "string", "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true, - "type": "string" + "x-ms-skip-url-encoding": true }, "AzurePlaneNameParameter": { "name": "planeName", "in": "path", - "required": true, "description": "The name of the plane", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true, - "type": "string" + "x-ms-skip-url-encoding": true }, "PlaneNameParameter": { "name": "planeName", "in": "path", - "required": true, "description": "The name of the plane", - "pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$", + "required": true, + "type": "string", "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$", "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true, - "type": "string" + "x-ms-skip-url-encoding": true } } } diff --git a/test/functional/ucp/aws_credential_test.go b/test/functional/ucp/aws_credential_test.go index 108a5b22f5..c0c79abd92 100644 --- a/test/functional/ucp/aws_credential_test.go +++ b/test/functional/ucp/aws_credential_test.go @@ -40,7 +40,7 @@ func Test_AWS_Credential_Operations(t *testing.T) { test.Test(t) } -func runAWSCredentialTests(t *testing.T, resourceUrl string, collectionUrl string, roundTripper http.RoundTripper, createCredential ucp.AWSCredentialResource, expectedCredential ucp.AWSCredentialResource) { +func runAWSCredentialTests(t *testing.T, resourceUrl string, collectionUrl string, roundTripper http.RoundTripper, createCredential ucp.AwsCredentialResource, expectedCredential ucp.AwsCredentialResource) { // Create credential operation createAWSTestCredential(t, roundTripper, resourceUrl, createCredential) @@ -71,7 +71,7 @@ func runAWSCredentialTests(t *testing.T, resourceUrl string, collectionUrl strin require.Equal(t, http.StatusNoContent, statusCode) } -func createAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url string, credential ucp.AWSCredentialResource) { +func createAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url string, credential ucp.AwsCredentialResource) { body, err := json.Marshal(credential) require.NoError(t, err) createRequest, err := NewUCPRequest(http.MethodPut, url, bytes.NewBuffer(body)) @@ -84,7 +84,7 @@ func createAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url s t.Logf("Credential: %s created/updated successfully", url) } -func getAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url string) (ucp.AWSCredentialResource, int) { +func getAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url string) (ucp.AwsCredentialResource, int) { getCredentialRequest, err := NewUCPRequest(http.MethodGet, url, nil) require.NoError(t, err) @@ -96,7 +96,7 @@ func getAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url stri payload, err := io.ReadAll(body) require.NoError(t, err) - credential := ucp.AWSCredentialResource{} + credential := ucp.AwsCredentialResource{} err = json.Unmarshal(payload, &credential) require.NoError(t, err) @@ -111,7 +111,7 @@ func deleteAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url s return res.StatusCode, err } -func listAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url string) []ucp.AWSCredentialResource { +func listAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url string) []ucp.AwsCredentialResource { listCredentialRequest, err := NewUCPRequest(http.MethodGet, url, nil) require.NoError(t, err) @@ -120,7 +120,7 @@ func listAWSTestCredential(t *testing.T, roundTripper http.RoundTripper, url str return getAWSTestCredentialList(t, res) } -func getAWSTestCredentialList(t *testing.T, res *http.Response) []ucp.AWSCredentialResource { +func getAWSTestCredentialList(t *testing.T, res *http.Response) []ucp.AwsCredentialResource { body := res.Body defer body.Close() @@ -129,11 +129,11 @@ func getAWSTestCredentialList(t *testing.T, res *http.Response) []ucp.AWSCredent require.NoError(t, err) list, ok := data["value"].([]any) require.Equal(t, ok, true) - var credentialList []ucp.AWSCredentialResource + var credentialList []ucp.AwsCredentialResource for _, item := range list { s, err := json.Marshal(item) require.NoError(t, err) - credential := ucp.AWSCredentialResource{} + credential := ucp.AwsCredentialResource{} err = json.Unmarshal(s, &credential) require.NoError(t, err) credentialList = append(credentialList, credential) @@ -141,8 +141,8 @@ func getAWSTestCredentialList(t *testing.T, res *http.Response) []ucp.AWSCredent return credentialList } -func getAWSTestCredentialObject() ucp.AWSCredentialResource { - return ucp.AWSCredentialResource{ +func getAWSTestCredentialObject() ucp.AwsCredentialResource { + return ucp.AwsCredentialResource{ Location: to.Ptr("global"), ID: to.Ptr("/planes/aws/awstest/providers/System.AWS/credentials/default"), Name: to.Ptr("default"), @@ -150,20 +150,20 @@ func getAWSTestCredentialObject() ucp.AWSCredentialResource { Tags: map[string]*string{ "env": to.Ptr("dev"), }, - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ AccessKeyID: to.Ptr("00000000-0000-0000-0000-000000000000"), SecretAccessKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - Kind: to.Ptr("AccessKey"), + Kind: to.Ptr(ucp.AWSCredentialKindAccessKey), Storage: &ucp.InternalCredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), SecretName: to.Ptr("aws-awstest-default"), }, }, } } -func getExpectedAWSTestCredentialObject() ucp.AWSCredentialResource { - return ucp.AWSCredentialResource{ +func getExpectedAWSTestCredentialObject() ucp.AwsCredentialResource { + return ucp.AwsCredentialResource{ Location: to.Ptr("global"), ID: to.Ptr("/planes/aws/awstest/providers/System.AWS/credentials/default"), Name: to.Ptr("default"), @@ -171,18 +171,18 @@ func getExpectedAWSTestCredentialObject() ucp.AWSCredentialResource { Tags: map[string]*string{ "env": to.Ptr("dev"), }, - Properties: &ucp.AWSAccessKeyCredentialProperties{ + Properties: &ucp.AwsAccessKeyCredentialProperties{ AccessKeyID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Kind: to.Ptr("AccessKey"), + Kind: to.Ptr(ucp.AWSCredentialKindAccessKey), Storage: &ucp.InternalCredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), SecretName: to.Ptr("aws-awstest-default"), }, }, } } -func getIndexOfAWSTestCredential(testCredentialId string, credentialList []ucp.AWSCredentialResource) (int, error) { +func getIndexOfAWSTestCredential(testCredentialId string, credentialList []ucp.AwsCredentialResource) (int, error) { found := false foundCredentials := make([]string, len(credentialList)) testCredentialIndex := -1 diff --git a/test/functional/ucp/azure_credential_test.go b/test/functional/ucp/azure_credential_test.go index bba566ec51..718b8a2203 100644 --- a/test/functional/ucp/azure_credential_test.go +++ b/test/functional/ucp/azure_credential_test.go @@ -152,9 +152,9 @@ func getAzureTestCredentialObject() ucp.AzureCredentialResource { ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), ClientSecret: to.Ptr("00000000-0000-0000-0000-000000000000"), - Kind: to.Ptr("ServicePrincipal"), + Kind: to.Ptr(ucp.AzureCredentialKindServicePrincipal), Storage: &ucp.InternalCredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), SecretName: to.Ptr("azure-azuretest-default"), }, }, @@ -173,9 +173,9 @@ func getExpectedAzureTestCredentialObject() ucp.AzureCredentialResource { Properties: &ucp.AzureServicePrincipalProperties{ ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Kind: to.Ptr("ServicePrincipal"), + Kind: to.Ptr(ucp.AzureCredentialKindServicePrincipal), Storage: &ucp.InternalCredentialStorageProperties{ - Kind: to.Ptr(string(ucp.CredentialStorageKindInternal)), + Kind: to.Ptr(ucp.CredentialStorageKindInternal), SecretName: to.Ptr("azure-azuretest-default"), }, }, diff --git a/typespec/UCP/aws-credentials.tsp b/typespec/UCP/aws-credentials.tsp new file mode 100644 index 0000000000..6b4b86166b --- /dev/null +++ b/typespec/UCP/aws-credentials.tsp @@ -0,0 +1,133 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; +import "./ucp-operations.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; +using OpenAPI; + +namespace Ucp; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars" +model AwsCredentialResource is TrackedResource { + @key("credentialName") + @doc("The AWS credential name.") + @path + @segment("providers/System.AWS/credentials") + name: ResourceNameString; +} + +@doc("The parameter for AWS plane name") +model AwsPlaneNameParameter { + @doc("The name of AWS plane") + @path + @segment("planes/aws") + @extension("x-ms-skip-url-encoding", true) + @extension("x-ms-parameter-location", "method") + planeName: ResourceNameString; +} + +@doc("AWS credential kind") +enum AWSCredentialKind { + @doc("The AWS Access Key credential") + AccessKey, +} + +@discriminator("kind") +@doc("AWS Credential properties") +model AwsCredentialProperties { + @doc("The AWS credential kind") + kind: AWSCredentialKind; + + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; +} + +@doc("AWS credential storage properties") +model AwsAccessKeyCredentialProperties extends AwsCredentialProperties { + @doc("Access Key kind") + kind: AWSCredentialKind.AccessKey; + + @doc("Access key ID for AWS identity") + @secret + accessKeyId: string; + + @doc("Secret Access Key for AWS identity") + @secret + secretAccessKey: string; + + @doc("The storage properties") + storage: CredentialStorageProperties; +} + +alias AwsCredentialBaseParameter = CredentialBaseParameters< + TResource, + AwsPlaneNameParameter +>; + +@armResourceOperations +interface AwsCredentials { + @doc("List AWS credentials") + list is UcpResourceList< + AwsCredentialResource, + { + ...ApiVersionParameter; + ...AwsPlaneNameParameter; + } + >; + + @doc("Get an AWS credential") + get is UcpResourceRead< + AwsCredentialResource, + AwsCredentialBaseParameter + >; + + @doc("Create or update an AWS credential") + createOrUpdate is UcpResourceCreateOrUpdateSync< + AwsCredentialResource, + AwsCredentialBaseParameter + >; + + @doc("Update an AWS credential") + update is UcpCustomPatchSync< + AwsCredentialResource, + AwsCredentialBaseParameter + >; + + @doc("Delete an AWS credential") + delete is UcpResourceDeleteSync< + AwsCredentialResource, + AwsCredentialBaseParameter + >; +} diff --git a/typespec/UCP/azure-credentials.tsp b/typespec/UCP/azure-credentials.tsp new file mode 100644 index 0000000000..113456e352 --- /dev/null +++ b/typespec/UCP/azure-credentials.tsp @@ -0,0 +1,137 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; +import "./ucp-operations.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; +using OpenAPI; + +namespace Ucp; + +@doc("The parameter of Azure plane") +model AzurePlaneNameParameter { + @doc("The name of the plane") + @path + @extension("x-ms-skip-url-encoding", true) + @extension("x-ms-parameter-location", "method") + @segment("planes/azure") + planeName: ResourceNameString; +} + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars" +@doc("Represents Azure Credential Resource") +model AzureCredentialResource is TrackedResource { + @doc("The Azure credential name.") + @path + @key("credentialName") + @segment("providers/System.Azure/credentials") + name: ResourceNameString; +} + +@doc("Azure credential kinds supported.") +enum AzureCredentialKind { + @doc("The Service Principal Credential") + ServicePrincipal, +} + +@discriminator("kind") +@doc("The base properties of Azure Credential") +model AzureCredentialProperties { + @doc("The kind of Azure credential") + kind: AzureCredentialKind; + + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; +} + +@doc("The properties of Service Principal credential storage") +model AzureServicePrincipalProperties extends AzureCredentialProperties { + @doc("Service principal kind") + kind: AzureCredentialKind.ServicePrincipal; + + @doc("clientId for ServicePrincipal") + clientId: string; + + @doc("secret for ServicePrincipal") + @extension("x-ms-secret", true) + clientSecret: string; + + @doc("tenantId for ServicePrincipal") + tenantId: string; + + @doc("The storage properties") + storage: CredentialStorageProperties; +} + +alias AzureCredentialBaseParameter = CredentialBaseParameters< + TResource, + AzurePlaneNameParameter +>; + +@autoRoute +@armResourceOperations +interface AzureCredentials { + @doc("List Azure credentials") + list is UcpResourceList< + AzureCredentialResource, + { + ...ApiVersionParameter; + ...AzurePlaneNameParameter; + } + >; + + @doc("Get an Azure credential") + get is UcpResourceRead< + AzureCredentialResource, + AzureCredentialBaseParameter + >; + + @doc("Create or update an Azure credential") + createOrUpdate is UcpResourceCreateOrUpdateSync< + AzureCredentialResource, + AzureCredentialBaseParameter + >; + + @doc("Update an Azure credential") + update is UcpCustomPatchSync< + AzureCredentialResource, + AzureCredentialBaseParameter + >; + + @doc("Delete an Azure credential") + delete is UcpResourceDeleteSync< + AzureCredentialResource, + AzureCredentialBaseParameter + >; +} diff --git a/typespec/UCP/common.tsp b/typespec/UCP/common.tsp new file mode 100644 index 0000000000..5387ba08df --- /dev/null +++ b/typespec/UCP/common.tsp @@ -0,0 +1,66 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; +using OpenAPI; + +@doc("The UCP HTTP request base parameters.") +model CredentialBaseParameters { + ...ApiVersionParameter; + ...TPlaneName; + ...KeysOf; +} + +@doc("Credential store kinds supported.") +enum CredentialStorageKind { + @doc("Internal credential storage") + Internal, +} + +@doc("The base credential storage properties") +@discriminator("kind") +model CredentialStorageProperties { + @doc("The kind of credential storage") + kind: CredentialStorageKind; +} + +@doc("Internal credential storage properties") +model InternalCredentialStorageProperties extends CredentialStorageProperties { + @doc("Internal credential storage kind") + kind: CredentialStorageKind.Internal; + + @doc("The name of secret stored.") + @visibility("read") + secretName: string; +} diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_CreateOrUpdate.json b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_CreateOrUpdate.json new file mode 100644 index 0000000000..c7fef81833 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_CreateOrUpdate.json @@ -0,0 +1,53 @@ +{ + "operationId": "AwsCredentials_CreateOrUpdate", + "title": "Create or update a AWS credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "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/2022-09-01-privatepreview/AWSCredential_Delete.json b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Delete.json new file mode 100644 index 0000000000..30907afdbe --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "AwsCredentials_Delete", + "title": "Delete a AWS credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "aws", + "planeName": "awscloud", + "credentialName": "default" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Get.json b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Get.json new file mode 100644 index 0000000000..1d6b3ee794 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Get.json @@ -0,0 +1,27 @@ +{ + "operationId": "AwsCredentials_Get", + "title": "Get a AWS credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "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/2022-09-01-privatepreview/AWSCredential_List.json b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_List.json new file mode 100644 index 0000000000..53baf9b1cb --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_List.json @@ -0,0 +1,30 @@ +{ + "operationId": "AwsCredentials_List", + "title": "List AWS credentials", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "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/2022-09-01-privatepreview/AWSCredential_Update.json b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Update.json new file mode 100644 index 0000000000..f9de8aaac1 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AWSCredential_Update.json @@ -0,0 +1,53 @@ +{ + "operationId": "AwsCredentials_Update", + "title": "Update a AWS credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "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/2022-09-01-privatepreview/AzureCredential_CreateOrUpdate.json b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_CreateOrUpdate.json new file mode 100644 index 0000000000..f2aad4bdc4 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_CreateOrUpdate.json @@ -0,0 +1,57 @@ +{ + "operationId": "AzureCredentials_CreateOrUpdate", + "title": "Create or update a Azure credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "azure", + "planeName": "azurecloud", + "credentialName": "default", + "Credential": { + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "clientId": "00000000-0000-0000-0000-000000000000", + "clientSecret": "secretString", + "tenantId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal" + } + } + } + }, + "201": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal", + "secretName": "azure-azurecloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Delete.json b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Delete.json new file mode 100644 index 0000000000..6d034d1e3b --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "AzureCredentials_Delete", + "title": "Delete a Azure credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "azure", + "planeName": "azurecloud", + "credentialName": "default" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Get.json b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Get.json new file mode 100644 index 0000000000..90eede6d4a --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Get.json @@ -0,0 +1,29 @@ +{ + "operationId": "AzureCredentials_Get", + "title": "Get a Azure credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "azure", + "planeName": "azurecloud", + "credentialName": "default" + }, + "responses": { + "200": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal", + "secretName": "azure-azurecloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_List.json b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_List.json new file mode 100644 index 0000000000..4f6ab2d815 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_List.json @@ -0,0 +1,32 @@ +{ + "operationId": "AzureCredentials_List", + "title": "List Azure credentials", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "azure", + "planeName": "azurecloud" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal", + "secretName": "azure-azurecloud-default" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Update.json b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Update.json new file mode 100644 index 0000000000..916dff73b8 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/AzureCredential_Update.json @@ -0,0 +1,57 @@ +{ + "operationId": "AzureCredentials_Update", + "title": "Update a Azure credential", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "azure", + "planeName": "azurecloud", + "credentialName": "default", + "Credential": { + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "clientId": "00000000-0000-0000-0000-000000000000", + "clientSecret": "secretString", + "tenantId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal" + } + } + } + }, + "201": { + "body": { + "id": "/planes/azure/azurecloud/providers/System.Azure/credentials/default", + "name": "default", + "type": "System.Azure/credentials", + "location": "west-us-2", + "properties": { + "kind": "ServicePrincipal", + "tenantId": "00000000-0000-0000-0000-000000000000", + "clientId": "00000000-0000-0000-0000-000000000000", + "storage": { + "kind": "Internal", + "secretName": "azure-azurecloud-default" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_CreateOrUpdate.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_CreateOrUpdate.json new file mode 100644 index 0000000000..12de0f2d68 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_CreateOrUpdate.json @@ -0,0 +1,34 @@ +{ + "operationId": "Planes_CreateOrUpdate", + "title": "Create or update a plane", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius", + "Plane": { + "location": "global", + "properties": { + "kind": "UCPNative", + "resourceProviders": { + "Applications.Core": "http://localhost:7443" + } + } + } + }, + "responses": { + "200": { + "body": { + "location": "global", + "id": "/planes/radius/local", + "name": "local", + "type": "System.Planes/radius", + "properties": { + "kind": "UCPNative", + "resourceProviders": { + "Applications.Core": "http://localhost:7443" + } + } + } + } + } +} \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsDeleteResourceGroupRG1.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_Delete.json similarity index 73% rename from swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsDeleteResourceGroupRG1.json rename to typespec/UCP/examples/2022-09-01-privatepreview/Planes_Delete.json index 87a04e79fa..9467f217ba 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/ResourceGroupsDeleteResourceGroupRG1.json +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_Delete.json @@ -1,7 +1,8 @@ { + "operationId": "Planes_Delete", + "title": "Delete a plane", "parameters": { "api-version": "2022-09-01-privatepreview", - "resourceGroupName": "rg1", "planeType": "radius", "planeName": "local" }, diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json new file mode 100644 index 0000000000..de4215466c --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json @@ -0,0 +1,26 @@ +{ + "operationId": "Planes_Get", + "title": "Get a plane", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local", + "name": "local", + "type": "System.Planes/radius", + "location": "global", + "properties": { + "resourceProviders": { + "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Core": "http://applications-rp.radius-system:5443" + }, + "kind": "UCPNative" + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json new file mode 100644 index 0000000000..7a43a4d64e --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json @@ -0,0 +1,29 @@ +{ + "operationId": "Planes_ListPlanes", + "title": "List planes", + "parameters": { + "api-version": "2022-09-01-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local", + "name": "local", + "type": "System.Planes/radius", + "location": "global", + "properties": { + "resourceProviders": { + "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Core": "http://applications-rp.radius-system:5443", + "Microsoft.Resources": "http://bicep-de.radius-system:6443" + }, + "kind": "UCPNative" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json new file mode 100644 index 0000000000..3376f3b537 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json @@ -0,0 +1,29 @@ +{ + "operationId": "Planes_ListByType", + "title": "List planes by planeType", + "parameters": { + "planeType": "radius", + "api-version": "2022-09-01-privatepreview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local", + "name": "local", + "type": "System.Planes/radius", + "location": "global", + "properties": { + "resourceProviders": { + "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Core": "http://applications-rp.radius-system:5443" + }, + "kind": "UCPNative" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_Update.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_Update.json new file mode 100644 index 0000000000..08b77b42ca --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_Update.json @@ -0,0 +1,34 @@ +{ + "operationId": "Planes_Update", + "title": "Update a plane", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius", + "Plane": { + "location": "global", + "properties": { + "kind": "UCPNative", + "resourceProviders": { + "Applications.Core": "http://localhost:7443" + } + } + } + }, + "responses": { + "200": { + "body": { + "location": "global", + "id": "/planes/radius/local", + "name": "local", + "type": "System.Planes/radius", + "properties": { + "kind": "UCPNative", + "resourceProviders": { + "Applications.Core": "http://localhost:7443" + } + } + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_CreateOrUpdate.json b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_CreateOrUpdate.json new file mode 100644 index 0000000000..889ee27bb1 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_CreateOrUpdate.json @@ -0,0 +1,22 @@ +{ + "operationId": "ResourceGroups_CreateOrUpdate", + "title": "Create or update a resource group", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "radius", + "planeName": "local", + "resourceGroupName": "rg1", + "ResourceGroup": { + "location": "global" + } + }, + "responses": { + "200": { + "body": { + "location": "global", + "id": "/planes/radius/local/resourcegroups/rg1", + "name": "rg1" + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Delete.json b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Delete.json new file mode 100644 index 0000000000..df56306964 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Delete.json @@ -0,0 +1,14 @@ +{ + "operationId": "ResourceGroups_Delete", + "title": "Delete a resource group", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "resourceGroupName": "rg1", + "planeType": "radius", + "planeName": "local" + }, + "responses": { + "200": {}, + "204": {} + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Get.json b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Get.json new file mode 100644 index 0000000000..c64ec98f63 --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Get.json @@ -0,0 +1,19 @@ +{ + "operationId": "ResourceGroups_Get", + "title": "Get a resource group", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius", + "resourceGroupName": "rg1" + }, + "responses": { + "200": { + "body": { + "id": "/planes/radius/local/resourcegroups/rg1", + "name": "rg1", + "location": "global" + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_List.json b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_List.json new file mode 100644 index 0000000000..3e67b7150c --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_List.json @@ -0,0 +1,27 @@ +{ + "operationId": "ResourceGroups_List", + "title": "List resource groups", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourcegroups/rg1", + "name": "rg1", + "location": "global" + }, + { + "id": "/planes/radius/local/resourcegroups/rg2", + "name": "rg2", + "location": "global" + } + ] + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Update.json b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Update.json new file mode 100644 index 0000000000..abcd61906a --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/ResourceGroups_Update.json @@ -0,0 +1,22 @@ +{ + "operationId": "ResourceGroups_Update", + "title": "Update a resource group", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeType": "radius", + "planeName": "local", + "resourceGroupName": "rg1", + "ResourceGroup": { + "location": "global" + } + }, + "responses": { + "200": { + "body": { + "location": "global", + "id": "/planes/radius/local/resourcegroups/rg1", + "name": "rg1" + } + } + } +} \ No newline at end of file diff --git a/typespec/UCP/main.tsp b/typespec/UCP/main.tsp new file mode 100644 index 0000000000..01f5c2162e --- /dev/null +++ b/typespec/UCP/main.tsp @@ -0,0 +1,44 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-resource-manager"; + +import "./common.tsp"; +import "./planes.tsp"; +import "./resourcegroups.tsp"; +import "./aws-credentials.tsp"; +import "./azure-credentials.tsp"; + +using TypeSpec.Versioning; +using Azure.ResourceManager; + +#suppress "@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint" +@armProviderNamespace +@service({ + title: "Universal Control Plane Resource Management APIs", +}) +@doc("REST APIs for Universal Control Plane") +@versioned(Versions) +namespace Ucp; + +@doc("Supported API versions for Universal Control Plane resource provider.") +enum Versions { + @doc("2022-09-01-privatepreview") + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) + v2022_09_01_privatepreview: "2022-09-01-privatepreview", +} diff --git a/typespec/UCP/planes.tsp b/typespec/UCP/planes.tsp new file mode 100644 index 0000000000..0c8bee781d --- /dev/null +++ b/typespec/UCP/planes.tsp @@ -0,0 +1,130 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; +using OpenAPI; + +namespace Ucp; + +@doc("The plane resource") +model PlaneResource is TrackedResource { + @key("planeType") + @doc("The plane type.") + @segment("planes") + @path + name: string; +} + +@doc("Plane kinds supported.") +enum PlaneKind { + @doc("UCP Native Plane") + UCPNative, + + @doc("Azure Plane") + Azure, + + @doc("AWS Plane") + AWS, +} + +@doc("The Plane Name parameter.") +model PlaneNameParameter { + @doc("The name of the plane") + @path + @extension("x-ms-skip-url-encoding", true) + @extension("x-ms-parameter-location", "method") + planeName: ResourceNameString; +} + +@doc("The UCP HTTP request base parameters.") +model PlaneBaseParameters< + TResource, + TPlaneName extends {} = PlaneNameParameter +> { + ...ApiVersionParameter; + ...KeysOf; + ...TPlaneName; +} + +@doc("The Plane properties.") +model PlaneResourceProperties { + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; + + @doc("The kind of plane") + kind: PlaneKind; + + @doc("URL to forward requests to for non UCP Native Plane") + url?: string; + + @doc("Resource Providers for UCP Native Plane") + resourceProviders?: Record; +} + +@armResourceOperations +interface Planes { + @doc("List all planes") + listPlanes is UcpResourceList; + + @doc("List planes by type") + @get + @autoRoute + @armResourceRead(PlaneResource) + @armResourceList(PlaneResource) + listByType( + ...PlaneBaseParameters, + ): ArmResponse> | ErrorResponse; + + @doc("Get a plane by name") + get is UcpResourceRead>; + + @doc("Create or update a plane") + createOrUpdate is UcpResourceCreateOrUpdateAsync< + PlaneResource, + PlaneBaseParameters + >; + + @doc("Update a plane") + update is UcpCustomPatchAsync< + PlaneResource, + PlaneBaseParameters + >; + + @doc("Delete a plane") + delete is UcpResourceDeleteAsync< + PlaneResource, + PlaneBaseParameters + >; +} diff --git a/typespec/UCP/resourcegroups.tsp b/typespec/UCP/resourcegroups.tsp new file mode 100644 index 0000000000..db83f4c466 --- /dev/null +++ b/typespec/UCP/resourcegroups.tsp @@ -0,0 +1,93 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/versioning"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-providerhub"; + +import "../radius/v1/ucprootscope.tsp"; +import "../radius/v1/resources.tsp"; +import "./common.tsp"; +import "./ucp-operations.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Autorest; +using Azure.Core; +using Azure.ResourceManager; +using OpenAPI; + +namespace Ucp; + +@doc("The resource group resource") +model ResourceGroupResource is TrackedResource { + @doc("The name of resource group") + @path + @key("resourceGroupName") + @segment("resourcegroups") + name: ResourceNameString; +} + +@doc("The resource group resource properties") +model ResourceGroupProperties { + @doc("The status of the asynchronous operation.") + @visibility("read") + provisioningState?: ProvisioningState; +} + +@doc("The UCP HTTP request base parameters.") +model ResourceGroupBaseParameters { + ...PlaneBaseParameters; + ...KeysOf; +} + +@armResourceOperations +interface ResourceGroups { + @doc("List resource groups") + list is UcpResourceList< + ResourceGroupResource, + PlaneBaseParameters + >; + + @doc("Get a resource group") + get is UcpResourceRead< + ResourceGroupResource, + ResourceGroupBaseParameters + >; + + @doc("Create or update a resource group") + createOrUpdate is UcpResourceCreateOrUpdateSync< + ResourceGroupResource, + ResourceGroupBaseParameters + >; + + @doc("Update a resource group") + update is UcpCustomPatchSync< + ResourceGroupResource, + ResourceGroupBaseParameters + >; + + @doc("Delete a resource group") + delete is UcpResourceDeleteSync< + ResourceGroupResource, + ResourceGroupBaseParameters + >; +} diff --git a/typespec/UCP/tspconfig.yaml b/typespec/UCP/tspconfig.yaml new file mode 100644 index 0000000000..7bd4805bb3 --- /dev/null +++ b/typespec/UCP/tspconfig.yaml @@ -0,0 +1,10 @@ +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + use-read-only-status-schema: true + azure-resource-provider-folder: "resource-manager" + examples-directory: "{project-root}/examples" + emitter-output-dir: "{project-root}/../../swagger/specification/ucp" + arm-types-dir: "{project-root}/../../swagger/specification/common-types/resource-management" + output-file: "{azure-resource-provider-folder}/UCP/{version-status}/{version}/openapi.json" diff --git a/typespec/UCP/ucp-operations.tsp b/typespec/UCP/ucp-operations.tsp new file mode 100644 index 0000000000..7cdb7f6165 --- /dev/null +++ b/typespec/UCP/ucp-operations.tsp @@ -0,0 +1,159 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import "@typespec/rest"; +import "@typespec/openapi"; +import "@azure-tools/typespec-autorest"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using Azure.ResourceManager; +using Azure.ResourceManager.Foundations; +using OpenAPI; + +// These operation helpers are created based on the following TypeSpec operations: +// https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/lib/operations.tsp + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@get +@autoRoute +@doc("List {name}", TResource) +@segmentOf(TResource) +@armResourceList(TResource) +op UcpResourceList( + ...TBaseParameters, + ...ParentKeysOf, +): ArmResponse> | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Get a {name}", TResource) +@get +@armResourceRead(TResource) +op UcpResourceRead( + ...TBaseParameters, +): ArmResponse | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Create a {name}", TResource) +@extension("x-ms-long-running-operation", true) +@extension( + "x-ms-long-running-operation-options", + { + `final-state-via`: "azure-async-operation", + } +) +@armResourceCreateOrUpdate(TResource) +@put +op UcpResourceCreateOrUpdateAsync< + TResource extends ArmResource, + TBaseParameters +>( + ...TBaseParameters, + + @doc("Resource create parameters.") + @body + resource: TResource, +): ArmResourceUpdatedResponse | ArmResourceCreatedResponse | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Update a {name}", TResource) +@extension("x-ms-long-running-operation", true) +@extension( + "x-ms-long-running-operation-options", + { + `final-state-via`: "location", + } +) +@armResourceUpdate(TResource) +@patch +op UcpCustomPatchAsync< + TResource extends ArmResource, + TBaseParameters, + TPatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel +>( + ...TBaseParameters, + + @doc("The resource properties to be updated.") + @body + properties: TPatchModel, +): ArmResponse | ArmAcceptedLroResponse<"Resource update request accepted."> | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Delete a {name}", TResource) +@extension("x-ms-long-running-operation", true) +@extension( + "x-ms-long-running-operation-options", + { + `final-state-via`: "location", + } +) +@armResourceDelete(TResource) +@delete +op UcpResourceDeleteAsync( + ...TBaseParameters, +): + | ArmDeletedResponse + | ArmDeleteAcceptedLroResponse + | ArmDeletedNoContentResponse + | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Create a {name}", TResource) +@armResourceCreateOrUpdate(TResource) +@put +op UcpResourceCreateOrUpdateSync< + TResource extends ArmResource, + TBaseParameters +>( + ...TBaseParameters, + + @doc("Resource create parameters.") + @body + resource: TResource, +): ArmResourceUpdatedResponse | ArmResourceCreatedSyncResponse | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Update a {name}", TResource) +@armResourceUpdate(TResource) +@patch +op UcpCustomPatchSync< + TResource extends ArmResource, + TBaseParameters, + TPatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel +>( + ...TBaseParameters, + + @doc("The resource properties to be updated.") + @body + properties: TPatchModel, +): ArmResponse | ErrorResponse; + +#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation-outside-interface" +@autoRoute +@doc("Delete a {name}", TResource) +@armResourceDelete(TResource) +@delete +op UcpResourceDeleteSync( + ...TBaseParameters, +): ArmDeletedResponse | ArmDeletedNoContentResponse | ErrorResponse; From 82be6a9f4d0ea06b03551feacd9d7250640740e4 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Fri, 1 Sep 2023 15:16:34 -0700 Subject: [PATCH 40/57] Cleanup portableresources/api package (#6192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Cleanup of portableresources/api after renaming of package and removal of linkrp resources. This includes moving out of common time specific util functions into armrpc/v1 package. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: Part of #3499 ## Auto-generated summary ### 🤖 Generated by Copilot at 2476c1b ### Summary 📝🔧🧪 This pull request refactors the code structure and organization of the Portable Resources API and its related RP APIs. It moves the `DefaultRecipeName` constant to the `portableresources` package and updates the references to it in the other packages. It also consolidates the version constants in the `portableresources/api` package and removes some unused imports and files. Additionally, it adds license header comments to some files in the ARM RPC API. > _Some constants and functions were moved_ > _To packages that better improved_ > _The code organization_ > _And version precision_ > _Of APIs that need to be proved_ ### Walkthrough * Add license header comments and test package declarations to `time_util.go` and `time_util_test.go` ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-11a2914e60769d287a5b7bf84ede141399ce0dc6020b0d89afff000e5a40f799R1-R85), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8976e24f45d6b89e3906d82af8c36d948acf84464f76a18549f708a5229502ecR1-R164)) * Remove unused imports of `v20220315privatepreview` package from various files ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-3497c5a60d626f25bd22acce0b5869eafda20f9dd890089f7192ebae77dfd19aL25), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-29be2aee7ca3efb04a61241945a3d1ef1404bedad88911cf603e06e513c4a3f2L25), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8306a2c498723acff8dcfe2c11c7dac4957ea18a67e50378377d860c9b31392aL25), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8ec39d09595474b8e8f3011847bbf8d28be10d8d597f69e126304c06a6e67856L26), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-411da4152b984c5f905c070c5bb1f03c7c4a1cdcd173ef74615da51c00e5350aL24)) * Replace imports and usages of `v20220315privatepreview` package with `portableresources` package for accessing `DefaultRecipeName` constant in various files ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-3497c5a60d626f25bd22acce0b5869eafda20f9dd890089f7192ebae77dfd19aL130-R134), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-29be2aee7ca3efb04a61241945a3d1ef1404bedad88911cf603e06e513c4a3f2L224-R223), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-29be2aee7ca3efb04a61241945a3d1ef1404bedad88911cf603e06e513c4a3f2L248-R247), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-0acb0398557e367637d61d4266cf929314cc95b02ebd0b3821f559b5b32528d6L105-R109), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8306a2c498723acff8dcfe2c11c7dac4957ea18a67e50378377d860c9b31392aL223-R222), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8306a2c498723acff8dcfe2c11c7dac4957ea18a67e50378377d860c9b31392aL247-R246), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8306a2c498723acff8dcfe2c11c7dac4957ea18a67e50378377d860c9b31392aL267-R266), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8306a2c498723acff8dcfe2c11c7dac4957ea18a67e50378377d860c9b31392aL273-R272), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-8ec39d09595474b8e8f3011847bbf8d28be10d8d597f69e126304c06a6e67856L129-R128), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-411da4152b984c5f905c070c5bb1f03c7c4a1cdcd173ef74615da51c00e5350aL125-R124), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-411da4152b984c5f905c070c5bb1f03c7c4a1cdcd173ef74615da51c00e5350aL149-R148)) * Replace imports and usages of `v20220315privatepreview` package with `v1` package for accessing `UnmarshalTimeString` function in various files ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-aacda259f121fc17b1c06417880dae07a0ed3d57db9f63b6df29f219137eb223L106-R108), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-0acb0398557e367637d61d4266cf929314cc95b02ebd0b3821f559b5b32528d6L157-R159), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-da64d71e361fb2a93ffb125912894ae841029d9582af77d5015ea0b8e13189efL106-R108)) * Rename `v20220315privatepreview/version.go` to `versions.go` and move `Version` constant to `api` package as `V20220315privatepreview` ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-4fa9f89b7341290353486bde9c114dfe366328d6e1f91dd6f5be991585d0e734L17-R20)) * Replace imports and usages of `v20220315privatepreview` package with `api` package for accessing `V20220315privatepreview` constant in `getoperations.go` and `getoperations_test.go` ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-72c62c901d96d8731589a498aa8646bb01aeefafd5dbcc0b56781120b151b14aL26-R26), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-72c62c901d96d8731589a498aa8646bb01aeefafd5dbcc0b56781120b151b14aL47-R47), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-935e98a3e7f642c3133e7514a00b6b326bc1a321b9a266fac3912ca49fbd4ca5L27-R27), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-935e98a3e7f642c3133e7514a00b6b326bc1a321b9a266fac3912ca49fbd4ca5L37-R37)) * Add `DefaultRecipeName` constant to `portableresources` package in `types.go` ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-a84c1408454dbdd6e92b77d98a50ce8954bc2477ffbef4eabd32d9f1d587e743L24-R55)) * Delete `util.go`, `util_test.go`, and `zz_generated_time_rfc3339.go` from `v20220315privatepreview` package ([link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-9162bbc81af4bb75db01d7ae42e1d98d49c9e6a703403ddd50314faca54e11a6), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-ebbed092c6f4dde1e056901ff165caaefdfa8815a8211b7c4e3040696e4bb586), [link](https://github.com/radius-project/radius/pull/6192/files?diff=unified&w=0#diff-4fc8a1591307c97568158b126deb63aadb7f75379e1d996937d59dc7dee1500e)) --- pkg/armrpc/api/v1/time_util.go | 85 +++++++++ pkg/armrpc/api/v1/time_util_test.go | 164 ++++++++++++++++++ .../extender_conversion.go | 5 +- .../v20220315privatepreview/datamodel_util.go | 9 +- .../datamodel_util_test.go | 5 +- .../v20220315privatepreview/datamodel_util.go | 9 +- .../datamodel_util_test.go | 9 +- .../mongodatabase_conversion_test.go | 3 +- .../v20220315privatepreview/datamodel_util.go | 9 +- .../datamodel_util_test.go | 5 +- .../api/v20220315privatepreview/util.go | 32 ---- .../api/v20220315privatepreview/util_test.go | 38 ---- .../zz_generated_time_rfc3339.go | 90 ---------- .../version.go => versions.go} | 6 +- .../frontend/handler/getoperations.go | 4 +- .../frontend/handler/getoperations_test.go | 4 +- pkg/portableresources/types.go | 39 +++-- 17 files changed, 308 insertions(+), 208 deletions(-) create mode 100644 pkg/armrpc/api/v1/time_util.go create mode 100644 pkg/armrpc/api/v1/time_util_test.go delete mode 100644 pkg/portableresources/api/v20220315privatepreview/util.go delete mode 100644 pkg/portableresources/api/v20220315privatepreview/util_test.go delete mode 100644 pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go rename pkg/portableresources/api/{v20220315privatepreview/version.go => versions.go} (78%) diff --git a/pkg/armrpc/api/v1/time_util.go b/pkg/armrpc/api/v1/time_util.go new file mode 100644 index 0000000000..1a2b66741f --- /dev/null +++ b/pkg/armrpc/api/v1/time_util.go @@ -0,0 +1,85 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +type timeRFC3339 time.Time + +// MarshalJSON is a method that converts the timeRFC3339 object into a JSON formatted byte array. +// It returns the JSON formatted byte array and an error if any occurred during the marshalling process. +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +// MarshalText converts the timeRFC3339 to text in the form of a byte slice. +// It returns the byte slice and an error if any occurred during the conversion. +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +// UnmarshalJSON is a method that implements the json.Unmarshaler interface. +// It takes a JSON-encoded byte slice and converts it into a timeRFC3339 value. +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +// UnmarshalText is a method of the timeRFC3339 type. +// The method attempts to parse the input data into a time value according to the RFC3339 standard. +// The method returns an error if the parsing fails. +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +// UnmarshalTimeString unmarshals a string representation of a time in RFC3339 format into a time.Time object. +func UnmarshalTimeString(ts string) *time.Time { + var tt timeRFC3339 + _ = tt.UnmarshalText([]byte(ts)) + return (*time.Time)(&tt) +} + +// Parse is a method of the timeRFC3339 type. It takes a layout and a value as strings, +// and attempts to parse the value into a time.Time object using the provided layout. +// The parsed time is then stored in the timeRFC3339 receiver. It returns any error produced by time.Parse. +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +} diff --git a/pkg/armrpc/api/v1/time_util_test.go b/pkg/armrpc/api/v1/time_util_test.go new file mode 100644 index 0000000000..be825a76b7 --- /dev/null +++ b/pkg/armrpc/api/v1/time_util_test.go @@ -0,0 +1,164 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestTimeRFC3339_MarshalText(t *testing.T) { + tt := timeRFC3339(time.Now()) + text, err := tt.MarshalText() + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if len(text) == 0 { + t.Errorf("Expected text time, got empty string") + } +} + +func TestTimeRFC3339_MarshalJSON(t *testing.T) { + tt := timeRFC3339(time.Now()) + json, err := tt.MarshalJSON() + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if len(json) == 0 { + t.Errorf("Expected JSON time, got empty string") + } +} + +func TestUnmarshalTimeString(t *testing.T) { + parsedTime := UnmarshalTimeString("2021-09-24T19:09:00.000000Z") + require.NotNil(t, parsedTime) + + require.Equal(t, 2021, parsedTime.Year()) + require.Equal(t, time.Month(9), parsedTime.Month()) + require.Equal(t, 24, parsedTime.Day()) + + parsedTime = UnmarshalTimeString("") + require.NotNil(t, parsedTime) + require.Equal(t, 1, parsedTime.Year()) +} + +func TestTimeRFC3339_UnmarshalText(t *testing.T) { + tests := []struct { + name string + data string + wantErr bool + }{ + { + name: "Valid RFC3339Nano time", + data: time.Now().Format(time.RFC3339Nano), + wantErr: false, + }, + { + name: "Valid UTC time", + data: time.Now().UTC().Format(utcLayout), + wantErr: false, + }, + { + name: "Invalid time", + data: "invalid time", + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var tr timeRFC3339 + if err := tr.UnmarshalText([]byte(tt.data)); (err != nil) != tt.wantErr { + t.Errorf("timeRFC3339.UnmarshalText() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestTimeRFC3339_UnmarshalJSON(t *testing.T) { + testCases := []struct { + name string + data string + expected time.Time + }{ + { + name: "UTC time", + data: `"2023-01-01T00:00:00.000000000"`, + expected: time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC), + }, + { + name: "RFC3339Nano time", + data: `"2023-01-01T00:00:00.000000000Z"`, + expected: time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC), + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + var tr timeRFC3339 + err := tr.UnmarshalJSON([]byte(tc.data)) + if err != nil { + t.Fatalf("UnmarshalJSON failed: %v", err) + } + + if !time.Time(tr).Equal(tc.expected) { + t.Errorf("Unmarshalled time does not match expected. Got: %v, Expected: %v", time.Time(tr), tc.expected) + } + }) + } +} + +func TestTimeRFC3339_Parse(t *testing.T) { + testCases := []struct { + name string + layout string + value string + want timeRFC3339 + wantErr bool + }{ + { + name: "valid RFC3339 time", + layout: time.RFC3339, + value: "2006-01-02T15:04:05Z", + want: timeRFC3339(time.Date(2006, 1, 2, 15, 4, 5, 0, time.UTC)), + wantErr: false, + }, + { + name: "invalid time", + layout: time.RFC3339, + value: "invalid time", + wantErr: true, + }, + // Add more test cases as needed + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + var tr timeRFC3339 + err := tr.Parse(tc.layout, tc.value) + if (err != nil) != tc.wantErr { + t.Errorf("timeRFC3339.Parse() error = %v, wantErr %v", err, tc.wantErr) + return + } + if !tc.wantErr && time.Time(tr) != time.Time(tc.want) { + t.Errorf("timeRFC3339.Parse() = %v, want %v", tr, tc.want) + } + }) + } +} diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go index 1391b88f0e..6c4a593e4c 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go @@ -22,7 +22,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/radius-project/radius/pkg/portableresources" - pr_apiver "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" ) @@ -127,12 +126,12 @@ func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { return portableresources.LinkRecipe{ - Name: pr_apiver.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, } } recipe := portableresources.LinkRecipe{} if r.Name == nil { - recipe.Name = pr_apiver.DefaultRecipeName + recipe.Name = portableresources.DefaultRecipeName } else { recipe.Name = to.String(r.Name) } diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go index e8ad78c497..5ee5f719d1 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go @@ -21,7 +21,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" ) @@ -103,22 +102,22 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { return &SystemData{ CreatedBy: to.Ptr(s.CreatedBy), CreatedByType: (*CreatedByType)(to.Ptr(s.CreatedByType)), - CreatedAt: v20220315privatepreview.UnmarshalTimeString(s.CreatedAt), + CreatedAt: v1.UnmarshalTimeString(s.CreatedAt), LastModifiedBy: to.Ptr(s.LastModifiedBy), LastModifiedByType: (*CreatedByType)(to.Ptr(s.LastModifiedByType)), - LastModifiedAt: v20220315privatepreview.UnmarshalTimeString(s.LastModifiedAt), + LastModifiedAt: v1.UnmarshalTimeString(s.LastModifiedAt), } } func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { return portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, } } recipe := portableresources.LinkRecipe{} if r.Name == nil { - recipe.Name = v20220315privatepreview.DefaultRecipeName + recipe.Name = portableresources.DefaultRecipeName } else { recipe.Name = to.String(r.Name) } diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go index f93491c1ec..77608de243 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go @@ -22,7 +22,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -221,7 +220,7 @@ func TestToRecipeDataModel(t *testing.T) { { nil, portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, }, }, { @@ -245,7 +244,7 @@ func TestToRecipeDataModel(t *testing.T) { }, }, portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", }, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go index 9b87b52187..823be224ec 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go @@ -21,7 +21,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" ) @@ -102,12 +101,12 @@ func fromResourceProvisioningDataModel(provisioning portableresources.ResourcePr func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { return portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, } } recipe := portableresources.LinkRecipe{} if r.Name == nil { - recipe.Name = v20220315privatepreview.DefaultRecipeName + recipe.Name = portableresources.DefaultRecipeName } else { recipe.Name = to.String(r.Name) } @@ -154,10 +153,10 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { return &SystemData{ CreatedBy: to.Ptr(s.CreatedBy), CreatedByType: (*CreatedByType)(to.Ptr(s.CreatedByType)), - CreatedAt: v20220315privatepreview.UnmarshalTimeString(s.CreatedAt), + CreatedAt: v1.UnmarshalTimeString(s.CreatedAt), LastModifiedBy: to.Ptr(s.LastModifiedBy), LastModifiedByType: (*CreatedByType)(to.Ptr(s.LastModifiedByType)), - LastModifiedAt: v20220315privatepreview.UnmarshalTimeString(s.LastModifiedAt), + LastModifiedAt: v1.UnmarshalTimeString(s.LastModifiedAt), } } diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go index 6c144f499c..b7bb9a2897 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go @@ -22,7 +22,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -220,7 +219,7 @@ func TestToRecipeDataModel(t *testing.T) { { nil, portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, }, }, { @@ -244,7 +243,7 @@ func TestToRecipeDataModel(t *testing.T) { }, }, portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", }, @@ -264,13 +263,13 @@ func TestFromRecipeDataModel(t *testing.T) { }{ { DMResources: []portableresources.LinkRecipe{{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", }, }}, VersionedResources: []*Recipe{{ - Name: to.Ptr(v20220315privatepreview.DefaultRecipeName), + Name: to.Ptr(portableresources.DefaultRecipeName), Parameters: map[string]any{ "foo": "bar", }, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go index 614e66d310..5b7866472e 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go @@ -23,7 +23,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/datastoresrp/datamodel" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" "github.com/radius-project/radius/test/testutil" @@ -126,7 +125,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "mynewhost.com", Port: 10256, - Recipe: portableresources.LinkRecipe{Name: v20220315privatepreview.DefaultRecipeName, Parameters: nil}, + Recipe: portableresources.LinkRecipe{Name: portableresources.DefaultRecipeName, Parameters: nil}, }, }, }, diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go index e8ad78c497..5ee5f719d1 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go @@ -21,7 +21,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" ) @@ -103,22 +102,22 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { return &SystemData{ CreatedBy: to.Ptr(s.CreatedBy), CreatedByType: (*CreatedByType)(to.Ptr(s.CreatedByType)), - CreatedAt: v20220315privatepreview.UnmarshalTimeString(s.CreatedAt), + CreatedAt: v1.UnmarshalTimeString(s.CreatedAt), LastModifiedBy: to.Ptr(s.LastModifiedBy), LastModifiedByType: (*CreatedByType)(to.Ptr(s.LastModifiedByType)), - LastModifiedAt: v20220315privatepreview.UnmarshalTimeString(s.LastModifiedAt), + LastModifiedAt: v1.UnmarshalTimeString(s.LastModifiedAt), } } func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { if r == nil { return portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, } } recipe := portableresources.LinkRecipe{} if r.Name == nil { - recipe.Name = v20220315privatepreview.DefaultRecipeName + recipe.Name = portableresources.DefaultRecipeName } else { recipe.Name = to.String(r.Name) } diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go index 26ee795605..4f886f97ef 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go @@ -21,7 +21,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" - "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" "github.com/radius-project/radius/pkg/to" "github.com/stretchr/testify/require" ) @@ -122,7 +121,7 @@ func TestToRecipeDataModel(t *testing.T) { { nil, portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, }, }, { @@ -146,7 +145,7 @@ func TestToRecipeDataModel(t *testing.T) { }, }, portableresources.LinkRecipe{ - Name: v20220315privatepreview.DefaultRecipeName, + Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", }, diff --git a/pkg/portableresources/api/v20220315privatepreview/util.go b/pkg/portableresources/api/v20220315privatepreview/util.go deleted file mode 100644 index 43bad67e57..0000000000 --- a/pkg/portableresources/api/v20220315privatepreview/util.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "time" -) - -// DefaultRecipeName represents the default recipe name. -const DefaultRecipeName = "default" - -// TODO: To be moved to a common package armrpc/api/v1 -// UnmarshalTimeString unmarshals a string representation of a time in RFC3339 format into a time.Time object. -func UnmarshalTimeString(ts string) *time.Time { - var tt timeRFC3339 - _ = tt.UnmarshalText([]byte(ts)) - return (*time.Time)(&tt) -} diff --git a/pkg/portableresources/api/v20220315privatepreview/util_test.go b/pkg/portableresources/api/v20220315privatepreview/util_test.go deleted file mode 100644 index c96f73f120..0000000000 --- a/pkg/portableresources/api/v20220315privatepreview/util_test.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v20220315privatepreview - -import ( - "testing" - "time" - - "github.com/stretchr/testify/require" -) - -// TODO: To be moved to a common package armrpc/api/v1 -func TestUnmarshalTimeString(t *testing.T) { - parsedTime := UnmarshalTimeString("2021-09-24T19:09:00.000000Z") - require.NotNil(t, parsedTime) - - require.Equal(t, 2021, parsedTime.Year()) - require.Equal(t, time.Month(9), parsedTime.Month()) - require.Equal(t, 24, parsedTime.Day()) - - parsedTime = UnmarshalTimeString("") - require.NotNil(t, parsedTime) - require.Equal(t, 1, parsedTime.Year()) -} diff --git a/pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go b/pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go deleted file mode 100644 index 7a36699595..0000000000 --- a/pkg/portableresources/api/v20220315privatepreview/zz_generated_time_rfc3339.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package v20220315privatepreview - - - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// TODO: Code to be moved to a common package armrpc/api/v1 - -const ( - utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` - utcLayout = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) - -type timeRFC3339 time.Time - -func (t timeRFC3339) MarshalJSON() (json []byte, err error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t timeRFC3339) MarshalText() (text []byte, err error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *timeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcLayoutJSON - if tzOffsetRegex.Match(data) { - layout = rfc3339JSON - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { - layout := utcLayout - if tzOffsetRegex.Match(data) { - layout = time.RFC3339Nano - } - return t.Parse(layout, string(data)) -} - -func (t *timeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = timeRFC3339(p) - return err -} - - -func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*timeRFC3339)(t) -} - -func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { - return nil - } - var aux timeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/pkg/portableresources/api/v20220315privatepreview/version.go b/pkg/portableresources/api/versions.go similarity index 78% rename from pkg/portableresources/api/v20220315privatepreview/version.go rename to pkg/portableresources/api/versions.go index 3a97781966..557058b8ca 100644 --- a/pkg/portableresources/api/v20220315privatepreview/version.go +++ b/pkg/portableresources/api/versions.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v20220315privatepreview +package api -// Version represents the api version in this package. -const Version = "2022-03-15-privatepreview" +// V20220315privatepreview represents the api version "2022-03-15-privatepreview". +const V20220315privatepreview = "2022-03-15-privatepreview" diff --git a/pkg/portableresources/frontend/handler/getoperations.go b/pkg/portableresources/frontend/handler/getoperations.go index 0e61ce1950..a718422d07 100644 --- a/pkg/portableresources/frontend/handler/getoperations.go +++ b/pkg/portableresources/frontend/handler/getoperations.go @@ -23,7 +23,7 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + api_ver "github.com/radius-project/radius/pkg/portableresources/api" ) var _ ctrl.Controller = (*GetOperations)(nil) @@ -44,7 +44,7 @@ func (opctrl *GetOperations) Run(ctx context.Context, w http.ResponseWriter, req sCtx := v1.ARMRequestContextFromContext(ctx) switch sCtx.APIVersion { - case v20220315privatepreview.Version: + case api_ver.V20220315privatepreview: return rest.NewOKResponse(opctrl.availableOperationsV1()), nil } diff --git a/pkg/portableresources/frontend/handler/getoperations_test.go b/pkg/portableresources/frontend/handler/getoperations_test.go index 36f3f152fa..15bbc57b4b 100644 --- a/pkg/portableresources/frontend/handler/getoperations_test.go +++ b/pkg/portableresources/frontend/handler/getoperations_test.go @@ -24,7 +24,7 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/radius-project/radius/pkg/portableresources/api/v20220315privatepreview" + api_ver "github.com/radius-project/radius/pkg/portableresources/api" "github.com/stretchr/testify/require" ) @@ -34,7 +34,7 @@ func TestRunWith20220315PrivatePreview(t *testing.T) { op, err := NewGetOperations(opts) require.NoError(t, err) ctx := v1.WithARMRequestContext(context.Background(), &v1.ARMRequestContext{ - APIVersion: v20220315privatepreview.Version, + APIVersion: api_ver.V20220315privatepreview, }) w := httptest.NewRecorder() diff --git a/pkg/portableresources/types.go b/pkg/portableresources/types.go index 26c8f7d6e7..68ef24ec90 100644 --- a/pkg/portableresources/types.go +++ b/pkg/portableresources/types.go @@ -21,19 +21,38 @@ import ( ) const ( + // DaprPubSubBrokersResourceType represents the resource type for Dapr PubSub brokers. DaprPubSubBrokersResourceType = "Applications.Dapr/pubSubBrokers" - DaprSecretStoresResourceType = "Applications.Dapr/secretStores" - DaprStateStoresResourceType = "Applications.Dapr/stateStores" - RabbitMQQueuesResourceType = "Applications.Messaging/rabbitMQQueues" - MongoDatabasesResourceType = "Applications.Datastores/mongoDatabases" - RedisCachesResourceType = "Applications.Datastores/redisCaches" - SqlDatabasesResourceType = "Applications.Datastores/sqlDatabases" - ExtendersResourceType = "Applications.Core/extenders" - - // ResourceProvisioningRecipe is the scenario when Radius manages the lifecycle of the resource through a Recipe + + // DaprSecretStoresResourceType represents the resource type for Dapr Secret stores. + DaprSecretStoresResourceType = "Applications.Dapr/secretStores" + + // DaprStateStoresResourceType represents the resource type for Dapr State stores. + DaprStateStoresResourceType = "Applications.Dapr/stateStores" + + // RabbitMQQueuesResourceType represents the resource type for RabbitMQ queue. + RabbitMQQueuesResourceType = "Applications.Messaging/rabbitMQQueues" + + // MongoDatabasesResourceType represents the resource type for Mongo database. + MongoDatabasesResourceType = "Applications.Datastores/mongoDatabases" + + // RedisCachesResourceType represents the resource type for Redis caches. + RedisCachesResourceType = "Applications.Datastores/redisCaches" + + // SqlDatabasesResourceType represents the resource type for SQL databases. + SqlDatabasesResourceType = "Applications.Datastores/sqlDatabases" + + // ExtendersResourceType represents the resource type for Extenders resource. + ExtendersResourceType = "Applications.Core/extenders" + + // ResourceProvisioningRecipe is the scenario when Radius manages the lifecycle of the resource through a Recipe. ResourceProvisioningRecipe ResourceProvisioning = "recipe" - // ResourceProvisiongManual is the scenario wher the user manages the resource and provides the values + + // ResourceProvisioningManual is the scenario where the user manages the resource and provides values. ResourceProvisioningManual ResourceProvisioning = "manual" + + // DefaultRecipeName represents the default recipe name. + DefaultRecipeName = "default" ) type RecipeData struct { From 0cb492debe9718c8db4cb1c87ff0dbb4ddee0256 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Fri, 1 Sep 2023 15:56:09 -0700 Subject: [PATCH 41/57] Initial commit of pod patching (#6188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This is the pod patching scenario of incremental adoption. ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). Fixes: #5121 ## Auto-generated summary ### 🤖 Generated by Copilot at 421e786 ### Summary 🐳🛠️📝 This pull request adds a new feature to the `corerp` package that allows users to customize the pod spec of a container resource using a `pod` field in the `KubernetesRuntimeProperties` struct. It updates the API, datamodel, renderer, typespec, and openapi.json files to support the new field, and adds a functional test case and a bicep template to verify the feature. > _We are the masters of the pod_ > _We patch the spec with our code_ > _We render the deployment with our skill_ > _We unleash the container's will_ ### Walkthrough * Add `Pod` field to `KubernetesRuntimeProperties` struct to represent Kubernetes PodSpec object patches ([link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-256a0f1ad5114a905914c6f931e4b42cc7f4c6cab143fcaebd4a77c48b2fdebeR1138-R1140), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-5275155acd7f7a59f0301cfc95f8dd38f72f22795e3197c6a150bae13dd5d5f3R85-R87), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-acc34335f7e6444b1371ec4d58b624e660fff3397b5862bada426ecf42779ee7R4191-R4195), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-2f8e96d0546ae7b99ee68e516a354825696d77ca06e49bb6f82ab1caaa778522R79-R81)) * Add logic to marshal and unmarshal `Pod` field as JSON string in `toRuntimeProperties` and `fromRuntimeProperties` functions in `container_conversion.go` ([link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbR20-R21), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbR517-R523), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbR537-R543)) * Add logic to serialize and deserialize `Pod` field as JSON object in `MarshalJSON` and `UnmarshalJSON` functions in `zz_generated_models_serde.go` ([link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-f404ae8ea064968eea9fa6e167913acc73be478dd3f36f7840767c9e7cd0d84dR2602), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-f404ae8ea064968eea9fa6e167913acc73be478dd3f36f7840767c9e7cd0d84dR2618-R2620)) * Add logic to apply `Pod` field as strategic merge patch to rendered PodSpec object in `makeDeployment` function in `render.go` ([link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R22), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R35), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R531-R547)) * Add functional test case and bicep template for container pod patching feature in `container_runtimes_test.go` and `corerp-resources-container-pod-patching.bicep` ([link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-ea9a079edf277b4770c4a91c1c9413b69b0a5a7dc32bfba16aa2020ee2f52143R150-R197), [link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-b9530ab70c6fdfbf387ed1c006077cf2c7cec41154ac32108a51205cf251a6f5R1-R58)) * Add blank line to separate `KubernetesRuntimeProperties` struct from `toRuntimeProperties` function for readability in `container_conversion.go` ([link](https://github.com/radius-project/radius/pull/6188/files?diff=unified&w=0#diff-748054c59cb5c49f1136d2fa782e435ccfb3c80be34b3d784d1d7fde679653dbR511)) --- .../2022-03-15-privatepreview/types.json | 2 +- .../2022-03-15-privatepreview/types.md | 6 ++ hack/bicep-types-radius/generated/index.json | 2 +- .../container_conversion.go | 20 +++++ .../container_conversion_test.go | 9 +++ .../testdata/containerresource-runtimes.json | 10 ++- .../containerresourcedatamodel-runtime.json | 3 +- .../zz_generated_models.go | 3 + .../zz_generated_models_serde.go | 4 + pkg/corerp/datamodel/container.go | 3 + .../controller/containers/validator.go | 41 ++++++++-- .../controller/containers/validator_test.go | 43 +++++++++++ pkg/corerp/renderers/container/manifest.go | 22 ++++++ .../renderers/container/manifest_test.go | 44 +++++++++++ pkg/corerp/renderers/container/render.go | 9 +++ pkg/corerp/renderers/container/render_test.go | 74 +++++++++++++++++++ .../2022-03-15-privatepreview/openapi.json | 9 +++ .../resources/container_runtimes_test.go | 50 +++++++++++++ ...erp-resources-container-pod-patching.bicep | 58 +++++++++++++++ typespec/Applications.Core/containers.tsp | 8 ++ 20 files changed, 409 insertions(+), 11 deletions(-) create mode 100644 test/functional/shared/resources/testdata/corerp-resources-container-pod-patching.bicep diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json index 9d8569805c..b6cbae045f 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.json @@ -1 +1 @@ -[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":111,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":107,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":108,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":109,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":74,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":75,"Flags":0,"Description":"environment"},"ports":{"Type":80,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":100,"Flags":0,"Description":"container volumes"},"command":{"Type":101,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":102,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[71,72,73]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":79,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[77,78]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":76}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":82,"httpGet":84,"tcp":87}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":83,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":85,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":86,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":88,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":90,"persistent":95}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":93,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":94,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[91,92]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":98,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":99,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[96,97]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":89}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":104,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":105,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":106,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":103}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":110,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."}}}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":113,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":114,"Flags":10,"Description":"The resource api version"},"properties":{"Type":116,"Flags":0,"Description":"Environment properties"},"tags":{"Type":136,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":124,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":125,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":134,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":135,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[117,118,119,120,121,122,123]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":126,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":127,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":129,"terraform":131}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":130,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":132,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":128}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":133}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":115}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":138,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":139,"Flags":10,"Description":"The resource api version"},"properties":{"Type":141,"Flags":0,"Description":"ExtenderResource portable resource properties"},"tags":{"Type":154,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":149,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":150,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":153,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[142,143,144,145,146,147,148]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[151,152]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":140}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":156,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":157,"Flags":10,"Description":"The resource api version"},"properties":{"Type":159,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":175,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":167,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":168,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":170,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":171,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[160,161,162,163,164,165,166]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":169}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":174,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[172,173]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":158}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":177,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":178,"Flags":10,"Description":"The resource api version"},"properties":{"Type":180,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":189,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":188,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[181,182,183,184,185,186,187]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":179}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":191,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":192,"Flags":10,"Description":"The resource api version"},"properties":{"Type":194,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":212,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":202,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":205,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":211,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[195,196,197,198,199,200,201]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[203,204]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":209,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":210,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[207,208]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":206}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":193}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":214,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":215,"Flags":10,"Description":"The resource api version"},"properties":{"Type":217,"Flags":0,"Description":"Volume properties"},"tags":{"Type":249,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":225,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":226}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[218,219,220,221,222,223,224]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":239,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":241,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":247,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":248,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":231,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":234,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":238,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[228,229,230]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[232,233]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[235,236,237]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":227}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":240}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":246,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[243,244,245]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":242}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":216}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":255,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":256,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[253,254]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":206}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":252,"Input":0}}] \ No newline at end of file +[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"6":{"Value":"Applications.Core/applications"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/applications","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":8,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":9,"Flags":10,"Description":"The resource api version"},"properties":{"Type":11,"Flags":0,"Description":"Application properties"},"tags":{"Type":45,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ApplicationProperties","Properties":{"provisioningState":{"Type":19,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"extensions":{"Type":34,"Flags":0,"Description":"The application extension."},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[12,13,14,15,16,17,18]}},{"7":{"Name":"Extension","Discriminator":"kind","BaseProperties":{},"Elements":{"daprSidecar":21,"kubernetesMetadata":26,"kubernetesNamespace":30,"manualScaling":32}}},{"2":{"Name":"DaprSidecarExtension","Properties":{"appPort":{"Type":3,"Flags":0,"Description":"The Dapr appPort. Specifies the internal listening port for the application to handle requests from the Dapr sidecar."},"appId":{"Type":4,"Flags":1,"Description":"The Dapr appId. Specifies the identifier used by Dapr for service invocation."},"config":{"Type":4,"Flags":0,"Description":"Specifies the Dapr configuration to use for the resource."},"protocol":{"Type":24,"Flags":0,"Description":"The Dapr sidecar extension protocol"},"kind":{"Type":25,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"http"}},{"6":{"Value":"grpc"}},{"5":{"Elements":[22,23]}},{"6":{"Value":"daprSidecar"}},{"2":{"Name":"KubernetesMetadataExtension","Properties":{"annotations":{"Type":27,"Flags":0,"Description":"Annotations to be applied to the Kubernetes resources output by the resource"},"labels":{"Type":28,"Flags":0,"Description":"Labels to be applied to the Kubernetes resources output by the resource"},"kind":{"Type":29,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"2":{"Name":"KubernetesMetadataExtensionAnnotations","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"KubernetesMetadataExtensionLabels","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"kubernetesMetadata"}},{"2":{"Name":"KubernetesNamespaceExtension","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace of the application environment."},"kind":{"Type":31,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"kubernetesNamespace"}},{"2":{"Name":"ManualScalingExtension","Properties":{"replicas":{"Type":3,"Flags":1,"Description":"Replica count."},"kind":{"Type":33,"Flags":1,"Description":"Discriminator property for Extension."}}}},{"6":{"Value":"manualScaling"}},{"3":{"ItemType":20}},{"2":{"Name":"ResourceStatus","Properties":{"compute":{"Type":36,"Flags":0,"Description":"Represents backing compute resource"},"outputResources":{"Type":44,"Flags":0,"Description":"Properties of an output resource"}}}},{"7":{"Name":"EnvironmentCompute","Discriminator":"kind","BaseProperties":{"resourceId":{"Type":4,"Flags":0,"Description":"The resource id of the compute resource for application environment."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."}},"Elements":{"kubernetes":41}}},{"2":{"Name":"IdentitySettings","Properties":{"kind":{"Type":40,"Flags":1,"Description":"IdentitySettingKind is the kind of supported external identity setting"},"oidcIssuer":{"Type":4,"Flags":0,"Description":"The URI for your compute platform's OIDC issuer"},"resource":{"Type":4,"Flags":0,"Description":"The resource ID of the provisioned identity"}}}},{"6":{"Value":"undefined"}},{"6":{"Value":"azure.com.workload"}},{"5":{"Elements":[38,39]}},{"2":{"Name":"KubernetesCompute","Properties":{"namespace":{"Type":4,"Flags":1,"Description":"The namespace to use for the environment."},"kind":{"Type":42,"Flags":1,"Description":"Discriminator property for EnvironmentCompute."}}}},{"6":{"Value":"kubernetes"}},{"2":{"Name":"OutputResource","Properties":{"localId":{"Type":4,"Flags":0,"Description":"The logical identifier scoped to the owning Radius resource. This is only needed or used when a resource has a dependency relationship. LocalIDs do not have any particular format or meaning beyond being compared to determine dependency relationships."},"id":{"Type":4,"Flags":0,"Description":"The UCP resource ID of the underlying resource."},"radiusManaged":{"Type":2,"Flags":0,"Description":"Determines whether Radius manages the lifecycle of the underlying resource."}}}},{"3":{"ItemType":43}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"SystemData","Properties":{"createdBy":{"Type":4,"Flags":0,"Description":"The identity that created the resource."},"createdByType":{"Type":51,"Flags":0,"Description":"The type of identity that created the resource."},"createdAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource creation (UTC)."},"lastModifiedBy":{"Type":4,"Flags":0,"Description":"The identity that last modified the resource."},"lastModifiedByType":{"Type":56,"Flags":0,"Description":"The type of identity that created the resource."},"lastModifiedAt":{"Type":4,"Flags":0,"Description":"The timestamp of resource last modification (UTC)"}}}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[47,48,49,50]}},{"6":{"Value":"User"}},{"6":{"Value":"Application"}},{"6":{"Value":"ManagedIdentity"}},{"6":{"Value":"Key"}},{"5":{"Elements":[52,53,54,55]}},{"4":{"Name":"Applications.Core/applications@2022-03-15-privatepreview","ScopeType":0,"Body":10}},{"6":{"Value":"Applications.Core/containers"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/containers","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":58,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":59,"Flags":10,"Description":"The resource api version"},"properties":{"Type":61,"Flags":0,"Description":"Container properties"},"tags":{"Type":112,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ContainerProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":69,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"container":{"Type":70,"Flags":1,"Description":"Definition of a container"},"connections":{"Type":107,"Flags":0,"Description":"Specifies a connection to another resource."},"identity":{"Type":37,"Flags":0,"Description":"IdentitySettings is the external identity setting."},"extensions":{"Type":108,"Flags":0,"Description":"Extensions spec of the resource"},"runtimes":{"Type":109,"Flags":0,"Description":"The properties for runtime configuration"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[62,63,64,65,66,67,68]}},{"2":{"Name":"Container","Properties":{"image":{"Type":4,"Flags":1,"Description":"The registry and image to download and run in your container"},"imagePullPolicy":{"Type":74,"Flags":0,"Description":"The image pull policy for the container"},"env":{"Type":75,"Flags":0,"Description":"environment"},"ports":{"Type":80,"Flags":0,"Description":"container ports"},"readinessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"livenessProbe":{"Type":81,"Flags":0,"Description":"Properties for readiness/liveness probe"},"volumes":{"Type":100,"Flags":0,"Description":"container volumes"},"command":{"Type":101,"Flags":0,"Description":"Entrypoint array. Overrides the container image's ENTRYPOINT"},"args":{"Type":102,"Flags":0,"Description":"Arguments to the entrypoint. Overrides the container image's CMD"},"workingDir":{"Type":4,"Flags":0,"Description":"Working directory for the container"}}}},{"6":{"Value":"Always"}},{"6":{"Value":"IfNotPresent"}},{"6":{"Value":"Never"}},{"5":{"Elements":[71,72,73]}},{"2":{"Name":"ContainerEnv","Properties":{},"AdditionalProperties":4}},{"2":{"Name":"ContainerPortProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"protocol":{"Type":79,"Flags":0,"Description":"The protocol in use by the port"},"provides":{"Type":4,"Flags":0,"Description":"Specifies a route provided by this port"},"scheme":{"Type":4,"Flags":0,"Description":"Specifies the URL scheme of the communication protocol. Consumers can use the scheme to construct a URL. The value defaults to 'http' or 'https' depending on the port value"},"port":{"Type":3,"Flags":0,"Description":"Specifies the port that will be exposed by this container. Must be set when value different from containerPort is desired"}}}},{"6":{"Value":"TCP"}},{"6":{"Value":"UDP"}},{"5":{"Elements":[77,78]}},{"2":{"Name":"ContainerPorts","Properties":{},"AdditionalProperties":76}},{"7":{"Name":"HealthProbeProperties","Discriminator":"kind","BaseProperties":{"initialDelaySeconds":{"Type":3,"Flags":0,"Description":"Initial delay in seconds before probing for readiness/liveness"},"failureThreshold":{"Type":3,"Flags":0,"Description":"Threshold number of times the probe fails after which a failure would be reported"},"periodSeconds":{"Type":3,"Flags":0,"Description":"Interval for the readiness/liveness probe in seconds"},"timeoutSeconds":{"Type":3,"Flags":0,"Description":"Number of seconds after which the readiness/liveness probe times out. Defaults to 5 seconds"}},"Elements":{"exec":82,"httpGet":84,"tcp":87}}},{"2":{"Name":"ExecHealthProbeProperties","Properties":{"command":{"Type":4,"Flags":1,"Description":"Command to execute to probe readiness/liveness"},"kind":{"Type":83,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"exec"}},{"2":{"Name":"HttpGetHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"path":{"Type":4,"Flags":1,"Description":"The route to make the HTTP request on"},"headers":{"Type":85,"Flags":0,"Description":"Custom HTTP headers to add to the get request"},"kind":{"Type":86,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"2":{"Name":"HttpGetHealthProbePropertiesHeaders","Properties":{},"AdditionalProperties":4}},{"6":{"Value":"httpGet"}},{"2":{"Name":"TcpHealthProbeProperties","Properties":{"containerPort":{"Type":3,"Flags":1,"Description":"The listening port number"},"kind":{"Type":88,"Flags":1,"Description":"Discriminator property for HealthProbeProperties."}}}},{"6":{"Value":"tcp"}},{"7":{"Name":"Volume","Discriminator":"kind","BaseProperties":{"mountPath":{"Type":4,"Flags":0,"Description":"The path where the volume is mounted"}},"Elements":{"ephemeral":90,"persistent":95}}},{"2":{"Name":"EphemeralVolume","Properties":{"managedStore":{"Type":93,"Flags":1,"Description":"The managed store for the ephemeral volume"},"kind":{"Type":94,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"memory"}},{"6":{"Value":"disk"}},{"5":{"Elements":[91,92]}},{"6":{"Value":"ephemeral"}},{"2":{"Name":"PersistentVolume","Properties":{"permission":{"Type":98,"Flags":0,"Description":"The persistent volume permission"},"source":{"Type":4,"Flags":1,"Description":"The source of the volume"},"kind":{"Type":99,"Flags":1,"Description":"Discriminator property for Volume."}}}},{"6":{"Value":"read"}},{"6":{"Value":"write"}},{"5":{"Elements":[96,97]}},{"6":{"Value":"persistent"}},{"2":{"Name":"ContainerVolumes","Properties":{},"AdditionalProperties":89}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"ConnectionProperties","Properties":{"source":{"Type":4,"Flags":1,"Description":"The source of the connection"},"disableDefaultEnvVars":{"Type":2,"Flags":0,"Description":"default environment variable override"},"iam":{"Type":104,"Flags":0,"Description":"IAM properties"}}}},{"2":{"Name":"IamProperties","Properties":{"kind":{"Type":105,"Flags":1,"Description":"The kind of IAM provider to configure"},"roles":{"Type":106,"Flags":0,"Description":"RBAC permissions to be assigned on the source resource"}}}},{"6":{"Value":"azure"}},{"3":{"ItemType":4}},{"2":{"Name":"ContainerPropertiesConnections","Properties":{},"AdditionalProperties":103}},{"3":{"ItemType":20}},{"2":{"Name":"RuntimesProperties","Properties":{"kubernetes":{"Type":110,"Flags":0,"Description":"The runtime configuration properties for Kubernetes"}}}},{"2":{"Name":"KubernetesRuntimeProperties","Properties":{"base":{"Type":4,"Flags":0,"Description":"The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps."},"pod":{"Type":111,"Flags":0,"Description":"A strategic merge patch that will be applied to the PodSpec object when this container is being deployed."}}}},{"2":{"Name":"KubernetesPodSpec","Properties":{},"AdditionalProperties":0}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/containers@2022-03-15-privatepreview","ScopeType":0,"Body":60}},{"6":{"Value":"Applications.Core/environments"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/environments","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":114,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":115,"Flags":10,"Description":"The resource api version"},"properties":{"Type":117,"Flags":0,"Description":"Environment properties"},"tags":{"Type":137,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"EnvironmentProperties","Properties":{"provisioningState":{"Type":125,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"compute":{"Type":36,"Flags":1,"Description":"Represents backing compute resource"},"providers":{"Type":126,"Flags":0,"Description":"The Cloud providers configuration"},"recipes":{"Type":135,"Flags":0,"Description":"Specifies Recipes linked to the Environment."},"extensions":{"Type":136,"Flags":0,"Description":"The environment extension."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[118,119,120,121,122,123,124]}},{"2":{"Name":"Providers","Properties":{"azure":{"Type":127,"Flags":0,"Description":"The Azure cloud provider definition"},"aws":{"Type":128,"Flags":0,"Description":"The AWS cloud provider definition"}}}},{"2":{"Name":"ProvidersAzure","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for Azure resources to be deployed into. For example: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup'"}}}},{"2":{"Name":"ProvidersAws","Properties":{"scope":{"Type":4,"Flags":1,"Description":"Target scope for AWS resources to be deployed into. For example: '/planes/aws/aws/accounts/000000000000/regions/us-west-2'"}}}},{"7":{"Name":"RecipeProperties","Discriminator":"templateKind","BaseProperties":{"templatePath":{"Type":4,"Flags":1,"Description":"Path to the template provided by the recipe. Currently only link to Azure Container Registry is supported."},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}},"Elements":{"bicep":130,"terraform":132}}},{"2":{"Name":"BicepRecipeProperties","Properties":{"templateKind":{"Type":131,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"bicep"}},{"2":{"Name":"TerraformRecipeProperties","Properties":{"templateVersion":{"Type":4,"Flags":0,"Description":"Version of the template to deploy. For Terraform recipes using a module registry this is required, but must be omitted for other module sources."},"templateKind":{"Type":133,"Flags":1,"Description":"Discriminator property for RecipeProperties."}}}},{"6":{"Value":"terraform"}},{"2":{"Name":"DictionaryOfRecipeProperties","Properties":{},"AdditionalProperties":129}},{"2":{"Name":"EnvironmentPropertiesRecipes","Properties":{},"AdditionalProperties":134}},{"3":{"ItemType":20}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/environments@2022-03-15-privatepreview","ScopeType":0,"Body":116}},{"6":{"Value":"Applications.Core/extenders"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/extenders","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":139,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":140,"Flags":10,"Description":"The resource api version"},"properties":{"Type":142,"Flags":0,"Description":"ExtenderResource portable resource properties"},"tags":{"Type":155,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"ExtenderProperties","Properties":{"environment":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to"},"application":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by (if applicable)"},"provisioningState":{"Type":150,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"secrets":{"Type":0,"Flags":0,"Description":"Any object"},"recipe":{"Type":151,"Flags":0,"Description":"The recipe used to automatically deploy underlying infrastructure for a portable resource"},"resourceProvisioning":{"Type":154,"Flags":0,"Description":"Specifies how the underlying service/resource is provisioned and managed. Available values are 'recipe', where Radius manages the lifecycle of the resource through a Recipe, and 'manual', where a user manages the resource and provides the values."}},"AdditionalProperties":0}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[143,144,145,146,147,148,149]}},{"2":{"Name":"Recipe","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the recipe within the environment to use"},"parameters":{"Type":0,"Flags":0,"Description":"Any object"}}}},{"6":{"Value":"recipe"}},{"6":{"Value":"manual"}},{"5":{"Elements":[152,153]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/extenders@2022-03-15-privatepreview","ScopeType":0,"Body":141}},{"6":{"Value":"Applications.Core/gateways"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/gateways","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":157,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":158,"Flags":10,"Description":"The resource api version"},"properties":{"Type":160,"Flags":0,"Description":"Gateway properties"},"tags":{"Type":176,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"GatewayProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":168,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"internal":{"Type":2,"Flags":0,"Description":"Sets Gateway to not be exposed externally (no public IP address associated). Defaults to false (exposed to internet)."},"hostname":{"Type":169,"Flags":0,"Description":"Declare hostname information for the Gateway. Leaving the hostname empty auto-assigns one: mygateway.myapp.PUBLICHOSTNAMEORIP.nip.io."},"routes":{"Type":171,"Flags":1,"Description":"Routes attached to this Gateway"},"tls":{"Type":172,"Flags":0,"Description":"TLS configuration definition for Gateway resource."},"url":{"Type":4,"Flags":2,"Description":"URL of the gateway resource. Readonly"}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[161,162,163,164,165,166,167]}},{"2":{"Name":"GatewayHostname","Properties":{"prefix":{"Type":4,"Flags":0,"Description":"Specify a prefix for the hostname: myhostname.myapp.PUBLICHOSTNAMEORIP.nip.io. Mutually exclusive with 'fullyQualifiedHostname' and will be overridden if both are defined."},"fullyQualifiedHostname":{"Type":4,"Flags":0,"Description":"Specify a fully-qualified domain name: myapp.mydomain.com. Mutually exclusive with 'prefix' and will take priority if both are defined."}}}},{"2":{"Name":"GatewayRoute","Properties":{"path":{"Type":4,"Flags":0,"Description":"The path to match the incoming request path on. Ex - /myservice."},"destination":{"Type":4,"Flags":0,"Description":"The HttpRoute to route to. Ex - myserviceroute.id."},"replacePrefix":{"Type":4,"Flags":0,"Description":"Optionally update the prefix when sending the request to the service. Ex - replacePrefix: '/' and path: '/myservice' will transform '/myservice/myroute' to '/myroute'"}}}},{"3":{"ItemType":170}},{"2":{"Name":"GatewayTls","Properties":{"sslPassthrough":{"Type":2,"Flags":0,"Description":"If true, gateway lets the https traffic sslPassthrough to the backend servers for decryption."},"minimumProtocolVersion":{"Type":175,"Flags":0,"Description":"Tls Minimum versions for Gateway resource."},"certificateFrom":{"Type":4,"Flags":0,"Description":"The resource id for the secret containing the TLS certificate and key for the gateway."}}}},{"6":{"Value":"1.2"}},{"6":{"Value":"1.3"}},{"5":{"Elements":[173,174]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/gateways@2022-03-15-privatepreview","ScopeType":0,"Body":159}},{"6":{"Value":"Applications.Core/httpRoutes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/httpRoutes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":178,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":179,"Flags":10,"Description":"The resource api version"},"properties":{"Type":181,"Flags":0,"Description":"HTTPRoute properties"},"tags":{"Type":190,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"HttpRouteProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":189,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"hostname":{"Type":4,"Flags":0,"Description":"The internal hostname accepting traffic for the HTTP Route. Readonly."},"port":{"Type":3,"Flags":0,"Description":"The port number for the HTTP Route. Defaults to 80. Readonly."},"scheme":{"Type":4,"Flags":2,"Description":"The scheme used for traffic. Readonly."},"url":{"Type":4,"Flags":2,"Description":"A stable URL that that can be used to route traffic to a resource. Readonly."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[182,183,184,185,186,187,188]}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/httpRoutes@2022-03-15-privatepreview","ScopeType":0,"Body":180}},{"6":{"Value":"Applications.Core/secretStores"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/secretStores","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":192,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":193,"Flags":10,"Description":"The resource api version"},"properties":{"Type":195,"Flags":0,"Description":"The properties of SecretStore"},"tags":{"Type":213,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"2":{"Name":"SecretStoreProperties","Properties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":203,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."},"type":{"Type":206,"Flags":0,"Description":"The type of SecretStore data"},"data":{"Type":212,"Flags":1,"Description":"An object to represent key-value type secrets"},"resource":{"Type":4,"Flags":0,"Description":"The resource id of external secret store."}}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[196,197,198,199,200,201,202]}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[204,205]}},{"2":{"Name":"SecretValueProperties","Properties":{"encoding":{"Type":210,"Flags":0,"Description":"The type of SecretValue Encoding"},"value":{"Type":4,"Flags":0,"Description":"The value of secret."},"valueFrom":{"Type":211,"Flags":0,"Description":"The Secret value source properties"}}}},{"6":{"Value":"raw"}},{"6":{"Value":"base64"}},{"5":{"Elements":[208,209]}},{"2":{"Name":"ValueFromProperties","Properties":{"name":{"Type":4,"Flags":1,"Description":"The name of the referenced secret."},"version":{"Type":4,"Flags":0,"Description":"The version of the referenced secret."}}}},{"2":{"Name":"SecretStorePropertiesData","Properties":{},"AdditionalProperties":207}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/secretStores@2022-03-15-privatepreview","ScopeType":0,"Body":194}},{"6":{"Value":"Applications.Core/volumes"}},{"6":{"Value":"2022-03-15-privatepreview"}},{"2":{"Name":"Applications.Core/volumes","Properties":{"id":{"Type":4,"Flags":10,"Description":"The resource id"},"name":{"Type":4,"Flags":9,"Description":"The resource name"},"type":{"Type":215,"Flags":10,"Description":"The resource type"},"apiVersion":{"Type":216,"Flags":10,"Description":"The resource api version"},"properties":{"Type":218,"Flags":0,"Description":"Volume properties"},"tags":{"Type":250,"Flags":0,"Description":"Resource tags."},"location":{"Type":4,"Flags":1,"Description":"The geo-location where the resource lives"},"systemData":{"Type":46,"Flags":2,"Description":"Metadata pertaining to creation and last modification of the resource."}}}},{"7":{"Name":"VolumeProperties","Discriminator":"kind","BaseProperties":{"environment":{"Type":4,"Flags":0,"Description":"Fully qualified resource ID for the environment that the portable resource is linked to (if applicable)"},"application":{"Type":4,"Flags":1,"Description":"Fully qualified resource ID for the application that the portable resource is consumed by"},"provisioningState":{"Type":226,"Flags":2,"Description":"Provisioning state of the portable resource at the time the operation was called"},"status":{"Type":35,"Flags":2,"Description":"Status of a resource."}},"Elements":{"azure.com.keyvault":227}}},{"6":{"Value":"Succeeded"}},{"6":{"Value":"Failed"}},{"6":{"Value":"Canceled"}},{"6":{"Value":"Provisioning"}},{"6":{"Value":"Updating"}},{"6":{"Value":"Deleting"}},{"6":{"Value":"Accepted"}},{"5":{"Elements":[219,220,221,222,223,224,225]}},{"2":{"Name":"AzureKeyVaultVolumeProperties","Properties":{"certificates":{"Type":240,"Flags":0,"Description":"The KeyVault certificates that this volume exposes"},"keys":{"Type":242,"Flags":0,"Description":"The KeyVault keys that this volume exposes"},"resource":{"Type":4,"Flags":1,"Description":"The ID of the keyvault to use for this volume resource"},"secrets":{"Type":248,"Flags":0,"Description":"The KeyVault secrets that this volume exposes"},"kind":{"Type":249,"Flags":1,"Description":"Discriminator property for VolumeProperties."}}}},{"2":{"Name":"CertificateObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":232,"Flags":0,"Description":"Represents secret encodings"},"format":{"Type":235,"Flags":0,"Description":"Represents certificate formats"},"name":{"Type":4,"Flags":1,"Description":"The name of the certificate"},"certType":{"Type":239,"Flags":0,"Description":"Represents certificate types"},"version":{"Type":4,"Flags":0,"Description":"Certificate version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[229,230,231]}},{"6":{"Value":"pem"}},{"6":{"Value":"pfx"}},{"5":{"Elements":[233,234]}},{"6":{"Value":"certificate"}},{"6":{"Value":"privatekey"}},{"6":{"Value":"publickey"}},{"5":{"Elements":[236,237,238]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesCertificates","Properties":{},"AdditionalProperties":228}},{"2":{"Name":"KeyObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"name":{"Type":4,"Flags":1,"Description":"The name of the key"},"version":{"Type":4,"Flags":0,"Description":"Key version"}}}},{"2":{"Name":"AzureKeyVaultVolumePropertiesKeys","Properties":{},"AdditionalProperties":241}},{"2":{"Name":"SecretObjectProperties","Properties":{"alias":{"Type":4,"Flags":0,"Description":"File name when written to disk"},"encoding":{"Type":247,"Flags":0,"Description":"Represents secret encodings"},"name":{"Type":4,"Flags":1,"Description":"The name of the secret"},"version":{"Type":4,"Flags":0,"Description":"secret version"}}}},{"6":{"Value":"utf-8"}},{"6":{"Value":"hex"}},{"6":{"Value":"base64"}},{"5":{"Elements":[244,245,246]}},{"2":{"Name":"AzureKeyVaultVolumePropertiesSecrets","Properties":{},"AdditionalProperties":243}},{"6":{"Value":"azure.com.keyvault"}},{"2":{"Name":"TrackedResourceTags","Properties":{},"AdditionalProperties":4}},{"4":{"Name":"Applications.Core/volumes@2022-03-15-privatepreview","ScopeType":0,"Body":217}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/extenders","ApiVersion":"2022-03-15-privatepreview","Output":0,"Input":0}},{"2":{"Name":"SecretStoreListSecretsResult","Properties":{"type":{"Type":256,"Flags":2,"Description":"The type of SecretStore data"},"data":{"Type":257,"Flags":2,"Description":"An object to represent key-value type secrets"}}}},{"6":{"Value":"generic"}},{"6":{"Value":"certificate"}},{"5":{"Elements":[254,255]}},{"2":{"Name":"SecretStoreListSecretsResultData","Properties":{},"AdditionalProperties":207}},{"8":{"Name":"listSecrets","ResourceType":"Applications.Core/secretStores","ApiVersion":"2022-03-15-privatepreview","Output":253,"Input":0}}] \ No newline at end of file diff --git a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md index ece5c35303..104bac72fb 100644 --- a/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md +++ b/hack/bicep-types-radius/generated/applications/applications.core/2022-03-15-privatepreview/types.md @@ -316,6 +316,12 @@ ## KubernetesRuntimeProperties ### Properties * **base**: string: The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps. +* **pod**: [KubernetesPodSpec](#kubernetespodspec): A strategic merge patch that will be applied to the PodSpec object when this container is being deployed. + +## KubernetesPodSpec +### Properties +### Additional Properties +* **Additional Properties Type**: any ## TrackedResourceTags ### Properties diff --git a/hack/bicep-types-radius/generated/index.json b/hack/bicep-types-radius/generated/index.json index 5c0e7ef2ec..f00058f3dc 100644 --- a/hack/bicep-types-radius/generated/index.json +++ b/hack/bicep-types-radius/generated/index.json @@ -1 +1 @@ -{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":112},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":137},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":155},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":176},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":190},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":213},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":250},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":257}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file +{"Resources":{"Applications.Core/applications@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":57},"Applications.Core/containers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":113},"Applications.Core/environments@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":138},"Applications.Core/extenders@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":156},"Applications.Core/gateways@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":177},"Applications.Core/httpRoutes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":191},"Applications.Core/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":214},"Applications.Core/volumes@2022-03-15-privatepreview":{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":251},"Applications.Dapr/pubSubBrokers@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":48},"Applications.Dapr/secretStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":65},"Applications.Dapr/stateStores@2022-03-15-privatepreview":{"RelativePath":"applications/applications.dapr/2022-03-15-privatepreview/types.json","Index":83},"Applications.Datastores/mongoDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":49},"Applications.Datastores/redisCaches@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":68},"Applications.Datastores/sqlDatabases@2022-03-15-privatepreview":{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":87},"Applications.Messaging/rabbitMQQueues@2022-03-15-privatepreview":{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":49}},"Functions":{"applications.core/extenders":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":252}]},"applications.core/secretstores":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.core/2022-03-15-privatepreview/types.json","Index":258}]},"applications.datastores/mongodatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":89}]},"applications.datastores/rediscaches":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":91}]},"applications.datastores/sqldatabases":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.datastores/2022-03-15-privatepreview/types.json","Index":93}]},"applications.messaging/rabbitmqqueues":{"2022-03-15-privatepreview":[{"RelativePath":"applications/applications.messaging/2022-03-15-privatepreview/types.json","Index":51}]}}} \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion.go b/pkg/corerp/api/v20220315privatepreview/container_conversion.go index 8d94e837fc..c1c7fcf993 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion.go @@ -17,6 +17,8 @@ limitations under the License. package v20220315privatepreview import ( + "encoding/json" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/corerp/datamodel" rpv1 "github.com/radius-project/radius/pkg/rp/v1" @@ -506,11 +508,22 @@ func toRuntimeProperties(runtime *RuntimesProperties) *datamodel.RuntimeProperti if runtime == nil { return nil } + r := &datamodel.RuntimeProperties{} if runtime.Kubernetes != nil { r.Kubernetes = &datamodel.KubernetesRuntime{ Base: to.String(runtime.Kubernetes.Base), } + if runtime.Kubernetes.Pod != nil { + // Serializes PodSpec patch object to JSON-encoded. Internally, Radius does JSON strategic merge patch + // with this JSON-encoded PodSpec patch object. Thus, datamodel holds JSON-encoded PodSpec patch object + // as a string. + serialiedPodPatch, err := json.Marshal(runtime.Kubernetes.Pod) + if err != nil { + return nil + } + r.Kubernetes.Pod = string(serialiedPodPatch) + } } return r } @@ -524,6 +537,13 @@ func fromRuntimeProperties(runtime *datamodel.RuntimeProperties) *RuntimesProper r.Kubernetes = &KubernetesRuntimeProperties{ Base: to.Ptr(runtime.Kubernetes.Base), } + if runtime.Kubernetes.Pod != "" { + podPatch := map[string]any{} + if err := json.Unmarshal([]byte(runtime.Kubernetes.Pod), &podPatch); err != nil { + return nil + } + r.Kubernetes.Pod = podPatch + } } return r } diff --git a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go index b776ac1a2f..207f0e5399 100644 --- a/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/container_conversion_test.go @@ -107,6 +107,7 @@ func TestContainerConvertVersionedToDataModel(t *testing.T) { require.NotNil(t, ct.Properties.Runtimes.Kubernetes) require.NotEmpty(t, ct.Properties.Runtimes.Kubernetes.Base) require.Equal(t, *r.Properties.Runtimes.Kubernetes.Base, ct.Properties.Runtimes.Kubernetes.Base) + require.Equal(t, "{\"containers\":[{\"name\":\"sidecar\"}],\"hostNetwork\":true}", ct.Properties.Runtimes.Kubernetes.Pod) } } }) @@ -173,6 +174,14 @@ func TestContainerConvertDataModelToVersioned(t *testing.T) { require.NotNil(t, versioned.Properties.Runtimes) require.NotEmpty(t, *versioned.Properties.Runtimes.Kubernetes.Base) require.Equal(t, r.Properties.Runtimes.Kubernetes.Base, *versioned.Properties.Runtimes.Kubernetes.Base) + require.Equal(t, map[string]any{ + "containers": []any{ + map[string]any{ + "name": "sidecar", + }, + }, + "hostNetwork": true, + }, versioned.Properties.Runtimes.Kubernetes.Pod) } } }) diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json index 085162bd13..f297aa46b0 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresource-runtimes.json @@ -74,7 +74,15 @@ ], "runtimes": { "kubernetes": { - "base": "apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app.kubernetes.io/name: MyApp\n ports:\n - protocol: TCP\n port: 80\n targetPort: 9376" + "base": "apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app.kubernetes.io/name: MyApp\n ports:\n - protocol: TCP\n port: 80\n targetPort: 9376", + "pod": { + "containers": [ + { + "name": "sidecar" + } + ], + "hostNetwork": true + } } } } diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json index 24e9ca4fb5..0364a72c9f 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/containerresourcedatamodel-runtime.json @@ -93,7 +93,8 @@ ], "runtimes": { "kubernetes": { - "base": "apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app.kubernetes.io/name: MyApp\n ports:\n - protocol: TCP\n port: 80\n targetPort: 9376" + "base": "apiVersion: v1\nkind: Service\nmetadata:\n name: my-service\nspec:\n selector:\n app.kubernetes.io/name: MyApp\n ports:\n - protocol: TCP\n port: 80\n targetPort: 9376", + "pod": "{\"containers\":[{\"name\":\"sidecar\"}],\"hostNetwork\":true}" } } } diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index 2984e63c92..ab9c514a02 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -1135,6 +1135,9 @@ type KubernetesRuntimeProperties struct { // The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, // Secrets, and ConfigMaps. Base *string + + // A strategic merge patch that will be applied to the PodSpec object when this container is being deployed. + Pod map[string]any } // ManualScalingExtension - ManualScaling Extension diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index 31b4f61a7c..8919ce08a3 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -2599,6 +2599,7 @@ func (k *KubernetesNamespaceExtension) UnmarshalJSON(data []byte) error { func (k KubernetesRuntimeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "base", k.Base) + populate(objectMap, "pod", k.Pod) return json.Marshal(objectMap) } @@ -2614,6 +2615,9 @@ func (k *KubernetesRuntimeProperties) UnmarshalJSON(data []byte) error { case "base": err = unpopulate(val, "Base", &k.Base) delete(rawMsg, key) + case "pod": + err = unpopulate(val, "Pod", &k.Pod) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) diff --git a/pkg/corerp/datamodel/container.go b/pkg/corerp/datamodel/container.go index 791b7d5b35..98a93c31a9 100644 --- a/pkg/corerp/datamodel/container.go +++ b/pkg/corerp/datamodel/container.go @@ -82,6 +82,9 @@ type ContainerProperties struct { type KubernetesRuntime struct { // Base represents the Kubernetes resource definition in the serialized YAML format Base string `json:"base,omitempty"` + + // Pod represents the Kuberetes PodSpec strategic merge patch to be applied to the rendered PodSpec. This is stored as a JSON-encoded string. + Pod string `json:"pod,omitempty"` } // RuntimeProperties represents the runtime configuration for the platform-specific functionalities. diff --git a/pkg/corerp/frontend/controller/containers/validator.go b/pkg/corerp/frontend/controller/containers/validator.go index 738ccb7e56..00a75dfc40 100644 --- a/pkg/corerp/frontend/controller/containers/validator.go +++ b/pkg/corerp/frontend/controller/containers/validator.go @@ -18,6 +18,7 @@ package containers import ( "context" + "encoding/json" "fmt" appsv1 "k8s.io/api/apps/v1" @@ -34,6 +35,7 @@ import ( const ( manifestTargetProperty = "$.properties.runtimes.kubernetes.base" + podTargetProperty = "$.properties.runtimes.kubernetes.pod" ) // ValidateAndMutateRequest checks if the newResource has a user-defined identity and if so, returns a bad request @@ -51,20 +53,45 @@ func ValidateAndMutateRequest(ctx context.Context, newResource, oldResource *dat } runtimes := newResource.Properties.Runtimes - if runtimes != nil && runtimes.Kubernetes != nil && runtimes.Kubernetes.Base != "" { - err := validateBaseManifest([]byte(runtimes.Kubernetes.Base), newResource) - if err != nil { - return rest.NewBadRequestARMResponse(v1.ErrorResponse{Error: err.(v1.ErrorDetails)}), nil + if runtimes != nil && runtimes.Kubernetes != nil { + if runtimes.Kubernetes.Base != "" { + err := validateBaseManifest([]byte(runtimes.Kubernetes.Base), newResource) + if err != nil { + return rest.NewBadRequestARMResponse(v1.ErrorResponse{Error: err.(v1.ErrorDetails)}), nil + } + } + + if runtimes.Kubernetes.Pod != "" { + err := validatePodSpec([]byte(runtimes.Kubernetes.Pod)) + if err != nil { + return rest.NewBadRequestARMResponse(v1.ErrorResponse{Error: err.(v1.ErrorDetails)}), nil + } } } return nil, nil } +// validatePodSpec is doing only syntactic validation for PodSpec by deserialzing the given JSON patch +// to PodSpec object at this time. The semantic validation will be done when Radius applies the +// patched object to Kubernetes API server. +func validatePodSpec(patch []byte) error { + podSpec := &corev1.PodSpec{} + err := json.Unmarshal(patch, podSpec) + if err != nil { + return v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: podTargetProperty, + Message: fmt.Sprintf("Invalid PodSpec for patching: %s.", err.Error()), + } + } + return nil +} + func errMultipleResources(typeName string, num int) v1.ErrorDetails { return v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, - Target: "$.properties.runtimes.kubernetes.base", + Target: manifestTargetProperty, Message: fmt.Sprintf("only one %s is allowed, but the manifest includes %d resources.", typeName, num), } } @@ -76,7 +103,7 @@ func errUnmatchedName(obj runtime.Object, name string) v1.ErrorDetails { return v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, - Target: "$.properties.runtimes.kubernetes.base", + Target: manifestTargetProperty, Message: fmt.Sprintf("%s name %s in manifest does not match resource name %s.", typeName, resourceName, name), } } @@ -154,7 +181,7 @@ func validateBaseManifest(manifest []byte, newResource *datamodel.ContainerResou if podSA != sa.Name { errDetails = append(errDetails, v1.ErrorDetails{ Code: v1.CodeInvalidRequestContent, - Target: "$.properties.runtimes.kubernetes.base", + Target: manifestTargetProperty, Message: fmt.Sprintf("ServiceAccount name %s in PodSpec does not match the name %s in ServiceAccount.", podSA, sa.Name), }) } diff --git a/pkg/corerp/frontend/controller/containers/validator_test.go b/pkg/corerp/frontend/controller/containers/validator_test.go index 46ec9b816b..f32a3d0cc7 100644 --- a/pkg/corerp/frontend/controller/containers/validator_test.go +++ b/pkg/corerp/frontend/controller/containers/validator_test.go @@ -401,3 +401,46 @@ func TestValidateManifest(t *testing.T) { }) } } + +const patching = ` +{ + "containers": [ + { + "name": "test" + } + ], + "nodeName": "test" +} +` + +func TestValidatePodSpec(t *testing.T) { + patchTests := []struct { + name string + patchSpec string + err error + }{ + { + name: "valid patch PodSpec", + patchSpec: patching, + err: nil, + }, + { + name: "invalid patch PodSpec", + patchSpec: "invalid", + err: v1.ErrorDetails{ + Code: v1.CodeInvalidRequestContent, + Target: podTargetProperty, + Message: "Invalid PodSpec for patching: invalid character 'i' looking for beginning of value.", + }, + }, + } + + for _, tc := range patchTests { + t.Run(tc.name, func(t *testing.T) { + err := validatePodSpec([]byte(tc.patchSpec)) + if tc.err != nil { + require.Equal(t, tc.err, err) + } + }) + } +} diff --git a/pkg/corerp/renderers/container/manifest.go b/pkg/corerp/renderers/container/manifest.go index 9efb3c592c..538832bdc4 100644 --- a/pkg/corerp/renderers/container/manifest.go +++ b/pkg/corerp/renderers/container/manifest.go @@ -18,6 +18,7 @@ package container import ( "context" + "encoding/json" "errors" "fmt" "strings" @@ -33,6 +34,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/strategicpatch" ) var errDeploymentNotFound = errors.New("deployment resource must be in outputResources") @@ -216,3 +218,23 @@ func populateAllBaseResources(ctx context.Context, base kubeutil.ObjectManifest, return outputResources } + +func patchPodSpec(sourceSpec *corev1.PodSpec, patchSpec []byte) (*corev1.PodSpec, error) { + podSpecJSON, err := json.Marshal(sourceSpec) + if err != nil { + return nil, err + } + + merged, err := strategicpatch.StrategicMergePatch(podSpecJSON, patchSpec, corev1.PodSpec{}) + if err != nil { + return nil, err + } + + patched := &corev1.PodSpec{} + err = json.Unmarshal(merged, patched) + if err != nil { + return nil, err + } + + return patched, nil +} diff --git a/pkg/corerp/renderers/container/manifest_test.go b/pkg/corerp/renderers/container/manifest_test.go index c27604d59d..12684ddf97 100644 --- a/pkg/corerp/renderers/container/manifest_test.go +++ b/pkg/corerp/renderers/container/manifest_test.go @@ -460,3 +460,47 @@ func TestPopulateAllBaseResources(t *testing.T) { require.ElementsMatch(t, []string{"Secret-dtl+8w==", "Secret-ddl9YA==", "ConfigMap-6BU8tQ==", "ConfigMap-5xU7Ig=="}, outputResources[0].CreateResource.Dependencies) }) } + +func TestPatchPodSpec(t *testing.T) { + podSpec := &corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "sidecar", + }, + { + Name: "test-container", + }, + }, + } + + patchingPod := ` +{ + "containers": [ + { + "name": "sidecar", + "image": "fluent-bit:latest" + } + ], + "nodeName": "test", + "hostNetwork": true +} +` + + expected := &corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "sidecar", + Image: "fluent-bit:latest", + }, + { + Name: "test-container", + }, + }, + NodeName: "test", + HostNetwork: true, + } + + patched, err := patchPodSpec(podSpec, []byte(patchingPod)) + require.NoError(t, err) + require.Equal(t, expected, patched) +} diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index eec9574ec9..cfac671c5f 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -651,6 +651,15 @@ func (r Renderer) makeDeployment( deps = append(deps, rpv1.LocalIDSecret) } + // Patching Runtimes.Kubernetes.Pod to the PodSpec in deployment resource. + if properties.Runtimes != nil && properties.Runtimes.Kubernetes != nil && properties.Runtimes.Kubernetes.Pod != "" { + patchedPodSpec, err := patchPodSpec(podSpec, []byte(properties.Runtimes.Kubernetes.Pod)) + if err != nil { + return []rpv1.OutputResource{}, nil, fmt.Errorf("failed to patch PodSpec: %w", err) + } + deployment.Spec.Template.Spec = *patchedPodSpec + } + deploymentOutput := rpv1.NewKubernetesOutputResource(rpv1.LocalIDDeployment, deployment, deployment.ObjectMeta) deploymentOutput.CreateResource.Dependencies = deps diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index d3436b006e..688151386e 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -1605,6 +1605,80 @@ func Test_Render_ImagePullPolicySpecified(t *testing.T) { }) } +func Test_Render_StrategicPatchMerge(t *testing.T) { + const contianerPatchObject = ` +{ + "containers": [ + { + "name": "test", + "image": "magpie" + }, + { + "name": "test-container", + "command": ["echo", "hello"], + "env": [ + { + "name": "env1", + "value": "value1" + } + ] + } + ], + "hostNetwork": true +} +` + properties := datamodel.ContainerProperties{ + BasicResourceProperties: rpv1.BasicResourceProperties{ + Application: applicationResourceID, + }, + Container: datamodel.Container{ + Image: "someimage:latest", + Env: map[string]string{ + envVarName1: envVarValue1, + envVarName2: envVarValue2, + }, + }, + Runtimes: &datamodel.RuntimeProperties{ + Kubernetes: &datamodel.KubernetesRuntime{ + Pod: contianerPatchObject, + }, + }, + } + resource := makeResource(t, properties) + dependencies := map[string]renderers.RendererDependency{} + + ctx := testcontext.New(t) + renderer := Renderer{} + output, err := renderer.Render(ctx, resource, renderers.RenderOptions{Dependencies: dependencies}) + require.NoError(t, err) + + deployment, _ := kubernetes.FindDeployment(output.Resources) + require.NotNil(t, deployment) + + require.True(t, deployment.Spec.Template.Spec.HostNetwork) + require.Len(t, deployment.Spec.Template.Spec.Containers, 2) + + expectedContainers := []corev1.Container{ + { + Name: resourceName, + Command: []string{"echo", "hello"}, + Env: []corev1.EnvVar{ + {Name: "env1", Value: "value1"}, + {Name: envVarName1, Value: envVarValue1}, + {Name: envVarName2, Value: envVarValue2}, + }, + Image: properties.Container.Image, + }, + { + Name: "test", + Env: nil, + Image: "magpie", + }, + } + + require.ElementsMatch(t, expectedContainers, deployment.Spec.Template.Spec.Containers) +} + func renderOptionsEnvAndAppKubeMetadata() renderers.RenderOptions { dependencies := map[string]renderers.RendererDependency{} option := renderers.RenderOptions{Dependencies: dependencies} diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index 891fb7fe19..d006909cbb 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -4181,6 +4181,11 @@ ], "x-ms-discriminator-value": "kubernetesNamespace" }, + "KubernetesPodSpec": { + "type": "object", + "description": "A strategic merge patch that will be applied to the PodSpec object when this container is being deployed.", + "additionalProperties": true + }, "KubernetesRuntimeProperties": { "type": "object", "description": "The runtime configuration properties for Kubernetes", @@ -4188,6 +4193,10 @@ "base": { "type": "string", "description": "The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps." + }, + "pod": { + "$ref": "#/definitions/KubernetesPodSpec", + "description": "A strategic merge patch that will be applied to the PodSpec object when this container is being deployed." } } }, diff --git a/test/functional/shared/resources/container_runtimes_test.go b/test/functional/shared/resources/container_runtimes_test.go index 2e2d2ff260..82f8a8b5b4 100644 --- a/test/functional/shared/resources/container_runtimes_test.go +++ b/test/functional/shared/resources/container_runtimes_test.go @@ -147,3 +147,53 @@ func Test_Container_YAMLManifest_SideCar(t *testing.T) { test.Test(t) } + +func Test_Container_pod_patching(t *testing.T) { + template := "testdata/corerp-resources-container-pod-patching.bicep" + name := "corerp-resources-container-podpatch" + appNamespace := "corerp-resources-container-podpatch" + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployExecutor(template, functional.GetMagpieImage()), + RPResources: &validation.RPResourceSet{ + Resources: []validation.RPResource{ + { + Name: name, + Type: validation.ApplicationsResource, + }, + { + Name: "ctnr-podpatch", + Type: validation.ContainersResource, + App: name, + }, + }, + }, + K8sObjects: &validation.K8sObjectSet{ + Namespaces: map[string][]validation.K8sObject{ + appNamespace: { + validation.NewK8sPodForResource(name, "ctnr-podpatch"), + }, + }, + }, + PostStepVerify: func(ctx context.Context, t *testing.T, test shared.RPTest) { + deploy, err := test.Options.K8sClient.AppsV1().Deployments(appNamespace).Get(ctx, "ctnr-podpatch", metav1.GetOptions{}) + require.NoError(t, err) + + t.Logf("deploy: %+v", deploy) + + require.Len(t, deploy.Spec.Template.Spec.Containers, 2) + + // Ensure that Pod includes sidecar. + require.ElementsMatch(t, []string{"ctnr-podpatch", "log-collector"}, []string{ + deploy.Spec.Template.Spec.Containers[0].Name, + deploy.Spec.Template.Spec.Containers[1].Name, + }) + + require.True(t, deploy.Spec.Template.Spec.HostNetwork) + }, + }, + }) + + test.Test(t) +} diff --git a/test/functional/shared/resources/testdata/corerp-resources-container-pod-patching.bicep b/test/functional/shared/resources/testdata/corerp-resources-container-pod-patching.bicep new file mode 100644 index 0000000000..7dd27bd62a --- /dev/null +++ b/test/functional/shared/resources/testdata/corerp-resources-container-pod-patching.bicep @@ -0,0 +1,58 @@ +import radius as radius + +@description('Specifies the location for resources.') +param location string = 'global' + +@description('Specifies the image of the container resource.') +param magpieimage string + +@description('Specifies the port of the container resource.') +param port int = 3000 + +@description('Specifies the environment for resources.') +param environment string + +resource app 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'corerp-resources-container-podpatch' + location: location + properties: { + environment: environment + extensions: [ + { + kind: 'kubernetesNamespace' + namespace: 'corerp-resources-container-podpatch' + } + ] + } +} + +resource container 'Applications.Core/containers@2022-03-15-privatepreview' = { + name: 'ctnr-podpatch' + location: location + properties: { + application: app.id + container: { + image: magpieimage + ports: { + web: { + containerPort: port + } + } + } + connections: {} + runtimes: { + kubernetes: { + pod: { + containers: [ + { + name: 'log-collector' + image: 'radiusdev.azurecr.io/fluent/fluent-bit:2.1.8' + } + ] + hostNetwork: true + } + } + } + } +} + diff --git a/typespec/Applications.Core/containers.tsp b/typespec/Applications.Core/containers.tsp index 60ceeffb24..27e8b11e1b 100644 --- a/typespec/Applications.Core/containers.tsp +++ b/typespec/Applications.Core/containers.tsp @@ -72,10 +72,18 @@ model RuntimesProperties { kubernetes?: KubernetesRuntimeProperties; } +#suppress "@azure-tools/typespec-azure-core/bad-record-type" +@doc("A strategic merge patch that will be applied to the PodSpec object when this container is being deployed.") +model KubernetesPodSpec is Record; + @doc("The runtime configuration properties for Kubernetes") model KubernetesRuntimeProperties { @doc("The serialized YAML manifest which represents the base Kubernetes resources to deploy, such as Deployment, Service, ServiceAccount, Secrets, and ConfigMaps.") base?: string; + + #suppress "@azure-tools/typespec-azure-core/bad-record-type" + @doc("A strategic merge patch that will be applied to the PodSpec object when this container is being deployed.") + pod?: KubernetesPodSpec; } @doc("Specifies a listening port for the container") From eb8f8f3867ababf1bd01aa1db719cb824090c384 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 1 Sep 2023 16:21:10 -0700 Subject: [PATCH 42/57] Add test RP for testing resource lifecycle (#6197) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This change adds a "test rp" to UCP that we can use in integration tests to verify the resource lifecycle precisely. The new tests will be updated during tracked resource implementation to test the interactions with resource groups. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 14d0807 ### Summary 🚀🧪🧹 Refactored and simplified the integration tests for the `radius` project, using new packages and types for testing resource operations, and improved the logging and readability of the test code. > _We test the async and sync resources_ > _We mock the clients and queues_ > _We simplify the code and improve the logs_ > _We are the masters of `testrp`_ ### Walkthrough * Simplify `initializeAWSTest` function by removing unused variables from return statement and using `ucp.Mocks` fields instead ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-eeda64694a7ba5705ceba51b2409e4a92335b8adcb19d48065d524ed933da403L46-R46), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-eeda64694a7ba5705ceba51b2409e4a92335b8adcb19d48065d524ed933da403L53-R53)) * Simplify test functions by removing unused variables from return value of `testserver.StartWithMocks` ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-9ba48598ee2e76b5f8152046838c5797037681d16ad9889dec6bbc5d557749b5L29-R29), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-9ba48598ee2e76b5f8152046838c5797037681d16ad9889dec6bbc5d557749b5L36-R36), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-6a6e3419d688c78b5b4e5fe442094bd83a813517e554c5ad98b2d00098d2e156L36-R36), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-6a6e3419d688c78b5b4e5fe442094bd83a813517e554c5ad98b2d00098d2e156L44-R44)) * Update `radius` package to import new packages and use new constants for testing asynchronous resource operations ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-db69491b21db2447e89782874bb114707eceaff6a84b700c20e2400317bad2a9L20-R28), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-db69491b21db2447e89782874bb114707eceaff6a84b700c20e2400317bad2a9L31-R44)) * Replace `Test_RadiusPlane_Proxy_Success` function with `Test_RadiusPlane_ResourceSync` and `Test_RadiusPlane_ResourceAsync` functions, which test the synchronous and asynchronous resource lifecycle operations using the new `testrp` package and the `worker` package ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-db69491b21db2447e89782874bb114707eceaff6a84b700c20e2400317bad2a9L81-R269)) * Add new file `pkg/ucp/integrationtests/testrp/async.go`, which contains the `AsyncResource` function that creates an HTTP handler for testing asynchronous resource operations using the `worker` package and the `backend_ctrl` package ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-1289bfcab366f6a4583213925149037ca54e7840f181f35605f4083f1c75e9bcR1-R156)) * Add new file `pkg/ucp/integrationtests/testrp/converter.go`, which contains the `TestResourceDataModelToVersioned` and `TestResourceDataModelFromVersioned` functions that convert between the version-agnostic and versioned models of the `TestResource` type using the `armrpc` package ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-e746d25880634f16c476f3968f1ad4b64e286b6c979cfc6667dfb0dfa2322c59R1-R103)) * Add new file `pkg/ucp/integrationtests/testrp/datamodel.go`, which contains the `TestResourceDatamodel` and `TestResourceDatamodelProperties` types that represent the version-agnostic data model of the `TestResource` type using the `armrpc` package ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-733b8911dd3607e3397240668dd544c28537bf77adbab0a488c785a6e283dfc8R1-R28)) * Add new file `pkg/ucp/integrationtests/testrp/resource.go`, which contains the `TestResourceList`, `TestResource`, and `TestResourceProperties` types that represent the versioned model of the `TestResource` type using the `armrpc` package ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-879883a859efaea4789f472c561440606b8f3ee02913abc9ef9db1e815cea257R1-R37)) * Add new file `pkg/ucp/integrationtests/testrp/sync.go`, which contains the `SyncResource` function that creates an HTTP handler for testing synchronous resource operations using the `frontend_ctrl` and `server` packages ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-cbcc5dc418e5865b33e5fe83553a09b3579d4cd317ffcf356d2b5b8dca27b583R1-R110)) * Update `testserver` package to import new packages and create new fields, clients, and providers for testing asynchronous resource operations ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR49-R50), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR73-R79), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR91-R111), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eL107-R137), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR151-R154), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eL163-R212), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR256-R259), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR265), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eR286), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-7016e6c35f2d910690bbbba1aa957ecc0439fabdd081576bbe49829e9f50665eL261-R318)) * Update `QueueProvider` type to add the `SetClient` method, which allows tests to mock the queue client ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-2bae5ed9d169517690778a05232fad37738cb9301f5aec9d544955bbb64efe49R65-R69)) * Update `ExtractPlanesPrefixFromURLPath` function to add named return values and use them instead of local variables, to make the code more readable and consistent ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-205044f118b5c4ccc5d1c4c9ac53023e648e8d9888bb8a25aaf572a57640a132L28-R28), [link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-205044f118b5c4ccc5d1c4c9ac53023e648e8d9888bb8a25aaf572a57640a132L57-R57)) * Update `Wrap` function to add logging options to the `testr.NewWithOptions` function, to improve the logging output for tests ([link](https://github.com/radius-project/radius/pull/6197/files?diff=unified&w=0#diff-83232aef0199447b4e895c72eb840c874fbb9eae10afeb07c30a6553008ae3e5L51-R52)) --- pkg/ucp/integrationtests/aws/awstest.go | 4 +- pkg/ucp/integrationtests/handler_test.go | 4 +- .../planes/validation_test.go | 4 +- pkg/ucp/integrationtests/radius/proxy_test.go | 228 ++++++++++++++++-- pkg/ucp/integrationtests/testrp/async.go | 159 ++++++++++++ pkg/ucp/integrationtests/testrp/converter.go | 103 ++++++++ pkg/ucp/integrationtests/testrp/datamodel.go | 28 +++ pkg/ucp/integrationtests/testrp/resource.go | 37 +++ pkg/ucp/integrationtests/testrp/sync.go | 110 +++++++++ .../integrationtests/testserver/testserver.go | 68 +++++- pkg/ucp/queue/provider/provider.go | 5 + pkg/ucp/resources/url.go | 4 +- test/testcontext/testcontext.go | 3 +- 13 files changed, 721 insertions(+), 36 deletions(-) create mode 100644 pkg/ucp/integrationtests/testrp/async.go create mode 100644 pkg/ucp/integrationtests/testrp/converter.go create mode 100644 pkg/ucp/integrationtests/testrp/datamodel.go create mode 100644 pkg/ucp/integrationtests/testrp/resource.go create mode 100644 pkg/ucp/integrationtests/testrp/sync.go diff --git a/pkg/ucp/integrationtests/aws/awstest.go b/pkg/ucp/integrationtests/aws/awstest.go index 039e380512..4676b23524 100644 --- a/pkg/ucp/integrationtests/aws/awstest.go +++ b/pkg/ucp/integrationtests/aws/awstest.go @@ -43,12 +43,12 @@ func initializeAWSTest(t *testing.T) (*testserver.TestServer, *store.MockStorage cloudControlClient := ucp_aws.NewMockAWSCloudControlClient(ctrl) cloudFormationClient := ucp_aws.NewMockAWSCloudFormationClient(ctrl) - ucp, storeClient, secretClient := testserver.StartWithMocks(t, func(options modules.Options) []modules.Initializer { + ucp := testserver.StartWithMocks(t, func(options modules.Options) []modules.Initializer { module := ucp_aws_frontend.NewModule(options) module.AWSClients.CloudControl = cloudControlClient module.AWSClients.CloudFormation = cloudFormationClient return []modules.Initializer{module} }) - return ucp, storeClient, secretClient, cloudControlClient, cloudFormationClient + return ucp, ucp.Mocks.Storage, ucp.Mocks.Secrets, cloudControlClient, cloudFormationClient } diff --git a/pkg/ucp/integrationtests/handler_test.go b/pkg/ucp/integrationtests/handler_test.go index 2a791f239f..4046735a96 100644 --- a/pkg/ucp/integrationtests/handler_test.go +++ b/pkg/ucp/integrationtests/handler_test.go @@ -26,14 +26,14 @@ import ( ) func Test_Handler_MethodNotAllowed(t *testing.T) { - ucp, _, _ := testserver.StartWithMocks(t, testserver.NoModules) + ucp := testserver.StartWithMocks(t, testserver.NoModules) response := ucp.MakeRequest(http.MethodDelete, "/planes?api-version=2022-09-01-privatepreview", nil) require.Equal(t, "failed to parse route: undefined route path", response.Error.Error.Details[0].Message) } func Test_Handler_NotFound(t *testing.T) { - ucp, _, _ := testserver.StartWithMocks(t, testserver.NoModules) + ucp := testserver.StartWithMocks(t, testserver.NoModules) response := ucp.MakeRequest(http.MethodGet, "/abc", nil) response.EqualsErrorCode(http.StatusNotFound, v1.CodeNotFound) diff --git a/pkg/ucp/integrationtests/planes/validation_test.go b/pkg/ucp/integrationtests/planes/validation_test.go index 2c5af626b5..8a864be18c 100644 --- a/pkg/ucp/integrationtests/planes/validation_test.go +++ b/pkg/ucp/integrationtests/planes/validation_test.go @@ -33,7 +33,7 @@ const ( ) func Test_Planes_GET_BadAPIVersion(t *testing.T) { - ucp, _, _ := testserver.StartWithMocks(t, api.DefaultModules) + ucp := testserver.StartWithMocks(t, api.DefaultModules) response := ucp.MakeRequest(http.MethodGet, "/planes?api-version=unsupported-version", nil) response.EqualsErrorCode(http.StatusBadRequest, v1.CodeInvalidApiVersionParameter) @@ -41,7 +41,7 @@ func Test_Planes_GET_BadAPIVersion(t *testing.T) { } func Test_Planes_PUT_BadAPIVersion(t *testing.T) { - ucp, _, _ := testserver.StartWithMocks(t, api.DefaultModules) + ucp := testserver.StartWithMocks(t, api.DefaultModules) requestBody := v20220901privatepreview.PlaneResource{ Location: to.Ptr(v1.LocationGlobal), diff --git a/pkg/ucp/integrationtests/radius/proxy_test.go b/pkg/ucp/integrationtests/radius/proxy_test.go index df4e2be573..96e45980d4 100644 --- a/pkg/ucp/integrationtests/radius/proxy_test.go +++ b/pkg/ucp/integrationtests/radius/proxy_test.go @@ -17,26 +17,31 @@ limitations under the License. package radius import ( + "context" "encoding/json" "net/http" "strings" "testing" + "time" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + backend_ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" "github.com/radius-project/radius/pkg/to" "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" "github.com/radius-project/radius/pkg/ucp/frontend/api" "github.com/radius-project/radius/pkg/ucp/integrationtests/testrp" "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const ( - apiVersionParameter = "api-version=2022-09-01-privatepreview" - testRadiusPlaneID = "/planes/radius/test" - testResourceNamespace = "Applications.Test" - testResourceGroupID = testRadiusPlaneID + "/resourceGroups/test-rg" - testResourceID = testResourceGroupID + "/providers/Applications.Test/testResources/test-resource" + apiVersionParameter = "api-version=2022-09-01-privatepreview" + testRadiusPlaneID = "/planes/radius/test" + testResourceNamespace = "System.Test" + testResourceGroupID = testRadiusPlaneID + "/resourceGroups/test-rg" + testResourceCollectionID = testResourceGroupID + "/providers/System.Test/testResources" + testResourceID = testResourceCollectionID + "/test-resource" ) func Test_RadiusPlane_Proxy_ResourceGroupDoesNotExist(t *testing.T) { @@ -50,27 +55,104 @@ func Test_RadiusPlane_Proxy_ResourceGroupDoesNotExist(t *testing.T) { response := ucp.MakeRequest(http.MethodGet, testResourceID, nil) response.EqualsErrorCode(http.StatusNotFound, "NotFound") - require.Equal(t, "the resource with id '/planes/radius/test/resourceGroups/test-rg/providers/Applications.Test/testResources/test-resource' was not found", response.Error.Error.Message) + require.Equal(t, "the resource with id '/planes/radius/test/resourceGroups/test-rg/providers/System.Test/testResources/test-resource' was not found", response.Error.Error.Message) } -func Test_RadiusPlane_Proxy_Success(t *testing.T) { +func Test_RadiusPlane_ResourceSync(t *testing.T) { ucp := testserver.StartWithETCD(t, api.DefaultModules) rp := testrp.Start(t) + rp.Handler = testrp.SyncResource(t, ucp, testResourceGroupID) - data := map[string]string{ - "message": "here is some test data", + rps := map[string]*string{ + testResourceNamespace: to.Ptr("http://" + rp.Address()), + } + createRadiusPlane(ucp, rps) + + createResourceGroup(ucp, testResourceGroupID) + + message := "here is some test data" + + t.Run("PUT", func(t *testing.T) { + data := testrp.TestResource{ + Properties: testrp.TestResourceProperties{ + Message: to.Ptr(message), + }, + } + body, err := json.Marshal(data) + require.NoError(t, err) + + response := ucp.MakeRequest(http.MethodPut, testResourceID+"?api-version="+testrp.Version, body) + response.EqualsStatusCode(http.StatusOK) + + resource := &testrp.TestResource{} + err = json.Unmarshal(response.Body.Bytes(), resource) + require.NoError(t, err) + require.Equal(t, message, *resource.Properties.Message) + }) + + t.Run("LIST", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceCollectionID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + + resources := &testrp.TestResourceList{} + err := json.Unmarshal(response.Body.Bytes(), resources) + require.NoError(t, err) + require.Len(t, resources.Value, 1) + require.Equal(t, message, *resources.Value[0].Properties.Message) + }) + + t.Run("GET", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + + resource := &testrp.TestResource{} + err := json.Unmarshal(response.Body.Bytes(), resource) + require.NoError(t, err) + require.Equal(t, message, *resource.Properties.Message) + }) + + t.Run("DELETE", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodDelete, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + }) + + t.Run("GET (after delete)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusNotFound) + }) + + t.Run("DELETE (again)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodDelete, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusNoContent) + }) +} + +func Test_RadiusPlane_ResourceAsync(t *testing.T) { + ucp := testserver.StartWithETCD(t, api.DefaultModules) + rp := testrp.Start(t) + + // Block background work item completion until we're ready. + putCh := make(chan struct{}) + deleteCh := make(chan struct{}) + onPut := func(ctx context.Context, request *backend_ctrl.Request) (backend_ctrl.Result, error) { + t.Log("PUT operation is waiting for completion") + <-putCh + return backend_ctrl.Result{}, nil } - body, err := json.Marshal(data) - require.NoError(t, err) - - rp.Handler = func(w http.ResponseWriter, r *http.Request) { - require.Equal(t, strings.ToLower(testResourceID), strings.ToLower(r.URL.Path)) - w.Header().Add("Content-Type", "application/json") - w.Header().Add("SomeHeader", "SomeValue") - w.WriteHeader(http.StatusOK) - _, err = w.Write(body) + onDelete := func(ctx context.Context, request *backend_ctrl.Request) (backend_ctrl.Result, error) { + t.Log("DELETE operation is waiting for completion") + <-deleteCh + + client, err := ucp.Clients.StorageProvider.GetStorageClient(ctx, "System.Test/testResources") + require.NoError(t, err) + err = client.Delete(ctx, testResourceID) + require.NoError(t, err) + + return backend_ctrl.Result{}, nil } + rp.Handler = testrp.AsyncResource(t, ucp, testResourceGroupID, onPut, onDelete) + rps := map[string]*string{ testResourceNamespace: to.Ptr("http://" + rp.Address()), } @@ -78,9 +160,113 @@ func Test_RadiusPlane_Proxy_Success(t *testing.T) { createResourceGroup(ucp, testResourceGroupID) - response := ucp.MakeRequest(http.MethodGet, testResourceID, nil) - response.EqualsResponse(http.StatusOK, body) - require.Equal(t, "SomeValue", response.Raw.Header.Get("SomeHeader")) + message := "here is some test data" + + t.Run("PUT", func(t *testing.T) { + data := testrp.TestResource{ + Properties: testrp.TestResourceProperties{ + Message: to.Ptr(message), + }, + } + body, err := json.Marshal(data) + require.NoError(t, err) + + response := ucp.MakeRequest(http.MethodPut, testResourceID+"?api-version="+testrp.Version, body) + response.EqualsStatusCode(http.StatusCreated) + + resource := &testrp.TestResource{} + err = json.Unmarshal(response.Body.Bytes(), resource) + require.NoError(t, err) + require.Equal(t, message, *resource.Properties.Message) + require.Equal(t, string(v1.ProvisioningStateAccepted), *resource.Properties.ProvisioningState) + + location := response.Raw.Header.Get("Location") + azureAsyncOperation := response.Raw.Header.Get("Azure-AsyncOperation") + require.True(t, strings.HasPrefix(location, ucp.BaseURL), "Location starts with UCP URL") + require.True(t, strings.HasPrefix(azureAsyncOperation, ucp.BaseURL), "Azure-AsyncOperation starts with UCP URL") + }) + + t.Run("LIST (during PUT)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceCollectionID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + + resources := &testrp.TestResourceList{} + err := json.Unmarshal(response.Body.Bytes(), resources) + require.NoError(t, err) + require.Len(t, resources.Value, 1) + require.Equal(t, message, *resources.Value[0].Properties.Message) + require.Equal(t, string(v1.ProvisioningStateAccepted), *resources.Value[0].Properties.ProvisioningState) + }) + + t.Run("GET (during PUT)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + + resource := &testrp.TestResource{} + err := json.Unmarshal(response.Body.Bytes(), resource) + require.NoError(t, err) + require.Equal(t, message, *resource.Properties.Message) + require.Equal(t, string(v1.ProvisioningStateAccepted), *resource.Properties.ProvisioningState) + }) + + t.Run("Complete PUT", func(t *testing.T) { + putCh <- struct{}{} + require.EventuallyWithT(t, func(collect *assert.CollectT) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + assert.Equal(collect, http.StatusOK, response.Raw.StatusCode) + + resource := &testrp.TestResource{} + err := json.Unmarshal(response.Body.Bytes(), resource) + assert.NoError(collect, err) + assert.Equal(collect, string(v1.ProvisioningStateSucceeded), *resource.Properties.ProvisioningState) + }, time.Second*5, time.Millisecond*100) + }) + + t.Run("DELETE", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodDelete, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusAccepted) + }) + + t.Run("LIST (during delete)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceCollectionID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + + resources := &testrp.TestResourceList{} + err := json.Unmarshal(response.Body.Bytes(), resources) + require.NoError(t, err) + require.Len(t, resources.Value, 1) + require.Equal(t, message, *resources.Value[0].Properties.Message) + require.Equal(t, string(v1.ProvisioningStateAccepted), *resources.Value[0].Properties.ProvisioningState) + }) + + t.Run("GET (during delete)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusOK) + + resource := &testrp.TestResource{} + err := json.Unmarshal(response.Body.Bytes(), resource) + require.NoError(t, err) + require.Equal(t, message, *resource.Properties.Message) + require.Equal(t, string(v1.ProvisioningStateAccepted), *resource.Properties.ProvisioningState) + }) + + t.Run("Complete DELETE", func(t *testing.T) { + deleteCh <- struct{}{} + require.EventuallyWithT(t, func(collect *assert.CollectT) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + assert.Equal(collect, http.StatusNotFound, response.Raw.StatusCode) + }, time.Second*5, time.Millisecond*100) + }) + + t.Run("GET (after delete)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodGet, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusNotFound) + }) + + t.Run("DELETE (again)", func(t *testing.T) { + response := ucp.MakeRequest(http.MethodDelete, testResourceID+"?api-version="+testrp.Version, nil) + response.EqualsStatusCode(http.StatusNoContent) + }) } func createRadiusPlane(ucp *testserver.TestServer, resourceProviders map[string]*string) { diff --git a/pkg/ucp/integrationtests/testrp/async.go b/pkg/ucp/integrationtests/testrp/async.go new file mode 100644 index 0000000000..6bf7249c52 --- /dev/null +++ b/pkg/ucp/integrationtests/testrp/async.go @@ -0,0 +1,159 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testrp + +import ( + "context" + "net/http" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + backend_ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + frontend_ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/armrpc/servicecontext" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" + "github.com/radius-project/radius/test/testcontext" + "github.com/stretchr/testify/require" +) + +type BackendFunc func(ctx context.Context, request *backend_ctrl.Request) (backend_ctrl.Result, error) + +type BackendFuncController struct { + backend_ctrl.BaseController + Func BackendFunc +} + +func (b *BackendFuncController) Run(ctx context.Context, request *backend_ctrl.Request) (backend_ctrl.Result, error) { + return b.Func(ctx, request) +} + +// AsyncResource creates an HTTP handler that can be used to test asynchronous resource lifecycle operations. +func AsyncResource(t *testing.T, ts *testserver.TestServer, rootScope string, put BackendFunc, delete BackendFunc) func(w http.ResponseWriter, r *http.Request) { + rootScope = strings.ToLower(rootScope) + + ctx := testcontext.New(t) + r := chi.NewRouter() + r.Use(servicecontext.ARMRequestCtx("", v1.LocationGlobal), middleware.LowercaseURLPath) + + resourceType := "System.Test/testResources" + + operationStoreClient, err := ts.Clients.StorageProvider.GetStorageClient(ctx, "System.Test/operationStatuses") + require.NoError(t, err) + + queueClient, err := ts.Clients.QueueProvider.GetClient(ctx) + require.NoError(t, err) + + statusManager := statusmanager.New(operationStoreClient, queueClient, "System.Test", v1.LocationGlobal) + + backendOpts := backend_ctrl.Options{ + DataProvider: ts.Clients.StorageProvider, + } + + registry := worker.NewControllerRegistry(ts.Clients.StorageProvider) + err = registry.Register(ctx, resourceType, v1.OperationPut, func(opts backend_ctrl.Options) (backend_ctrl.Controller, error) { + return &BackendFuncController{BaseController: backend_ctrl.NewBaseAsyncController(opts), Func: put}, nil + }, backendOpts) + require.NoError(t, err) + + err = registry.Register(ctx, resourceType, v1.OperationDelete, func(opts backend_ctrl.Options) (backend_ctrl.Controller, error) { + return &BackendFuncController{BaseController: backend_ctrl.NewBaseAsyncController(opts), Func: delete}, nil + }, backendOpts) + require.NoError(t, err) + + workerContext, cancel := testcontext.NewWithCancel(t) + t.Cleanup(cancel) + + w := worker.New(worker.Options{}, statusManager, queueClient, registry) + go func() { + err = w.Start(workerContext) + require.NoError(t, err) + }() + + frontendOpts := frontend_ctrl.Options{ + DataProvider: ts.Clients.StorageProvider, + StatusManager: statusManager, + } + + err = server.ConfigureDefaultHandlers(ctx, r, rootScope, false, "System.Test", nil, frontendOpts) + require.NoError(t, err) + + rootScopeRouter := server.NewSubrouter(r, rootScope) + testResourceCollectionRouter := server.NewSubrouter(rootScopeRouter, "/providers/system.test/testresources") + testResourceSingleRouter := server.NewSubrouter(rootScopeRouter, "/providers/system.test/testresources/{testResourceName}") + + resourceOptions := frontend_ctrl.ResourceOptions[TestResourceDatamodel]{ + RequestConverter: TestResourceDataModelFromVersioned, + ResponseConverter: TestResourceDataModelToVersioned, + } + + handlerOptions := []server.HandlerOptions{ + { + ParentRouter: testResourceCollectionRouter, + ResourceType: resourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncPut(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete(opt, resourceOptions) + }, + }, + } + + for _, h := range handlerOptions { + err := server.RegisterHandler(ctx, h, frontendOpts) + require.NoError(t, err) + } + + return r.ServeHTTP +} diff --git a/pkg/ucp/integrationtests/testrp/converter.go b/pkg/ucp/integrationtests/testrp/converter.go new file mode 100644 index 0000000000..656b9394db --- /dev/null +++ b/pkg/ucp/integrationtests/testrp/converter.go @@ -0,0 +1,103 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testrp + +import ( + "encoding/json" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" +) + +// TestResourceDataModelToVersioned converts version agnostic TestResource datamodel to versioned model. +func TestResourceDataModelToVersioned(model *TestResourceDatamodel, version string) (v1.VersionedModelInterface, error) { + switch version { + case Version: + versioned := &TestResource{} + if err := versioned.ConvertFrom(model); err != nil { + return nil, err + } + return versioned, nil + + default: + return nil, v1.ErrUnsupportedAPIVersion + } +} + +// TestResourceDataModelFromVersioned converts versioned TestResource model to datamodel. +func TestResourceDataModelFromVersioned(content []byte, version string) (*TestResourceDatamodel, error) { + switch version { + case Version: + am := &TestResource{} + if err := json.Unmarshal(content, am); err != nil { + return nil, err + } + dm, err := am.ConvertTo() + if err != nil { + return nil, err + } + return dm.(*TestResourceDatamodel), nil + + default: + return nil, v1.ErrUnsupportedAPIVersion + } +} + +func (src *TestResource) ConvertTo() (v1.DataModelInterface, error) { + // Note: SystemData conversion isn't required since this property comes ARM and datastore. + + converted := &TestResourceDatamodel{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + ID: to.String(src.ID), + Name: to.String(src.Name), + Type: to.String(src.Type), + Location: to.String(src.Location), + Tags: to.StringMap(src.Tags), + }, + InternalMetadata: v1.InternalMetadata{ + CreatedAPIVersion: Version, + UpdatedAPIVersion: Version, + }, + }, + Properties: TestResourceDatamodelProperties{ + Message: src.Properties.Message, + }, + } + + return converted, nil +} + +// ConvertFrom converts from version-agnostic datamodel to the versioned TestResource resource. +func (dst *TestResource) ConvertFrom(src v1.DataModelInterface) error { + tr, ok := src.(*TestResourceDatamodel) + if !ok { + return v1.ErrInvalidModelConversion + } + + dst.ID = to.Ptr(tr.ID) + dst.Name = to.Ptr(tr.Name) + dst.Type = to.Ptr(tr.Type) + dst.Location = to.Ptr(tr.Location) + dst.Tags = *to.StringMapPtr(tr.Tags) + dst.Properties = TestResourceProperties{ + Message: tr.Properties.Message, + ProvisioningState: to.Ptr[string](string(tr.InternalMetadata.AsyncProvisioningState)), + } + + return nil +} diff --git a/pkg/ucp/integrationtests/testrp/datamodel.go b/pkg/ucp/integrationtests/testrp/datamodel.go new file mode 100644 index 0000000000..b8bf099ef7 --- /dev/null +++ b/pkg/ucp/integrationtests/testrp/datamodel.go @@ -0,0 +1,28 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testrp + +import v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + +type TestResourceDatamodel struct { + v1.BaseResource + Properties TestResourceDatamodelProperties `json:"properties"` +} + +type TestResourceDatamodelProperties struct { + Message *string `json:"message,omitempty"` +} diff --git a/pkg/ucp/integrationtests/testrp/resource.go b/pkg/ucp/integrationtests/testrp/resource.go new file mode 100644 index 0000000000..f244bb1a61 --- /dev/null +++ b/pkg/ucp/integrationtests/testrp/resource.go @@ -0,0 +1,37 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testrp + +const Version = "2022-03-15-privatepreview" + +type TestResourceList struct { + Value []TestResource `json:"value"` +} + +type TestResource struct { + ID *string `json:"id"` + Type *string `json:"type"` + Name *string `json:"name"` + Location *string `json:"location"` + Tags map[string]*string + Properties TestResourceProperties `json:"properties,omitempty"` +} + +type TestResourceProperties struct { + Message *string `json:"message,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/pkg/ucp/integrationtests/testrp/sync.go b/pkg/ucp/integrationtests/testrp/sync.go new file mode 100644 index 0000000000..53ca8b4438 --- /dev/null +++ b/pkg/ucp/integrationtests/testrp/sync.go @@ -0,0 +1,110 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testrp + +import ( + "net/http" + "strings" + "testing" + + "github.com/go-chi/chi/v5" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + frontend_ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/armrpc/servicecontext" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/integrationtests/testserver" + "github.com/radius-project/radius/test/testcontext" + "github.com/stretchr/testify/require" +) + +// SyncResource creates an HTTP handler that can be used to test synchronous resource lifecycle operations. +func SyncResource(t *testing.T, ts *testserver.TestServer, rootScope string) func(w http.ResponseWriter, r *http.Request) { + rootScope = strings.ToLower(rootScope) + + ctx := testcontext.New(t) + r := chi.NewRouter() + r.Use(servicecontext.ARMRequestCtx("", v1.LocationGlobal), middleware.LowercaseURLPath) + + ctrlOpts := frontend_ctrl.Options{ + DataProvider: ts.Clients.StorageProvider, + } + + err := server.ConfigureDefaultHandlers(ctx, r, rootScope, false, "System.Test", nil, ctrlOpts) + require.NoError(t, err) + + resourceType := "System.Test/testResources" + rootScopeRouter := server.NewSubrouter(r, rootScope) + testResourceCollectionRouter := server.NewSubrouter(rootScopeRouter, "/providers/system.test/testresources") + testResourceSingleRouter := server.NewSubrouter(rootScopeRouter, "/providers/system.test/testresources/{testResourceName}") + + resourceOptions := frontend_ctrl.ResourceOptions[TestResourceDatamodel]{ + RequestConverter: TestResourceDataModelFromVersioned, + ResponseConverter: TestResourceDataModelToVersioned, + } + + handlerOptions := []server.HandlerOptions{ + { + ParentRouter: testResourceCollectionRouter, + ResourceType: resourceType, + Method: v1.OperationList, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewListResources(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationGet, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewGetResource(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationPut, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultSyncPut(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationPatch, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultSyncPut(opt, resourceOptions) + }, + }, + { + ParentRouter: testResourceSingleRouter, + ResourceType: resourceType, + Method: v1.OperationDelete, + ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { + return defaultoperation.NewDefaultSyncDelete(opt, resourceOptions) + }, + }, + } + + for _, h := range handlerOptions { + err := server.RegisterHandler(ctx, h, ctrlOpts) + require.NoError(t, err) + } + + return r.ServeHTTP +} diff --git a/pkg/ucp/integrationtests/testserver/testserver.go b/pkg/ucp/integrationtests/testserver/testserver.go index 67a0f91331..5fd3830d64 100644 --- a/pkg/ucp/integrationtests/testserver/testserver.go +++ b/pkg/ucp/integrationtests/testserver/testserver.go @@ -46,6 +46,8 @@ import ( "github.com/radius-project/radius/pkg/ucp/frontend/modules" "github.com/radius-project/radius/pkg/ucp/hosting" "github.com/radius-project/radius/pkg/ucp/hostoptions" + queue "github.com/radius-project/radius/pkg/ucp/queue/client" + queueprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" "github.com/radius-project/radius/pkg/ucp/secret" secretprovider "github.com/radius-project/radius/pkg/ucp/secret/provider" "github.com/radius-project/radius/pkg/ucp/store" @@ -68,6 +70,13 @@ type TestServer struct { // BaseURL is the base URL of the server, including the path base. BaseURL string + // Clients gets access to the clients created by TestServer regardless of whether + // they are mocks. + Clients *TestServerClients + + // Mocks gets access to the mock clients. Will be nil if StartWithETCD is used. + Mocks *TestServerMocks + // Server provides access to the test HTTP server. Server *httptest.Server @@ -79,6 +88,27 @@ type TestServer struct { shutdown sync.Once } +// TestServerClients provides access to the clients created by the TestServer. +type TestServerClients struct { + // QueueProvider is the queue client provider. + QueueProvider *queueprovider.QueueProvider + + // SecretProvider is the secret client provider. + SecretProvider *secretprovider.SecretProvider + + // StorageProvider is the storage client provider. + StorageProvider dataprovider.DataStorageProvider +} + +// TestServerMocks provides access to mock instances created by the TestServer. +type TestServerMocks struct { + // Secrets is the mock secret client. + Secrets *secret.MockClient + + // Storage is the mock storage client. + Storage *store.MockStorageClient +} + // Client provides access to an http.Client that can be used to send requests. Most tests should use the functionality // like MakeRequest instead of testing the client directly. func (ts *TestServer) Client() *http.Client { @@ -104,7 +134,7 @@ func (ts *TestServer) Close() { } // StartWithMocks creates and starts a new TestServer that used an mocks for storage. -func StartWithMocks(t *testing.T, configureModules func(options modules.Options) []modules.Initializer) (*TestServer, *store.MockStorageClient, *secret.MockClient) { +func StartWithMocks(t *testing.T, configureModules func(options modules.Options) []modules.Initializer) *TestServer { ctx, cancel := testcontext.NewWithCancel(t) // Generate a random base path to ensure we're handling it correctly. @@ -118,6 +148,10 @@ func StartWithMocks(t *testing.T, configureModules func(options modules.Options) Return(dataClient, nil). AnyTimes() + queueClient := queue.NewMockClient(ctrl) + queueProvider := queueprovider.New("System.Resources", queueprovider.QueueProviderOptions{}) + queueProvider.SetClient(queueClient) + secretClient := secret.NewMockClient(ctrl) secretProvider := secretprovider.NewSecretProvider(secretprovider.SecretProviderOptions{}) secretProvider.SetClient(secretClient) @@ -160,13 +194,22 @@ func StartWithMocks(t *testing.T, configureModules func(options modules.Options) ucp := &TestServer{ BaseURL: server.URL + pathBase, - Server: server, - cancel: cancel, - t: t, + Clients: &TestServerClients{ + QueueProvider: queueProvider, + SecretProvider: secretProvider, + StorageProvider: dataProvider, + }, + Mocks: &TestServerMocks{ + Secrets: secretClient, + Storage: dataClient, + }, + Server: server, + cancel: cancel, + t: t, } t.Cleanup(ucp.Close) - return ucp, dataClient, secretClient + return ucp } // StartWithETCD creates and starts a new TestServer that used an embedded ETCD instance for storage. @@ -210,11 +253,16 @@ func StartWithETCD(t *testing.T, configureModules func(options modules.Options) Provider: secretprovider.TypeETCDSecret, ETCD: storageOptions.ETCD, } + queueOptions := queueprovider.QueueProviderOptions{ + Provider: queueprovider.TypeInmemory, + InMemory: &queueprovider.InMemoryQueueOptions{}, + } // Generate a random base path to ensure we're handling it correctly. pathBase := "/" + uuid.New().String() dataProvider := dataprovider.NewStorageProvider(storageOptions) secretProvider := secretprovider.NewSecretProvider(secretOptions) + queueProvider := queueprovider.New("System.Resources", queueOptions) router := chi.NewRouter() router.Use(servicecontext.ARMRequestCtx(pathBase, "global")) @@ -235,6 +283,7 @@ func StartWithETCD(t *testing.T, configureModules func(options modules.Options) DataProvider: dataProvider, SecretProvider: secretProvider, SpecLoader: specLoader, + QueueProvider: queueProvider, } if configureModules == nil { @@ -258,8 +307,15 @@ func StartWithETCD(t *testing.T, configureModules func(options modules.Options) require.NoError(t, err, "failed to query etcd") logger.Info("Connected to data store") + // TODO: start worker + ucp := &TestServer{ - BaseURL: server.URL + pathBase, + BaseURL: server.URL + pathBase, + Clients: &TestServerClients{ + QueueProvider: queueProvider, + SecretProvider: secretProvider, + StorageProvider: dataProvider, + }, Server: server, cancel: cancel, etcdService: etcd, diff --git a/pkg/ucp/queue/provider/provider.go b/pkg/ucp/queue/provider/provider.go index bd706949cb..7d331e3dc6 100644 --- a/pkg/ucp/queue/provider/provider.go +++ b/pkg/ucp/queue/provider/provider.go @@ -62,3 +62,8 @@ func (p *QueueProvider) GetClient(ctx context.Context) (queue.Client, error) { return p.queueClient, err } + +// SetClient sets the queue client for the QueueProvider. This should be used by tests that need to mock the queue client. +func (p *QueueProvider) SetClient(client queue.Client) { + p.queueClient = client +} diff --git a/pkg/ucp/resources/url.go b/pkg/ucp/resources/url.go index a99d68eab8..90488e4512 100644 --- a/pkg/ucp/resources/url.go +++ b/pkg/ucp/resources/url.go @@ -25,7 +25,7 @@ import ( // ExtractPlanesPrefixFromURLPath splits a URL path into segments and checks if the first two segments are valid, returning // // the first two segments and the remainder of the URL path if valid, or an error if not. -func ExtractPlanesPrefixFromURLPath(path string) (string, string, string, error) { +func ExtractPlanesPrefixFromURLPath(path string) (planeType string, planeName string, remainder string, err error) { // Remove the /planes/foo/bar/ prefix from the URL with the minimum amount of // garbage allocated during parsing. splitCount := 5 @@ -54,7 +54,7 @@ func ExtractPlanesPrefixFromURLPath(path string) (string, string, string, error) return "", "", "", errors.New("URL paths should not contain empty segments") } - remainder := "/" + remainder = "/" if len(segments) > minimumSegmentCount { remainder = SegmentSeparator + segments[3] } diff --git a/test/testcontext/testcontext.go b/test/testcontext/testcontext.go index 372b4a3f28..6f6a65a330 100644 --- a/test/testcontext/testcontext.go +++ b/test/testcontext/testcontext.go @@ -48,7 +48,8 @@ func Wrap(t *testing.T, ctx context.Context) (context.Context, context.CancelFun ctx = context.Background() } - ctx = logr.NewContext(ctx, testr.New(t)) + // Setting verbosity so that everything gets logged. + ctx = logr.NewContext(ctx, testr.NewWithOptions(t, testr.Options{LogTimestamp: true, Verbosity: 10000})) deadline, ok := t.Deadline() if ok { return context.WithDeadline(ctx, deadline) From 0d02367bbad29bf891e33841bacd4015841245b7 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Tue, 5 Sep 2023 09:54:08 -0700 Subject: [PATCH 43/57] Update sudo prompt (#6125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Today we prompt if the user needs to enter their sudo password. There's an edge case, particularly in Codespaces, where the user can elevate without entering a password. This can cause a request to enter a password to be shown even if the user was not prompted. Simplest solution is to update prompt so that it says "enter if prompted", so if not prompted it still makes sense. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 27b9691 ### Summary 🗣️🔑📄 Updated the `deploy/install.sh` script to display a more accurate echo message about the sudo password. This was done to enhance the user experience and documentation of the radius installation process. > _`echo` message changed_ > _Clarify sudo password_ > _Winter of user's ease_ ### Walkthrough * Clarify sudo password prompt message in `deploy/install.sh` ([link](https://github.com/project-radius/radius/pull/6125/files?diff=unified&w=0#diff-ed1191c237ea4ba8f2011568f4ed0208c8d0ca36cbde1285828a61b4ff2128b4L74-R74)) --- deploy/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/install.sh b/deploy/install.sh index 49eb60d535..1395bc61df 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -71,7 +71,7 @@ runAsRoot() { local CMD="$*" if [ $EUID -ne 0 -a $USE_SUDO = "true" ]; then - echo "Additional permissions needed. Please enter your sudo password..." + echo "Additional permission needed. Please enter your sudo password if prompted..." CMD="sudo $CMD" fi From 9796f19057ae02fc3f805a49c1c83c11ef8868a3 Mon Sep 17 00:00:00 2001 From: nithyatsu <98416062+nithyatsu@users.noreply.github.com> Date: Wed, 6 Sep 2023 10:05:53 -0700 Subject: [PATCH 44/57] rad init should use current kube context for its operations (#6212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description If there was an existing workspace, rad init was using the kube context from this file, instead of current kube context. This caused init to fail. We should use current kube context for rad init and also update workspace to reflect the correct context. ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: #6028 ## Auto-generated summary ### 🤖 Generated by Copilot at f048585 ### Summary 🐛🧪♻️ This pull request fixes a test failure and simplifies the code in the `radinit` package. It updates the expected value for the `workspace.Connection` field in the `test case for the `enterInitOptions` function and moves some assignments outside an `if` statement in the same function. > _`enterInitOptions`_ > _Fix test, simplify logic_ > _Autumn of refactor_ ### Walkthrough * Simplify workspace name assignment in `enterInitOptions` function ([link](https://github.com/radius-project/radius/pull/6212/files?diff=unified&w=0#diff-a786a8b7ff8510f7a22696b1be6f2a304c325c404b381caff53b758e8e1ec482L115-R122)) * Update test case for `enterInitOptions` function in `options_test.go` to match the new logic of selecting Kubernetes context ([link](https://github.com/radius-project/radius/pull/6212/files?diff=unified&w=0#diff-8ade53961f66c9f7818a671656cdac5de7967ea3c6dcb1d54a6b63b13e27f653L160-R164)) --- pkg/cli/cmd/radinit/options.go | 18 ++++---- pkg/cli/cmd/radinit/options_test.go | 70 +++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 12 deletions(-) diff --git a/pkg/cli/cmd/radinit/options.go b/pkg/cli/cmd/radinit/options.go index 1b4b586387..350cc8b6a0 100644 --- a/pkg/cli/cmd/radinit/options.go +++ b/pkg/cli/cmd/radinit/options.go @@ -111,16 +111,16 @@ func (r *Runner) enterInitOptions(ctx context.Context) (*initOptions, *workspace options.Recipes.DevRecipes = !r.Full + // If the user has a current workspace we should overwrite it. + // If the user does not have a current workspace we should create a new one called default and set it as current + // If the user does not have a current workspace and has an existing one called default we should overwrite it and set it as current if ws == nil { - // Update the workspace with the information we captured about the environment. - workspace.Name = options.Environment.Name - workspace.Environment = fmt.Sprintf("/planes/radius/local/resourceGroups/%s/providers/Applications.Core/environments/%s", options.Environment.Name, options.Environment.Name) - workspace.Scope = fmt.Sprintf("/planes/radius/local/resourceGroups/%s", options.Environment.Name) - return &options, workspace, nil + workspace.Name = "default" + } else { + workspace.Name = ws.Name } + workspace.Environment = fmt.Sprintf("/planes/radius/local/resourceGroups/%s/providers/Applications.Core/environments/%s", options.Environment.Name, options.Environment.Name) + workspace.Scope = fmt.Sprintf("/planes/radius/local/resourceGroups/%s", options.Environment.Name) + return &options, workspace, nil - ws.Environment = fmt.Sprintf("/planes/radius/local/resourceGroups/%s/providers/Applications.Core/environments/%s", options.Environment.Name, options.Environment.Name) - ws.Scope = fmt.Sprintf("/planes/radius/local/resourceGroups/%s", options.Environment.Name) - - return &options, ws, nil } diff --git a/pkg/cli/cmd/radinit/options_test.go b/pkg/cli/cmd/radinit/options_test.go index 12b362796f..8d04393860 100644 --- a/pkg/cli/cmd/radinit/options_test.go +++ b/pkg/cli/cmd/radinit/options_test.go @@ -96,7 +96,7 @@ func Test_enterInitOptions(t *testing.T) { require.NoError(t, err) expectedWorkspace := workspaces.Workspace{ - Name: "test-env", + Name: "default", Connection: map[string]any{ "context": "kind-kind", "kind": workspaces.KindKubernetes, @@ -157,12 +157,76 @@ workspaces: expectedWorkspace := workspaces.Workspace{ Name: "abc", Connection: map[string]any{ - "context": "cool-beans", + "context": "kind-kind", + "kind": workspaces.KindKubernetes, + }, + Environment: "/planes/radius/local/resourceGroups/test-env/providers/Applications.Core/environments/test-env", + Scope: "/planes/radius/local/resourceGroups/test-env", + } + require.Equal(t, expectedWorkspace, *workspace) + + expectedOptions := initOptions{ + Cluster: clusterOptions{ + Context: "kind-kind", + Install: true, + Namespace: "radius-system", + Version: version.Version(), + }, + Environment: environmentOptions{ + Create: true, + Name: "test-env", + Namespace: "test-namespace", + }, + } + require.Equal(t, expectedOptions, *options) + }) + + t.Run("existing-workspace-with-default-as-an-entry", func(t *testing.T) { + ctrl := gomock.NewController(t) + prompter := prompt.NewMockInterface(ctrl) + k8s := kubernetes.NewMockInterface(ctrl) + helm := helm.NewMockInterface(ctrl) + + var yaml = ` +workspaces: + default: default + items: + abc: + connection: + kind: kubernetes + context: cool-beans + scope: /a/b/c + environment: /a/b/c/providers/Applications.Core/environments/ice-cold + default: + connection: + kind: kubernetes + context: hot-beans + scope: /d/e/f + environment: /a/b/c/providers/Applications.Core/environments/hot-coffee +` + v, err := makeConfig(yaml) + runner := Runner{Prompter: prompter, KubernetesInterface: k8s, HelmInterface: helm, Full: true, ConfigHolder: &framework.ConfigHolder{Config: v}} + + require.NoError(t, err) + initGetKubeContextSuccess(k8s) + initKubeContextWithKind(prompter) + initHelmMockRadiusNotInstalled(helm) + initEnvNamePrompt(prompter, "test-env") + initNamespacePrompt(prompter, "test-namespace") + initAddCloudProviderPromptNo(prompter) + setScaffoldApplicationPromptNo(prompter) + + options, workspace, err := runner.enterInitOptions(context.Background()) + require.NoError(t, err) + + expectedWorkspace := workspaces.Workspace{ + Name: "default", + Connection: map[string]any{ + "context": "kind-kind", "kind": workspaces.KindKubernetes, }, Environment: "/planes/radius/local/resourceGroups/test-env/providers/Applications.Core/environments/test-env", Scope: "/planes/radius/local/resourceGroups/test-env", - Source: "userconfig", } require.Equal(t, expectedWorkspace, *workspace) From 6a9173f962ac9d1fce1c7102ae64b072a517310b Mon Sep 17 00:00:00 2001 From: vinayada1 <28875764+vinayada1@users.noreply.github.com> Date: Wed, 6 Sep 2023 10:55:41 -0700 Subject: [PATCH 45/57] Detect deployment failures with gateway (#6126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Detect deployment failures with gateway ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). Fixes: #6015 ## Auto-generated summary ### 🤖 Generated by Copilot at 32c8c4e ### Summary 🛡️🚀🐛 This pull request adds support for the HTTPProxy custom resource from Contour, which is a way to configure ingress routes for Kubernetes applications. It does so by using the dynamic client and informer packages from `k8s.io/client-go` to create, watch, and wait for the HTTPProxy resources in the Radius RP. It also updates the RBAC rules and the error handling for the async operation metrics. > _Oh we are the coders of the Radius RP_ > _We use the dynamic client to talk to the `HTTPProxy`_ > _We watch and we wait for the ingress to be ready_ > _And we heave on the rope on the count of three_ ### Walkthrough * Add support for HTTPProxy resource from Contour, which is a custom resource that extends the ingress concept ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-13e38bac99402c4ae82609aaba31139f5f9f7c229d1bd955032255cb18f356c6R125-R132), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45L29-R32), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R54-R55), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R84-R88), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-5d6b976ca1401aa4b4ea6fdaf8142700ada0d6ddd9690bb7eed8797f91d33466L89-R89), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R32), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R40-R41), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L48-R79), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R136-R142), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L189-R228), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L204-R241), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R248-R252), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R297-R392), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1R37), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L43-R44), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L111-R112), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L118-R119), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L125-R126), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L132-R133), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L139-R140), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L146-R147), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L153-R154), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L161-R162), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L169-R170), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L176-R177), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L183-R184)) * Use dynamic client and dynamic informer to interact with any Kubernetes resource, including custom resources, without needing to know the schema beforehand (`k8s.io/client-go/dynamic` and `k8s.io/client-go/dynamic/dynamicinformer` packages) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45L29-R32), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R54-R55), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R84-R88), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R40-R41), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1R37), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L43-R44)) * Use HTTPProxy types and constants from Contour (`github.com/projectcontour/contour/apis/projectcontour/v1` package) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R32)) * Add new RBAC rule to allow Radius RP service account to get, list, and watch HTTPProxy resources ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-13e38bac99402c4ae82609aaba31139f5f9f7c229d1bd955032255cb18f356c6R125-R132)) * Add new field to `Service` struct to store dynamic client set ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R54-R55)) * Initialize dynamic client set in `NewService` function ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-454529b0ae518dcc56ddbb99b2ff6fe9b343a3f379412d04a7c663c999dd9b45R84-R88)) * Pass dynamic client set from backend service to application model ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-5d6b976ca1401aa4b4ea6fdaf8142700ada0d6ddd9690bb7eed8797f91d33466L89-R89), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L43-R44)) * Pass dynamic client set from application model to Kubernetes handler ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L111-R112), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L118-R119), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L125-R126), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L132-R133), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L139-R140), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L146-R147), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L153-R154), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L161-R162), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L169-R170), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L176-R177), [link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-e7ee031acac05594d728e23d4e9d0db2ff67d3406372583aeac14a256fcb69e1L183-R184)) * Add new case for "httpproxy" resource type in `Put` method of Kubernetes handler ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R136-R142)) * Add new method to Kubernetes handler to wait until HTTPProxy resource is ready or an error occurs (`waitUntilHTTPProxyIsReady`) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R297-R392)) * Add new method to Kubernetes handler to check the status of HTTPProxy resource and send a nil or an error to a done channel (`checkHTTPProxyStatus`) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R297-R392)) * Add new method to Kubernetes handler to add an event handler to HTTPProxy informer (`addHTTPProxyEventHandler`) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L189-R228)) * Add new function to handlers package to create and get HTTPProxy informer (`HTTPProxyInformer`) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7R248-R252)) * Add new constants and modify comment for existing constants in handlers package (`MaxHTTPProxyDeploymentTimeout`, `ProxyConditionValid`, `MaxDeploymentTimeout`) ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-033dc8a7c9b970cc30f7420ce8cf2f12a26258b276779683ba3f761c481bf0a7L48-R79)) * Improve error handling for async operation metrics by adding nil check for `res.Error` field before accessing `res.Error.Code` field in `newAsyncOperationCommonAttributes` function ([link](https://github.com/project-radius/radius/pull/6126/files?diff=unified&w=0#diff-0746ff3ed894513244b3843837993bc5f1de5716bb72e8114c0020cc6821a03bL141-R143)) --- go.mod | 2 +- pkg/armrpc/asyncoperation/worker/service.go | 10 + pkg/corerp/backend/service.go | 2 +- pkg/corerp/handlers/kubernetes.go | 322 +---- .../handlers/kubernetes_deployment_waiter.go | 323 +++++ .../kubernetes_deployment_waiter_test.go | 1116 +++++++++++++++++ .../handlers/kubernetes_http_proxy_waiter.go | 171 +++ .../kubernetes_http_proxy_waiter_test.go | 326 +++++ pkg/corerp/handlers/kubernetes_test.go | 1092 +--------------- pkg/corerp/model/application_model.go | 9 +- pkg/corerp/renderers/gateway/render.go | 15 +- pkg/corerp/renderers/gateway/render_test.go | 7 + .../shared/resources/gateway_test.go | 47 + .../corerp-resources-gateway-failure.bicep | 54 + test/functional/shared/rptest.go | 3 + 15 files changed, 2111 insertions(+), 1388 deletions(-) create mode 100644 pkg/corerp/handlers/kubernetes_deployment_waiter.go create mode 100644 pkg/corerp/handlers/kubernetes_deployment_waiter_test.go create mode 100644 pkg/corerp/handlers/kubernetes_http_proxy_waiter.go create mode 100644 pkg/corerp/handlers/kubernetes_http_proxy_waiter_test.go create mode 100644 test/functional/shared/resources/testdata/corerp-resources-gateway-failure.bicep diff --git a/go.mod b/go.mod index 4e1df70233..213c5e4731 100644 --- a/go.mod +++ b/go.mod @@ -67,7 +67,6 @@ require ( github.com/wI2L/jsondiff v0.2.0 go.etcd.io/etcd/client/v3 v3.5.9 go.etcd.io/etcd/server/v3 v3.5.9 - go.mongodb.org/mongo-driver v1.12.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 go.opentelemetry.io/contrib/instrumentation/runtime v0.42.0 go.opentelemetry.io/otel v1.16.0 @@ -98,6 +97,7 @@ require ( github.com/tidwall/gjson v1.14.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect + go.mongodb.org/mongo-driver v1.12.0 // indirect ) require ( diff --git a/pkg/armrpc/asyncoperation/worker/service.go b/pkg/armrpc/asyncoperation/worker/service.go index f8fb7c508a..d2ce0cec69 100644 --- a/pkg/armrpc/asyncoperation/worker/service.go +++ b/pkg/armrpc/asyncoperation/worker/service.go @@ -29,6 +29,9 @@ import ( "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" + + "k8s.io/client-go/dynamic" + controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -52,6 +55,8 @@ type Service struct { KubeClientSet kubernetes.Interface // KubeDiscoveryClient is the Kubernetes discovery client. KubeDiscoveryClient discovery.ServerResourcesInterface + // KubeDynamicClientSet is the Kubernetes dynamic client. + KubeDynamicClientSet dynamic.Interface } // Init initializes worker service - it initializes the StorageProvider, RequestQueue, OperationStatusManager, Controllers, KubeClient and @@ -90,6 +95,11 @@ func (s *Service) Init(ctx context.Context) error { // TODO: Disable UseLegacyDiscovery once https://github.com/radius-project/radius/issues/5974 is resolved. discoveryClient.UseLegacyDiscovery = true s.KubeDiscoveryClient = discoveryClient + + s.KubeDynamicClientSet, err = dynamic.NewForConfig(s.Options.K8sConfig) + if err != nil { + return err + } } return nil } diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go index acd679e5b1..931846bcbc 100644 --- a/pkg/corerp/backend/service.go +++ b/pkg/corerp/backend/service.go @@ -84,7 +84,7 @@ func (w *Service) Run(ctx context.Context) error { return err } - coreAppModel, err := model.NewApplicationModel(w.Options.Arm, w.KubeClient, w.KubeClientSet, w.KubeDiscoveryClient) + coreAppModel, err := model.NewApplicationModel(w.Options.Arm, w.KubeClient, w.KubeClientSet, w.KubeDiscoveryClient, w.KubeDynamicClientSet) if err != nil { return fmt.Errorf("failed to initialize application model: %w", err) } diff --git a/pkg/corerp/handlers/kubernetes.go b/pkg/corerp/handlers/kubernetes.go index 11cfb8eeb8..cbcfa770a3 100644 --- a/pkg/corerp/handlers/kubernetes.go +++ b/pkg/corerp/handlers/kubernetes.go @@ -31,14 +31,13 @@ import ( resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "github.com/radius-project/radius/pkg/ucp/ucplog" - v1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/discovery" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/informers" k8s "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" @@ -46,32 +45,33 @@ import ( ) const ( - // MaxDeploymentTimeout is the max timeout for waiting for a deployment to be ready. - // Deployment duration should not reach to this timeout since async operation worker will time out context before MaxDeploymentTimeout. - MaxDeploymentTimeout = time.Minute * time.Duration(10) // DefaultCacheResyncInterval is the interval for resyncing informer. DefaultCacheResyncInterval = time.Second * time.Duration(30) ) +// Create an interface for deployment waiter and http proxy waiter +type ResourceWaiter interface { + addDynamicEventHandler(ctx context.Context, informerFactory dynamicinformer.DynamicSharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) + addEventHandler(ctx context.Context, informerFactory informers.SharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) + waitUntilReady(ctx context.Context, item client.Object) error +} + // NewKubernetesHandler creates a new KubernetesHandler which is used to handle Kubernetes resources. -func NewKubernetesHandler(client client.Client, clientSet k8s.Interface, discoveryClient discovery.ServerResourcesInterface) ResourceHandler { +func NewKubernetesHandler(client client.Client, clientSet k8s.Interface, discoveryClient discovery.ServerResourcesInterface, dynamicClientSet dynamic.Interface) ResourceHandler { return &kubernetesHandler{ - client: client, - clientSet: clientSet, - k8sDiscoveryClient: discoveryClient, - deploymentTimeOut: MaxDeploymentTimeout, - cacheResyncInterval: DefaultCacheResyncInterval, + client: client, + k8sDiscoveryClient: discoveryClient, + httpProxyWaiter: NewHTTPProxyWaiter(dynamicClientSet), + deploymentWaiter: NewDeploymentWaiter(clientSet), } } type kubernetesHandler struct { - client client.Client - clientSet k8s.Interface + client client.Client // k8sDiscoveryClient is the Kubernetes client to used for API version lookups on Kubernetes resources. Override this for testing. k8sDiscoveryClient discovery.ServerResourcesInterface - - deploymentTimeOut time.Duration - cacheResyncInterval time.Duration + httpProxyWaiter ResourceWaiter + deploymentWaiter ResourceWaiter } // Put stores the Kubernetes resource in the cluster and returns the properties of the resource. If the resource is a @@ -118,297 +118,25 @@ func (handler *kubernetesHandler) Put(ctx context.Context, options *PutOptions) switch strings.ToLower(item.GetKind()) { case "deployment": // Monitor the deployment until it is ready. - err = handler.waitUntilDeploymentIsReady(ctx, &item) + err = handler.deploymentWaiter.waitUntilReady(ctx, &item) if err != nil { return nil, err } logger.Info(fmt.Sprintf("Deployment %s in namespace %s is ready", item.GetName(), item.GetNamespace())) return properties, nil + case "httpproxy": + err = handler.httpProxyWaiter.waitUntilReady(ctx, &item) + if err != nil { + return nil, err + } + logger.Info(fmt.Sprintf("HTTP Proxy %s in namespace %s is ready", item.GetName(), item.GetNamespace())) + return properties, nil default: // We do not monitor the other resource types. return properties, nil } } -func (handler *kubernetesHandler) waitUntilDeploymentIsReady(ctx context.Context, item client.Object) error { - logger := ucplog.FromContextOrDiscard(ctx) - - // When the deployment is done, an error nil will be sent - // In case of an error, the error will be sent - doneCh := make(chan error, 1) - - ctx, cancel := context.WithTimeout(ctx, handler.deploymentTimeOut) - // This ensures that the informer is stopped when this function is returned. - defer cancel() - - err := handler.startInformers(ctx, item, doneCh) - if err != nil { - logger.Error(err, "failed to start deployment informer") - return err - } - - select { - case <-ctx.Done(): - // Get the final deployment status - dep, err := handler.clientSet.AppsV1().Deployments(item.GetNamespace()).Get(ctx, item.GetName(), metav1.GetOptions{}) - if err != nil { - return fmt.Errorf("deployment timed out, name: %s, namespace %s, error occured while fetching latest status: %w", item.GetName(), item.GetNamespace(), err) - } - - // Now get the latest available observation of deployment current state - // note that there can be a race condition here, by the time it fetches the latest status, deployment might be succeeded - status := v1.DeploymentCondition{} - if len(dep.Status.Conditions) > 0 { - status = dep.Status.Conditions[len(dep.Status.Conditions)-1] - } - return fmt.Errorf("deployment timed out, name: %s, namespace %s, status: %s, reason: %s", item.GetName(), item.GetNamespace(), status.Message, status.Reason) - - case err := <-doneCh: - if err == nil { - logger.Info(fmt.Sprintf("Marking deployment %s in namespace %s as complete", item.GetName(), item.GetNamespace())) - } - return err - } -} - -func (handler *kubernetesHandler) addEventHandler(ctx context.Context, informerFactory informers.SharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) { - logger := ucplog.FromContextOrDiscard(ctx) - - _, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj any) { - handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - }, - UpdateFunc: func(_, newObj any) { - handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - }, - }) - - if err != nil { - logger.Error(err, "failed to add event handler") - } -} - -func (handler *kubernetesHandler) startInformers(ctx context.Context, item client.Object, doneCh chan<- error) error { - logger := ucplog.FromContextOrDiscard(ctx) - informerFactory := informers.NewSharedInformerFactoryWithOptions(handler.clientSet, handler.cacheResyncInterval, informers.WithNamespace(item.GetNamespace())) - // Add event handlers to the pod informer - handler.addEventHandler(ctx, informerFactory, informerFactory.Core().V1().Pods().Informer(), item, doneCh) - - // Add event handlers to the deployment informer - handler.addEventHandler(ctx, informerFactory, informerFactory.Apps().V1().Deployments().Informer(), item, doneCh) - - // Add event handlers to the replicaset informer - handler.addEventHandler(ctx, informerFactory, informerFactory.Apps().V1().ReplicaSets().Informer(), item, doneCh) - - // Start the informers - informerFactory.Start(ctx.Done()) - - // Wait for the deployment and pod informer's cache to be synced. - informerFactory.WaitForCacheSync(ctx.Done()) - - logger.Info(fmt.Sprintf("Informers started and caches synced for deployment: %s in namespace: %s", item.GetName(), item.GetNamespace())) - return nil -} - -// Check if all the pods in the deployment are ready -func (handler *kubernetesHandler) checkDeploymentStatus(ctx context.Context, informerFactory informers.SharedInformerFactory, item client.Object, doneCh chan<- error) bool { - logger := ucplog.FromContextOrDiscard(ctx).WithValues("deploymentName", item.GetName(), "namespace", item.GetNamespace()) - - // Get the deployment - deployment, err := informerFactory.Apps().V1().Deployments().Lister().Deployments(item.GetNamespace()).Get(item.GetName()) - if err != nil { - logger.Info("Unable to find deployment") - return false - } - - deploymentReplicaSet := handler.getCurrentReplicaSetForDeployment(ctx, informerFactory, deployment) - if deploymentReplicaSet == nil { - logger.Info("Unable to find replica set for deployment") - return false - } - - allReady := handler.checkAllPodsReady(ctx, informerFactory, deployment, deploymentReplicaSet, doneCh) - if !allReady { - logger.Info("All pods are not ready yet for deployment") - return false - } - - // Check if the deployment is ready - if deployment.Status.ObservedGeneration != deployment.Generation { - logger.Info(fmt.Sprintf("Deployment status is not ready: Observed generation: %d, Generation: %d, Deployment Replicaset: %s", deployment.Status.ObservedGeneration, deployment.Generation, deploymentReplicaSet.Name)) - return false - } - - // ObservedGeneration should be updated to latest generation to avoid stale replicas - for _, c := range deployment.Status.Conditions { - // check for complete deployment condition - // Reference https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#complete-deployment - if c.Type == v1.DeploymentProgressing && c.Status == corev1.ConditionTrue && strings.EqualFold(c.Reason, "NewReplicaSetAvailable") { - logger.Info(fmt.Sprintf("Deployment is ready. Observed generation: %d, Generation: %d, Deployment Replicaset: %s", deployment.Status.ObservedGeneration, deployment.Generation, deploymentReplicaSet.Name)) - doneCh <- nil - return true - } else { - logger.Info(fmt.Sprintf("Deployment status is: %s - %s, Reason: %s, Deployment replicaset: %s", c.Type, c.Status, c.Reason, deploymentReplicaSet.Name)) - } - } - return false -} - -// Gets the current replica set for the deployment -func (handler *kubernetesHandler) getCurrentReplicaSetForDeployment(ctx context.Context, informerFactory informers.SharedInformerFactory, deployment *v1.Deployment) *v1.ReplicaSet { - if deployment == nil { - return nil - } - - logger := ucplog.FromContextOrDiscard(ctx).WithValues("deploymentName", deployment.Name, "namespace", deployment.Namespace) - - // List all replicasets for this deployment - rl, err := informerFactory.Apps().V1().ReplicaSets().Lister().ReplicaSets(deployment.Namespace).List(labels.Everything()) - if err != nil { - // This is a valid state which will eventually be resolved. Therefore, only log the error here. - logger.Info(fmt.Sprintf("Unable to list replicasets for deployment: %s", err.Error())) - return nil - } - - if len(rl) == 0 { - // This is a valid state which will eventually be resolved. Therefore, only log the error here. - return nil - } - - deploymentRevision := deployment.Annotations["deployment.kubernetes.io/revision"] - - // Find the latest ReplicaSet associated with the deployment - for _, rs := range rl { - if !metav1.IsControlledBy(rs, deployment) { - continue - } - if rs.Annotations == nil { - continue - } - revision, ok := rs.Annotations["deployment.kubernetes.io/revision"] - if !ok { - continue - } - - // The first answer here https://stackoverflow.com/questions/59848252/kubectl-retrieving-the-current-new-replicaset-for-a-deployment-in-json-forma - // looks like the best way to determine the current replicaset. - // Match the replica set revision with the deployment revision - if deploymentRevision == revision { - return rs - } - } - - return nil -} - -func (handler *kubernetesHandler) checkAllPodsReady(ctx context.Context, informerFactory informers.SharedInformerFactory, obj *v1.Deployment, deploymentReplicaSet *v1.ReplicaSet, doneCh chan<- error) bool { - logger := ucplog.FromContextOrDiscard(ctx).WithValues("deploymentName", obj.GetName(), "namespace", obj.GetNamespace()) - logger.Info("Checking if all pods in the deployment are ready") - - podsInDeployment, err := handler.getPodsInDeployment(ctx, informerFactory, obj, deploymentReplicaSet) - if err != nil { - logger.Info(fmt.Sprintf("Error getting pods for deployment: %s", err.Error())) - return false - } - - allReady := true - for _, pod := range podsInDeployment { - podReady, err := handler.checkPodStatus(ctx, &pod) - if err != nil { - // Terminate the deployment and return the error encountered - doneCh <- err - return false - } - if !podReady { - allReady = false - } - } - - if allReady { - logger.Info(fmt.Sprintf("All %d pods in the deployment are ready", len(podsInDeployment))) - } - return allReady -} - -func (handler *kubernetesHandler) getPodsInDeployment(ctx context.Context, informerFactory informers.SharedInformerFactory, deployment *v1.Deployment, deploymentReplicaSet *v1.ReplicaSet) ([]corev1.Pod, error) { - logger := ucplog.FromContextOrDiscard(ctx) - - pods := []corev1.Pod{} - - // List all pods that match the current replica set - pl, err := informerFactory.Core().V1().Pods().Lister().Pods(deployment.GetNamespace()).List(labels.Set(deployment.Spec.Selector.MatchLabels).AsSelector()) - if err != nil { - logger.Info(fmt.Sprintf("Unable to find pods for deployment %s in namespace %s", deployment.GetName(), deployment.GetNamespace())) - return []corev1.Pod{}, nil - } - - // Filter out the pods that are not in the Deployment's current ReplicaSet - for _, p := range pl { - if !metav1.IsControlledBy(p, deploymentReplicaSet) { - continue - } - pods = append(pods, *p) - } - - return pods, nil -} - -func (handler *kubernetesHandler) checkPodStatus(ctx context.Context, pod *corev1.Pod) (bool, error) { - logger := ucplog.FromContextOrDiscard(ctx).WithValues("podName", pod.Name, "namespace", pod.Namespace) - - conditionPodReady := true - for _, cc := range pod.Status.Conditions { - if cc.Type == corev1.PodReady && cc.Status != corev1.ConditionTrue { - // Do not return false here else if the pod transitions to a crash loop backoff state, - // we won't be able to detect that condition. - conditionPodReady = false - } - - if cc.Type == corev1.ContainersReady && cc.Status != corev1.ConditionTrue { - // Do not return false here else if the pod transitions to a crash loop backoff state, - // we won't be able to detect that condition. - conditionPodReady = false - } - } - - // Sometimes container statuses are not yet available and we do not want to falsely return that the containers are ready - if len(pod.Status.ContainerStatuses) <= 0 { - return false, nil - } - - for _, cs := range pod.Status.ContainerStatuses { - // Check if the container state is terminated or unable to start due to crash loop, image pull back off or error - // Note that sometimes a pod can go into running state but can crash later and can go undetected by this condition - // We will rely on the user defining a readiness probe to ensure that the pod is ready to serve traffic for those cases - if cs.State.Terminated != nil { - logger.Info(fmt.Sprintf("Container state is terminated Reason: %s, Message: %s", cs.State.Terminated.Reason, cs.State.Terminated.Message)) - return false, fmt.Errorf("Container state is 'Terminated' Reason: %s, Message: %s", cs.State.Terminated.Reason, cs.State.Terminated.Message) - } else if cs.State.Waiting != nil { - if cs.State.Waiting.Reason == "ErrImagePull" || cs.State.Waiting.Reason == "CrashLoopBackOff" || cs.State.Waiting.Reason == "ImagePullBackOff" { - message := cs.State.Waiting.Message - if cs.LastTerminationState.Terminated != nil { - message += " LastTerminationState: " + cs.LastTerminationState.Terminated.Message - } - return false, fmt.Errorf("Container state is 'Waiting' Reason: %s, Message: %s", cs.State.Waiting.Reason, message) - } else { - return false, nil - } - } else if cs.State.Running == nil { - // The container is not yet running - return false, nil - } else if !cs.Ready { - // The container is running but has not passed its readiness probe yet - return false, nil - } - } - - if !conditionPodReady { - return false, nil - } - logger.Info("All containers for pod are ready") - return true, nil -} - // Delete decodes the identity data from the DeleteOptions, creates an unstructured object from the identity data, // and then attempts to delete the object from the Kubernetes cluster, returning an error if one occurs. func (handler *kubernetesHandler) Delete(ctx context.Context, options *DeleteOptions) error { diff --git a/pkg/corerp/handlers/kubernetes_deployment_waiter.go b/pkg/corerp/handlers/kubernetes_deployment_waiter.go new file mode 100644 index 0000000000..71d61ebff0 --- /dev/null +++ b/pkg/corerp/handlers/kubernetes_deployment_waiter.go @@ -0,0 +1,323 @@ +package handlers + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/radius-project/radius/pkg/ucp/ucplog" + v1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/dynamic/dynamicinformer" + "k8s.io/client-go/informers" + k8s "k8s.io/client-go/kubernetes" + "k8s.io/client-go/tools/cache" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + // MaxDeploymentTimeout is the max timeout for waiting for a deployment to be ready. + // Deployment duration should not reach to this timeout since async operation worker will time out context before MaxDeploymentTimeout. + MaxDeploymentTimeout = time.Minute * time.Duration(10) +) + +type deploymentWaiter struct { + clientSet k8s.Interface + deploymentTimeOut time.Duration + cacheResyncInterval time.Duration +} + +func NewDeploymentWaiter(clientSet k8s.Interface) *deploymentWaiter { + return &deploymentWaiter{ + clientSet: clientSet, + deploymentTimeOut: MaxDeploymentTimeout, + cacheResyncInterval: DefaultCacheResyncInterval, + } +} + +func (handler *deploymentWaiter) addEventHandler(ctx context.Context, informerFactory informers.SharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) { + logger := ucplog.FromContextOrDiscard(ctx) + + _, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj any) { + handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + }, + UpdateFunc: func(_, newObj any) { + handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + }, + }) + + if err != nil { + logger.Error(err, "failed to add event handler") + } +} + +// addDynamicEventHandler is not implemented for deploymentWaiter +func (handler *deploymentWaiter) addDynamicEventHandler(ctx context.Context, informerFactory dynamicinformer.DynamicSharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) { +} + +func (handler *deploymentWaiter) waitUntilReady(ctx context.Context, item client.Object) error { + logger := ucplog.FromContextOrDiscard(ctx) + + // When the deployment is done, an error nil will be sent + // In case of an error, the error will be sent + doneCh := make(chan error, 1) + + ctx, cancel := context.WithTimeout(ctx, handler.deploymentTimeOut) + // This ensures that the informer is stopped when this function is returned. + defer cancel() + + err := handler.startInformers(ctx, item, doneCh) + if err != nil { + logger.Error(err, "failed to start deployment informer") + return err + } + + select { + case <-ctx.Done(): + // Get the final deployment status + dep, err := handler.clientSet.AppsV1().Deployments(item.GetNamespace()).Get(ctx, item.GetName(), metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("deployment timed out, name: %s, namespace %s, error occured while fetching latest status: %w", item.GetName(), item.GetNamespace(), err) + } + + // Now get the latest available observation of deployment current state + // note that there can be a race condition here, by the time it fetches the latest status, deployment might be succeeded + status := v1.DeploymentCondition{} + if len(dep.Status.Conditions) > 0 { + status = dep.Status.Conditions[len(dep.Status.Conditions)-1] + } + return fmt.Errorf("deployment timed out, name: %s, namespace %s, status: %s, reason: %s", item.GetName(), item.GetNamespace(), status.Message, status.Reason) + + case err := <-doneCh: + if err == nil { + logger.Info(fmt.Sprintf("Marking deployment %s in namespace %s as complete", item.GetName(), item.GetNamespace())) + } + return err + } +} + +// Check if all the pods in the deployment are ready +func (handler *deploymentWaiter) checkDeploymentStatus(ctx context.Context, informerFactory informers.SharedInformerFactory, item client.Object, doneCh chan<- error) bool { + logger := ucplog.FromContextOrDiscard(ctx).WithValues("deploymentName", item.GetName(), "namespace", item.GetNamespace()) + + // Get the deployment + deployment, err := informerFactory.Apps().V1().Deployments().Lister().Deployments(item.GetNamespace()).Get(item.GetName()) + if err != nil { + logger.Info("Unable to find deployment") + return false + } + + deploymentReplicaSet := handler.getCurrentReplicaSetForDeployment(ctx, informerFactory, deployment) + if deploymentReplicaSet == nil { + logger.Info("Unable to find replica set for deployment") + return false + } + + allReady := handler.checkAllPodsReady(ctx, informerFactory, deployment, deploymentReplicaSet, doneCh) + if !allReady { + logger.Info("All pods are not ready yet for deployment") + return false + } + + // Check if the deployment is ready + if deployment.Status.ObservedGeneration != deployment.Generation { + logger.Info(fmt.Sprintf("Deployment status is not ready: Observed generation: %d, Generation: %d, Deployment Replicaset: %s", deployment.Status.ObservedGeneration, deployment.Generation, deploymentReplicaSet.Name)) + return false + } + + // ObservedGeneration should be updated to latest generation to avoid stale replicas + for _, c := range deployment.Status.Conditions { + // check for complete deployment condition + // Reference https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#complete-deployment + if c.Type == v1.DeploymentProgressing && c.Status == corev1.ConditionTrue && strings.EqualFold(c.Reason, "NewReplicaSetAvailable") { + logger.Info(fmt.Sprintf("Deployment is ready. Observed generation: %d, Generation: %d, Deployment Replicaset: %s", deployment.Status.ObservedGeneration, deployment.Generation, deploymentReplicaSet.Name)) + doneCh <- nil + return true + } else { + logger.Info(fmt.Sprintf("Deployment status is: %s - %s, Reason: %s, Deployment replicaset: %s", c.Type, c.Status, c.Reason, deploymentReplicaSet.Name)) + } + } + return false +} + +func (handler *deploymentWaiter) startInformers(ctx context.Context, item client.Object, doneCh chan<- error) error { + logger := ucplog.FromContextOrDiscard(ctx) + + informerFactory := informers.NewSharedInformerFactoryWithOptions(handler.clientSet, handler.cacheResyncInterval, informers.WithNamespace(item.GetNamespace())) + // Add event handlers to the pod informer + handler.addEventHandler(ctx, informerFactory, informerFactory.Core().V1().Pods().Informer(), item, doneCh) + + // Add event handlers to the deployment informer + handler.addEventHandler(ctx, informerFactory, informerFactory.Apps().V1().Deployments().Informer(), item, doneCh) + + // Add event handlers to the replicaset informer + handler.addEventHandler(ctx, informerFactory, informerFactory.Apps().V1().ReplicaSets().Informer(), item, doneCh) + + // Start the informers + informerFactory.Start(ctx.Done()) + + // Wait for the deployment and pod informer's cache to be synced. + informerFactory.WaitForCacheSync(ctx.Done()) + + logger.Info(fmt.Sprintf("Informers started and caches synced for deployment: %s in namespace: %s", item.GetName(), item.GetNamespace())) + return nil +} + +// Gets the current replica set for the deployment +func (handler *deploymentWaiter) getCurrentReplicaSetForDeployment(ctx context.Context, informerFactory informers.SharedInformerFactory, deployment *v1.Deployment) *v1.ReplicaSet { + if deployment == nil { + return nil + } + + logger := ucplog.FromContextOrDiscard(ctx).WithValues("deploymentName", deployment.Name, "namespace", deployment.Namespace) + + // List all replicasets for this deployment + rl, err := informerFactory.Apps().V1().ReplicaSets().Lister().ReplicaSets(deployment.Namespace).List(labels.Everything()) + if err != nil { + // This is a valid state which will eventually be resolved. Therefore, only log the error here. + logger.Info(fmt.Sprintf("Unable to list replicasets for deployment: %s", err.Error())) + return nil + } + + if len(rl) == 0 { + // This is a valid state which will eventually be resolved. Therefore, only log the error here. + return nil + } + + deploymentRevision := deployment.Annotations["deployment.kubernetes.io/revision"] + + // Find the latest ReplicaSet associated with the deployment + for _, rs := range rl { + if !metav1.IsControlledBy(rs, deployment) { + continue + } + if rs.Annotations == nil { + continue + } + revision, ok := rs.Annotations["deployment.kubernetes.io/revision"] + if !ok { + continue + } + + // The first answer here https://stackoverflow.com/questions/59848252/kubectl-retrieving-the-current-new-replicaset-for-a-deployment-in-json-forma + // looks like the best way to determine the current replicaset. + // Match the replica set revision with the deployment revision + if deploymentRevision == revision { + return rs + } + } + + return nil +} + +func (handler *deploymentWaiter) checkAllPodsReady(ctx context.Context, informerFactory informers.SharedInformerFactory, obj *v1.Deployment, deploymentReplicaSet *v1.ReplicaSet, doneCh chan<- error) bool { + logger := ucplog.FromContextOrDiscard(ctx).WithValues("deploymentName", obj.GetName(), "namespace", obj.GetNamespace()) + logger.Info("Checking if all pods in the deployment are ready") + + podsInDeployment, err := handler.getPodsInDeployment(ctx, informerFactory, obj, deploymentReplicaSet) + if err != nil { + logger.Info(fmt.Sprintf("Error getting pods for deployment: %s", err.Error())) + return false + } + + allReady := true + for _, pod := range podsInDeployment { + podReady, err := handler.checkPodStatus(ctx, &pod) + if err != nil { + // Terminate the deployment and return the error encountered + doneCh <- err + return false + } + if !podReady { + allReady = false + } + } + + if allReady { + logger.Info(fmt.Sprintf("All %d pods in the deployment are ready", len(podsInDeployment))) + } + return allReady +} + +func (handler *deploymentWaiter) getPodsInDeployment(ctx context.Context, informerFactory informers.SharedInformerFactory, deployment *v1.Deployment, deploymentReplicaSet *v1.ReplicaSet) ([]corev1.Pod, error) { + logger := ucplog.FromContextOrDiscard(ctx) + + pods := []corev1.Pod{} + + // List all pods that match the current replica set + pl, err := informerFactory.Core().V1().Pods().Lister().Pods(deployment.GetNamespace()).List(labels.Set(deployment.Spec.Selector.MatchLabels).AsSelector()) + if err != nil { + logger.Info(fmt.Sprintf("Unable to find pods for deployment %s in namespace %s", deployment.GetName(), deployment.GetNamespace())) + return []corev1.Pod{}, nil + } + + // Filter out the pods that are not in the Deployment's current ReplicaSet + for _, p := range pl { + if !metav1.IsControlledBy(p, deploymentReplicaSet) { + continue + } + pods = append(pods, *p) + } + + return pods, nil +} + +func (handler *deploymentWaiter) checkPodStatus(ctx context.Context, pod *corev1.Pod) (bool, error) { + logger := ucplog.FromContextOrDiscard(ctx).WithValues("podName", pod.Name, "namespace", pod.Namespace) + + conditionPodReady := true + for _, cc := range pod.Status.Conditions { + if cc.Type == corev1.PodReady && cc.Status != corev1.ConditionTrue { + // Do not return false here else if the pod transitions to a crash loop backoff state, + // we won't be able to detect that condition. + conditionPodReady = false + } + + if cc.Type == corev1.ContainersReady && cc.Status != corev1.ConditionTrue { + // Do not return false here else if the pod transitions to a crash loop backoff state, + // we won't be able to detect that condition. + conditionPodReady = false + } + } + + // Sometimes container statuses are not yet available and we do not want to falsely return that the containers are ready + if len(pod.Status.ContainerStatuses) <= 0 { + return false, nil + } + + for _, cs := range pod.Status.ContainerStatuses { + // Check if the container state is terminated or unable to start due to crash loop, image pull back off or error + // Note that sometimes a pod can go into running state but can crash later and can go undetected by this condition + // We will rely on the user defining a readiness probe to ensure that the pod is ready to serve traffic for those cases + if cs.State.Terminated != nil { + logger.Info(fmt.Sprintf("Container state is terminated Reason: %s, Message: %s", cs.State.Terminated.Reason, cs.State.Terminated.Message)) + return false, fmt.Errorf("Container state is 'Terminated' Reason: %s, Message: %s", cs.State.Terminated.Reason, cs.State.Terminated.Message) + } else if cs.State.Waiting != nil { + if cs.State.Waiting.Reason == "ErrImagePull" || cs.State.Waiting.Reason == "CrashLoopBackOff" || cs.State.Waiting.Reason == "ImagePullBackOff" { + message := cs.State.Waiting.Message + if cs.LastTerminationState.Terminated != nil { + message += " LastTerminationState: " + cs.LastTerminationState.Terminated.Message + } + return false, fmt.Errorf("Container state is 'Waiting' Reason: %s, Message: %s", cs.State.Waiting.Reason, message) + } else { + return false, nil + } + } else if cs.State.Running == nil { + // The container is not yet running + return false, nil + } else if !cs.Ready { + // The container is running but has not passed its readiness probe yet + return false, nil + } + } + + if !conditionPodReady { + return false, nil + } + logger.Info("All containers for pod are ready") + return true, nil +} diff --git a/pkg/corerp/handlers/kubernetes_deployment_waiter_test.go b/pkg/corerp/handlers/kubernetes_deployment_waiter_test.go new file mode 100644 index 0000000000..c7b48968a4 --- /dev/null +++ b/pkg/corerp/handlers/kubernetes_deployment_waiter_test.go @@ -0,0 +1,1116 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package handlers + +import ( + "context" + "testing" + "time" + + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/test/k8sutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + v1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes/fake" +) + +var testDeployment = &v1.Deployment{ + TypeMeta: metav1.TypeMeta{ + Kind: "Deployment", + APIVersion: "apps/v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + }, + Spec: v1.DeploymentSpec{ + Replicas: to.Ptr(int32(1)), + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "test", + }, + }, + }, + Status: v1.DeploymentStatus{ + Conditions: []v1.DeploymentCondition{ + { + Type: v1.DeploymentProgressing, + Status: corev1.ConditionTrue, + Reason: "NewReplicaSetAvailable", + Message: "Deployment has minimum availability", + }, + }, + }, +} + +func addReplicaSetToDeployment(t *testing.T, ctx context.Context, clientset *fake.Clientset, deployment *v1.Deployment) *v1.ReplicaSet { + replicaSet := &v1.ReplicaSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-replicaset-1", + Namespace: deployment.Namespace, + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + OwnerReferences: []metav1.OwnerReference{ + *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ + Group: v1.SchemeGroupVersion.Group, + Version: v1.SchemeGroupVersion.Version, + Kind: "Deployment", + }), + }, + }, + } + + // Add the ReplicaSet objects to the fake Kubernetes clientset + _, err := clientset.AppsV1().ReplicaSets(replicaSet.Namespace).Create(ctx, replicaSet, metav1.CreateOptions{}) + require.NoError(t, err) + + _, err = clientset.AppsV1().Deployments(deployment.Namespace).Update(ctx, deployment, metav1.UpdateOptions{}) + require.NoError(t, err) + + return replicaSet +} + +func startInformers(ctx context.Context, clientSet *fake.Clientset, handler *kubernetesHandler) informers.SharedInformerFactory { + // Create a fake replicaset informer and start + informerFactory := informers.NewSharedInformerFactory(clientSet, 0) + + // Add informers + informerFactory.Apps().V1().Deployments().Informer() + informerFactory.Apps().V1().ReplicaSets().Informer() + informerFactory.Core().V1().Pods().Informer() + + informerFactory.Start(context.Background().Done()) + informerFactory.WaitForCacheSync(ctx.Done()) + return informerFactory +} + +func TestWaitUntilReady_NewResource(t *testing.T) { + ctx := context.Background() + + // Create first deployment that will be watched + deployment := &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + Labels: map[string]string{ + kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, + }, + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + }, + Spec: v1.DeploymentSpec{ + Replicas: to.Ptr(int32(1)), + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "test", + }, + }, + }, + Status: v1.DeploymentStatus{ + Conditions: []v1.DeploymentCondition{ + { + Type: v1.DeploymentProgressing, + Status: corev1.ConditionTrue, + Reason: "NewReplicaSetAvailable", + Message: "Deployment has minimum availability", + }, + }, + }, + } + + clientset := fake.NewSimpleClientset(deployment) + + // The deployment is not marked as ready till we find a replica set. Therefore, we need to create one. + addReplicaSetToDeployment(t, ctx, clientset, deployment) + + handler := kubernetesHandler{ + client: k8sutil.NewFakeKubeClient(nil), + deploymentWaiter: &deploymentWaiter{ + clientSet: clientset, + deploymentTimeOut: time.Duration(50) * time.Second, + cacheResyncInterval: time.Duration(10) * time.Second, + }, + } + + err := handler.deploymentWaiter.waitUntilReady(ctx, deployment) + require.NoError(t, err, "Failed to wait for deployment to be ready") +} + +func TestWaitUntilReady_Timeout(t *testing.T) { + ctx := context.Background() + // Create first deployment that will be watched + deployment := &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + }, + Status: v1.DeploymentStatus{ + Conditions: []v1.DeploymentCondition{ + { + Type: v1.DeploymentProgressing, + Status: corev1.ConditionFalse, + Reason: "NewReplicaSetAvailable", + Message: "Deployment has minimum availability", + }, + }, + }, + } + + deploymentClient := fake.NewSimpleClientset(deployment) + + handler := kubernetesHandler{ + client: k8sutil.NewFakeKubeClient(nil), + deploymentWaiter: &deploymentWaiter{ + clientSet: deploymentClient, + deploymentTimeOut: time.Duration(1) * time.Second, + cacheResyncInterval: time.Duration(10) * time.Second, + }, + } + + err := handler.deploymentWaiter.waitUntilReady(ctx, deployment) + require.Error(t, err) + require.Equal(t, "deployment timed out, name: test-deployment, namespace test-namespace, status: Deployment has minimum availability, reason: NewReplicaSetAvailable", err.Error()) +} + +func TestWaitUntilReady_DifferentResourceName(t *testing.T) { + ctx := context.Background() + // Create first deployment that will be watched + deployment := &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + }, + Status: v1.DeploymentStatus{ + Conditions: []v1.DeploymentCondition{ + { + Type: v1.DeploymentProgressing, + Status: corev1.ConditionTrue, + Reason: "NewReplicaSetAvailable", + Message: "Deployment has minimum availability", + }, + }, + }, + } + + clientset := fake.NewSimpleClientset(deployment) + + handler := kubernetesHandler{ + deploymentWaiter: &deploymentWaiter{ + clientSet: clientset, + deploymentTimeOut: time.Duration(1) * time.Second, + cacheResyncInterval: time.Duration(10) * time.Second, + }, + } + + err := handler.deploymentWaiter.waitUntilReady(ctx, &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "not-matched-deployment", + Namespace: "test-namespace", + }, + }) + + // It must be timed out because the name of the deployment does not match. + require.Error(t, err) + require.Equal(t, "deployment timed out, name: not-matched-deployment, namespace test-namespace, error occured while fetching latest status: deployments.apps \"not-matched-deployment\" not found", err.Error()) +} + +func TestGetPodsInDeployment(t *testing.T) { + // Create a fake Kubernetes clientset + fakeClient := fake.NewSimpleClientset() + + // Create a Deployment object + deployment := &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + }, + Spec: v1.DeploymentSpec{ + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "test-app", + }, + }, + }, + } + + // Create a ReplicaSet object + replicaset := &v1.ReplicaSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-replicaset", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test-app", + }, + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + UID: "1234", + }, + } + + // Create a Pod object + pod1 := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test-app", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: replicaset.Name, + Controller: to.Ptr(true), + UID: "1234", + }, + }, + }, + } + + // Create a Pod object + pod2 := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod2", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "doesnotmatch", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: "xyz", + Controller: to.Ptr(true), + UID: "1234", + }, + }, + }, + } + + // Add the Pod object to the fake Kubernetes clientset + _, err := fakeClient.CoreV1().Pods(pod1.Namespace).Create(context.Background(), pod1, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + _, err = fakeClient.CoreV1().Pods(pod2.Namespace).Create(context.Background(), pod2, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + // Create a KubernetesHandler object with the fake clientset + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + handler := &kubernetesHandler{ + deploymentWaiter: deploymentWaiter, + } + + ctx := context.Background() + informerFactory := startInformers(ctx, fakeClient, handler) + + // Call the getPodsInDeployment function + pods, err := deploymentWaiter.getPodsInDeployment(ctx, informerFactory, deployment, replicaset) + require.NoError(t, err) + require.Equal(t, 1, len(pods)) + require.Equal(t, pod1.Name, pods[0].Name) +} + +func TestGetCurrentReplicaSetForDeployment(t *testing.T) { + // Create a fake Kubernetes clientset + fakeClient := fake.NewSimpleClientset() + + // Create a Deployment object + deployment := &v1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-deployment", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + }, + } + + // Create a ReplicaSet object with a higher revision than the other ReplicaSet + replicaSet1 := &v1.ReplicaSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-replicaset-1", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, + OwnerReferences: []metav1.OwnerReference{ + *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ + Group: v1.SchemeGroupVersion.Group, + Version: v1.SchemeGroupVersion.Version, + Kind: "Deployment", + }), + }, + }, + } + // Create another ReplicaSet object with a lower revision than the other ReplicaSet + replicaSet2 := &v1.ReplicaSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-replicaset-2", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "0"}, + OwnerReferences: []metav1.OwnerReference{ + *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ + Group: v1.SchemeGroupVersion.Group, + Version: v1.SchemeGroupVersion.Version, + Kind: "Deployment", + }), + }, + }, + } + + // Create another ReplicaSet object with a higher revision than the other ReplicaSet + replicaSet3 := &v1.ReplicaSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-replicaset-3", + Namespace: "test-namespace", + Annotations: map[string]string{"deployment.kubernetes.io/revision": "3"}, + OwnerReferences: []metav1.OwnerReference{ + *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ + Group: v1.SchemeGroupVersion.Group, + Version: v1.SchemeGroupVersion.Version, + Kind: "Deployment", + }), + }, + }, + } + + // Add the ReplicaSet objects to the fake Kubernetes clientset + _, err := fakeClient.AppsV1().ReplicaSets(replicaSet1.Namespace).Create(context.Background(), replicaSet1, metav1.CreateOptions{}) + require.NoError(t, err) + _, err = fakeClient.AppsV1().ReplicaSets(replicaSet2.Namespace).Create(context.Background(), replicaSet2, metav1.CreateOptions{}) + require.NoError(t, err) + _, err = fakeClient.AppsV1().ReplicaSets(replicaSet2.Namespace).Create(context.Background(), replicaSet3, metav1.CreateOptions{}) + require.NoError(t, err) + + // Add the Deployment object to the fake Kubernetes clientset + _, err = fakeClient.AppsV1().Deployments(deployment.Namespace).Create(context.Background(), deployment, metav1.CreateOptions{}) + require.NoError(t, err) + + // Create a KubernetesHandler object with the fake clientset + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + handler := &kubernetesHandler{ + deploymentWaiter: deploymentWaiter, + } + + ctx := context.Background() + informerFactory := startInformers(ctx, fakeClient, handler) + + // Call the getNewestReplicaSetForDeployment function + rs := deploymentWaiter.getCurrentReplicaSetForDeployment(ctx, informerFactory, deployment) + require.Equal(t, replicaSet1.Name, rs.Name) +} + +func TestCheckPodStatus(t *testing.T) { + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod", + Namespace: "test-namespace", + }, + Status: corev1.PodStatus{}, + } + + podTests := []struct { + podCondition []corev1.PodCondition + containerStatus []corev1.ContainerStatus + isReady bool + expectedError string + }{ + { + // Container is in Terminated state + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + Reason: "Error", + Message: "Container terminated due to an error", + }, + }, + }, + }, + isReady: false, + expectedError: "Container state is 'Terminated' Reason: Error, Message: Container terminated due to an error", + }, + { + // Container is in CrashLoopBackOff state + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Waiting: &corev1.ContainerStateWaiting{ + Reason: "CrashLoopBackOff", + Message: "Back-off 5m0s restarting failed container=test-container pod=test-pod", + }, + }, + }, + }, + isReady: false, + expectedError: "Container state is 'Waiting' Reason: CrashLoopBackOff, Message: Back-off 5m0s restarting failed container=test-container pod=test-pod", + }, + { + // Container is in ErrImagePull state + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Waiting: &corev1.ContainerStateWaiting{ + Reason: "ErrImagePull", + Message: "Cannot pull image", + }, + }, + }, + }, + isReady: false, + expectedError: "Container state is 'Waiting' Reason: ErrImagePull, Message: Cannot pull image", + }, + { + // Container is in ImagePullBackOff state + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Waiting: &corev1.ContainerStateWaiting{ + Reason: "ImagePullBackOff", + Message: "ImagePullBackOff", + }, + }, + }, + }, + isReady: false, + expectedError: "Container state is 'Waiting' Reason: ImagePullBackOff, Message: ImagePullBackOff", + }, + { + // No container statuses available + isReady: false, + expectedError: "", + }, + { + // Container is in Waiting state but not a terminally failed state + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Waiting: &corev1.ContainerStateWaiting{ + Reason: "ContainerCreating", + Message: "Container is being created", + }, + }, + Ready: false, + }, + }, + isReady: false, + expectedError: "", + }, + { + // Container's Running state is nil + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Running: nil, + }, + Ready: false, + }, + }, + isReady: false, + expectedError: "", + }, + { + // Readiness check is not yet passed + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Running: &corev1.ContainerStateRunning{}, + }, + Ready: false, + }, + }, + isReady: false, + expectedError: "", + }, + { + // Container is in Ready state + podCondition: nil, + containerStatus: []corev1.ContainerStatus{ + { + State: corev1.ContainerState{ + Running: &corev1.ContainerStateRunning{}, + }, + Ready: true, + }, + }, + isReady: true, + expectedError: "", + }, + } + + ctx := context.Background() + deploymentWaiter := NewDeploymentWaiter(fake.NewSimpleClientset()) + for _, tc := range podTests { + pod.Status.Conditions = tc.podCondition + pod.Status.ContainerStatuses = tc.containerStatus + isReady, err := deploymentWaiter.checkPodStatus(ctx, pod) + if tc.expectedError != "" { + require.Error(t, err) + require.Equal(t, tc.expectedError, err.Error()) + } else { + require.NoError(t, err) + } + require.Equal(t, tc.isReady, isReady) + } +} + +func TestCheckAllPodsReady_Success(t *testing.T) { + // Create a fake Kubernetes clientset + clientset := fake.NewSimpleClientset() + + ctx := context.Background() + + _, err := clientset.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) + require.NoError(t, err) + + replicaSet := addReplicaSetToDeployment(t, ctx, clientset, testDeployment) + + // Create a pod + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "test-container", + Image: "test-image", + }, + }, + }, + Status: corev1.PodStatus{ + Phase: corev1.PodRunning, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: true, + }, + }, + }, + } + _, err = clientset.CoreV1().Pods("test-namespace").Create(context.Background(), pod, metav1.CreateOptions{}) + assert.NoError(t, err) + + // Create an informer factory and add the deployment and replica set to the cache + informerFactory := informers.NewSharedInformerFactory(clientset, 0) + addTestObjects(t, clientset, informerFactory, testDeployment, replicaSet, pod) + + // Create a done channel + doneCh := make(chan error) + + // Create a handler with the fake clientset + deploymentWaiter := &deploymentWaiter{ + clientSet: clientset, + } + + // Call the checkAllPodsReady function + allReady := deploymentWaiter.checkAllPodsReady(ctx, informerFactory, testDeployment, replicaSet, doneCh) + + // Check that all pods are ready + require.True(t, allReady) +} + +func TestCheckAllPodsReady_Fail(t *testing.T) { + // Create a fake Kubernetes clientset + clientset := fake.NewSimpleClientset() + + ctx := context.Background() + + _, err := clientset.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) + require.NoError(t, err) + + replicaSet := addReplicaSetToDeployment(t, ctx, clientset, testDeployment) + + // Create a pod + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: replicaSet.Name, + Controller: to.Ptr(true), + }, + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + { + Name: "test-container", + Image: "test-image", + }, + }, + }, + Status: corev1.PodStatus{ + Phase: corev1.PodRunning, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: false, + }, + }, + }, + } + _, err = clientset.CoreV1().Pods(pod.Namespace).Create(context.Background(), pod, metav1.CreateOptions{}) + require.NoError(t, err) + + // Create an informer factory and add the deployment and replica set to the cache + informerFactory := informers.NewSharedInformerFactory(clientset, 0) + addTestObjects(t, clientset, informerFactory, testDeployment, replicaSet, pod) + + // Create a done channel + doneCh := make(chan error) + + // Create a handler with the fake clientset + deploymentWaiter := &deploymentWaiter{ + clientSet: clientset, + } + + // Call the checkAllPodsReady function + allReady := deploymentWaiter.checkAllPodsReady(ctx, informerFactory, testDeployment, replicaSet, doneCh) + + // Check that all pods are ready + require.False(t, allReady) +} + +func TestCheckDeploymentStatus_AllReady(t *testing.T) { + // Create a fake Kubernetes fakeClient + fakeClient := fake.NewSimpleClientset() + + ctx := context.Background() + _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) + require.NoError(t, err) + replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, testDeployment) + + // Create a Pod object + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: replicaSet.Name, + Controller: to.Ptr(true), + }, + }, + }, + Status: corev1.PodStatus{ + Conditions: []corev1.PodCondition{ + { + Type: corev1.PodScheduled, + Status: corev1.ConditionTrue, + }, + }, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: true, + State: corev1.ContainerState{ + Running: &corev1.ContainerStateRunning{}, + }, + }, + }, + }, + } + + // Add the Pod object to the fake Kubernetes clientset + _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + // Create an informer factory and add the deployment to the cache + informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) + addTestObjects(t, fakeClient, informerFactory, testDeployment, replicaSet, pod) + + // Create a fake item and object + item := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "test-deployment", + "namespace": "test-namespace", + }, + }, + } + + // Create a done channel + doneCh := make(chan error, 1) + + // Call the checkDeploymentStatus function + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + + deploymentWaiter.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + + err = <-doneCh + + // Check that the deployment readiness was checked + require.Nil(t, err) +} + +func TestCheckDeploymentStatus_NoReplicaSetsFound(t *testing.T) { + // Create a fake Kubernetes fakeClient + fakeClient := fake.NewSimpleClientset() + + ctx := context.Background() + _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) + require.NoError(t, err) + + // Create a Pod object + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + }, + Status: corev1.PodStatus{ + Conditions: []corev1.PodCondition{ + { + Type: corev1.PodScheduled, + Status: corev1.ConditionTrue, + }, + }, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: true, + State: corev1.ContainerState{ + Running: &corev1.ContainerStateRunning{}, + }, + }, + }, + }, + } + + // Add the Pod object to the fake Kubernetes clientset + _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + // Create an informer factory and add the deployment to the cache + informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) + err = informerFactory.Apps().V1().Deployments().Informer().GetIndexer().Add(testDeployment) + require.NoError(t, err, "Failed to add deployment to informer cache") + err = informerFactory.Core().V1().Pods().Informer().GetIndexer().Add(pod) + require.NoError(t, err, "Failed to add pod to informer cache") + // Note: No replica set added + + // Create a fake item and object + item := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "test-deployment", + "namespace": "test-namespace", + }, + }, + } + + // Create a done channel + doneCh := make(chan error, 1) + + // Call the checkDeploymentStatus function + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + + allReady := deploymentWaiter.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + + // Check that the deployment readiness was checked + require.False(t, allReady) +} + +func TestCheckDeploymentStatus_PodsNotReady(t *testing.T) { + // Create a fake Kubernetes fakeClient + fakeClient := fake.NewSimpleClientset() + + ctx := context.Background() + _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) + require.NoError(t, err) + replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, testDeployment) + + // Create a Pod object + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: replicaSet.Name, + Controller: to.Ptr(true), + }, + }, + }, + Status: corev1.PodStatus{ + Conditions: []corev1.PodCondition{ + { + Type: corev1.PodScheduled, + Status: corev1.ConditionTrue, + }, + }, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: true, + State: corev1.ContainerState{ + Terminated: &corev1.ContainerStateTerminated{ + Reason: "Error", + Message: "Container terminated due to an error", + }, + }, + }, + }, + }, + } + + // Add the Pod object to the fake Kubernetes clientset + _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + // Create an informer factory and add the deployment to the cache + informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) + addTestObjects(t, fakeClient, informerFactory, testDeployment, replicaSet, pod) + + // Create a fake item and object + item := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "test-deployment", + "namespace": "test-namespace", + }, + }, + } + + // Create a done channel + doneCh := make(chan error, 1) + + // Call the checkDeploymentStatus function + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + + go deploymentWaiter.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + err = <-doneCh + + // Check that the deployment readiness was checked + require.Error(t, err) + require.Equal(t, err.Error(), "Container state is 'Terminated' Reason: Error, Message: Container terminated due to an error") +} + +func TestCheckDeploymentStatus_ObservedGenerationMismatch(t *testing.T) { + // Modify testDeployment to have a different generation than the observed generation + generationMismatchDeployment := testDeployment.DeepCopy() + generationMismatchDeployment.Generation = 2 + + // Create a fake Kubernetes fakeClient + fakeClient := fake.NewSimpleClientset() + + ctx := context.Background() + _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, generationMismatchDeployment, metav1.CreateOptions{}) + require.NoError(t, err) + replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, generationMismatchDeployment) + + // Create a Pod object + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: replicaSet.Name, + Controller: to.Ptr(true), + }, + }, + }, + Status: corev1.PodStatus{ + Conditions: []corev1.PodCondition{ + { + Type: corev1.PodScheduled, + Status: corev1.ConditionTrue, + }, + }, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: true, + State: corev1.ContainerState{ + Running: &corev1.ContainerStateRunning{}, + }, + }, + }, + }, + } + + // Add the Pod object to the fake Kubernetes clientset + _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + // Create an informer factory and add the deployment to the cache + informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) + addTestObjects(t, fakeClient, informerFactory, generationMismatchDeployment, replicaSet, pod) + + // Create a fake item and object + item := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "test-deployment", + "namespace": "test-namespace", + }, + }, + } + + // Create a done channel + doneCh := make(chan error, 1) + + // Call the checkDeploymentStatus function + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + + deploymentWaiter.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + + // Check that the deployment readiness was checked + require.Zero(t, len(doneCh)) +} + +func TestCheckDeploymentStatus_DeploymentNotProgressing(t *testing.T) { + // Create a fake Kubernetes fakeClient + fakeClient := fake.NewSimpleClientset() + + deploymentNotProgressing := testDeployment.DeepCopy() + + ctx := context.Background() + _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, deploymentNotProgressing, metav1.CreateOptions{}) + require.NoError(t, err) + replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, deploymentNotProgressing) + + // Create a Pod object + pod := &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-pod1", + Namespace: "test-namespace", + Labels: map[string]string{ + "app": "test", + }, + OwnerReferences: []metav1.OwnerReference{ + { + Kind: "ReplicaSet", + Name: replicaSet.Name, + Controller: to.Ptr(true), + }, + }, + }, + Status: corev1.PodStatus{ + Conditions: []corev1.PodCondition{ + { + Type: corev1.PodScheduled, + Status: corev1.ConditionTrue, + }, + }, + ContainerStatuses: []corev1.ContainerStatus{ + { + Name: "test-container", + Ready: true, + State: corev1.ContainerState{ + Running: &corev1.ContainerStateRunning{}, + }, + }, + }, + }, + } + + // Add the Pod object to the fake Kubernetes clientset + _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) + require.NoError(t, err, "Failed to create Pod: %v", err) + + // Create an informer factory and add the deployment to the cache + informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) + addTestObjects(t, fakeClient, informerFactory, deploymentNotProgressing, replicaSet, pod) + + deploymentNotProgressing.Status = v1.DeploymentStatus{ + Conditions: []v1.DeploymentCondition{ + { + Type: v1.DeploymentProgressing, + Status: corev1.ConditionFalse, + Reason: "NewReplicaSetAvailable", + Message: "Deployment has minimum availability", + }, + }, + } + + // Create a fake item and object + item := &unstructured.Unstructured{ + Object: map[string]interface{}{ + "metadata": map[string]interface{}{ + "name": "test-deployment", + "namespace": "test-namespace", + }, + }, + } + + // Create a done channel + doneCh := make(chan error, 1) + + // Call the checkDeploymentStatus function + deploymentWaiter := &deploymentWaiter{ + clientSet: fakeClient, + } + + ready := deploymentWaiter.checkDeploymentStatus(ctx, informerFactory, item, doneCh) + require.False(t, ready) +} + +func addTestObjects(t *testing.T, fakeClient *fake.Clientset, informerFactory informers.SharedInformerFactory, deployment *v1.Deployment, replicaSet *v1.ReplicaSet, pod *corev1.Pod) { + err := informerFactory.Apps().V1().Deployments().Informer().GetIndexer().Add(deployment) + require.NoError(t, err, "Failed to add deployment to informer cache") + err = informerFactory.Apps().V1().ReplicaSets().Informer().GetIndexer().Add(replicaSet) + require.NoError(t, err, "Failed to add replica set to informer cache") + err = informerFactory.Core().V1().Pods().Informer().GetIndexer().Add(pod) + require.NoError(t, err, "Failed to add pod to informer cache") +} diff --git a/pkg/corerp/handlers/kubernetes_http_proxy_waiter.go b/pkg/corerp/handlers/kubernetes_http_proxy_waiter.go new file mode 100644 index 0000000000..03edcfd88b --- /dev/null +++ b/pkg/corerp/handlers/kubernetes_http_proxy_waiter.go @@ -0,0 +1,171 @@ +package handlers + +import ( + "context" + "errors" + "fmt" + "strings" + "time" + + contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/radius-project/radius/pkg/ucp/ucplog" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/dynamic/dynamicinformer" + "k8s.io/client-go/informers" + "k8s.io/client-go/tools/cache" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + MaxHTTPProxyDeploymentTimeout = time.Minute * time.Duration(10) + HTTPProxyConditionValid = "Valid" + HTTPProxyStatusInvalid = "invalid" + HTTPProxyStatusValid = "valid" +) + +type httpProxyWaiter struct { + dynamicClientSet dynamic.Interface + httpProxyDeploymentTimeout time.Duration + cacheResyncInterval time.Duration +} + +// NewHTTPProxyWaiter returns a new instance of HTTPProxyWaiter +func NewHTTPProxyWaiter(dynamicClientSet dynamic.Interface) *httpProxyWaiter { + return &httpProxyWaiter{ + dynamicClientSet: dynamicClientSet, + httpProxyDeploymentTimeout: MaxHTTPProxyDeploymentTimeout, + cacheResyncInterval: DefaultCacheResyncInterval, + } +} + +func (handler *httpProxyWaiter) addDynamicEventHandler(ctx context.Context, informerFactory dynamicinformer.DynamicSharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) { + logger := ucplog.FromContextOrDiscard(ctx) + + _, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj any) { + handler.checkHTTPProxyStatus(ctx, informerFactory, item, doneCh) + }, + UpdateFunc: func(_, newObj any) { + handler.checkHTTPProxyStatus(ctx, informerFactory, item, doneCh) + }, + }) + + if err != nil { + logger.Error(err, "failed to add event handler") + } +} + +// addEventHandler is not implemented for HTTPProxyWaiter +func (handler *httpProxyWaiter) addEventHandler(ctx context.Context, informerFactory informers.SharedInformerFactory, informer cache.SharedIndexInformer, item client.Object, doneCh chan<- error) { +} + +func (handler *httpProxyWaiter) waitUntilReady(ctx context.Context, obj client.Object) error { + logger := ucplog.FromContextOrDiscard(ctx).WithValues("httpProxyName", obj.GetName(), "namespace", obj.GetNamespace()) + + doneCh := make(chan error, 1) + + ctx, cancel := context.WithTimeout(ctx, handler.httpProxyDeploymentTimeout) + // This ensures that the informer is stopped when this function is returned. + defer cancel() + + // Create dynamic informer for HTTPProxy + dynamicInformerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(handler.dynamicClientSet, 0, obj.GetNamespace(), nil) + httpProxyInformer := dynamicInformerFactory.ForResource(contourv1.HTTPProxyGVR) + // Add event handlers to the http proxy informer + handler.addDynamicEventHandler(ctx, dynamicInformerFactory, httpProxyInformer.Informer(), obj, doneCh) + + // Start the informers + dynamicInformerFactory.Start(ctx.Done()) + + // Wait for the cache to be synced. + dynamicInformerFactory.WaitForCacheSync(ctx.Done()) + + select { + case <-ctx.Done(): + // Get the final status + proxy, err := httpProxyInformer.Lister().Get(obj.GetName()) + + if err != nil { + return fmt.Errorf("proxy deployment timed out, name: %s, namespace %s, error occured while fetching latest status: %w", obj.GetName(), obj.GetNamespace(), err) + } + + p := contourv1.HTTPProxy{} + err = runtime.DefaultUnstructuredConverter.FromUnstructured(proxy.(*unstructured.Unstructured).Object, &p) + if err != nil { + return fmt.Errorf("proxy deployment timed out, name: %s, namespace %s, error occured while fetching latest status: %w", obj.GetName(), obj.GetNamespace(), err) + } + + status := contourv1.DetailedCondition{} + if len(p.Status.Conditions) > 0 { + status = p.Status.Conditions[len(p.Status.Conditions)-1] + } + return fmt.Errorf("HTTP proxy deployment timed out, name: %s, namespace %s, status: %s, reason: %s", obj.GetName(), obj.GetNamespace(), status.Message, status.Reason) + case err := <-doneCh: + if err == nil { + logger.Info(fmt.Sprintf("Marking HTTP proxy deployment %s in namespace %s as complete", obj.GetName(), obj.GetNamespace())) + } + return err + } +} + +func (handler *httpProxyWaiter) checkHTTPProxyStatus(ctx context.Context, dynamicInformerFactory dynamicinformer.DynamicSharedInformerFactory, obj client.Object, doneCh chan<- error) bool { + logger := ucplog.FromContextOrDiscard(ctx).WithValues("httpProxyName", obj.GetName(), "namespace", obj.GetNamespace()) + selector := labels.SelectorFromSet( + map[string]string{ + kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, + kubernetes.LabelName: obj.GetName(), + }, + ) + proxies, err := dynamicInformerFactory.ForResource(contourv1.HTTPProxyGVR).Lister().List(selector) + if err != nil { + logger.Info(fmt.Sprintf("Unable to list http proxies: %s", err.Error())) + return false + } + + for _, proxy := range proxies { + p := contourv1.HTTPProxy{} + err = runtime.DefaultUnstructuredConverter.FromUnstructured(proxy.(*unstructured.Unstructured).Object, &p) + if err != nil { + logger.Info(fmt.Sprintf("Unable to convert http proxy: %s", err.Error())) + continue + } + + if len(p.Spec.Includes) == 0 && len(p.Spec.Routes) > 0 { + // This is a route HTTP proxy. We will not validate deployment completion for it and return success here + logger.Info("Not validating the deployment of route HTTP proxy for ", p.Name) + doneCh <- nil + return true + } + + // We will check the status for the root HTTP proxy + if p.Status.CurrentStatus == HTTPProxyStatusInvalid { + if strings.Contains(p.Status.Description, "see Errors for details") { + var msg string + for _, c := range p.Status.Conditions { + if c.ObservedGeneration != p.Generation { + continue + } + if c.Type == HTTPProxyConditionValid && c.Status == "False" { + for _, e := range c.Errors { + msg += fmt.Sprintf("Error - Type: %s, Status: %s, Reason: %s, Message: %s\n", e.Type, e.Status, e.Reason, e.Message) + } + } + } + doneCh <- errors.New(msg) + } else { + doneCh <- fmt.Errorf("Failed to deploy HTTP proxy. Description: %s", p.Status.Description) + } + return false + } else if p.Status.CurrentStatus == HTTPProxyStatusValid { + // The HTTPProxy is ready + doneCh <- nil + return true + } + } + return false +} diff --git a/pkg/corerp/handlers/kubernetes_http_proxy_waiter_test.go b/pkg/corerp/handlers/kubernetes_http_proxy_waiter_test.go new file mode 100644 index 0000000000..44837ef551 --- /dev/null +++ b/pkg/corerp/handlers/kubernetes_http_proxy_waiter_test.go @@ -0,0 +1,326 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package handlers + +import ( + "context" + "testing" + + contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" + "github.com/radius-project/radius/pkg/kubernetes" + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic/dynamicinformer" + fakedynamic "k8s.io/client-go/dynamic/fake" +) + +func TestCheckHTTPProxyStatus_ValidStatus(t *testing.T) { + + httpProxy := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + Labels: map[string]string{ + kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, + kubernetes.LabelName: "example.com", + }, + }, + Status: contourv1.HTTPProxyStatus{ + CurrentStatus: HTTPProxyStatusValid, + }, + } + // create fake dynamic clientset + s := runtime.NewScheme() + err := contourv1.AddToScheme(s) + require.NoError(t, err) + fakeClient := fakedynamic.NewSimpleDynamicClient(s, httpProxy) + + // create a fake dynamic informer factory with a mock HTTPProxy informer + dynamicInformerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(fakeClient, 0, "default", nil) + err = dynamicInformerFactory.ForResource(contourv1.HTTPProxyGVR).Informer().GetIndexer().Add(httpProxy) + require.NoError(t, err, "Could not add test http proxy to informer cache") + + // create a mock object + obj := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + }, + } + + // create a channel for the done signal + doneCh := make(chan error) + + httpProxyWaiter := &httpProxyWaiter{ + dynamicClientSet: fakeClient, + } + + ctx := context.Background() + dynamicInformerFactory.Start(ctx.Done()) + dynamicInformerFactory.WaitForCacheSync(ctx.Done()) + + // call the function with the fake clientset, informer factory, logger, object, and done channel + go httpProxyWaiter.checkHTTPProxyStatus(context.Background(), dynamicInformerFactory, obj, doneCh) + err = <-doneCh + require.NoError(t, err) +} + +func TestCheckHTTPProxyStatus_InvalidStatusForRootProxy(t *testing.T) { + + httpProxy := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + Labels: map[string]string{ + kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, + kubernetes.LabelName: "example.com", + }, + }, + Spec: contourv1.HTTPProxySpec{ + VirtualHost: &contourv1.VirtualHost{ + Fqdn: "example.com", + }, + Includes: []contourv1.Include{ + { + Name: "example.com", + Namespace: "default", + }, + }, + }, + Status: contourv1.HTTPProxyStatus{ + CurrentStatus: HTTPProxyStatusInvalid, + Description: "Failed to deploy HTTP proxy. see Errors for details", + Conditions: []contourv1.DetailedCondition{ + { + // specify Condition of type json + Condition: metav1.Condition{ + Type: HTTPProxyConditionValid, + Status: contourv1.ConditionFalse, + }, + Errors: []contourv1.SubCondition{ + { + Type: HTTPProxyConditionValid, + Status: contourv1.ConditionFalse, + Reason: "RouteNotDefined", + Message: "HTTPProxy is invalid", + }, + }, + }, + }, + }, + } + // create fake dynamic clientset + s := runtime.NewScheme() + err := contourv1.AddToScheme(s) + require.NoError(t, err) + fakeClient := fakedynamic.NewSimpleDynamicClient(s, httpProxy) + + // create a fake dynamic informer factory with a mock HTTPProxy informer + dynamicInformerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(fakeClient, 0, "default", nil) + err = dynamicInformerFactory.ForResource(contourv1.HTTPProxyGVR).Informer().GetIndexer().Add(httpProxy) + require.NoError(t, err, "Could not add test http proxy to informer cache") + + // create a mock object + obj := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + }, + } + + // create a channel for the done signal + doneCh := make(chan error) + + httpProxyWaiter := &httpProxyWaiter{ + dynamicClientSet: fakeClient, + } + + ctx := context.Background() + dynamicInformerFactory.Start(ctx.Done()) + dynamicInformerFactory.WaitForCacheSync(ctx.Done()) + + // call the function with the fake clientset, informer factory, logger, object, and done channel + go httpProxyWaiter.checkHTTPProxyStatus(context.Background(), dynamicInformerFactory, obj, doneCh) + err = <-doneCh + require.EqualError(t, err, "Error - Type: Valid, Status: False, Reason: RouteNotDefined, Message: HTTPProxy is invalid\n") +} + +func TestCheckHTTPProxyStatus_InvalidStatusForRouteProxy(t *testing.T) { + httpProxyRoute := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + Labels: map[string]string{ + kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, + kubernetes.LabelName: "example.com", + }, + }, + Spec: contourv1.HTTPProxySpec{ + Routes: []contourv1.Route{ + { + Conditions: []contourv1.MatchCondition{ + { + Prefix: "/", + }, + }, + Services: []contourv1.Service{ + { + Name: "test", + Port: 80, + }, + }, + }, + }, + }, + Status: contourv1.HTTPProxyStatus{ + CurrentStatus: HTTPProxyStatusInvalid, + Description: "Failed to deploy HTTP proxy. see Errors for details", + Conditions: []contourv1.DetailedCondition{ + { + // specify Condition of type json + Condition: metav1.Condition{ + Type: HTTPProxyConditionValid, + Status: contourv1.ConditionFalse, + }, + Errors: []contourv1.SubCondition{ + { + Type: HTTPProxyConditionValid, + Status: contourv1.ConditionFalse, + Reason: "orphaned", + Message: "HTTPProxy is invalid", + }, + }, + }, + }, + }, + } + // create fake dynamic clientset + s := runtime.NewScheme() + err := contourv1.AddToScheme(s) + require.NoError(t, err) + fakeClient := fakedynamic.NewSimpleDynamicClient(s, httpProxyRoute) + + // create a fake dynamic informer factory with a mock HTTPProxy informer + dynamicInformerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(fakeClient, 0, "default", nil) + err = dynamicInformerFactory.ForResource(contourv1.HTTPProxyGVR).Informer().GetIndexer().Add(httpProxyRoute) + require.NoError(t, err, "Could not add test http proxy to informer cache") + + // create a mock object + obj := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + }, + } + + // create a channel for the done signal + doneCh := make(chan error) + + httpProxyWaiter := &httpProxyWaiter{ + dynamicClientSet: fakeClient, + } + + ctx := context.Background() + dynamicInformerFactory.Start(ctx.Done()) + dynamicInformerFactory.WaitForCacheSync(ctx.Done()) + + // call the function with the fake clientset, informer factory, logger, object, and done channel + go httpProxyWaiter.checkHTTPProxyStatus(context.Background(), dynamicInformerFactory, obj, doneCh) + err = <-doneCh + require.NoError(t, err) +} + +func TestCheckHTTPProxyStatus_WrongSelector(t *testing.T) { + + httpProxy := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "abcd.com", + Labels: map[string]string{ + kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, + kubernetes.LabelName: "abcd.com", + }, + }, + Spec: contourv1.HTTPProxySpec{ + VirtualHost: &contourv1.VirtualHost{ + Fqdn: "abcd.com", + }, + Includes: []contourv1.Include{ + { + Name: "abcd.com", + Namespace: "default", + }, + }, + }, + Status: contourv1.HTTPProxyStatus{ + CurrentStatus: HTTPProxyStatusInvalid, + Description: "Failed to deploy HTTP proxy. see Errors for details", + Conditions: []contourv1.DetailedCondition{ + { + // specify Condition of type json + Condition: metav1.Condition{ + Type: HTTPProxyConditionValid, + Status: contourv1.ConditionFalse, + }, + Errors: []contourv1.SubCondition{ + { + Type: HTTPProxyConditionValid, + Status: contourv1.ConditionFalse, + Reason: "RouteNotDefined", + Message: "HTTPProxy is invalid", + }, + }, + }, + }, + }, + } + + // create fake dynamic clientset + s := runtime.NewScheme() + err := contourv1.AddToScheme(s) + require.NoError(t, err) + fakeClient := fakedynamic.NewSimpleDynamicClient(s, httpProxy) + + // create a fake dynamic informer factory with a mock HTTPProxy informer + dynamicInformerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(fakeClient, 0, "default", nil) + err = dynamicInformerFactory.ForResource(contourv1.HTTPProxyGVR).Informer().GetIndexer().Add(httpProxy) + require.NoError(t, err, "Could not add test http proxy to informer cache") + + // create a mock object + obj := &contourv1.HTTPProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "example.com", + }, + } + + // create a channel for the done signal + doneCh := make(chan error) + + httpProxyWaiter := &httpProxyWaiter{ + dynamicClientSet: fakeClient, + } + + ctx := context.Background() + dynamicInformerFactory.Start(ctx.Done()) + dynamicInformerFactory.WaitForCacheSync(ctx.Done()) + + // call the function with the fake clientset, informer factory, logger, object, and done channel + status := httpProxyWaiter.checkHTTPProxyStatus(context.Background(), dynamicInformerFactory, obj, doneCh) + require.False(t, status) +} diff --git a/pkg/corerp/handlers/kubernetes_test.go b/pkg/corerp/handlers/kubernetes_test.go index 11d1c87e13..0403b340f9 100644 --- a/pkg/corerp/handlers/kubernetes_test.go +++ b/pkg/corerp/handlers/kubernetes_test.go @@ -22,94 +22,19 @@ import ( "testing" "time" - "github.com/radius-project/radius/pkg/kubernetes" "github.com/radius-project/radius/pkg/resourcemodel" rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/radius-project/radius/pkg/to" resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "github.com/radius-project/radius/test/k8sutil" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" ) -var testDeployment = &v1.Deployment{ - TypeMeta: metav1.TypeMeta{ - Kind: "Deployment", - APIVersion: "apps/v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - }, - Spec: v1.DeploymentSpec{ - Replicas: to.Ptr(int32(1)), - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app": "test", - }, - }, - }, - Status: v1.DeploymentStatus{ - Conditions: []v1.DeploymentCondition{ - { - Type: v1.DeploymentProgressing, - Status: corev1.ConditionTrue, - Reason: "NewReplicaSetAvailable", - Message: "Deployment has minimum availability", - }, - }, - }, -} - -func addReplicaSetToDeployment(t *testing.T, ctx context.Context, clientset *fake.Clientset, deployment *v1.Deployment) *v1.ReplicaSet { - replicaSet := &v1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-replicaset-1", - Namespace: deployment.Namespace, - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ - Group: v1.SchemeGroupVersion.Group, - Version: v1.SchemeGroupVersion.Version, - Kind: "Deployment", - }), - }, - }, - } - - // Add the ReplicaSet objects to the fake Kubernetes clientset - _, err := clientset.AppsV1().ReplicaSets(replicaSet.Namespace).Create(ctx, replicaSet, metav1.CreateOptions{}) - require.NoError(t, err) - - _, err = clientset.AppsV1().Deployments(deployment.Namespace).Update(ctx, deployment, metav1.UpdateOptions{}) - require.NoError(t, err) - - return replicaSet -} - -func startInformers(ctx context.Context, clientSet *fake.Clientset, handler *kubernetesHandler) informers.SharedInformerFactory { - // Create a fake replicaset informer and start - informerFactory := informers.NewSharedInformerFactory(clientSet, 0) - - // Add informers - informerFactory.Apps().V1().Deployments().Informer() - informerFactory.Apps().V1().ReplicaSets().Informer() - informerFactory.Core().V1().Pods().Informer() - - informerFactory.Start(context.Background().Done()) - informerFactory.WaitForCacheSync(ctx.Done()) - return informerFactory -} - func TestPut(t *testing.T) { putTests := []struct { name string @@ -171,16 +96,16 @@ func TestPut(t *testing.T) { t.Run(tc.name, func(t *testing.T) { ctx := context.Background() + clientSet := fake.NewSimpleClientset(tc.in.Resource.CreateResource.Data.(runtime.Object)) handler := kubernetesHandler{ - client: k8sutil.NewFakeKubeClient(nil), - clientSet: nil, - deploymentTimeOut: time.Duration(50) * time.Second, - cacheResyncInterval: time.Duration(1) * time.Second, + client: k8sutil.NewFakeKubeClient(nil), + deploymentWaiter: &deploymentWaiter{ + clientSet: clientSet, + deploymentTimeOut: time.Duration(50) * time.Second, + cacheResyncInterval: time.Duration(1) * time.Second, + }, } - clientSet := fake.NewSimpleClientset(tc.in.Resource.CreateResource.Data.(runtime.Object)) - handler.clientSet = clientSet - // If the resource is a deployment, we need to add a replica set to it if tc.in.Resource.CreateResource.Data.(runtime.Object).GetObjectKind().GroupVersionKind().Kind == "Deployment" { // The deployment is not marked as ready till we find a replica set. Therefore, we need to create one. @@ -225,10 +150,12 @@ func TestDelete(t *testing.T) { } handler := kubernetesHandler{ - client: k8sutil.NewFakeKubeClient(nil), - k8sDiscoveryClient: dc, - deploymentTimeOut: time.Duration(1) * time.Second, - cacheResyncInterval: time.Duration(10) * time.Second, + client: k8sutil.NewFakeKubeClient(nil), + k8sDiscoveryClient: dc, + deploymentWaiter: &deploymentWaiter{ + deploymentTimeOut: time.Duration(1) * time.Second, + cacheResyncInterval: time.Duration(10) * time.Second, + }, } err := handler.client.Create(ctx, deployment) @@ -341,996 +268,3 @@ func TestConvertToUnstructured(t *testing.T) { }) } } - -func TestWaitUntilDeploymentIsReady_NewResource(t *testing.T) { - ctx := context.Background() - - // Create first deployment that will be watched - deployment := &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", - Labels: map[string]string{ - kubernetes.LabelManagedBy: kubernetes.LabelManagedByRadiusRP, - }, - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - }, - Spec: v1.DeploymentSpec{ - Replicas: to.Ptr(int32(1)), - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app": "test", - }, - }, - }, - Status: v1.DeploymentStatus{ - Conditions: []v1.DeploymentCondition{ - { - Type: v1.DeploymentProgressing, - Status: corev1.ConditionTrue, - Reason: "NewReplicaSetAvailable", - Message: "Deployment has minimum availability", - }, - }, - }, - } - - clientset := fake.NewSimpleClientset(deployment) - - // The deployment is not marked as ready till we find a replica set. Therefore, we need to create one. - addReplicaSetToDeployment(t, ctx, clientset, deployment) - - handler := kubernetesHandler{ - clientSet: clientset, - deploymentTimeOut: time.Duration(50) * time.Second, - cacheResyncInterval: time.Duration(10) * time.Second, - } - - err := handler.waitUntilDeploymentIsReady(ctx, deployment) - require.NoError(t, err, "Failed to wait for deployment to be ready") -} - -func TestWaitUntilDeploymentIsReady_Timeout(t *testing.T) { - ctx := context.Background() - // Create first deployment that will be watched - deployment := &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - }, - Status: v1.DeploymentStatus{ - Conditions: []v1.DeploymentCondition{ - { - Type: v1.DeploymentProgressing, - Status: corev1.ConditionFalse, - Reason: "NewReplicaSetAvailable", - Message: "Deployment has minimum availability", - }, - }, - }, - } - - deploymentClient := fake.NewSimpleClientset(deployment) - - handler := kubernetesHandler{ - clientSet: deploymentClient, - deploymentTimeOut: time.Duration(1) * time.Second, - cacheResyncInterval: time.Duration(10) * time.Second, - } - - err := handler.waitUntilDeploymentIsReady(ctx, deployment) - require.Error(t, err) - require.Equal(t, "deployment timed out, name: test-deployment, namespace test-namespace, status: Deployment has minimum availability, reason: NewReplicaSetAvailable", err.Error()) -} - -func TestWaitUntilDeploymentIsReady_DifferentResourceName(t *testing.T) { - ctx := context.Background() - // Create first deployment that will be watched - deployment := &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - }, - Status: v1.DeploymentStatus{ - Conditions: []v1.DeploymentCondition{ - { - Type: v1.DeploymentProgressing, - Status: corev1.ConditionTrue, - Reason: "NewReplicaSetAvailable", - Message: "Deployment has minimum availability", - }, - }, - }, - } - - clientset := fake.NewSimpleClientset(deployment) - - handler := kubernetesHandler{ - clientSet: clientset, - deploymentTimeOut: time.Duration(1) * time.Second, - cacheResyncInterval: time.Duration(10) * time.Second, - } - - err := handler.waitUntilDeploymentIsReady(ctx, &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "not-matched-deployment", - Namespace: "test-namespace", - }, - }) - - // It must be timed out because the name of the deployment does not match. - require.Error(t, err) - require.Equal(t, "deployment timed out, name: not-matched-deployment, namespace test-namespace, error occured while fetching latest status: deployments.apps \"not-matched-deployment\" not found", err.Error()) -} - -func TestGetPodsInDeployment(t *testing.T) { - // Create a fake Kubernetes clientset - fakeClient := fake.NewSimpleClientset() - - // Create a Deployment object - deployment := &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - }, - Spec: v1.DeploymentSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "app": "test-app", - }, - }, - }, - } - - // Create a ReplicaSet object - replicaset := &v1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-replicaset", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test-app", - }, - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - UID: "1234", - }, - } - - // Create a Pod object - pod1 := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test-app", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: replicaset.Name, - Controller: to.Ptr(true), - UID: "1234", - }, - }, - }, - } - - // Create a Pod object - pod2 := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod2", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "doesnotmatch", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: "xyz", - Controller: to.Ptr(true), - UID: "1234", - }, - }, - }, - } - - // Add the Pod object to the fake Kubernetes clientset - _, err := fakeClient.CoreV1().Pods(pod1.Namespace).Create(context.Background(), pod1, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - _, err = fakeClient.CoreV1().Pods(pod2.Namespace).Create(context.Background(), pod2, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - // Create a KubernetesHandler object with the fake clientset - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - ctx := context.Background() - informerFactory := startInformers(ctx, fakeClient, handler) - - // Call the getPodsInDeployment function - pods, err := handler.getPodsInDeployment(ctx, informerFactory, deployment, replicaset) - require.NoError(t, err) - require.Equal(t, 1, len(pods)) - require.Equal(t, pod1.Name, pods[0].Name) -} - -func TestGetCurrentReplicaSetForDeployment(t *testing.T) { - // Create a fake Kubernetes clientset - fakeClient := fake.NewSimpleClientset() - - // Create a Deployment object - deployment := &v1.Deployment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-deployment", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - }, - } - - // Create a ReplicaSet object with a higher revision than the other ReplicaSet - replicaSet1 := &v1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-replicaset-1", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "1"}, - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ - Group: v1.SchemeGroupVersion.Group, - Version: v1.SchemeGroupVersion.Version, - Kind: "Deployment", - }), - }, - }, - } - // Create another ReplicaSet object with a lower revision than the other ReplicaSet - replicaSet2 := &v1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-replicaset-2", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "0"}, - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ - Group: v1.SchemeGroupVersion.Group, - Version: v1.SchemeGroupVersion.Version, - Kind: "Deployment", - }), - }, - }, - } - - // Create another ReplicaSet object with a higher revision than the other ReplicaSet - replicaSet3 := &v1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-replicaset-3", - Namespace: "test-namespace", - Annotations: map[string]string{"deployment.kubernetes.io/revision": "3"}, - OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(deployment, schema.GroupVersionKind{ - Group: v1.SchemeGroupVersion.Group, - Version: v1.SchemeGroupVersion.Version, - Kind: "Deployment", - }), - }, - }, - } - - // Add the ReplicaSet objects to the fake Kubernetes clientset - _, err := fakeClient.AppsV1().ReplicaSets(replicaSet1.Namespace).Create(context.Background(), replicaSet1, metav1.CreateOptions{}) - require.NoError(t, err) - _, err = fakeClient.AppsV1().ReplicaSets(replicaSet2.Namespace).Create(context.Background(), replicaSet2, metav1.CreateOptions{}) - require.NoError(t, err) - _, err = fakeClient.AppsV1().ReplicaSets(replicaSet2.Namespace).Create(context.Background(), replicaSet3, metav1.CreateOptions{}) - require.NoError(t, err) - - // Add the Deployment object to the fake Kubernetes clientset - _, err = fakeClient.AppsV1().Deployments(deployment.Namespace).Create(context.Background(), deployment, metav1.CreateOptions{}) - require.NoError(t, err) - - // Create a KubernetesHandler object with the fake clientset - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - ctx := context.Background() - informerFactory := startInformers(ctx, fakeClient, handler) - - // Call the getNewestReplicaSetForDeployment function - rs := handler.getCurrentReplicaSetForDeployment(ctx, informerFactory, deployment) - require.Equal(t, replicaSet1.Name, rs.Name) -} - -func TestCheckPodStatus(t *testing.T) { - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - }, - Status: corev1.PodStatus{}, - } - - podTests := []struct { - podCondition []corev1.PodCondition - containerStatus []corev1.ContainerStatus - isReady bool - expectedError string - }{ - { - // Container is in Terminated state - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - Reason: "Error", - Message: "Container terminated due to an error", - }, - }, - }, - }, - isReady: false, - expectedError: "Container state is 'Terminated' Reason: Error, Message: Container terminated due to an error", - }, - { - // Container is in CrashLoopBackOff state - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Waiting: &corev1.ContainerStateWaiting{ - Reason: "CrashLoopBackOff", - Message: "Back-off 5m0s restarting failed container=test-container pod=test-pod", - }, - }, - }, - }, - isReady: false, - expectedError: "Container state is 'Waiting' Reason: CrashLoopBackOff, Message: Back-off 5m0s restarting failed container=test-container pod=test-pod", - }, - { - // Container is in ErrImagePull state - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Waiting: &corev1.ContainerStateWaiting{ - Reason: "ErrImagePull", - Message: "Cannot pull image", - }, - }, - }, - }, - isReady: false, - expectedError: "Container state is 'Waiting' Reason: ErrImagePull, Message: Cannot pull image", - }, - { - // Container is in ImagePullBackOff state - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Waiting: &corev1.ContainerStateWaiting{ - Reason: "ImagePullBackOff", - Message: "ImagePullBackOff", - }, - }, - }, - }, - isReady: false, - expectedError: "Container state is 'Waiting' Reason: ImagePullBackOff, Message: ImagePullBackOff", - }, - { - // No container statuses available - isReady: false, - expectedError: "", - }, - { - // Container is in Waiting state but not a terminally failed state - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Waiting: &corev1.ContainerStateWaiting{ - Reason: "ContainerCreating", - Message: "Container is being created", - }, - }, - Ready: false, - }, - }, - isReady: false, - expectedError: "", - }, - { - // Container's Running state is nil - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Running: nil, - }, - Ready: false, - }, - }, - isReady: false, - expectedError: "", - }, - { - // Readiness check is not yet passed - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Running: &corev1.ContainerStateRunning{}, - }, - Ready: false, - }, - }, - isReady: false, - expectedError: "", - }, - { - // Container is in Ready state - podCondition: nil, - containerStatus: []corev1.ContainerStatus{ - { - State: corev1.ContainerState{ - Running: &corev1.ContainerStateRunning{}, - }, - Ready: true, - }, - }, - isReady: true, - expectedError: "", - }, - } - - ctx := context.Background() - handler := &kubernetesHandler{} - for _, tc := range podTests { - pod.Status.Conditions = tc.podCondition - pod.Status.ContainerStatuses = tc.containerStatus - isReady, err := handler.checkPodStatus(ctx, pod) - if tc.expectedError != "" { - require.Error(t, err) - require.Equal(t, tc.expectedError, err.Error()) - } else { - require.NoError(t, err) - } - require.Equal(t, tc.isReady, isReady) - } -} - -func TestCheckAllPodsReady_Success(t *testing.T) { - // Create a fake Kubernetes clientset - clientset := fake.NewSimpleClientset() - - ctx := context.Background() - - _, err := clientset.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - - replicaSet := addReplicaSetToDeployment(t, ctx, clientset, testDeployment) - - // Create a pod - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - }, - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ - { - Name: "test-container", - Image: "test-image", - }, - }, - }, - Status: corev1.PodStatus{ - Phase: corev1.PodRunning, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: true, - }, - }, - }, - } - _, err = clientset.CoreV1().Pods("test-namespace").Create(context.Background(), pod, metav1.CreateOptions{}) - assert.NoError(t, err) - - // Create an informer factory and add the deployment and replica set to the cache - informerFactory := informers.NewSharedInformerFactory(clientset, 0) - addTestObjects(t, clientset, informerFactory, testDeployment, replicaSet, pod) - - // Create a done channel - doneCh := make(chan error) - - // Create a handler with the fake clientset - handler := &kubernetesHandler{ - clientSet: clientset, - } - - // Call the checkAllPodsReady function - allReady := handler.checkAllPodsReady(ctx, informerFactory, testDeployment, replicaSet, doneCh) - - // Check that all pods are ready - require.True(t, allReady) -} - -func TestCheckAllPodsReady_Fail(t *testing.T) { - // Create a fake Kubernetes clientset - clientset := fake.NewSimpleClientset() - - ctx := context.Background() - - _, err := clientset.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - - replicaSet := addReplicaSetToDeployment(t, ctx, clientset, testDeployment) - - // Create a pod - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: replicaSet.Name, - Controller: to.Ptr(true), - }, - }, - }, - Spec: corev1.PodSpec{ - Containers: []corev1.Container{ - { - Name: "test-container", - Image: "test-image", - }, - }, - }, - Status: corev1.PodStatus{ - Phase: corev1.PodRunning, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: false, - }, - }, - }, - } - _, err = clientset.CoreV1().Pods(pod.Namespace).Create(context.Background(), pod, metav1.CreateOptions{}) - require.NoError(t, err) - - // Create an informer factory and add the deployment and replica set to the cache - informerFactory := informers.NewSharedInformerFactory(clientset, 0) - addTestObjects(t, clientset, informerFactory, testDeployment, replicaSet, pod) - - // Create a done channel - doneCh := make(chan error) - - // Create a handler with the fake clientset - handler := &kubernetesHandler{ - clientSet: clientset, - } - - // Call the checkAllPodsReady function - allReady := handler.checkAllPodsReady(ctx, informerFactory, testDeployment, replicaSet, doneCh) - - // Check that all pods are ready - require.False(t, allReady) -} - -func TestCheckDeploymentStatus_AllReady(t *testing.T) { - // Create a fake Kubernetes fakeClient - fakeClient := fake.NewSimpleClientset() - - ctx := context.Background() - _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, testDeployment) - - // Create a Pod object - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: replicaSet.Name, - Controller: to.Ptr(true), - }, - }, - }, - Status: corev1.PodStatus{ - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodScheduled, - Status: corev1.ConditionTrue, - }, - }, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: true, - State: corev1.ContainerState{ - Running: &corev1.ContainerStateRunning{}, - }, - }, - }, - }, - } - - // Add the Pod object to the fake Kubernetes clientset - _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - // Create an informer factory and add the deployment to the cache - informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) - addTestObjects(t, fakeClient, informerFactory, testDeployment, replicaSet, pod) - - // Create a fake item and object - item := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ - "name": "test-deployment", - "namespace": "test-namespace", - }, - }, - } - - // Create a done channel - doneCh := make(chan error, 1) - - // Call the checkDeploymentStatus function - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - go handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - - err = <-doneCh - - // Check that the deployment readiness was checked - require.Nil(t, err) -} - -func TestCheckDeploymentStatus_NoReplicaSetsFound(t *testing.T) { - // Create a fake Kubernetes fakeClient - fakeClient := fake.NewSimpleClientset() - - ctx := context.Background() - _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - - // Create a Pod object - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - }, - Status: corev1.PodStatus{ - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodScheduled, - Status: corev1.ConditionTrue, - }, - }, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: true, - State: corev1.ContainerState{ - Running: &corev1.ContainerStateRunning{}, - }, - }, - }, - }, - } - - // Add the Pod object to the fake Kubernetes clientset - _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - // Create an informer factory and add the deployment to the cache - informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) - err = informerFactory.Apps().V1().Deployments().Informer().GetIndexer().Add(testDeployment) - require.NoError(t, err, "Failed to add deployment to informer cache") - err = informerFactory.Core().V1().Pods().Informer().GetIndexer().Add(pod) - require.NoError(t, err, "Failed to add pod to informer cache") - // Note: No replica set added - - // Create a fake item and object - item := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ - "name": "test-deployment", - "namespace": "test-namespace", - }, - }, - } - - // Create a done channel - doneCh := make(chan error, 1) - - // Call the checkDeploymentStatus function - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - allReady := handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - - // Check that the deployment readiness was checked - require.False(t, allReady) -} - -func TestCheckDeploymentStatus_PodsNotReady(t *testing.T) { - // Create a fake Kubernetes fakeClient - fakeClient := fake.NewSimpleClientset() - - ctx := context.Background() - _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, testDeployment) - - // Create a Pod object - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: replicaSet.Name, - Controller: to.Ptr(true), - }, - }, - }, - Status: corev1.PodStatus{ - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodScheduled, - Status: corev1.ConditionTrue, - }, - }, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: true, - State: corev1.ContainerState{ - Terminated: &corev1.ContainerStateTerminated{ - Reason: "Error", - Message: "Container terminated due to an error", - }, - }, - }, - }, - }, - } - - // Add the Pod object to the fake Kubernetes clientset - _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - // Create an informer factory and add the deployment to the cache - informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) - addTestObjects(t, fakeClient, informerFactory, testDeployment, replicaSet, pod) - - // Create a fake item and object - item := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ - "name": "test-deployment", - "namespace": "test-namespace", - }, - }, - } - - // Create a done channel - doneCh := make(chan error, 1) - - // Call the checkDeploymentStatus function - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - go handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - err = <-doneCh - - // Check that the deployment readiness was checked - require.Error(t, err) - require.Equal(t, err.Error(), "Container state is 'Terminated' Reason: Error, Message: Container terminated due to an error") -} - -func TestCheckDeploymentStatus_ObservedGenerationMismatch(t *testing.T) { - // Modify testDeployment to have a different generation than the observed generation - testDeployment.Generation = 2 - - // Create a fake Kubernetes fakeClient - fakeClient := fake.NewSimpleClientset() - - ctx := context.Background() - _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, testDeployment) - - // Create a Pod object - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: replicaSet.Name, - Controller: to.Ptr(true), - }, - }, - }, - Status: corev1.PodStatus{ - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodScheduled, - Status: corev1.ConditionTrue, - }, - }, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: true, - State: corev1.ContainerState{ - Running: &corev1.ContainerStateRunning{}, - }, - }, - }, - }, - } - - // Add the Pod object to the fake Kubernetes clientset - _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - // Create an informer factory and add the deployment to the cache - informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) - addTestObjects(t, fakeClient, informerFactory, testDeployment, replicaSet, pod) - - // Create a fake item and object - item := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ - "name": "test-deployment", - "namespace": "test-namespace", - }, - }, - } - - // Create a done channel - doneCh := make(chan error, 1) - - // Call the checkDeploymentStatus function - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - - // Check that the deployment readiness was checked - require.Zero(t, len(doneCh)) -} - -func TestCheckDeploymentStatus_DeploymentNotProgressing(t *testing.T) { - // Create a fake Kubernetes fakeClient - fakeClient := fake.NewSimpleClientset() - - ctx := context.Background() - _, err := fakeClient.AppsV1().Deployments("test-namespace").Create(ctx, testDeployment, metav1.CreateOptions{}) - require.NoError(t, err) - replicaSet := addReplicaSetToDeployment(t, ctx, fakeClient, testDeployment) - - // Create a Pod object - pod := &corev1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test-pod1", - Namespace: "test-namespace", - Labels: map[string]string{ - "app": "test", - }, - OwnerReferences: []metav1.OwnerReference{ - { - Kind: "ReplicaSet", - Name: replicaSet.Name, - Controller: to.Ptr(true), - }, - }, - }, - Status: corev1.PodStatus{ - Conditions: []corev1.PodCondition{ - { - Type: corev1.PodScheduled, - Status: corev1.ConditionTrue, - }, - }, - ContainerStatuses: []corev1.ContainerStatus{ - { - Name: "test-container", - Ready: true, - State: corev1.ContainerState{ - Running: &corev1.ContainerStateRunning{}, - }, - }, - }, - }, - } - - // Add the Pod object to the fake Kubernetes clientset - _, err = fakeClient.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{}) - require.NoError(t, err, "Failed to create Pod: %v", err) - - // Create an informer factory and add the deployment to the cache - informerFactory := informers.NewSharedInformerFactory(fakeClient, 0) - addTestObjects(t, fakeClient, informerFactory, testDeployment, replicaSet, pod) - - testDeployment.Status = v1.DeploymentStatus{ - Conditions: []v1.DeploymentCondition{ - { - Type: v1.DeploymentProgressing, - Status: corev1.ConditionFalse, - Reason: "NewReplicaSetAvailable", - Message: "Deployment has minimum availability", - }, - }, - } - - // Create a fake item and object - item := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "metadata": map[string]interface{}{ - "name": "test-deployment", - "namespace": "test-namespace", - }, - }, - } - - // Create a done channel - doneCh := make(chan error, 1) - - // Call the checkDeploymentStatus function - handler := &kubernetesHandler{ - clientSet: fakeClient, - } - - ready := handler.checkDeploymentStatus(ctx, informerFactory, item, doneCh) - require.False(t, ready) -} - -func addTestObjects(t *testing.T, fakeClient *fake.Clientset, informerFactory informers.SharedInformerFactory, deployment *v1.Deployment, replicaSet *v1.ReplicaSet, pod *corev1.Pod) { - err := informerFactory.Apps().V1().Deployments().Informer().GetIndexer().Add(testDeployment) - require.NoError(t, err, "Failed to add deployment to informer cache") - err = informerFactory.Apps().V1().ReplicaSets().Informer().GetIndexer().Add(replicaSet) - require.NoError(t, err, "Failed to add replica set to informer cache") - err = informerFactory.Core().V1().Pods().Informer().GetIndexer().Add(pod) - require.NoError(t, err, "Failed to add pod to informer cache") -} diff --git a/pkg/corerp/model/application_model.go b/pkg/corerp/model/application_model.go index 3f74b837d3..bd86257eaf 100644 --- a/pkg/corerp/model/application_model.go +++ b/pkg/corerp/model/application_model.go @@ -36,6 +36,7 @@ import ( resources_kubernetes "github.com/radius-project/radius/pkg/ucp/resources/kubernetes" "k8s.io/client-go/discovery" + "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -48,7 +49,7 @@ const ( // NewApplicationModel configures RBAC support on connections based on connection kind, configures the providers supported by the appmodel, // registers the renderers and handlers for various resources, and checks for duplicate registrations. -func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sClientSet kubernetes.Interface, discoveryClient discovery.ServerResourcesInterface) (ApplicationModel, error) { +func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sClientSet kubernetes.Interface, discoveryClient discovery.ServerResourcesInterface, k8sDynamicClientSet dynamic.Interface) (ApplicationModel, error) { // Configure RBAC support on connections based connection kind. // Role names can be user input or default roles assigned by Radius. // Leave RoleNames field empty if no default roles are supported for a connection kind. @@ -116,7 +117,7 @@ func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sCli Type: AnyResourceType, Provider: resourcemodel.ProviderKubernetes, }, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient), + ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient, k8sDynamicClientSet), }, { ResourceType: resourcemodel.ResourceType{ @@ -124,7 +125,7 @@ func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sCli Provider: resourcemodel.ProviderKubernetes, }, ResourceTransformer: azcontainer.TransformSecretProviderClass, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient), + ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient, k8sDynamicClientSet), }, { ResourceType: resourcemodel.ResourceType{ @@ -132,7 +133,7 @@ func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sCli Provider: resourcemodel.ProviderKubernetes, }, ResourceTransformer: azcontainer.TransformFederatedIdentitySA, - ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient), + ResourceHandler: handlers.NewKubernetesHandler(k8sClient, k8sClientSet, discoveryClient, k8sDynamicClientSet), }, } diff --git a/pkg/corerp/renderers/gateway/render.go b/pkg/corerp/renderers/gateway/render.go index 8203328292..2fe79fa094 100644 --- a/pkg/corerp/renderers/gateway/render.go +++ b/pkg/corerp/renderers/gateway/render.go @@ -103,7 +103,7 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options publicEndpoint = getPublicEndpoint(hostname, options.Environment.Gateway.Port, isHttps) } - gatewayObject, err := MakeGateway(ctx, options, gateway, gateway.Name, applicationName, hostname) + gatewayObject, err := MakeRootHTTPProxy(ctx, options, gateway, gateway.Name, applicationName, hostname) if err != nil { return renderers.RendererOutput{}, err } @@ -116,7 +116,7 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options }, } - httpRouteObjects, err := MakeHttpRoutes(ctx, options, *gateway, &gateway.Properties, gatewayName, applicationName) + httpRouteObjects, err := MakeRoutesHTTPProxies(ctx, options, *gateway, &gateway.Properties, gatewayName, gatewayObject, applicationName) if err != nil { return renderers.RendererOutput{}, err } @@ -128,9 +128,9 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options }, nil } -// MakeGateway validates the Gateway resource and its dependencies, and creates a Contour HTTPProxy resource +// MakeRootHTTPProxy validates the Gateway resource and its dependencies, and creates a Contour HTTPProxy resource // to act as the Gateway. -func MakeGateway(ctx context.Context, options renderers.RenderOptions, gateway *datamodel.Gateway, resourceName string, applicationName string, hostname string) (rpv1.OutputResource, error) { +func MakeRootHTTPProxy(ctx context.Context, options renderers.RenderOptions, gateway *datamodel.Gateway, resourceName string, applicationName string, hostname string) (rpv1.OutputResource, error) { includes := []contourv1.Include{} dependencies := options.Dependencies @@ -292,9 +292,9 @@ func MakeGateway(ctx context.Context, options renderers.RenderOptions, gateway * return rpv1.NewKubernetesOutputResource(rpv1.LocalIDGateway, rootHTTPProxy, rootHTTPProxy.ObjectMeta), nil } -// MakeHttpRoutes creates HTTPProxy objects for each route in the gateway and returns them as OutputResources. It returns +// MakeRoutesHTTPProxies creates HTTPProxy objects for each route in the gateway and returns them as OutputResources. It returns // an error if it fails to get the route name. -func MakeHttpRoutes(ctx context.Context, options renderers.RenderOptions, resource datamodel.Gateway, gateway *datamodel.GatewayProperties, gatewayName string, applicationName string) ([]rpv1.OutputResource, error) { +func MakeRoutesHTTPProxies(ctx context.Context, options renderers.RenderOptions, resource datamodel.Gateway, gateway *datamodel.GatewayProperties, gatewayName string, gatewayOutPutResource rpv1.OutputResource, applicationName string) ([]rpv1.OutputResource, error) { dependencies := options.Dependencies objects := make(map[string]*contourv1.HTTPProxy) @@ -387,6 +387,9 @@ func MakeHttpRoutes(ctx context.Context, options renderers.RenderOptions, resour } objects[localID] = httpProxyObject + + // Add the route as a dependency of the root http proxy to ensure that the route is created before the root http proxy + gatewayOutPutResource.CreateResource.Dependencies = append(gatewayOutPutResource.CreateResource.Dependencies, localID) } var outputResources []rpv1.OutputResource diff --git a/pkg/corerp/renderers/gateway/render_test.go b/pkg/corerp/renderers/gateway/render_test.go index 204f75b041..dab84c49f1 100644 --- a/pkg/corerp/renderers/gateway/render_test.go +++ b/pkg/corerp/renderers/gateway/render_test.go @@ -19,6 +19,7 @@ package gateway import ( "context" "fmt" + "strings" "testing" contourv1 "github.com/projectcontour/contour/apis/projectcontour/v1" @@ -1466,6 +1467,12 @@ func validateHTTPProxy(t *testing.T, outputResources []rpv1.OutputResource, expe httpProxy, httpProxyOutputResource := kubernetes.FindContourHTTPProxy(outputResources) expectedHTTPProxyOutputResource := rpv1.NewKubernetesOutputResource(rpv1.LocalIDGateway, httpProxy, httpProxy.ObjectMeta) + for _, r := range outputResources { + if strings.Contains(r.LocalID, rpv1.LocalIDHttpRoute) { + expectedHTTPProxyOutputResource.CreateResource.Dependencies = append(expectedHTTPProxyOutputResource.CreateResource.Dependencies, r.LocalID) + } + } + require.Equal(t, expectedHTTPProxyOutputResource, httpProxyOutputResource) require.Equal(t, kubernetes.NormalizeResourceName(resourceName), httpProxy.Name) require.Equal(t, applicationName, httpProxy.Namespace) diff --git a/test/functional/shared/resources/gateway_test.go b/test/functional/shared/resources/gateway_test.go index ab6d45f006..647a3a9317 100644 --- a/test/functional/shared/resources/gateway_test.go +++ b/test/functional/shared/resources/gateway_test.go @@ -31,6 +31,7 @@ import ( "github.com/radius-project/radius/test/step" "github.com/radius-project/radius/test/validation" "github.com/stretchr/testify/require" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) const ( @@ -107,6 +108,8 @@ func Test_Gateway(t *testing.T) { require.NoError(t, err) t.Logf("found root proxy with hostname: {%s} and status: {%s}", metadata.Hostname, metadata.Status) + require.Equal(t, "Valid HTTPProxy", metadata.Status) + // Set up pod port-forwarding for contour-envoy t.Logf("Setting up portforward") @@ -369,6 +372,50 @@ func Test_Gateway_TLSTermination(t *testing.T) { test.Test(t) } +func Test_Gateway_Failure(t *testing.T) { + template := "testdata/corerp-resources-gateway-failure.bicep" + name := "corerp-resources-gateway-failure" + secret := "secret" + + // We might see either of these states depending on the timing. + validateFn := step.ValidateAnyDetails("DeploymentFailed", []step.DeploymentErrorDetail{ + { + Code: "ResourceDeploymentFailure", + Details: []step.DeploymentErrorDetail{ + { + Code: "Internal", + MessageContains: "invalid TLS certificate", + }, + }, + }, + }) + + test := shared.NewRPTest(t, name, []shared.TestStep{ + { + Executor: step.NewDeployErrorExecutor(template, validateFn), + SkipObjectValidation: true, + SkipKubernetesOutputResourceValidation: true, + }, + }, + unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Secret", + "metadata": map[string]interface{}{ + "name": secret, + "namespace": "mynamespace", + }, + "type": "Opaque", + "data": map[string]interface{}{ + "tls.crt": "", + "tls.key": "", + }, + }, + }) + + test.Test(t) +} + func testGatewayWithPortForward(t *testing.T, ctx context.Context, at shared.RPTest, hostname string, remotePort int, isHttps bool, tests []GatewayTestConfig) error { // stopChan will close the port-forward connection on close stopChan := make(chan struct{}) diff --git a/test/functional/shared/resources/testdata/corerp-resources-gateway-failure.bicep b/test/functional/shared/resources/testdata/corerp-resources-gateway-failure.bicep new file mode 100644 index 0000000000..ef7a22b8a5 --- /dev/null +++ b/test/functional/shared/resources/testdata/corerp-resources-gateway-failure.bicep @@ -0,0 +1,54 @@ +import radius as radius + +@description('ID of the Radius environment. Passed in automatically via the rad CLI') +param environment string + +resource demoApplication 'Applications.Core/applications@2022-03-15-privatepreview' = { + name: 'corerp-resources-gateway-failure-app' + properties: { + environment: environment + } +} + +resource demoSecretStore 'Applications.Core/secretStores@2022-03-15-privatepreview' = { + name: 'corerp-resources-gateway-failure-secretstore' + properties: { + application: demoApplication.id + type: 'certificate' + + // Reference the existing mynamespace/secret Kubernetes secret + resource: 'mynamespace/secret' + data: { + // Make the tls.crt and tls.key secrets available to the application + 'tls.crt': {} + 'tls.key': {} + } + } +} + +resource demoGateway 'Applications.Core/gateways@2022-03-15-privatepreview' = { + name: 'corerp-resources-gateway-failure-gateway' + properties: { + application: demoApplication.id + hostname: { + fullyQualifiedHostname: 'a.example.com' // Replace with your domain name. + } + routes: [ + { + path: '/' + destination: demoRoute.id + } + ] + tls: { + certificateFrom: demoSecretStore.id + minimumProtocolVersion: '1.2' + } + } +} + +resource demoRoute 'Applications.Core/httpRoutes@2022-03-15-privatepreview' = { + name: 'corerp-resources-gateway-failure-route' + properties: { + application: demoApplication.id + } +} diff --git a/test/functional/shared/rptest.go b/test/functional/shared/rptest.go index 0f93500c4e..42a2865532 100644 --- a/test/functional/shared/rptest.go +++ b/test/functional/shared/rptest.go @@ -163,6 +163,9 @@ func (ct RPTest) CreateInitialResources(ctx context.Context) error { } for _, r := range ct.InitialResources { + if err := kubernetes.EnsureNamespace(ctx, ct.Options.K8sClient, r.GetNamespace()); err != nil { + return fmt.Errorf("failed to create namespace %s: %w", ct.Name, err) + } if err := ct.Options.Client.Create(ctx, &r); err != nil { return fmt.Errorf("failed to create resource %#v: %w", r, err) } From 512a08bd457bf6ab0d4ad1b10f9ee4fc8a48a8c6 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Wed, 6 Sep 2023 13:32:44 -0700 Subject: [PATCH 46/57] Add plumbing for tracked resources (#6199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This change adds the API endpoint for listing resources in a resource group. Right now nothing *writes* data to this collection, so nothing will be returned. The write-side of this relationship will be sent in a follow-up PR. ## Type of change - This pull request adds or changes features of Radius and has an approved issue (issue link required). ## Auto-generated summary ### 🤖 Generated by Copilot at db58a8f ### Summary 📝🔄📦 This pull request adds the `ResourceGroups.Resources` operation to the UCP resource manager API, which allows listing the tracked resources in a UCP resource group. It also adds the necessary models, converters, tests, and documentation for the operation, and updates the frontend routes and the plane name references. It removes the unused `pkg/ucp/datamodel/resource.go` file. > _`ResourceGroups` API_ > _Listing tracked resources_ > _Autumn harvest time_ ### Walkthrough * Add the `ResourceGroups.Resources` operation to the UCP API, which lists the resources in a UCP resource group ([link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-cc310274506998a9cb634be1fcf47f3d60e3952ededc2877d22e13aa6b1da6a9R109-R119), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-4b6a62f07b9f16f76cad4ff01bc3123c05785d1609f10a0f65ca4587b1477380R644-R690), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-c8b433357e1b615716c00d5c04690a6743c6f0dd73f772da9a981c86bd509c5eR102-R110), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-9abfb8c07367e0af734a41a615f83d1812ff44b5433f3aed6fbae234bb31e7b0R1-R110), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-6a0e13310a26b0bc0209469890851dd4afbc44bd718a77f51ec68e4f4d4170b5R1-R144), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-0c748400ed77b4a219c97b84d9ecbc73d081ca60a4e3abaa34cc9617eeb9e5abR273-R331), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-c74c23d29da9a5ac2ea4388c4cfd23f42018e45c93a29f71c4c5eeadebdfa4c6R126-R131), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-416356e403db5b572d2c0f372baef2abfeb3000363efc6d41f55bdc65f47ebafR116-R120)) * Add the `TrackedResourceList` and `TrackedResourceListEntry` types to the UCP API and data model, which represent the resources stored in a UCP resource group ([link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-cc310274506998a9cb634be1fcf47f3d60e3952ededc2877d22e13aa6b1da6a9R56-R71), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-4b6a62f07b9f16f76cad4ff01bc3123c05785d1609f10a0f65ca4587b1477380R1702-R1740), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-6f7e7aae5544d15eeb60fd6452c8cdcdd56c68c1c6c5a9910511ef0aef14aa77R386-R403), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-6f300088351b430ca2464beef84ad3069228f02d95a3dcd3641926ad1c2620fbR963-R1024), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-175a83221c86f8341e51bd539a67049bd60b6300f86d403e5c3d0b5e426e2e4dR1-R55), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-1d3c43c905868be0c590c7d498d5f3349ca187ab61dc75417f27005fc00d6a1dR1-R48), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-67d1d73e44007a6f222129ec3b59a86b35e0a0b819d43c714f46475dfccbc1f6R1-R47)) * Add the `UcpResourceActionSync` type to the UCP API, which defines a custom action type for UCP resources ([link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-49dd7f9c188a21384e7a8f64fbf861fa27bdc362c4bc738f1e74e62820aefe4fR160-R168)) * Add the test data, test files, and comments for the new types and operations ([link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-5cafe7e061f2893eb4c59ad4a73e7ab07fa5031b59ebee00fda2810595369e36L1-R21), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-134cfc7ecd8473c79defbf93680b83f13d844fef7ad68d994b7c89f87a7c3faeR1-R73), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-cc76a2a14994ce1ed06bd12ba9665a1d20a17992f345a7f8ca06afc934da2a92L35-R35)) * Update the comments for the catch-all paths for the proxy requests to use the correct plane name ([link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-c8b433357e1b615716c00d5c04690a6743c6f0dd73f772da9a981c86bd509c5eL107-R116), [link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-c8b433357e1b615716c00d5c04690a6743c6f0dd73f772da9a981c86bd509c5eL114-R123)) * Delete the unused file `pkg/ucp/datamodel/resource.go` ([link](https://github.com/radius-project/radius/pull/6199/files?diff=unified&w=0#diff-333442dc1efebe43776ff8af54908f266a90d118599279b0d6f065f81673bb19)) --- build/generate.mk | 2 +- .../genericresource_conversion.go | 49 ++++++ .../genericresource_conversion_test.go | 73 ++++++++ .../testdata/genericresource_datamodel.json | 22 +++ .../zz_generated_client_factory.go | 5 + .../zz_generated_models.go | 62 +++++++ .../zz_generated_models_serde.go | 156 ++++++++++++++++++ .../zz_generated_options.go | 5 + .../zz_generated_resources_client.go | 108 ++++++++++++ .../zz_generated_response_types.go | 6 + .../converter/genericresource_converter.go | 47 ++++++ pkg/ucp/datamodel/genericresource.go | 55 ++++++ pkg/ucp/datamodel/resource.go | 29 ---- .../resourcegroups/listresources.go | 110 ++++++++++++ .../resourcegroups/listresources_test.go | 144 ++++++++++++++++ pkg/ucp/frontend/radius/routes.go | 13 +- .../examples/Resources_List.json | 30 ++++ .../2022-09-01-privatepreview/openapi.json | 126 ++++++++++++++ .../Resources_List.json | 30 ++++ typespec/UCP/resourcegroups.tsp | 20 +++ 20 files changed, 1060 insertions(+), 32 deletions(-) create mode 100644 pkg/ucp/api/v20220901privatepreview/genericresource_conversion.go create mode 100644 pkg/ucp/api/v20220901privatepreview/genericresource_conversion_test.go create mode 100644 pkg/ucp/api/v20220901privatepreview/testdata/genericresource_datamodel.json create mode 100644 pkg/ucp/api/v20220901privatepreview/zz_generated_resources_client.go create mode 100644 pkg/ucp/datamodel/converter/genericresource_converter.go create mode 100644 pkg/ucp/datamodel/genericresource.go delete mode 100644 pkg/ucp/datamodel/resource.go create mode 100644 pkg/ucp/frontend/controller/resourcegroups/listresources.go create mode 100644 pkg/ucp/frontend/controller/resourcegroups/listresources_test.go create mode 100644 swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Resources_List.json create mode 100644 typespec/UCP/examples/2022-09-01-privatepreview/Resources_List.json diff --git a/build/generate.mk b/build/generate.mk index f7417df5b6..3863d7b2fe 100644 --- a/build/generate.mk +++ b/build/generate.mk @@ -32,7 +32,7 @@ generate-tsp-installed: @echo "$(ARROW) OK" .PHONY: generate-openapi-spec -generate-openapi-spec: +generate-openapi-spec: # Generates all Radius OpenAPI specs from TypeSpec. @echo "Generating openapi specs from typespec models." cd typespec/UCP && npx$(CMD_EXT) tsp compile . cd typespec/Applications.Core && npx$(CMD_EXT) tsp compile . diff --git a/pkg/ucp/api/v20220901privatepreview/genericresource_conversion.go b/pkg/ucp/api/v20220901privatepreview/genericresource_conversion.go new file mode 100644 index 0000000000..089cbaade7 --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/genericresource_conversion.go @@ -0,0 +1,49 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v20220901privatepreview + +import ( + "errors" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/datamodel" +) + +const ( + ResourceType = "System.Resources/resources" +) + +// ConvertTo converts from the versioned GenericResource resource to version-agnostic datamodel. +func (src *GenericResource) ConvertTo() (v1.DataModelInterface, error) { + return nil, errors.New("the GenericResource type does not support conversion from versioned models") +} + +// ConvertFrom converts from version-agnostic datamodel to the versioned GenericResource resource. +func (dst *GenericResource) ConvertFrom(src v1.DataModelInterface) error { + entry, ok := src.(*datamodel.GenericResource) + if !ok { + return v1.ErrInvalidModelConversion + } + + // The properties are used to store the data of the "tracked" resource. + dst.ID = to.Ptr(entry.Properties.ID) + dst.Name = to.Ptr(entry.Properties.Name) + dst.Type = to.Ptr(entry.Properties.Type) + + return nil +} diff --git a/pkg/ucp/api/v20220901privatepreview/genericresource_conversion_test.go b/pkg/ucp/api/v20220901privatepreview/genericresource_conversion_test.go new file mode 100644 index 0000000000..e1a93743ff --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/genericresource_conversion_test.go @@ -0,0 +1,73 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v20220901privatepreview + +import ( + "encoding/json" + "errors" + "testing" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/test/testutil" + + "github.com/stretchr/testify/require" +) + +func Test_GenericResource_VersionedToDataModel(t *testing.T) { + versioned := &GenericResource{} + dm, err := versioned.ConvertTo() + require.Equal(t, errors.New("the GenericResource type does not support conversion from versioned models"), err) + require.Nil(t, dm) +} + +func Test_GenericResource_DataModelToVersioned(t *testing.T) { + conversionTests := []struct { + filename string + expected *GenericResource + err error + }{ + { + filename: "genericresource_datamodel.json", + expected: &GenericResource{ + ID: to.Ptr("/planes/radius/local/resourcegroups/rg1/providers/Applications.Core/applications/test-app"), + Type: to.Ptr("Applications.Core/applications"), + Name: to.Ptr("test-app"), + }, + }, + } + + for _, tt := range conversionTests { + t.Run(tt.filename, func(t *testing.T) { + rawPayload := testutil.ReadFixture(tt.filename) + data := &datamodel.GenericResource{} + err := json.Unmarshal(rawPayload, data) + require.NoError(t, err) + + versioned := &GenericResource{} + + err = versioned.ConvertFrom(data) + + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + } else { + require.NoError(t, err) + require.Equal(t, tt.expected, versioned) + } + }) + } +} diff --git a/pkg/ucp/api/v20220901privatepreview/testdata/genericresource_datamodel.json b/pkg/ucp/api/v20220901privatepreview/testdata/genericresource_datamodel.json new file mode 100644 index 0000000000..c8fabfc130 --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/testdata/genericresource_datamodel.json @@ -0,0 +1,22 @@ +{ + "id": "/planes/radius/local/providers/System.Resources/resources/asdf", + "name": "asdf", + "type": "System.Resources/resources", + "location": "global", + "systemData": { + "createdBy": "fakeid@live.com", + "createdByType": "User", + "createdAt": "2021-09-24T19:09:54.2403864Z", + "lastModifiedBy": "fakeid@live.com", + "lastModifiedByType": "User", + "lastModifiedAt": "2021-09-24T20:09:54.2403864Z" + }, + "tags": { + "env": "dev" + }, + "properties": { + "id": "/planes/radius/local/resourcegroups/rg1/providers/Applications.Core/applications/test-app", + "type": "Applications.Core/applications", + "name": "test-app" + } +} \ No newline at end of file diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go index f0fbcdc587..c88e54ed34 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_client_factory.go @@ -54,3 +54,8 @@ func (c *ClientFactory) NewResourceGroupsClient() *ResourceGroupsClient { return subClient } +func (c *ClientFactory) NewResourcesClient() *ResourcesClient { + subClient, _ := NewResourcesClient(c.credential, c.options) + return subClient +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go index eebab52ecf..0a2ddfb425 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_models.go @@ -167,6 +167,25 @@ func (a *AzureServicePrincipalProperties) GetAzureCredentialProperties() *AzureC } } +// ComponentsKhmx01SchemasGenericresourceAllof0 - Concrete proxy resource types can be created by aliasing this type using +// a specific property type. +type ComponentsKhmx01SchemasGenericresourceAllof0 struct { + // The resource-specific properties for this resource. + Properties map[string]any + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // CredentialStorageProperties - The base credential storage properties type CredentialStorageProperties struct { // REQUIRED; The kind of credential storage @@ -210,6 +229,33 @@ type ErrorResponse struct { Error *ErrorDetail } +// GenericResource - Represents resource data. +type GenericResource struct { + // The resource-specific properties for this resource. + Properties map[string]any + + // READ-ONLY; The name of resource + Name *string + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GenericResourceListResult - The response of a GenericResource list operation. +type GenericResourceListResult struct { + // REQUIRED; The GenericResource items on this page + Value []*GenericResource + + // The link to the next page of items + NextLink *string +} + // InternalCredentialStorageProperties - Internal credential storage properties type InternalCredentialStorageProperties struct { // REQUIRED; The kind of credential storage @@ -280,6 +326,22 @@ type PlaneResourceTagsUpdate struct { Tags map[string]*string } +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go index 8709f69fad..ac9308dbde 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_models_serde.go @@ -384,6 +384,49 @@ func (a *AzureServicePrincipalProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ComponentsKhmx01SchemasGenericresourceAllof0. +func (c ComponentsKhmx01SchemasGenericresourceAllof0) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsKhmx01SchemasGenericresourceAllof0. +func (c *ComponentsKhmx01SchemasGenericresourceAllof0) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CredentialStorageProperties. func (c CredentialStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -512,6 +555,80 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GenericResource. +func (g GenericResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericResource. +func (g *GenericResource) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GenericResourceListResult. +func (g GenericResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericResourceListResult. +func (g *GenericResourceListResult) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type InternalCredentialStorageProperties. func (i InternalCredentialStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -691,6 +808,45 @@ func (p *PlaneResourceTagsUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go index 4803307634..92d7c3ec05 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_options.go @@ -118,3 +118,8 @@ type ResourceGroupsClientUpdateOptions struct { // placeholder for future optional parameters } +// ResourcesClientListOptions contains the optional parameters for the ResourcesClient.NewListPager method. +type ResourcesClientListOptions struct { + // placeholder for future optional parameters +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_resources_client.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_resources_client.go new file mode 100644 index 0000000000..2b54a983c2 --- /dev/null +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_resources_client.go @@ -0,0 +1,108 @@ +//go:build go1.18 +// +build go1.18 + +// Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package v20220901privatepreview + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ResourcesClient contains the methods for the Resources group. +// Don't use this type directly, use NewResourcesClient() instead. +type ResourcesClient struct { + internal *arm.Client +} + +// NewResourcesClient creates a new instance of ResourcesClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewResourcesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourcesClient, error) { + cl, err := arm.NewClient(moduleName+".ResourcesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ResourcesClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - List resources in a resource group +// +// Generated from API version 2022-09-01-privatepreview +// - planeType - The plane type. +// - planeName - The name of the plane +// - resourceGroupName - The name of resource group +// - options - ResourcesClientListOptions contains the optional parameters for the ResourcesClient.NewListPager method. +func (client *ResourcesClient) NewListPager(planeType string, planeName string, resourceGroupName string, options *ResourcesClientListOptions) (*runtime.Pager[ResourcesClientListResponse]) { + return runtime.NewPager(runtime.PagingHandler[ResourcesClientListResponse]{ + More: func(page ResourcesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ResourcesClientListResponse) (ResourcesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, planeType, planeName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ResourcesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ResourcesClient) listCreateRequest(ctx context.Context, planeType string, planeName string, resourceGroupName string, options *ResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/planes/{planeType}/{planeName}/resourcegroups/{resourceGroupName}/resources" + if planeType == "" { + return nil, errors.New("parameter planeType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{planeType}", url.PathEscape(planeType)) + urlPath = strings.ReplaceAll(urlPath, "{planeName}", planeName) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-09-01-privatepreview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ResourcesClient) listHandleResponse(resp *http.Response) (ResourcesClientListResponse, error) { + result := ResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GenericResourceListResult); err != nil { + return ResourcesClientListResponse{}, err + } + return result, nil +} + diff --git a/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go b/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go index 8ff262c9ad..f3990338b0 100644 --- a/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go +++ b/pkg/ucp/api/v20220901privatepreview/zz_generated_response_types.go @@ -129,3 +129,9 @@ type ResourceGroupsClientUpdateResponse struct { ResourceGroupResource } +// ResourcesClientListResponse contains the response from method ResourcesClient.NewListPager. +type ResourcesClientListResponse struct { + // The response of a GenericResource list operation. + GenericResourceListResult +} + diff --git a/pkg/ucp/datamodel/converter/genericresource_converter.go b/pkg/ucp/datamodel/converter/genericresource_converter.go new file mode 100644 index 0000000000..7d2cb4bbc1 --- /dev/null +++ b/pkg/ucp/datamodel/converter/genericresource_converter.go @@ -0,0 +1,47 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package converter + +import ( + "errors" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + v20220901privatepreview "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" +) + +// GenericResourceDataModelToVersioned converts version agnostic datamodel to versioned model. +// It returns an error if the conversion fails. +func GenericResourceDataModelToVersioned(model *datamodel.GenericResource, version string) (v1.VersionedModelInterface, error) { + switch version { + case v20220901privatepreview.Version: + versioned := &v20220901privatepreview.GenericResource{} + if err := versioned.ConvertFrom(model); err != nil { + return nil, err + } + return versioned, nil + + default: + return nil, v1.ErrUnsupportedAPIVersion + } +} + +// GenericResourceDataModelFromVersioned converts versioned model to datamodel. +// It returns an error if the conversion fails. +func GenericResourceDataModelFromVersioned(content []byte, version string) (*datamodel.GenericResource, error) { + return nil, errors.New("the GenericResource type does not support conversion from versioned models") +} diff --git a/pkg/ucp/datamodel/genericresource.go b/pkg/ucp/datamodel/genericresource.go new file mode 100644 index 0000000000..f80d60a3b2 --- /dev/null +++ b/pkg/ucp/datamodel/genericresource.go @@ -0,0 +1,55 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package datamodel + +import v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + +// GenericResource represents a stored "tracked resource" within a UCP resource group. +// +// This type is used to store tracked resources within UCP regardless of the actual +// resource type. You can think of it as a "meta-resource". The top level fields like "ID", +// "Name", and "Type" reflect the GenericResource entry itself. The actual resource data +// is stored in the "Properties" field. +// +// GenericResource are returned through the resource list APIs, but don't support PUT or +// DELETE operations directly. The resource ID, Name, and Type of the GenericResource +// are an implementation detail and are never exposed to users. +type GenericResource struct { + v1.BaseResource + + // Properties stores the properties of the resource being tracked. + Properties GenericResourceProperties `json:"properties"` +} + +// ResourceTypeName gives the type of ucp resource. +func (r *GenericResource) ResourceTypeName() string { + return "System.Resources/resources" +} + +// GenericResourceProperties stores the properties of the resource being tracked. +// +// Right now we only track the basic identifiers. This is enough for UCP to remebmer +// which resources exist, but not to act as a cache. We may want to add more fields +// in the future as we support additional scenarios. +type GenericResourceProperties struct { + // ID is the fully qualified resource ID for the resource. + ID string `json:"id"` + // Name is the resource name. + Name string `json:"name"` + // Type is the resource type. + Type string `json:"type"` +} diff --git a/pkg/ucp/datamodel/resource.go b/pkg/ucp/datamodel/resource.go deleted file mode 100644 index edcda5fd67..0000000000 --- a/pkg/ucp/datamodel/resource.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -// Resource represents a resource within a UCP resource group -type Resource struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` -} - -// ResourceList represents a list of resources -type ResourceList struct { - Value []Resource `json:"value" yaml:"value"` -} diff --git a/pkg/ucp/frontend/controller/resourcegroups/listresources.go b/pkg/ucp/frontend/controller/resourcegroups/listresources.go new file mode 100644 index 0000000000..c0d5d35b4f --- /dev/null +++ b/pkg/ucp/frontend/controller/resourcegroups/listresources.go @@ -0,0 +1,110 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package resourcegroups + +import ( + "context" + "errors" + http "net/http" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/middleware" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/datamodel/converter" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" +) + +var _ armrpc_controller.Controller = (*ListResources)(nil) + +// ListResources is the controller implementation to get the list of resources stored in a resource group. +type ListResources struct { + armrpc_controller.Operation[*datamodel.GenericResource, datamodel.GenericResource] +} + +// NewListResources creates a new controller for listing resources stored in a resource group. +func NewListResources(opts armrpc_controller.Options) (armrpc_controller.Controller, error) { + return &ListResources{ + Operation: armrpc_controller.NewOperation(opts, + armrpc_controller.ResourceOptions[datamodel.GenericResource]{ + RequestConverter: converter.GenericResourceDataModelFromVersioned, + ResponseConverter: converter.GenericResourceDataModelToVersioned, + }, + ), + }, nil +} + +// Run implements controller.Controller. +func (r *ListResources) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (armrpc_rest.Response, error) { + relativePath := middleware.GetRelativePath(r.Options().PathBase, req.URL.Path) + id, err := resources.Parse(relativePath) + if err != nil { + return nil, err + } + + // Cut off the "resources" part of the ID. The ID should be the ID of a resource group. + resourceGroupID := id.Truncate() + + // First check if the resource group exists. + _, err = r.StorageClient().Get(ctx, resourceGroupID.String()) + if errors.Is(err, &store.ErrNotFound{}) { + return armrpc_rest.NewNotFoundResponse(id), nil + } else if err != nil { + return nil, err + } + + query := store.Query{ + RootScope: resourceGroupID.String(), + ResourceType: v20220901privatepreview.ResourceType, + } + + result, err := r.StorageClient().Query(ctx, query) + if err != nil { + return nil, err + } + + response, err := r.createResponse(ctx, req, result) + if err != nil { + return nil, err + } + + return armrpc_rest.NewOKResponse(response), nil +} + +func (r *ListResources) createResponse(ctx context.Context, req *http.Request, result *store.ObjectQueryResult) (*v1.PaginatedList, error) { + items := v1.PaginatedList{} + serviceCtx := v1.ARMRequestContextFromContext(ctx) + + for _, item := range result.Items { + data := datamodel.GenericResource{} + err := item.As(&data) + if err != nil { + return nil, err + } + + versioned, err := converter.GenericResourceDataModelToVersioned(&data, serviceCtx.APIVersion) + if err != nil { + return nil, err + } + + items.Value = append(items.Value, versioned) + } + + return &items, nil +} diff --git a/pkg/ucp/frontend/controller/resourcegroups/listresources_test.go b/pkg/ucp/frontend/controller/resourcegroups/listresources_test.go new file mode 100644 index 0000000000..3a933d372f --- /dev/null +++ b/pkg/ucp/frontend/controller/resourcegroups/listresources_test.go @@ -0,0 +1,144 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package resourcegroups + +import ( + "net/http" + "testing" + + "github.com/golang/mock/gomock" + "github.com/google/uuid" + "github.com/stretchr/testify/require" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + armrpc_controller "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + armrpc_rest "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/to" + "github.com/radius-project/radius/pkg/ucp/api/v20220901privatepreview" + "github.com/radius-project/radius/pkg/ucp/datamodel" + "github.com/radius-project/radius/pkg/ucp/resources" + "github.com/radius-project/radius/pkg/ucp/store" +) + +func Test_ListResources(t *testing.T) { + entryResource := v20220901privatepreview.GenericResource{ + ID: to.Ptr("/planes/radius/local/resourceGroups/test-rg/providers/Applications.Core/applications/test-app"), + Type: to.Ptr("Applications.Core/applications"), + Name: to.Ptr("test-app"), + } + entryDatamodel := datamodel.GenericResource{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + ID: "ignored", + Type: "ignored", + Name: "ignored", + }, + }, + Properties: datamodel.GenericResourceProperties{ + ID: *entryResource.ID, + Type: *entryResource.Type, + Name: *entryResource.Name, + }, + } + + // Not currently used, but may be in the future. + resourceGroupDatamodel := datamodel.ResourceGroup{} + + resourceGroupID := "/planes/radius/local/resourceGroups/test-rg" + id := resourceGroupID + "/resources" + + t.Run("success", func(t *testing.T) { + storage, ctrl := setupListResources(t) + + storage.EXPECT(). + Get(gomock.Any(), resourceGroupID). + Return(&store.Object{Data: resourceGroupDatamodel}, nil). + Times(1) + + expectedQuery := store.Query{RootScope: resourceGroupID, ResourceType: v20220901privatepreview.ResourceType} + storage.EXPECT(). + Query(gomock.Any(), expectedQuery). + Return(&store.ObjectQueryResult{Items: []store.Object{{Data: entryDatamodel}}}, nil). + Times(1) + + expected := armrpc_rest.NewOKResponse(&v1.PaginatedList{ + Value: []any{&entryResource}, + }) + + request, err := http.NewRequest(http.MethodGet, ctrl.Options().PathBase+id+"?api-version="+v20220901privatepreview.Version, nil) + require.NoError(t, err) + ctx := rpctest.NewARMRequestContext(request) + response, err := ctrl.Run(ctx, nil, request) + require.NoError(t, err) + require.Equal(t, expected, response) + }) + + t.Run("success - empty", func(t *testing.T) { + storage, ctrl := setupListResources(t) + + storage.EXPECT(). + Get(gomock.Any(), resourceGroupID). + Return(&store.Object{Data: resourceGroupDatamodel}, nil). + Times(1) + + expectedQuery := store.Query{RootScope: resourceGroupID, ResourceType: v20220901privatepreview.ResourceType} + storage.EXPECT(). + Query(gomock.Any(), expectedQuery). + Return(&store.ObjectQueryResult{Items: []store.Object{}}, nil). + Times(1) + + expected := armrpc_rest.NewOKResponse(&v1.PaginatedList{}) + + request, err := http.NewRequest(http.MethodGet, ctrl.Options().PathBase+id+"?api-version="+v20220901privatepreview.Version, nil) + require.NoError(t, err) + ctx := rpctest.NewARMRequestContext(request) + response, err := ctrl.Run(ctx, nil, request) + require.NoError(t, err) + require.Equal(t, expected, response) + }) + + t.Run("resource group not found", func(t *testing.T) { + storage, ctrl := setupListResources(t) + + storage.EXPECT(). + Get(gomock.Any(), resourceGroupID). + Return(nil, &store.ErrNotFound{ID: resourceGroupID}). + Times(1) + + parsed, err := resources.Parse(id) + require.NoError(t, err) + + expected := armrpc_rest.NewNotFoundResponse(parsed) + + request, err := http.NewRequest(http.MethodGet, ctrl.Options().PathBase+id+"?api-version="+v20220901privatepreview.Version, nil) + require.NoError(t, err) + ctx := rpctest.NewARMRequestContext(request) + response, err := ctrl.Run(ctx, nil, request) + require.NoError(t, err) + require.Equal(t, expected, response) + }) +} + +func setupListResources(t *testing.T) (*store.MockStorageClient, *ListResources) { + ctrl := gomock.NewController(t) + storage := store.NewMockStorageClient(ctrl) + + c, err := NewListResources(armrpc_controller.Options{StorageClient: storage, PathBase: "/" + uuid.New().String()}) + require.NoError(t, err) + + return storage, c.(*ListResources) +} diff --git a/pkg/ucp/frontend/radius/routes.go b/pkg/ucp/frontend/radius/routes.go index 1c5a17be29..294e12eb9e 100644 --- a/pkg/ucp/frontend/radius/routes.go +++ b/pkg/ucp/frontend/radius/routes.go @@ -99,19 +99,28 @@ func (m *Module) Initialize(ctx context.Context) (http.Handler, error) { ) }, }, + { + ParentRouter: resourceGroupResourceRouter, + ResourceType: v20220901privatepreview.ResourceType, + Path: "/resources", + Method: v1.OperationList, + ControllerFactory: func(opt controller.Options) (controller.Controller, error) { + return resourcegroups_ctrl.NewListResources(opt) + }, + }, // Chi router uses radix tree so that it doesn't linear search the matched one. So, to catch all requests, // we need to use CatchAllPath(/*) at the above matched routes path in chi router. // // Note that the API validation is not applied for CatchAllPath(/*). { - // Proxy request should use CatchAllPath(/*) to process all requests under /planes/azure/{planeName}/resourcegroups/{resourceGroupName}. + // Proxy request should use CatchAllPath(/*) to process all requests under /planes/radius/{planeName}/resourcegroups/{resourceGroupName}. ParentRouter: resourceGroupResourceRouter, Path: server.CatchAllPath, OperationType: &v1.OperationType{Type: OperationTypeUCPRadiusProxy, Method: v1.OperationProxy}, ControllerFactory: planes_ctrl.NewProxyController, }, { - // Proxy request should use CatchAllPath(/*) to process all requests under /planes/azure/{planeName}/. + // Proxy request should use CatchAllPath(/*) to process all requests under /planes/radius/{planeName}/. ParentRouter: baseRouter, Path: server.CatchAllPath, OperationType: &v1.OperationType{Type: OperationTypeUCPRadiusProxy, Method: v1.OperationProxy}, diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Resources_List.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Resources_List.json new file mode 100644 index 0000000000..47836a988a --- /dev/null +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Resources_List.json @@ -0,0 +1,30 @@ +{ + "operationId": "Resources_List", + "title": "List resources in a resource group.", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius", + "resourceGroupName": "rg1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourcegroups/rg1/providers/Applications.Core/containers/my-container", + "name": "my-container", + "location": "global", + "type": "Applications.Core/containers" + }, + { + "id": "/planes/radius/local/resourcegroups/rg1/providers/Applications.Core/applications/my-application", + "name": "my-application", + "location": "global", + "type": "Applications.Core/applications" + } + ] + } + } + } + } \ No newline at end of file diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json index 4960817d11..a1a88fa46c 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/openapi.json @@ -45,6 +45,9 @@ { "name": "ResourceGroups" }, + { + "name": "Resources" + }, { "name": "AwsCredentials" }, @@ -641,6 +644,61 @@ } } }, + "/planes/{planeType}/{planeName}/resourcegroups/{resourceGroupName}/resources": { + "get": { + "operationId": "Resources_List", + "tags": [ + "Resources" + ], + "description": "List resources in a resource group", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "planeType", + "in": "path", + "description": "The plane type.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/PlaneNameParameter" + }, + { + "name": "resourceGroupName", + "in": "path", + "description": "The name of resource group", + "required": true, + "type": "string", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/GenericResourceListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "List resources in a resource group.": { + "$ref": "./examples/Resources_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/planes/aws/{planeName}/providers/System.AWS/credentials": { "get": { "operationId": "AwsCredentials_List", @@ -1399,6 +1457,63 @@ "kind" ] }, + "GenericResource": { + "type": "object", + "description": "Represents resource data.", + "properties": { + "name": { + "$ref": "#/definitions/ResourceNameString", + "description": "The name of resource", + "readOnly": true + } + }, + "required": [ + "name" + ], + "allOf": [ + { + "type": "object", + "description": "Concrete proxy resource types can be created by aliasing this type using a specific property type.", + "properties": { + "properties": { + "$ref": "#/definitions/ResourceProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ] + } + ] + }, + "GenericResourceListResult": { + "type": "object", + "description": "The response of a GenericResource list operation.", + "properties": { + "value": { + "type": "array", + "description": "The GenericResource items on this page", + "items": { + "$ref": "#/definitions/GenericResource" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, "InternalCredentialStorageProperties": { "type": "object", "description": "Internal credential storage properties", @@ -1652,6 +1767,17 @@ } } }, + "ResourceNameString": { + "type": "string", + "description": "The resource name", + "maxLength": 63, + "pattern": "^[A-Za-z]([-A-Za-z0-9]*[A-Za-z0-9])?$" + }, + "ResourceProperties": { + "type": "object", + "description": "The resource properties", + "properties": {} + }, "Versions": { "type": "string", "description": "Supported API versions for Universal Control Plane resource provider.", diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Resources_List.json b/typespec/UCP/examples/2022-09-01-privatepreview/Resources_List.json new file mode 100644 index 0000000000..47836a988a --- /dev/null +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Resources_List.json @@ -0,0 +1,30 @@ +{ + "operationId": "Resources_List", + "title": "List resources in a resource group.", + "parameters": { + "api-version": "2022-09-01-privatepreview", + "planeName": "local", + "planeType": "radius", + "resourceGroupName": "rg1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/planes/radius/local/resourcegroups/rg1/providers/Applications.Core/containers/my-container", + "name": "my-container", + "location": "global", + "type": "Applications.Core/containers" + }, + { + "id": "/planes/radius/local/resourcegroups/rg1/providers/Applications.Core/applications/my-application", + "name": "my-application", + "location": "global", + "type": "Applications.Core/applications" + } + ] + } + } + } + } \ No newline at end of file diff --git a/typespec/UCP/resourcegroups.tsp b/typespec/UCP/resourcegroups.tsp index db83f4c466..03edb5c601 100644 --- a/typespec/UCP/resourcegroups.tsp +++ b/typespec/UCP/resourcegroups.tsp @@ -53,6 +53,20 @@ model ResourceGroupProperties { provisioningState?: ProvisioningState; } +@doc("Represents resource data.") +@parentResource(ResourceGroupResource) +model GenericResource extends ProxyResource { + @doc("The name of resource") + @path + @key("resourceName") + @segment("resources") + @visibility("read") + name: ResourceNameString; +} + +@doc("The resource properties") +model ResourceProperties {} + @doc("The UCP HTTP request base parameters.") model ResourceGroupBaseParameters { ...PlaneBaseParameters; @@ -91,3 +105,9 @@ interface ResourceGroups { ResourceGroupBaseParameters >; } + +@armResourceOperations +interface Resources { + @doc("List resources in a resource group") + list is UcpResourceList>; +} From b48e549f96b8647b26323518b276fc2bf9141313 Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Wed, 6 Sep 2023 14:10:51 -0700 Subject: [PATCH 47/57] Adding applyDeploymentOutput to the necessary resources (#6203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding applyDeploymentOutput to the necessary resources but not sure if that function (applyDeploymentOutput) is longer being used for portable resources (after the Processor implementation). ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #5396 ## Auto-generated summary ### 🤖 Generated by Copilot at 851e1f2 ### Summary 🔒📝🚀 This pull request adds support for the Dapr secret store feature and improves the Dapr component creation process. It updates the DaprPubSubBroker and DaprSecretStore resources to use the renderers package and store the computed values from the DeploymentOutput object. It also updates the LocalID constants to match the current resources and adds unit tests for the Dapr resources. > _We're sailing on the Dapr seas, with secrets and pubsub_ > _We're rendering and testing, to make our code more robust_ > _We're heaving on the yardarm, on the count of three_ > _We're updating our `localids`, to match our resources_ ### Walkthrough * Add and assign ComputedValues and SecretValues fields to SecretStore, DaprPubSubBroker, and DaprSecretStore resources from DeploymentOutput object ([link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-9f935e3c9932333a6c9f098ec1e56cf83d72bc99478430a73c839b44288a8eb4R69-R70), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-a74b5d21cf74e51c5ab93a6f4634a606a4f869aa1b9a279fb25df2fdcc386d2dL39-R48), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-e58a6737964c53219141f95631bcc9c8e7bb532d131b03919fd9593cf29b6dbaR41-R45)) * Set ComponentName property of DaprPubSubBroker and DaprSecretStore resources based on computed value from DeploymentOutput object ([link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-a74b5d21cf74e51c5ab93a6f4634a606a4f869aa1b9a279fb25df2fdcc386d2dL39-R48), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-e58a6737964c53219141f95631bcc9c8e7bb532d131b03919fd9593cf29b6dbaR41-R45)) * Import renderers package to use ComponentNameKey constant in `daprpubsubbroker.go` and `daprsecretstore.go` files ([link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-a74b5d21cf74e51c5ab93a6f4634a606a4f869aa1b9a279fb25df2fdcc386d2dR23), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-e58a6737964c53219141f95631bcc9c8e7bb532d131b03919fd9593cf29b6dbaR23)) * Add unit tests for ApplyDeploymentOutput method and fields of DaprPubSubBroker and DaprSecretStore resources in `daprpubsubbroker_test.go` and `daprsecretstore_test.go` files ([link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-ef7ee8ae2ed1365eff1acc39de71a720b8819ddc6a40686bd2b30ce4f5e183cfR1-R85), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-660e457f6d85e692ba69a80bed51332131453001ac9098fe751761dbd82dda4bR1-R85)) * Update list of LocalID constants in `localids.go` file to remove unused or obsolete ones and add new ones for Dapr resources ([link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-1a8ed1597b7f87b2cb720a92c0e95326b83c0c22c8afc96a9bb4dcac66eb37f9L50-R57), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-1a8ed1597b7f87b2cb720a92c0e95326b83c0c22c8afc96a9bb4dcac66eb37f9L82), [link](https://github.com/radius-project/radius/pull/6203/files?diff=unified&w=0#diff-1a8ed1597b7f87b2cb720a92c0e95326b83c0c22c8afc96a9bb4dcac66eb37f9L88-R70)) --- pkg/corerp/datamodel/secretstore.go | 2 + pkg/daprrp/datamodel/daprpubsubbroker.go | 4 +- pkg/daprrp/datamodel/daprsecretstore.go | 3 +- pkg/daprrp/datamodel/daprstatestore.go | 7 -- pkg/daprrp/datamodel/daprstatestore_test.go | 85 ------------------- pkg/datastoresrp/datamodel/mongodatabase.go | 8 -- pkg/datastoresrp/datamodel/rediscache.go | 30 ------- pkg/datastoresrp/datamodel/sqldatabase.go | 1 - pkg/messagingrp/datamodel/rabbitmq.go | 1 - .../controller/createorupdateresource_test.go | 1 - pkg/rp/v1/localids.go | 26 +----- 11 files changed, 7 insertions(+), 161 deletions(-) delete mode 100644 pkg/daprrp/datamodel/daprstatestore_test.go diff --git a/pkg/corerp/datamodel/secretstore.go b/pkg/corerp/datamodel/secretstore.go index 5a3e7d24e0..d7cbd55af2 100644 --- a/pkg/corerp/datamodel/secretstore.go +++ b/pkg/corerp/datamodel/secretstore.go @@ -66,6 +66,8 @@ func (s *SecretStore) ResourceTypeName() string { // object and returns no error. func (s *SecretStore) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { s.Properties.Status.OutputResources = do.DeployedOutputResources + s.ComputedValues = do.ComputedValues + s.SecretValues = do.SecretValues return nil } diff --git a/pkg/daprrp/datamodel/daprpubsubbroker.go b/pkg/daprrp/datamodel/daprpubsubbroker.go index e89499107b..94b2553b21 100644 --- a/pkg/daprrp/datamodel/daprpubsubbroker.go +++ b/pkg/daprrp/datamodel/daprpubsubbroker.go @@ -34,10 +34,8 @@ type DaprPubSubBroker struct { pr_dm.LinkMetadata } -// ApplyDeploymentOutput applies the properties changes based on the deployment output. It updates the -// OutputResources of the DaprPubSubBroker resource with the output resources from a DeploymentOutput object. +// ApplyDeploymentOutput updates the DaprPubSubBroker resource with the DeploymentOutput values. func (r *DaprPubSubBroker) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources return nil } diff --git a/pkg/daprrp/datamodel/daprsecretstore.go b/pkg/daprrp/datamodel/daprsecretstore.go index fb9dc1fd15..41bfd2fc51 100644 --- a/pkg/daprrp/datamodel/daprsecretstore.go +++ b/pkg/daprrp/datamodel/daprsecretstore.go @@ -34,9 +34,8 @@ type DaprSecretStore struct { pr_dm.LinkMetadata } -// ApplyDeploymentOutput updates the status of the secret store with the output resources from a deployment. +// ApplyDeploymentOutput updates the DaprSecretStore resource with the DeploymentOutput values. func (r *DaprSecretStore) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources return nil } diff --git a/pkg/daprrp/datamodel/daprstatestore.go b/pkg/daprrp/datamodel/daprstatestore.go index ae224edb0e..6c2efc5869 100644 --- a/pkg/daprrp/datamodel/daprstatestore.go +++ b/pkg/daprrp/datamodel/daprstatestore.go @@ -20,7 +20,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" - "github.com/radius-project/radius/pkg/portableresources/renderers" rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) @@ -37,12 +36,6 @@ type DaprStateStore struct { // ApplyDeploymentOutput updates the DaprStateStore resource with the DeploymentOutput values. func (r *DaprStateStore) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - r.ComputedValues = do.ComputedValues - r.SecretValues = do.SecretValues - if cn, ok := do.ComputedValues[renderers.ComponentNameKey].(string); ok { - r.Properties.ComponentName = cn - } return nil } diff --git a/pkg/daprrp/datamodel/daprstatestore_test.go b/pkg/daprrp/datamodel/daprstatestore_test.go deleted file mode 100644 index d376817fdb..0000000000 --- a/pkg/daprrp/datamodel/daprstatestore_test.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package datamodel - -import ( - "testing" - - "github.com/radius-project/radius/pkg/portableresources/renderers" - rpv1 "github.com/radius-project/radius/pkg/rp/v1" - "github.com/radius-project/radius/pkg/to" - "github.com/stretchr/testify/require" -) - -func TestDaprStateStore_ApplyDeploymentOutput(t *testing.T) { - tests := []struct { - name string - dss *DaprStateStore - do *rpv1.DeploymentOutput - wantErr bool - }{ - { - name: "with component name", - dss: &DaprStateStore{}, - do: &rpv1.DeploymentOutput{ - DeployedOutputResources: []rpv1.OutputResource{ - { - LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - RadiusManaged: to.Ptr(true), - }, - }, - ComputedValues: map[string]any{ - renderers.ComponentNameKey: "dapr-state-store-test", - }, - }, - wantErr: false, - }, - { - name: "without component name", - dss: &DaprStateStore{}, - do: &rpv1.DeploymentOutput{ - DeployedOutputResources: []rpv1.OutputResource{ - { - LocalID: rpv1.LocalIDDaprStateStoreAzureStorage, - RadiusManaged: to.Ptr(true), - }, - }, - ComputedValues: map[string]any{}, - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if err := tt.dss.ApplyDeploymentOutput(*tt.do); (err != nil) != tt.wantErr { - t.Errorf("DaprStateStore.ApplyDeploymentOutput() error = %v, wantErr %v", err, tt.wantErr) - } - - if !tt.wantErr { - require.EqualValues(t, tt.do.DeployedOutputResources, tt.dss.Properties.Status.OutputResources) - require.EqualValues(t, tt.do.ComputedValues, tt.dss.ComputedValues) - require.EqualValues(t, tt.do.SecretValues, tt.dss.SecretValues) - require.Condition(t, func() bool { - if tt.do.ComputedValues[renderers.ComponentNameKey] != nil { - return tt.dss.Properties.ComponentName == tt.do.ComputedValues[renderers.ComponentNameKey] - } - return tt.dss.Properties.ComponentName == "" - }, "component name should be equal") - } - }) - } -} diff --git a/pkg/datastoresrp/datamodel/mongodatabase.go b/pkg/datastoresrp/datamodel/mongodatabase.go index ea526354f1..3882d0ab37 100644 --- a/pkg/datastoresrp/datamodel/mongodatabase.go +++ b/pkg/datastoresrp/datamodel/mongodatabase.go @@ -23,7 +23,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" - "github.com/radius-project/radius/pkg/portableresources/renderers" rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) @@ -103,13 +102,6 @@ func (mongodb *MongoDatabase) VerifyInputs() error { // ApplyDeploymentOutput updates the Mongo database instance's database property, output resources, computed values // and secret values with the given DeploymentOutput. func (r *MongoDatabase) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - r.ComputedValues = do.ComputedValues - r.SecretValues = do.SecretValues - if database, ok := do.ComputedValues[renderers.DatabaseNameValue].(string); ok { - r.Properties.Database = database - } - return nil } diff --git a/pkg/datastoresrp/datamodel/rediscache.go b/pkg/datastoresrp/datamodel/rediscache.go index 4d1ce293b9..1b9db8f07e 100644 --- a/pkg/datastoresrp/datamodel/rediscache.go +++ b/pkg/datastoresrp/datamodel/rediscache.go @@ -17,15 +17,12 @@ limitations under the License. package datamodel import ( - "errors" "fmt" - "strconv" "strings" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/portableresources" pr_dm "github.com/radius-project/radius/pkg/portableresources/datamodel" - "github.com/radius-project/radius/pkg/portableresources/renderers" rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) @@ -43,33 +40,6 @@ type RedisCache struct { // ApplyDeploymentOutput sets the Status, ComputedValues, SecretValues, Host, Port and Username properties of the // Redis cache instance based on the DeploymentOutput object. func (r *RedisCache) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources - r.ComputedValues = do.ComputedValues - r.SecretValues = do.SecretValues - if host, ok := do.ComputedValues[renderers.Host].(string); ok { - r.Properties.Host = host - } - if port, ok := do.ComputedValues[renderers.Port]; ok { - if port != nil { - switch p := port.(type) { - case float64: - r.Properties.Port = int32(p) - case int32: - r.Properties.Port = p - case string: - converted, err := strconv.Atoi(p) - if err != nil { - return err - } - r.Properties.Port = int32(converted) - default: - return errors.New("unhandled type for the property port") - } - } - } - if username, ok := do.ComputedValues[renderers.UsernameStringValue].(string); ok { - r.Properties.Username = username - } return nil } diff --git a/pkg/datastoresrp/datamodel/sqldatabase.go b/pkg/datastoresrp/datamodel/sqldatabase.go index 2c67929475..1bf003ff86 100644 --- a/pkg/datastoresrp/datamodel/sqldatabase.go +++ b/pkg/datastoresrp/datamodel/sqldatabase.go @@ -49,7 +49,6 @@ type SqlDatabase struct { // ApplyDeploymentOutput updates the output resources of a SQL database resource with the output resources of a DeploymentOutput // object and returns no error. func (r *SqlDatabase) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources return nil } diff --git a/pkg/messagingrp/datamodel/rabbitmq.go b/pkg/messagingrp/datamodel/rabbitmq.go index 29a5aa28d5..a16b840a54 100644 --- a/pkg/messagingrp/datamodel/rabbitmq.go +++ b/pkg/messagingrp/datamodel/rabbitmq.go @@ -40,7 +40,6 @@ type RabbitMQQueue struct { // ApplyDeploymentOutput updates the RabbitMQQueue instance with the DeployedOutputResources from the // DeploymentOutput object and returns no error. func (r *RabbitMQQueue) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { - r.Properties.Status.OutputResources = do.DeployedOutputResources return nil } diff --git a/pkg/portableresources/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go index 3b9732103b..f47a801e44 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -61,7 +61,6 @@ func (r *TestResource) ApplyDeploymentOutput(do rpv1.DeploymentOutput) error { r.Properties.Status.OutputResources = do.DeployedOutputResources r.ComputedValues = do.ComputedValues r.SecretValues = do.SecretValues - return nil } diff --git a/pkg/rp/v1/localids.go b/pkg/rp/v1/localids.go index 67e7d06344..1d0507bbe0 100644 --- a/pkg/rp/v1/localids.go +++ b/pkg/rp/v1/localids.go @@ -47,31 +47,14 @@ import ( const ( LocalIDAzureCosmosAccount = "AzureCosmosAccount" LocalIDAzureCosmosDBMongo = "AzureCosmosDBMongo" - LocalIDAzureCosmosDBSQL = "AzureCosmosDBSQL" - LocalIDAzureFileShare = "AzureFileShare" LocalIDAzureFileShareStorageAccount = "AzureFileShareStorageAccount" - LocalIDAzureRedis = "AzureRedis" - LocalIDAzureServiceBusNamespace = "AzureServiceBusNamespace" - LocalIDAzureServiceBusQueue = "AzureServiceBusQueue" - LocalIDAzureSqlServer = "AzureSqlServer" - LocalIDAzureSqlServerDatabase = "AzureSqlServerDatabase" - LocalIDExtender = "Extender" LocalIDDaprStateStoreAzureStorage = "DaprStateStoreAzureStorage" - LocalIDAzureStorageTableService = "AzureStorageTableService" - LocalIDAzureStorageTable = "AzureStorageTable" - LocalIDDaprStateStoreComponent = "DaprStateStoreComponent" - LocalIDDaprStateStoreSQLServer = "DaprStateStoreSQLServer" - LocalIDDaprComponent = "DaprComponent" + LocalIDDaprSecretStoreAzureKeyVault = "DaprSecretStoreAzureKeyVault" + LocalIDDaprPubSubBrokerKafka = "DaprPubSubBrokerKafka" LocalIDDeployment = "Deployment" LocalIDGateway = "Gateway" LocalIDHttpRoute = "HttpRoute" LocalIDKeyVault = "KeyVault" - LocalIDRabbitMQDeployment = "KubernetesRabbitMQDeployment" - LocalIDRabbitMQSecret = "KubernetesRabbitMQSecret" - LocalIDRabbitMQService = "KubernetesRabbitMQService" - LocalIDRedisDeployment = "KubernetesRedisDeployment" - LocalIDRedisService = "KubernetesRedisService" - LocalIDScrapedSecret = "KubernetesScrapedSecret" LocalIDSecret = "Secret" LocalIDConfigMap = "ConfigMap" LocalIDSecretProviderClass = "SecretProviderClass" @@ -79,15 +62,12 @@ const ( LocalIDKubernetesRole = "KubernetesRole" LocalIDKubernetesRoleBinding = "KubernetesRoleBinding" LocalIDService = "Service" - LocalIDStatefulSet = "StatefulSet" LocalIDUserAssignedManagedIdentity = "UserAssignedManagedIdentity" LocalIDFederatedIdentity = "FederatedIdentity" LocalIDRoleAssignmentPrefix = "RoleAssignment" // Obsolete when we remove AppModelV1 - LocalIDRoleAssignmentKVKeys = "RoleAssignment-KVKeys" - LocalIDRoleAssignmentKVSecretsCerts = "RoleAssignment-KVSecretsCerts" - LocalIDKeyVaultSecret = "KeyVaultSecret" + LocalIDRoleAssignmentKVKeys = "RoleAssignment-KVKeys" ) // NewLocalID generates a unique string based on the input parameter ids using a stable hashing algorithm. From 35a3de0007fb989c137f2c72f2878d8ac137455c Mon Sep 17 00:00:00 2001 From: vinayada1 <28875764+vinayada1@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:35:21 -0700 Subject: [PATCH 48/57] Docs cleanup (#6229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Removing internal references from ucp docs ## Type of change - This pull request fixes a bug in Radius and has an approved issue . Fixes: https://github.com/radius-project/radius/issues/6228 ## Auto-generated summary ### 🤖 Generated by Copilot at 85b214f ### Summary :arrows_counterclockwise::wastebasket::memo: Updated the UCP documentation to reflect the latest design and usage of state storage and credentials. Deleted an unused file and fixed some broken links. > _`rad credential`_ > _Manage secrets with commands_ > _Design docs no more_ ### Walkthrough * Update the link to the state storage design document in `docs/ucp/aws.md` ([link](https://github.com/radius-project/radius/pull/6229/files?diff=unified&w=0#diff-ab05297ef5912c3fe9af8990ae991bb0e2b60ee1f432779562332039c5409665L64-R64)) * Replace the credential design document reference with a summary of the "rad credential" CLI commands in `docs/ucp/resources.md` ([link](https://github.com/radius-project/radius/pull/6229/files?diff=unified&w=0#diff-855597a63f268673bfb989106b82aa9424c7167e7d44c789037ca2f91bf72946L11-R11)) * Delete the outdated file `docs/ucp/references.md` ([link](https://github.com/radius-project/radius/pull/6229/files?diff=unified&w=0#diff-3867e2268f892fa7cea1760b415832784b49be0c5c76362048853be5fb90ea43)) --- docs/ucp/aws.md | 2 +- docs/ucp/references.md | 9 --------- docs/ucp/resources.md | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 docs/ucp/references.md diff --git a/docs/ucp/aws.md b/docs/ucp/aws.md index dda809aa63..ef855b5430 100644 --- a/docs/ucp/aws.md +++ b/docs/ucp/aws.md @@ -61,4 +61,4 @@ Many AWS resources have a generated name and the resource schema does not necess To address this issue, we will introduce state storage in UCP. The user will specify a friendly name for the resource in the bicep file that is unique in the deployment scope (which will be the Radius resource group). UCP will create a mapping between the friendly name and the actual AWS resource deployed. After this point, UCP will use this mapping to determine if the resource with the particular friendly name is being created or updated. -The details of this design can be found at: https://microsoft.sharepoint.com/:w:/t/radiuscoreteam/Ef0J0DM89-1Foyb36i4_a_EBn4zW61Dk8paVfJ9p9RUDOg?e=9tnaV1 +The details of this design can be found at: https://github.com/radius-project/design-notes/pull/21 diff --git a/docs/ucp/references.md b/docs/ucp/references.md deleted file mode 100644 index 5a758899f2..0000000000 --- a/docs/ucp/references.md +++ /dev/null @@ -1,9 +0,0 @@ -## References - -[UCP Summary](https://microsoft.sharepoint.com/:w:/r/teams/radiuscoreteam/_layouts/15/Doc.aspx?sourcedoc=%7B00979177-9BF7-4D93-A730-B1CC5AB55E3E%7D&file=2022-04%20UCP%20Summary.docx&action=default&mobileredirect=true&share=IQF3kZcA95uTTacwscxatV4-AVk2opS7WrAGFzv-sQ0k0Do) - -[UCP Vision](https://microsoft.sharepoint.com/:w:/r/teams/radiuscoreteam/_layouts/15/Doc.aspx?sourcedoc=%7B217B9C83-6D8D-47EC-AFDE-537FC1A20D27%7D&file=2022-04-01%20UCP%20Vision.docx&action=default&mobileredirect=true&share=IQGDnHshjW3sR6_eU3_Bog0nAfOFmzuio1X1alZMQvxukxU) - -[AWS Non-Idempotency Design](https://microsoft-my.sharepoint.com/:w:/p/willsmith/EWqUj9lGHL9Dk4s6aGfXVmQB0K9JicgimbP1gw8QRoAtiQ?e=TJvOhw) - -[UCP Credentials Design](https://microsoft.sharepoint.com/:w:/t/radiuscoreteam/EVAuQrRK6tRIqiOZmjnyxjoBUfaa2jF2uiV-jhibg5qB5A?e=2t2hef) \ No newline at end of file diff --git a/docs/ucp/resources.md b/docs/ucp/resources.md index af4001a948..8df4aaf6bb 100644 --- a/docs/ucp/resources.md +++ b/docs/ucp/resources.md @@ -8,4 +8,4 @@ UCP uses a Plane resource to support ids that come from different types of syste A resource group is used to organize user resources. Note that even though conceptually this is similar to an Azure resource group but it is not the same and is a UCP resource independent of Azure. ### Credentials -A user can configure provider credentials in UCP. Currently Azure and AWS credentials are supported. Please refer to [Credential Design Document](https://microsoft.sharepoint.com/:w:/t/radiuscoreteam/EVAuQrRK6tRIqiOZmjnyxjoBUfaa2jF2uiV-jhibg5qB5A?e=2t2hef) for details. +A user can configure provider credentials in UCP. Currently Azure and AWS credentials are supported and can be managed using "rad credential" CLI commands. From f28f8c11a862aaa9dbdb50308466b27c8ffd2a3a Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 7 Sep 2023 09:11:16 -0700 Subject: [PATCH 49/57] Add purge AWS resources GitHub workflow (#6160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description * Adding GitHub workflow to purge AWS test resources ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 60d995b ### Summary :wastebasket::cloud::runner: Added a GitHub workflow to purge AWS test resources on demand. The workflow uses a self-hosted runner and the AWS Cloud Control API to delete resources of specified types from AWS. > _`purge-aws` workflow_ > _sweeps away test resources_ > _autumn leaves of code_ ### Walkthrough * Create a new GitHub workflow to purge AWS test resources on demand ([link](https://github.com/project-radius/radius/pull/6160/files?diff=unified&w=0#diff-cdbef2239fc7a1aa34d773cb6dae3395193da5015c322ef49bb02025b701a0bcR1-R43)) --------- Co-authored-by: Young Bu Park --- .../workflows/purge-aws-test-resources.yaml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/purge-aws-test-resources.yaml diff --git a/.github/workflows/purge-aws-test-resources.yaml b/.github/workflows/purge-aws-test-resources.yaml new file mode 100644 index 0000000000..b2effb7e9d --- /dev/null +++ b/.github/workflows/purge-aws-test-resources.yaml @@ -0,0 +1,46 @@ +# ------------------------------------------------------------ +# Copyright 2023 The Radius Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------ + +name: Purge AWS test resources +on: + workflow_dispatch: + schedule: + # Run at 12:00AM PST every day. + - cron: "0 7 * * 0-6" + +env: + AWS_REGION: us-west-2 + AWS_RESOURCE_TYPES: 'AWS::Kinesis::Stream,AWS::S3::Bucket,AWS::RDS::DBInstance,AWS::RDS::DBSubnetGroup,AWS::MemoryDB::Cluster,AWS::MemoryDB::SubnetGroup' +jobs: + purge_aws_resources: + name: AWS resources clean-ups + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.FUNCTEST_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.FUNCTEST_AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + - name: Filter and delete resources + run: | + for resource_type in ${${{env.AWS_RESOURCE_TYPES}}//,/ } + do + aws cloudcontrol list-resources --type-name "$resource_type" --query "ResourceDescriptions[].Identifier" --output text | tr '\t' '\n' | while read identifier + do + aws cloudcontrol delete-resource --type-name "$resource_type" --identifier "$identifier" + done + done From 90a12a089ef0c33c4815121d4f0f9263b9a76b01 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Thu, 7 Sep 2023 10:38:54 -0700 Subject: [PATCH 50/57] Updating linktype, link-type, linkrecipe, linkmetadata constructs (#6211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Updating constructs of linktype, linkrecipe, linkmetadata to resourcetype, resourcerecipe and portableresourcemetadata respectively. link-type -> resource-type LinkType -> ResourceType LinkRecipe-> ResourceRecipe LinkMetadata -> PortableResourceMetadata (ResourceMetadata exists, containing BasicResourceProperties, across all resources) ## Type of change - This pull request adds or changes features of Radius and has an approved issue (#6170 ). Fixes: #6170 ## Auto-generated summary ### 🤖 Generated by Copilot at cdd9975 ### Summary 🔄📝🛠️ This pull request renames the term `link-type` to `resource-type` in the `radius` CLI and the `corerp` API to align with the new concept of portable resources. This change affects the commands, flags, structs, functions, tests, and JSON files related to the `recipe` subcommand and the `EnvironmentRecipe` and `PortableResource` types. The pull request also updates the `ResourceRecipe` type to match the API definition and the extender conversion logic. > _We are the portable resources, we break the chains of link-type_ > _We rise above the old constraints, we forge our own resource-type_ > _We are the portable resources, we extend and adapt to any shape_ > _We are the future of the radius, we are the masters of our fate_ ### Walkthrough * Rename `LinkType` to `ResourceType` in various structs, functions, and constants to reflect the new terminology for portable resources ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9L44-R44),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9L542-R548),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-634496167e8df4561426e60325b16d951bcf89d5595715b559a6a008b6f04896L128-R128),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-634496167e8df4561426e60325b16d951bcf89d5595715b559a6a008b6f04896L136-R136),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-455cce87d0a66ee8bd33b2e8549200653478b7e582745b3976b77200d45aed91L106-R106),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-455cce87d0a66ee8bd33b2e8549200653478b7e582745b3976b77200d45aed91L112-R112),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L92-R92),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L195-R198),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL178-R178),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL247-R247),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL274-R274),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL327-R327),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL383-R383),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL435-R435),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-a6f10a0125ba5ff86166bb7dd0369942834185ce5533c250891f995dae6ed236L84-R84),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-a6f10a0125ba5ff86166bb7dd0369942834185ce5533c250891f995dae6ed236L155-R155),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-a6f10a0125ba5ff86166bb7dd0369942834185ce5533c250891f995dae6ed236L162-R162),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L114-R114),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L148-R148),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L190-R190),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L225-R225),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-dcebf4c2ef0dbafd80cf2712748894d06dbe1fd48e2136b3cf3ac99848dad9c9L21-R21),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL68-R68),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL105-R109),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL125-R132),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL139-R139),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL205-R205),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL250-R250),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL300-R300),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL338-R338),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL368-R368),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL421-R421),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f2e80353ac2e49da41bc04958b9568c662162f7dbb52ada2c328851436925482L214-R214),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL69-R69),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-148a9d17d0f5b5371877028809ef405378ccdc9f45782cb92b299f0059422c17L51-R52),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-7b363611c8c65a48f1bf2081dcccb8b96f71e7fd06d0b6bf82b261d62c193d65L92-R93),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-3497c5a60d626f25bd22acce0b5869eafda20f9dd890089f7192ebae77dfd19aL119-R119),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-3497c5a60d626f25bd22acce0b5869eafda20f9dd890089f7192ebae77dfd19aL126-R132),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-5d7486ace43eb3f6c18a9d9336afd5503a0186c9a6f73130a25f5a60f5eccdd1L2-L1)) * Rename `RequireLinkType` to `GetResourceType` and update its logic to return the resource type instead of requiring it as a flag ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-bf4e917446c73565ee6967f28bdd8e619c0d4fa40b215f195b840c021dd36ce9L542-R548),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L133-R137),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-a6f10a0125ba5ff86166bb7dd0369942834185ce5533c250891f995dae6ed236L126-R130),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL105-R109)) * Rename `AddLinkTypeFlag` to `AddResourceTypeFlag` and update its description and default value to match the new terminology for portable resources ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-40d092c037a2ba62ae8e3716ee0ebc4e4244023c7b030a0c855da629076a5053L83-R85)) * Rename `--link-type` flag to `--resource-type` flag and update its usage in various commands and tests ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L55-R61),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L76-R77),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL50-R50),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL59-R59),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL68-R68),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL77-R77),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL86-R86),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL95-R95),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL104-R104),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-b44b694e65d357babf13fbdd996633e13398552ecb5ca8aced2ad4d7bb0e405cL112-R112),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-a6f10a0125ba5ff86166bb7dd0369942834185ce5533c250891f995dae6ed236L71-R72),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L49-R49),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L58-R58),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L67-R67),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L76-R76),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-13fc0c59e89a1fa92926d4fdd0ef9a6ef372c9816c6c43ec6b003427b63e0852L84-R84),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL38-R38),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL55-R56),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL50-R50),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL59-R59),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL77-R77),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL85-R85),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL307-R307),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-af989492b2507d305e426234d48b6905a2d3f4d22e9069d9f3a32c72cbc5d837L251-R252),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-2d2e076adef117e743fd5a3e96df002c933180cf97a8875fcdc04a1c7472644a),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-5d7486ace43eb3f6c18a9d9336afd5503a0186c9a6f73130a25f5a60f5eccdd1L2-L1)) * Rename `LinkRecipe` to `ResourceRecipe` and update its usage in the `PortableResource` struct and related functions ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-3497c5a60d626f25bd22acce0b5869eafda20f9dd890089f7192ebae77dfd19aL119-R119),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-3497c5a60d626f25bd22acce0b5869eafda20f9dd890089f7192ebae77dfd19aL126-R132),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-bdb2119eb3545d9d4248e90cc22d8e305745c34e0261c27993de2c1df6c32274L65-R65),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-bdb2119eb3545d9d4248e90cc22d8e305745c34e0261c27993de2c1df6c32274L94-R94),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-bdb2119eb3545d9d4248e90cc22d8e305745c34e0261c27993de2c1df6c32274L122-R122)) * Rename file `environmentresource-invalid-linktype.json` to `environmentresource-invalid-resourcetype.json` and update its content to use the `resourceType` field instead of the `linkType` field ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-2d2e076adef117e743fd5a3e96df002c933180cf97a8875fcdc04a1c7472644a)) * Update comments and error messages to mention the `resource-type` flag instead of the `link-type` flag ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-cd6c2e17113715641f64f2653287de4acb9fe04b45ce8c597ef104ed055d8a16L109-R109),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL38-R38),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-1b915dfcc5ae81097b37f20414aeafc05f8bd67648aaa37e5490ffe8a2c6c08dL83-R83),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-d649987c28f8f2d588094e6f264f56f09cce3c06470e5942fd258127b08544dfL69-R69),[link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-af989492b2507d305e426234d48b6905a2d3f4d22e9069d9f3a32c72cbc5d837L251-R252)) * Update the JSONPath for the `TYPE` column in the `GetEnvironmentRecipesTableFormat` function to use the `ResourceType` field instead of the `LinkType` field ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f2e80353ac2e49da41bc04958b9568c662162f7dbb52ada2c328851436925482L214-R214)) * Update the test name for the `recipe unregister` command to mention the `resource-type` flag instead of the `link-type` flag ([link](https://github.com/radius-project/radius/pull/6211/files?diff=unified&w=0#diff-f77272892bbdeda953e0ee83c7e1199ed43ee540c1e08022845824a36b56ae1fL307-R307)) --- pkg/cli/clivalidation.go | 12 ++++---- pkg/cli/cmd/commonflags/flags.go | 6 ++-- pkg/cli/cmd/recipe/list/list.go | 4 +-- pkg/cli/cmd/recipe/list/list_test.go | 4 +-- pkg/cli/cmd/recipe/register/register.go | 22 +++++++-------- pkg/cli/cmd/recipe/register/register_test.go | 28 +++++++++---------- pkg/cli/cmd/recipe/show/show.go | 14 +++++----- pkg/cli/cmd/recipe/show/show_test.go | 18 ++++++------ pkg/cli/cmd/recipe/types.go | 2 +- pkg/cli/cmd/recipe/unregister/unregister.go | 20 ++++++------- .../cmd/recipe/unregister/unregister_test.go | 24 ++++++++-------- pkg/cli/objectformats/objectformats.go | 2 +- .../environment_conversion.go | 2 +- .../environment_conversion_test.go | 4 +-- .../environmentrecipeproperties_conversion.go | 4 +-- ...ronmentrecipeproperties_conversion_test.go | 4 +-- .../extender_conversion.go | 8 +++--- .../extender_conversion_test.go | 6 ++-- ...ronmentresource-invalid-resourcetype.json} | 0 .../testdata/reciperesource.json | 2 +- .../zz_generated_models.go | 6 ++-- .../zz_generated_models_serde.go | 8 +++--- .../deployment/deploymentprocessor_test.go | 6 ++-- pkg/corerp/datamodel/container.go | 2 +- pkg/corerp/datamodel/environment.go | 2 +- pkg/corerp/datamodel/extender.go | 10 +++---- pkg/corerp/datamodel/gateway.go | 2 +- pkg/corerp/datamodel/httproute.go | 2 +- ...etadata.go => portableresourcemetadata.go} | 4 +-- pkg/corerp/datamodel/secretstore.go | 2 +- pkg/corerp/datamodel/volume.go | 2 +- .../environments/getrecipemetadata.go | 6 ++-- .../environments/getrecipemetadata_test.go | 6 ++-- ...ingrecipe20220315privatepreview_input.json | 2 +- ...emetadata20220315privatepreview_input.json | 2 +- ...0220315privatepreview_input_terraform.json | 2 +- .../v20220315privatepreview/datamodel_util.go | 8 +++--- .../datamodel_util_test.go | 8 +++--- .../pubsubbroker_conversion_test.go | 2 +- .../secretstore_conversion_test.go | 2 +- pkg/daprrp/datamodel/daprpubsubbroker.go | 8 +++--- pkg/daprrp/datamodel/daprsecretstore.go | 8 +++--- pkg/daprrp/datamodel/daprstatestore.go | 8 +++--- .../v20220315privatepreview/datamodel_util.go | 8 +++--- .../datamodel_util_test.go | 12 ++++---- .../mongodatabase_conversion_test.go | 4 +-- .../rediscache_conversion_test.go | 6 ++-- .../sqldatabase_conversion_test.go | 2 +- pkg/datastoresrp/datamodel/mongodatabase.go | 10 +++---- pkg/datastoresrp/datamodel/rediscache.go | 10 +++---- pkg/datastoresrp/datamodel/sqldatabase.go | 10 +++---- .../v20220315privatepreview/datamodel_util.go | 8 +++--- .../datamodel_util_test.go | 8 +++--- .../rabbitmq_conversion_test.go | 2 +- pkg/messagingrp/datamodel/rabbitmq.go | 10 +++---- .../controller/createorupdateresource_test.go | 12 ++++---- .../{linkmetadata.go => metadata.go} | 23 +++++---------- pkg/portableresources/datamodel/recipes.go | 2 +- pkg/portableresources/types.go | 16 +++++------ pkg/recipes/recipecontext/context.go | 2 +- pkg/recipes/recipecontext/types.go | 2 +- pkg/rp/doc.go | 2 +- .../Environments_GetRecipeMetadata.json | 2 +- .../2022-03-15-privatepreview/openapi.json | 6 ++-- .../examples/Planes_GetPlaneLocal.json | 2 +- .../examples/Planes_List.json | 2 +- .../examples/Planes_ListPlanesByType.json | 2 +- test/functional/shared/cli/cli_test.go | 26 ++++++++--------- test/radcli/cli.go | 18 ++++++------ typespec/Applications.Core/environments.tsp | 4 +-- .../Environments_GetRecipeMetadata.json | 2 +- .../Planes_GetPlaneLocal.json | 2 +- .../Planes_List.json | 2 +- .../Planes_ListPlanesByType.json | 2 +- 74 files changed, 252 insertions(+), 261 deletions(-) rename pkg/corerp/api/v20220315privatepreview/testdata/{environmentresource-invalid-linktype.json => environmentresource-invalid-resourcetype.json} (100%) rename pkg/corerp/datamodel/{linkmetadata.go => portableresourcemetadata.go} (88%) rename pkg/portableresources/datamodel/{linkmetadata.go => metadata.go} (66%) diff --git a/pkg/cli/clivalidation.go b/pkg/cli/clivalidation.go index 195698d9be..bc8e317995 100644 --- a/pkg/cli/clivalidation.go +++ b/pkg/cli/clivalidation.go @@ -41,7 +41,7 @@ type AzureResource struct { } const ( - LinkTypeFlag = "link-type" + ResourceTypeFlag = "resource-type" ) // RequireEnvironmentNameArgs checks if an environment name is provided as an argument or if a default environment is set @@ -539,11 +539,11 @@ func RequireRecipeNameArgs(cmd *cobra.Command, args []string) (string, error) { return args[0], nil } -// RequireLinkType retrieves the link type flag from the given command and returns it, or an error if the flag is not set. -func RequireLinkType(cmd *cobra.Command) (string, error) { - linkType, err := cmd.Flags().GetString(LinkTypeFlag) +// GetResourceType retrieves the resource type flag from the given command and returns it, or an error if the flag is not set. +func GetResourceType(cmd *cobra.Command) (string, error) { + resourceType, err := cmd.Flags().GetString(ResourceTypeFlag) if err != nil { - return linkType, err + return resourceType, err } - return linkType, nil + return resourceType, nil } diff --git a/pkg/cli/cmd/commonflags/flags.go b/pkg/cli/cmd/commonflags/flags.go index 839ed52acf..ecc84172ac 100644 --- a/pkg/cli/cmd/commonflags/flags.go +++ b/pkg/cli/cmd/commonflags/flags.go @@ -80,9 +80,9 @@ func AddParameterFlag(cmd *cobra.Command) { cmd.Flags().StringArrayP("parameters", "p", []string{}, "Specify parameters for the deployment") } -// AddLinkTypeFlag adds a flag to the given command that allows the user to specify the type of the link this recipe can be consumed by. -func AddLinkTypeFlag(cmd *cobra.Command) { - cmd.Flags().String("link-type", "", "Specify the type of the link this recipe can be consumed by") +// AddResourceTypeFlag adds a flag to the given command that allows the user to specify the type of the portable resource this recipe can be consumed by. +func AddResourceTypeFlag(cmd *cobra.Command) { + cmd.Flags().String("resource-type", "", "Specify the type of the portable resource this recipe can be consumed by") } // AddAzureScopeFlags adds flags to a command to specify an Azure subscription and resource group, and marks them as diff --git a/pkg/cli/cmd/recipe/list/list.go b/pkg/cli/cmd/recipe/list/list.go index 4974b7b656..fd5797c0c1 100644 --- a/pkg/cli/cmd/recipe/list/list.go +++ b/pkg/cli/cmd/recipe/list/list.go @@ -125,7 +125,7 @@ func (r *Runner) Run(ctx context.Context) error { case *corerp.TerraformRecipeProperties: recipe = types.EnvironmentRecipe{ Name: recipeName, - LinkType: resourceType, + ResourceType: resourceType, TemplatePath: *c.TemplatePath, TemplateKind: *c.TemplateKind, TemplateVersion: *c.TemplateVersion, @@ -133,7 +133,7 @@ func (r *Runner) Run(ctx context.Context) error { case *corerp.BicepRecipeProperties: recipe = types.EnvironmentRecipe{ Name: recipeName, - LinkType: resourceType, + ResourceType: resourceType, TemplatePath: *c.TemplatePath, TemplateKind: *c.TemplateKind, } diff --git a/pkg/cli/cmd/recipe/list/list_test.go b/pkg/cli/cmd/recipe/list/list_test.go index 14e195d0da..95da164d7c 100644 --- a/pkg/cli/cmd/recipe/list/list_test.go +++ b/pkg/cli/cmd/recipe/list/list_test.go @@ -103,13 +103,13 @@ func Test_Run(t *testing.T) { recipes := []types.EnvironmentRecipe{ { Name: "cosmosDB", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", }, { Name: "cosmosDB-terraform", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", diff --git a/pkg/cli/cmd/recipe/register/register.go b/pkg/cli/cmd/recipe/register/register.go index 77a0fdedb0..cd49b946db 100644 --- a/pkg/cli/cmd/recipe/register/register.go +++ b/pkg/cli/cmd/recipe/register/register.go @@ -52,13 +52,13 @@ You can specify parameters using the '--parameter' flag ('-p' for short). Parame `, Example: ` # Add a recipe to an environment -rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Datastores/mongoDatabases +rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --resource-type Applications.Datastores/mongoDatabases # Specify a parameter -rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Datastores/mongoDatabases --parameters throughput=400 +rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --resource-type Applications.Datastores/mongoDatabases --parameters throughput=400 # specify multiple parameters using a JSON parameter file -rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --link-type Applications.Datastores/mongoDatabases --parameters @myfile.json +rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --template-path template_path --resource-type Applications.Datastores/mongoDatabases --parameters @myfile.json `, Args: cobra.ExactArgs(1), RunE: framework.RunCommand(runner), @@ -73,8 +73,8 @@ rad recipe register cosmosdb -e env_name -w workspace --template-kind bicep --te cmd.Flags().String("template-version", "", "specify the version for the terraform module.") cmd.Flags().String("template-path", "", "specify the path to the template provided by the recipe.") _ = cmd.MarkFlagRequired("template-path") - cmd.Flags().String("link-type", "", "specify the type of the portable resource this recipe can be consumed by") - _ = cmd.MarkFlagRequired("link-type") + cmd.Flags().String("resource-type", "", "specify the type of the portable resource this recipe can be consumed by") + _ = cmd.MarkFlagRequired("resource-type") commonflags.AddParameterFlag(cmd) return cmd, runner @@ -89,7 +89,7 @@ type Runner struct { TemplateKind string TemplatePath string TemplateVersion string - LinkType string + ResourceType string RecipeName string Parameters map[string]map[string]any } @@ -106,7 +106,7 @@ func NewRunner(factory framework.Factory) *Runner { // Validate runs validation for the `rad recipe register` command. // -// Validate validates the command line args, sets the workspace, environment, template kind, template path, link type, +// Validate validates the command line args, sets the workspace, environment, template kind, template path, resource type, // recipe name, and parameters, and returns an error if any of these fail. func (r *Runner) Validate(cmd *cobra.Command, args []string) error { // Validate command line args @@ -130,11 +130,11 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { r.TemplatePath = templatePath r.TemplateVersion = templateVersion - linkType, err := cli.RequireLinkType(cmd) + resourceType, err := cli.GetResourceType(cmd) if err != nil { return err } - r.LinkType = linkType + r.ResourceType = resourceType recipeName, err := cli.RequireRecipeNameArgs(cmd, args) if err != nil { @@ -192,10 +192,10 @@ func (r *Runner) Run(ctx context.Context) error { Parameters: bicep.ConvertToMapStringInterface(r.Parameters), } } - if val, ok := envRecipes[r.LinkType]; ok { + if val, ok := envRecipes[r.ResourceType]; ok { val[r.RecipeName] = properties } else { - envRecipes[r.LinkType] = map[string]corerp.RecipePropertiesClassification{ + envRecipes[r.ResourceType] = map[string]corerp.RecipePropertiesClassification{ r.RecipeName: properties, } } diff --git a/pkg/cli/cmd/recipe/register/register_test.go b/pkg/cli/cmd/recipe/register/register_test.go index cb84b910d6..ac66ccf7bc 100644 --- a/pkg/cli/cmd/recipe/register/register_test.go +++ b/pkg/cli/cmd/recipe/register/register_test.go @@ -47,7 +47,7 @@ func Test_Validate(t *testing.T) { testcases := []radcli.ValidateInput{ { Name: "Valid Register Command with parameters", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType, "--parameters", "a=b"}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--resource-type", portableresources.MongoDatabasesResourceType, "--parameters", "a=b"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -56,7 +56,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Valid Register Command for terraform recipe", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindTerraform, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType, "--template-version", "1.1.0"}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindTerraform, "--template-path", "test_template", "--resource-type", portableresources.MongoDatabasesResourceType, "--template-version", "1.1.0"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -65,7 +65,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Valid Register Command with parameters passed as file", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType, "--parameters", "@testdata/recipeparam.json"}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--resource-type", portableresources.MongoDatabasesResourceType, "--parameters", "@testdata/recipeparam.json"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -74,7 +74,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command with fallback workspace", - Input: []string{"-e", "myenvironment", "test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType}, + Input: []string{"-e", "myenvironment", "test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--resource-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -83,7 +83,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command without name", - Input: []string{"--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType}, + Input: []string{"--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template", "--resource-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -92,7 +92,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command without template kind", - Input: []string{"test_recipe", "--template-path", "test_template", "--link-type", portableresources.MongoDatabasesResourceType}, + Input: []string{"test_recipe", "--template-path", "test_template", "--resource-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -101,7 +101,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Register Command without template path", - Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--link-type", portableresources.MongoDatabasesResourceType}, + Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--resource-type", portableresources.MongoDatabasesResourceType}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -109,7 +109,7 @@ func Test_Validate(t *testing.T) { }, }, { - Name: "Register Command without link-type", + Name: "Register Command without resource-type", Input: []string{"test_recipe", "--template-kind", recipes.TemplateKindBicep, "--template-path", "test_template"}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ @@ -175,7 +175,7 @@ func Test_Run(t *testing.T) { TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_new", } @@ -244,7 +244,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_new", } @@ -271,7 +271,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_new", } @@ -324,7 +324,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/rediscaches:v1", - LinkType: portableresources.RedisCachesResourceType, + ResourceType: portableresources.RedisCachesResourceType, RecipeName: "redis", Parameters: map[string]map[string]any{}, } @@ -380,7 +380,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, RecipeName: "cosmosDB_no_namespace", } @@ -432,7 +432,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{Environment: "kind-kind"}, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/rediscaches:v1", - LinkType: portableresources.RedisCachesResourceType, + ResourceType: portableresources.RedisCachesResourceType, RecipeName: "redis", } diff --git a/pkg/cli/cmd/recipe/show/show.go b/pkg/cli/cmd/recipe/show/show.go index 6698acbe7a..b051cd0050 100644 --- a/pkg/cli/cmd/recipe/show/show.go +++ b/pkg/cli/cmd/recipe/show/show.go @@ -68,8 +68,8 @@ rad recipe show redis-dev --group dev --environment dev`, commonflags.AddWorkspaceFlag(cmd) commonflags.AddResourceGroupFlag(cmd) commonflags.AddEnvironmentNameFlag(cmd) - commonflags.AddLinkTypeFlag(cmd) - _ = cmd.MarkFlagRequired(cli.LinkTypeFlag) + commonflags.AddResourceTypeFlag(cmd) + _ = cmd.MarkFlagRequired(cli.ResourceTypeFlag) return cmd, runner } @@ -81,7 +81,7 @@ type Runner struct { Output output.Interface Workspace *workspaces.Workspace RecipeName string - LinkType string + ResourceType string Format string } @@ -123,11 +123,11 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { } r.RecipeName = recipeName - linkType, err := cli.RequireLinkType(cmd) + resourceType, err := cli.GetResourceType(cmd) if err != nil { return err } - r.LinkType = linkType + r.ResourceType = resourceType format, err := cli.RequireOutput(cmd) if err != nil { @@ -152,14 +152,14 @@ func (r *Runner) Run(ctx context.Context) error { return err } - recipeDetails, err := client.ShowRecipe(ctx, r.Workspace.Environment, v20220315privatepreview.RecipeGetMetadata{Name: &r.RecipeName, LinkType: &r.LinkType}) + recipeDetails, err := client.ShowRecipe(ctx, r.Workspace.Environment, v20220315privatepreview.RecipeGetMetadata{Name: &r.RecipeName, ResourceType: &r.ResourceType}) if err != nil { return err } recipe := types.EnvironmentRecipe{ Name: r.RecipeName, - LinkType: r.LinkType, + ResourceType: r.ResourceType, TemplatePath: *recipeDetails.TemplatePath, TemplateKind: *recipeDetails.TemplateKind, } diff --git a/pkg/cli/cmd/recipe/show/show_test.go b/pkg/cli/cmd/recipe/show/show_test.go index e489c34390..903ba99381 100644 --- a/pkg/cli/cmd/recipe/show/show_test.go +++ b/pkg/cli/cmd/recipe/show/show_test.go @@ -46,7 +46,7 @@ func Test_Validate(t *testing.T) { testcases := []radcli.ValidateInput{ { Name: "Valid Show Command", - Input: []string{"recipeName", "--link-type", "link-type"}, + Input: []string{"recipeName", "--resource-type", "resource-type"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -55,7 +55,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Show Command with incorrect fallback workspace", - Input: []string{"-e", "my-env", "-g", "my-env", "recipeName", "--link-type", "link-type"}, + Input: []string{"-e", "my-env", "-g", "my-env", "recipeName", "--resource-type", "resource-type"}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -64,7 +64,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Show Command with too many positional args", - Input: []string{"recipeName", "arg2", "--link-type", "link-type"}, + Input: []string{"recipeName", "arg2", "--resource-type", "resource-type"}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -73,7 +73,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Show Command with fallback workspace", - Input: []string{"-e", "my-env", "-w", "test-workspace", "recipeName", "--link-type", "link-type"}, + Input: []string{"-e", "my-env", "-w", "test-workspace", "recipeName", "--resource-type", "resource-type"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -81,7 +81,7 @@ func Test_Validate(t *testing.T) { }, }, { - Name: "Show Command without LinkType", + Name: "Show Command without ResourceType", Input: []string{"recipeName"}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ @@ -111,7 +111,7 @@ func Test_Run(t *testing.T) { } recipe := types.EnvironmentRecipe{ Name: "cosmosDB", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindBicep, TemplatePath: "testpublicrecipe.azurecr.io/bicep/modules/mongodatabases:v1", } @@ -145,7 +145,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{}, Format: "table", RecipeName: "cosmosDB", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, } err := runner.Run(context.Background()) @@ -187,7 +187,7 @@ func Test_Run(t *testing.T) { } recipe := types.EnvironmentRecipe{ Name: "cosmosDB", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, TemplateKind: recipes.TemplateKindTerraform, TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", @@ -222,7 +222,7 @@ func Test_Run(t *testing.T) { Workspace: &workspaces.Workspace{}, Format: "table", RecipeName: "cosmosDB", - LinkType: portableresources.MongoDatabasesResourceType, + ResourceType: portableresources.MongoDatabasesResourceType, } err := runner.Run(context.Background()) diff --git a/pkg/cli/cmd/recipe/types.go b/pkg/cli/cmd/recipe/types.go index 6c4ff26ce7..7b8104e84d 100644 --- a/pkg/cli/cmd/recipe/types.go +++ b/pkg/cli/cmd/recipe/types.go @@ -18,7 +18,7 @@ package recipe type EnvironmentRecipe struct { Name string `json:"name"` - LinkType string `json:"linkType"` + ResourceType string `json:"resourceType"` TemplateKind string `json:"templateKind"` TemplatePath string `json:"templatePath"` TemplateVersion string `json:"templateVersion"` diff --git a/pkg/cli/cmd/recipe/unregister/unregister.go b/pkg/cli/cmd/recipe/unregister/unregister.go index c6c8e818f3..0d529503c0 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister.go +++ b/pkg/cli/cmd/recipe/unregister/unregister.go @@ -35,7 +35,7 @@ import ( // // NewCommand creates a new cobra command for unregistering a recipe from an environment, which takes in a factory and returns a cobra command -// and a runner. It also sets up flags for output, workspace, resource group, environment name and portable resource type, with link-type being a required flag. +// and a runner. It also sets up flags for output, workspace, resource group, environment name and portable resource type, with resource-type being a required flag. func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) { runner := NewRunner(factory) @@ -52,8 +52,8 @@ func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner) { commonflags.AddWorkspaceFlag(cmd) commonflags.AddResourceGroupFlag(cmd) commonflags.AddEnvironmentNameFlag(cmd) - commonflags.AddLinkTypeFlag(cmd) - _ = cmd.MarkFlagRequired(cli.LinkTypeFlag) + commonflags.AddResourceTypeFlag(cmd) + _ = cmd.MarkFlagRequired(cli.ResourceTypeFlag) return cmd, runner } @@ -65,7 +65,7 @@ type Runner struct { Output output.Interface Workspace *workspaces.Workspace RecipeName string - LinkType string + ResourceType string } // NewRunner creates a new instance of the `rad recipe unregister` runner. @@ -80,7 +80,7 @@ func NewRunner(factory framework.Factory) *Runner { // Validate runs validation for the `rad recipe unregister` command. // -// // Runner.Validate checks the command line arguments for a workspace, environment, recipe name, and link type, and +// // Runner.Validate checks the command line arguments for a workspace, environment, recipe name, and resource type, and // returns an error if any of these are not present. func (r *Runner) Validate(cmd *cobra.Command, args []string) error { // Validate command line args @@ -102,11 +102,11 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error { } r.RecipeName = recipeName - linkType, err := cli.RequireLinkType(cmd) + resourceType, err := cli.GetResourceType(cmd) if err != nil { return err } - r.LinkType = linkType + r.ResourceType = resourceType return nil } @@ -122,14 +122,14 @@ func (r *Runner) Run(ctx context.Context) error { return err } - envResource, recipeProperties, err := cmd.CheckIfRecipeExists(ctx, client, r.Workspace.Environment, r.RecipeName, r.LinkType) + envResource, recipeProperties, err := cmd.CheckIfRecipeExists(ctx, client, r.Workspace.Environment, r.RecipeName, r.ResourceType) if err != nil { return err } - if val, ok := recipeProperties[r.LinkType]; ok { + if val, ok := recipeProperties[r.ResourceType]; ok { delete(val, r.RecipeName) if len(val) == 0 { - delete(recipeProperties, r.LinkType) + delete(recipeProperties, r.ResourceType) } } envResource.Properties.Recipes = recipeProperties diff --git a/pkg/cli/cmd/recipe/unregister/unregister_test.go b/pkg/cli/cmd/recipe/unregister/unregister_test.go index a493fc8fa9..e7b9302202 100644 --- a/pkg/cli/cmd/recipe/unregister/unregister_test.go +++ b/pkg/cli/cmd/recipe/unregister/unregister_test.go @@ -47,7 +47,7 @@ func Test_Validate(t *testing.T) { testcases := []radcli.ValidateInput{ { Name: "Valid Unregister Command", - Input: []string{"test_recipe", "--link-type", "link-type"}, + Input: []string{"test_recipe", "--resource-type", "resource-type"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -56,7 +56,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Unregister Command with fallback workspace", - Input: []string{"-e", "my-env", "test_recipe", "--link-type", "link-type"}, + Input: []string{"-e", "my-env", "test_recipe", "--resource-type", "resource-type"}, ExpectedValid: true, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -74,7 +74,7 @@ func Test_Validate(t *testing.T) { }, { Name: "Unregister Command with too many args", - Input: []string{"foo", "bar", "foo1", "--link-type", "link-type"}, + Input: []string{"foo", "bar", "foo1", "--resource-type", "resource-type"}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ ConfigFilePath: "", @@ -82,7 +82,7 @@ func Test_Validate(t *testing.T) { }, }, { - Name: "Unregister Command without link type", + Name: "Unregister Command without resource type", Input: []string{"foo"}, ExpectedValid: false, ConfigHolder: framework.ConfigHolder{ @@ -136,7 +136,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Datastores/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } expectedOutput := []any{ @@ -202,7 +202,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Datastores/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } err := runner.Run(context.Background()) @@ -247,7 +247,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Datastores/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } expectedOutput := []any{ @@ -297,14 +297,14 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB1", - LinkType: "Applications.Datastores/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } err := runner.Run(context.Background()) require.Error(t, err) }) - t.Run("Unregister recipe with linkType doesn't exist in the environment", func(t *testing.T) { + t.Run("Unregister recipe with resourceType doesn't exist in the environment", func(t *testing.T) { ctrl := gomock.NewController(t) envResource := v20220315privatepreview.EnvironmentResource{ ID: to.Ptr("/planes/radius/local/resourcegroups/kind-kind/providers/applications.core/environments/kind-kind"), @@ -335,7 +335,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "testResource", - LinkType: "Applications.Datastores/redisCaches", + ResourceType: "Applications.Datastores/redisCaches", } err := runner.Run(context.Background()) @@ -365,7 +365,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "cosmosDB", - LinkType: "Applications.Datastores/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } err := runner.Run(context.Background()) @@ -418,7 +418,7 @@ func Test_Run(t *testing.T) { Output: outputSink, Workspace: &workspaces.Workspace{Environment: "kind-kind"}, RecipeName: "testResource", - LinkType: "Applications.Datastores/mongoDatabases", + ResourceType: "Applications.Datastores/mongoDatabases", } expectedOutput := []any{ diff --git a/pkg/cli/objectformats/objectformats.go b/pkg/cli/objectformats/objectformats.go index 499bd2c957..b6224cbd6e 100644 --- a/pkg/cli/objectformats/objectformats.go +++ b/pkg/cli/objectformats/objectformats.go @@ -211,7 +211,7 @@ func GetEnvironmentRecipesTableFormat() output.FormatterOptions { }, { Heading: "TYPE", - JSONPath: "{ .LinkType }", + JSONPath: "{ .ResourceType }", }, { Heading: "TEMPLATE KIND", diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go index 1f4610bb70..51101bb4a9 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion.go @@ -66,7 +66,7 @@ func (src *EnvironmentResource) ConvertTo() (v1.DataModelInterface, error) { envRecipes := make(map[string]map[string]datamodel.EnvironmentRecipeProperties) for resourceType, recipes := range src.Properties.Recipes { if !portableresources.IsValidPortableResourceType(resourceType) { - return &datamodel.Environment{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid link type: %q", resourceType)) + return &datamodel.Environment{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid resource type: %q", resourceType)) } envRecipes[resourceType] = map[string]datamodel.EnvironmentRecipeProperties{} for recipeName, recipeDetails := range recipes { diff --git a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go index 45423b8c3c..42545b43f9 100644 --- a/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environment_conversion_test.go @@ -248,8 +248,8 @@ func TestConvertVersionedToDataModel(t *testing.T) { err: &v1.ErrModelConversion{PropertyName: "$.properties.compute.namespace", ValidValue: "63 characters or less"}, }, { - filename: "environmentresource-invalid-linktype.json", - err: &v1.ErrClientRP{Code: v1.CodeInvalid, Message: "invalid link type: \"Applications.Dapr/pubsub\""}, + filename: "environmentresource-invalid-resourcetype.json", + err: &v1.ErrClientRP{Code: v1.CodeInvalid, Message: "invalid resource type: \"Applications.Dapr/pubsub\""}, }, { filename: "environmentresource-invalid-templatekind.json", diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go index b01962447b..e2dd4c990f 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion.go @@ -48,7 +48,7 @@ func (dst *RecipeGetMetadataResponse) ConvertFrom(src v1.DataModelInterface) err // ConvertTo converts from the versioned Environment Recipe Properties resource to version-agnostic datamodel. func (src *RecipeGetMetadata) ConvertTo() (v1.DataModelInterface, error) { return &datamodel.Recipe{ - Name: to.String(src.Name), - LinkType: to.String(src.LinkType), + Name: to.String(src.Name), + ResourceType: to.String(src.ResourceType), }, nil } diff --git a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go index ead1d8723e..6f9fa96f6d 100644 --- a/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/environmentrecipeproperties_conversion_test.go @@ -89,8 +89,8 @@ func TestRecipeConvertVersionedToDataModel(t *testing.T) { t.Run("Convert to Data Model", func(t *testing.T) { filename := "reciperesource.json" expected := &datamodel.Recipe{ - LinkType: portableresources.MongoDatabasesResourceType, - Name: "mongo-azure", + ResourceType: portableresources.MongoDatabasesResourceType, + Name: "mongo-azure", } rawPayload := testutil.ReadFixture(filename) r := &RecipeGetMetadata{} diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go index 6c4a593e4c..f5153f9b91 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion.go @@ -116,20 +116,20 @@ func fromResourceProvisioningDataModel(provisioning portableresources.ResourcePr return &converted } -func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.ResourceRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, } } -func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.ResourceRecipe { if r == nil { - return portableresources.LinkRecipe{ + return portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, } } - recipe := portableresources.LinkRecipe{} + recipe := portableresources.ResourceRecipe{} if r.Name == nil { recipe.Name = portableresources.DefaultRecipeName } else { diff --git a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go index f79a6f36a7..e308f266fe 100644 --- a/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go +++ b/pkg/corerp/api/v20220315privatepreview/extender_conversion_test.go @@ -62,7 +62,7 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, ResourceProvisioning: portableresources.ResourceProvisioningManual, Secrets: map[string]any{"accountSid": "sid", "authToken": "token"}, - ResourceRecipe: portableresources.LinkRecipe{Name: "default"}, + ResourceRecipe: portableresources.ResourceRecipe{Name: "default"}, }, }, }, @@ -91,7 +91,7 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { }, AdditionalProperties: map[string]any{"fromNumber": "222-222-2222"}, ResourceProvisioning: portableresources.ResourceProvisioningManual, - ResourceRecipe: portableresources.LinkRecipe{Name: "default"}, + ResourceRecipe: portableresources.ResourceRecipe{Name: "default"}, }, }, }, @@ -119,7 +119,7 @@ func TestExtender_ConvertVersionedToDataModel(t *testing.T) { Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/env0", }, ResourceProvisioning: portableresources.ResourceProvisioningRecipe, - ResourceRecipe: portableresources.LinkRecipe{Name: "test-recipe"}, + ResourceRecipe: portableresources.ResourceRecipe{Name: "test-recipe"}, }, }, }, diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-linktype.json b/pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-resourcetype.json similarity index 100% rename from pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-linktype.json rename to pkg/corerp/api/v20220315privatepreview/testdata/environmentresource-invalid-resourcetype.json diff --git a/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json b/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json index 31eff8b802..ee608ee6db 100644 --- a/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json +++ b/pkg/corerp/api/v20220315privatepreview/testdata/reciperesource.json @@ -1,4 +1,4 @@ { - "linkType":"Applications.Datastores/mongoDatabases", + "resourceType":"Applications.Datastores/mongoDatabases", "name":"mongo-azure" } \ No newline at end of file diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go index ab9c514a02..707d39a845 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models.go @@ -1295,11 +1295,11 @@ type Recipe struct { // RecipeGetMetadata - Represents the request body of the getmetadata action. type RecipeGetMetadata struct { - // REQUIRED; Type of the link this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases' - LinkType *string - // REQUIRED; The name of the recipe registered to the environment Name *string + + // REQUIRED; Type of the resource this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases' + ResourceType *string } // RecipeGetMetadataResponse - The properties of a Recipe linked to an Environment. diff --git a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go index 8919ce08a3..f56e2e9934 100644 --- a/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go +++ b/pkg/corerp/api/v20220315privatepreview/zz_generated_models_serde.go @@ -3048,8 +3048,8 @@ func (r *Recipe) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RecipeGetMetadata. func (r RecipeGetMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "linkType", r.LinkType) populate(objectMap, "name", r.Name) + populate(objectMap, "resourceType", r.ResourceType) return json.Marshal(objectMap) } @@ -3062,12 +3062,12 @@ func (r *RecipeGetMetadata) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "linkType": - err = unpopulate(val, "LinkType", &r.LinkType) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &r.ResourceType) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) diff --git a/pkg/corerp/backend/deployment/deploymentprocessor_test.go b/pkg/corerp/backend/deployment/deploymentprocessor_test.go index a0b5efac37..15f34ee043 100644 --- a/pkg/corerp/backend/deployment/deploymentprocessor_test.go +++ b/pkg/corerp/backend/deployment/deploymentprocessor_test.go @@ -175,10 +175,10 @@ func buildMongoDBWithRecipe() dsrp_dm.MongoDatabase { Environment: "/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Core/environments/env0", }, }, - LinkMetadata: pr_dm.LinkMetadata{ + PortableResourceMetadata: pr_dm.PortableResourceMetadata{ RecipeData: portableresources.RecipeData{ RecipeProperties: portableresources.RecipeProperties{ - LinkRecipe: portableresources.LinkRecipe{ + ResourceRecipe: portableresources.ResourceRecipe{ Name: "mongoDB", Parameters: map[string]any{ "ResourceGroup": "testRG", @@ -1043,7 +1043,7 @@ func Test_getResourceDataByID(t *testing.T) { depId, _ := resources.ParseResource("/subscriptions/test-subscription/resourceGroups/test-resource-group/providers/Applications.Datastores/mongoDatabases/test-mongo") mongoResource := buildMongoDBWithRecipe() - mongoResource.LinkMetadata.RecipeData = portableresources.RecipeData{} + mongoResource.PortableResourceMetadata.RecipeData = portableresources.RecipeData{} mr := store.Object{ Metadata: store.Metadata{ ID: mongoResource.ID, diff --git a/pkg/corerp/datamodel/container.go b/pkg/corerp/datamodel/container.go index 98a93c31a9..87fe8ec615 100644 --- a/pkg/corerp/datamodel/container.go +++ b/pkg/corerp/datamodel/container.go @@ -28,7 +28,7 @@ type ContainerResource struct { v1.BaseResource // TODO: remove this from CoreRP - LinkMetadata + PortableResourceMetadata // Properties is the properties of the resource. Properties ContainerProperties `json:"properties"` diff --git a/pkg/corerp/datamodel/environment.go b/pkg/corerp/datamodel/environment.go index c3648f4d11..da36c496b4 100644 --- a/pkg/corerp/datamodel/environment.go +++ b/pkg/corerp/datamodel/environment.go @@ -55,7 +55,7 @@ type EnvironmentRecipeProperties struct { // Recipe represents input properties for recipe getMetadata api. type Recipe struct { // Type of the portable resource this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases' - LinkType string `json:"linkType,omitempty"` + ResourceType string `json:"resourceType,omitempty"` // Name of the recipe registered to the environment. Name string `json:"recipeName,omitempty"` diff --git a/pkg/corerp/datamodel/extender.go b/pkg/corerp/datamodel/extender.go index a2b721d1bc..a0780546a3 100644 --- a/pkg/corerp/datamodel/extender.go +++ b/pkg/corerp/datamodel/extender.go @@ -32,8 +32,8 @@ type Extender struct { // Properties is the properties of the resource. Properties ExtenderProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all portable resource types. - LinkMetadata + // PortableResourceMetadata represents internal DataModel properties common to all portable resource types. + PortableResourceMetadata } // ApplyDeploymentOutput updates the Status of Properties of the Extender resource with the DeployedOutputResources and returns no error. @@ -57,9 +57,9 @@ func (extender *Extender) ResourceTypeName() string { return ExtenderResourceType } -// Recipe returns the LinkRecipe associated with the Extender if the ResourceProvisioning is not set to Manual, +// Recipe returns the ResourceRecipe associated with the Extender if the ResourceProvisioning is not set to Manual, // otherwise it returns nil. -func (extender *Extender) Recipe() *portableresources.LinkRecipe { +func (extender *Extender) Recipe() *portableresources.ResourceRecipe { if extender.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } @@ -74,7 +74,7 @@ type ExtenderProperties struct { // Secrets values provided for the resource Secrets map[string]any `json:"secrets,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Extender - ResourceRecipe portableresources.LinkRecipe `json:"recipe,omitempty"` + ResourceRecipe portableresources.ResourceRecipe `json:"recipe,omitempty"` // Specifies how the underlying service/resource is provisioned and managed ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` } diff --git a/pkg/corerp/datamodel/gateway.go b/pkg/corerp/datamodel/gateway.go index 68c9a9e682..052cf17dae 100644 --- a/pkg/corerp/datamodel/gateway.go +++ b/pkg/corerp/datamodel/gateway.go @@ -28,7 +28,7 @@ type Gateway struct { v1.BaseResource // TODO: remove this from CoreRP - LinkMetadata + PortableResourceMetadata // Properties is the properties of the resource. Properties GatewayProperties `json:"properties"` } diff --git a/pkg/corerp/datamodel/httproute.go b/pkg/corerp/datamodel/httproute.go index bd59039180..7cfa894b37 100644 --- a/pkg/corerp/datamodel/httproute.go +++ b/pkg/corerp/datamodel/httproute.go @@ -28,7 +28,7 @@ type HTTPRoute struct { v1.BaseResource // TODO: remove this from CoreRP - LinkMetadata + PortableResourceMetadata // Properties is the properties of the resource. Properties *HTTPRouteProperties `json:"properties"` } diff --git a/pkg/corerp/datamodel/linkmetadata.go b/pkg/corerp/datamodel/portableresourcemetadata.go similarity index 88% rename from pkg/corerp/datamodel/linkmetadata.go rename to pkg/corerp/datamodel/portableresourcemetadata.go index dd6b47fa47..e7bf3ffbee 100644 --- a/pkg/corerp/datamodel/linkmetadata.go +++ b/pkg/corerp/datamodel/portableresourcemetadata.go @@ -20,8 +20,8 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) -// LinkMetadata represents internal DataModel properties common to all portable resource types. -type LinkMetadata struct { +// PortableResourceMetadata represents internal DataModel properties common to all portable resource types. +type PortableResourceMetadata struct { // TODO: stop using this type in CoreRP models. // ComputedValues map is any resource values that will be needed for more operations. diff --git a/pkg/corerp/datamodel/secretstore.go b/pkg/corerp/datamodel/secretstore.go index d7cbd55af2..5ec0993538 100644 --- a/pkg/corerp/datamodel/secretstore.go +++ b/pkg/corerp/datamodel/secretstore.go @@ -52,7 +52,7 @@ type SecretStore struct { v1.BaseResource // TODO: remove this from CoreRP - LinkMetadata + PortableResourceMetadata // Properties is the properties of the resource. Properties *SecretStoreProperties `json:"properties"` } diff --git a/pkg/corerp/datamodel/volume.go b/pkg/corerp/datamodel/volume.go index 924ff428fb..e7aee0521b 100644 --- a/pkg/corerp/datamodel/volume.go +++ b/pkg/corerp/datamodel/volume.go @@ -33,7 +33,7 @@ type VolumeResource struct { v1.BaseResource // TODO: remove this from CoreRP - LinkMetadata + PortableResourceMetadata // Properties is the properties of the resource. Properties VolumeResourceProperties `json:"properties"` diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go index 0511bc32ff..dacf58a561 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata.go @@ -74,12 +74,12 @@ func (r *GetRecipeMetadata) Run(ctx context.Context, w http.ResponseWriter, req return nil, err } var recipeProperties datamodel.EnvironmentRecipeProperties - recipe, exists := resource.Properties.Recipes[recipeDatamodel.LinkType] + recipe, exists := resource.Properties.Recipes[recipeDatamodel.ResourceType] if exists { recipeProperties, exists = recipe[recipeDatamodel.Name] } if !exists { - return rest.NewNotFoundMessageResponse(fmt.Sprintf("Either recipe with name %q or resource type %q not found on environment with id %q", recipeDatamodel.Name, recipeDatamodel.LinkType, serviceCtx.ResourceID)), nil + return rest.NewNotFoundMessageResponse(fmt.Sprintf("Either recipe with name %q or resource type %q not found on environment with id %q", recipeDatamodel.Name, recipeDatamodel.ResourceType, serviceCtx.ResourceID)), nil } recipeParams, err := r.GetRecipeMetadataFromRegistry(ctx, recipeProperties, recipeDatamodel) @@ -108,7 +108,7 @@ func (r *GetRecipeMetadata) GetRecipeMetadataFromRegistry(ctx context.Context, r Parameters: recipeProperties.Parameters, TemplatePath: recipeProperties.TemplatePath, TemplateVersion: recipeProperties.TemplateVersion, - ResourceType: recipeDataModel.LinkType, + ResourceType: recipeDataModel.ResourceType, } recipeParameters = make(map[string]any) diff --git a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go index 35bbe040f0..ce1c3259e3 100644 --- a/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go +++ b/pkg/corerp/frontend/controller/environments/getrecipemetadata_test.go @@ -65,7 +65,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0", TemplateVersion: "", Driver: "bicep", - ResourceType: *envInput.LinkType, + ResourceType: *envInput.ResourceType, } recipeData := map[string]any{ "parameters": map[string]any{ @@ -113,7 +113,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { TemplatePath: "Azure/cosmosdb/azurerm", TemplateVersion: "1.1.0", Driver: "terraform", - ResourceType: *envInput.LinkType, + ResourceType: *envInput.ResourceType, } recipeData := map[string]any{ "parameters": map[string]any{ @@ -237,7 +237,7 @@ func TestGetRecipeMetadataRun_20220315PrivatePreview(t *testing.T) { TemplatePath: "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0", TemplateVersion: "", Driver: "bicep", - ResourceType: *envInput.LinkType, + ResourceType: *envInput.ResourceType, } engineErr := fmt.Errorf("could not find driver %s", "invalidDriver") mEngine.EXPECT().GetRecipeMetadata(ctx, recipeDefinition).Return(nil, engineErr) diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json index 5eb30a4ebe..f059c65f10 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetmetadatanonexistingrecipe20220315privatepreview_input.json @@ -1,4 +1,4 @@ { "name":"mongodb", - "linkType":"Applications.Datastores/mongoDatabases" + "resourceType":"Applications.Datastores/mongoDatabases" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json index ab09f45543..7b16bdeca8 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input.json @@ -1,4 +1,4 @@ { "name":"mongo-parameters", - "linkType":"Applications.Datastores/mongoDatabases" + "resourceType":"Applications.Datastores/mongoDatabases" } \ No newline at end of file diff --git a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json index 1331658ada..5939a0fc83 100644 --- a/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json +++ b/pkg/corerp/frontend/controller/environments/testdata/environmentgetrecipemetadata20220315privatepreview_input_terraform.json @@ -1,4 +1,4 @@ { "name":"mongo-terraform", - "linkType":"Applications.Datastores/mongoDatabases" + "resourceType":"Applications.Datastores/mongoDatabases" } \ No newline at end of file diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go index 5ee5f719d1..fe1e1724b3 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util.go @@ -109,13 +109,13 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { } } -func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.ResourceRecipe { if r == nil { - return portableresources.LinkRecipe{ + return portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, } } - recipe := portableresources.LinkRecipe{} + recipe := portableresources.ResourceRecipe{} if r.Name == nil { recipe.Name = portableresources.DefaultRecipeName } else { @@ -127,7 +127,7 @@ func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { return recipe } -func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.ResourceRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, diff --git a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go index 77608de243..515e76ec06 100644 --- a/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/datamodel_util_test.go @@ -215,11 +215,11 @@ func TestFromResourceProvisiongDataModel(t *testing.T) { func TestToRecipeDataModel(t *testing.T) { testset := []struct { versioned *Recipe - datamodel portableresources.LinkRecipe + datamodel portableresources.ResourceRecipe }{ { nil, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, }, }, @@ -230,7 +230,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: "test", Parameters: map[string]any{ "foo": "bar", @@ -243,7 +243,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go index 3a40262630..bddbe94961 100644 --- a/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/pubsubbroker_conversion_test.go @@ -103,7 +103,7 @@ func TestDaprPubSubBroker_ConvertVersionedToDataModel(t *testing.T) { Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, ResourceProvisioning: portableresources.ResourceProvisioningRecipe, - Recipe: portableresources.LinkRecipe{ + Recipe: portableresources.ResourceRecipe{ Name: "dpsb-recipe", }, }, diff --git a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go index 7a94d9e5bc..8d47ae1e83 100644 --- a/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go +++ b/pkg/daprrp/api/v20220315privatepreview/secretstore_conversion_test.go @@ -98,7 +98,7 @@ func TestDaprSecretStore_ConvertVersionedToDataModel(t *testing.T) { Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, ResourceProvisioning: portableresources.ResourceProvisioningRecipe, - Recipe: portableresources.LinkRecipe{ + Recipe: portableresources.ResourceRecipe{ Name: "daprSecretStore", Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/daprrp/datamodel/daprpubsubbroker.go b/pkg/daprrp/datamodel/daprpubsubbroker.go index 94b2553b21..35367d6331 100644 --- a/pkg/daprrp/datamodel/daprpubsubbroker.go +++ b/pkg/daprrp/datamodel/daprpubsubbroker.go @@ -30,8 +30,8 @@ type DaprPubSubBroker struct { // Properties is the properties of the resource. Properties DaprPubSubBrokerProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all portable resource types. - pr_dm.LinkMetadata + // ResourceMetadata represents internal DataModel properties common to all portable resource types. + pr_dm.PortableResourceMetadata } // ApplyDeploymentOutput updates the DaprPubSubBroker resource with the DeploymentOutput values. @@ -55,7 +55,7 @@ func (daprPubSub *DaprPubSubBroker) ResourceTypeName() string { } // Recipe returns the recipe information of the resource. Returns nil if recipe execution is disabled. -func (r *DaprPubSubBroker) Recipe() *portableresources.LinkRecipe { +func (r *DaprPubSubBroker) Recipe() *portableresources.ResourceRecipe { if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } @@ -74,7 +74,7 @@ type DaprPubSubBrokerProperties struct { Metadata map[string]any `json:"metadata,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Dapr Pub/Sub Broker resource. - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` // List of the resource IDs that support the Dapr Pub/Sub Broker resource. Resources []*portableresources.ResourceReference `json:"resources,omitempty"` diff --git a/pkg/daprrp/datamodel/daprsecretstore.go b/pkg/daprrp/datamodel/daprsecretstore.go index 41bfd2fc51..d6bdad5e5e 100644 --- a/pkg/daprrp/datamodel/daprsecretstore.go +++ b/pkg/daprrp/datamodel/daprsecretstore.go @@ -30,8 +30,8 @@ type DaprSecretStore struct { // Properties is the properties of the resource. Properties DaprSecretStoreProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all portable resource types. - pr_dm.LinkMetadata + // ResourceMetadata represents internal DataModel properties common to all portable resource types. + pr_dm.PortableResourceMetadata } // ApplyDeploymentOutput updates the DaprSecretStore resource with the DeploymentOutput values. @@ -61,13 +61,13 @@ type DaprSecretStoreProperties struct { Type string `json:"type,omitempty"` Version string `json:"version,omitempty"` Metadata map[string]any `json:"metadata,omitempty"` - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` } // Recipe returns the Recipe from the DaprSecretStore Properties if ResourceProvisioning is not set to Manual, // otherwise it returns nil. -func (daprSecretStore *DaprSecretStore) Recipe() *portableresources.LinkRecipe { +func (daprSecretStore *DaprSecretStore) Recipe() *portableresources.ResourceRecipe { if daprSecretStore.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } diff --git a/pkg/daprrp/datamodel/daprstatestore.go b/pkg/daprrp/datamodel/daprstatestore.go index 6c2efc5869..fde21de75c 100644 --- a/pkg/daprrp/datamodel/daprstatestore.go +++ b/pkg/daprrp/datamodel/daprstatestore.go @@ -30,8 +30,8 @@ type DaprStateStore struct { // Properties is the properties of the resource. Properties DaprStateStoreProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all portable types. - pr_dm.LinkMetadata + // PortableResourceMetadata represents internal DataModel properties common to all portable types. + pr_dm.PortableResourceMetadata } // ApplyDeploymentOutput updates the DaprStateStore resource with the DeploymentOutput values. @@ -55,7 +55,7 @@ func (daprStateStore *DaprStateStore) ResourceTypeName() string { } // Recipe returns the recipe information of the resource. It returns nil if the ResourceProvisioning is set to manual. -func (r *DaprStateStore) Recipe() *portableresources.LinkRecipe { +func (r *DaprStateStore) Recipe() *portableresources.ResourceRecipe { if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } @@ -69,7 +69,7 @@ type DaprStateStoreProperties struct { // Specifies how the underlying service/resource is provisioned and managed ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` Metadata map[string]any `json:"metadata,omitempty"` - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` Resources []*portableresources.ResourceReference `json:"resources,omitempty"` Type string `json:"type,omitempty"` Version string `json:"version,omitempty"` diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go index 823be224ec..64cd7d4158 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util.go @@ -98,13 +98,13 @@ func fromResourceProvisioningDataModel(provisioning portableresources.ResourcePr return &converted } -func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.ResourceRecipe { if r == nil { - return portableresources.LinkRecipe{ + return portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, } } - recipe := portableresources.LinkRecipe{} + recipe := portableresources.ResourceRecipe{} if r.Name == nil { recipe.Name = portableresources.DefaultRecipeName } else { @@ -116,7 +116,7 @@ func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { return recipe } -func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.ResourceRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go index b7bb9a2897..1162b6aeb2 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/datamodel_util_test.go @@ -214,11 +214,11 @@ func TestFromResourceProvisiongDataModel(t *testing.T) { func TestToRecipeDataModel(t *testing.T) { testset := []struct { versioned *Recipe - datamodel portableresources.LinkRecipe + datamodel portableresources.ResourceRecipe }{ { nil, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, }, }, @@ -229,7 +229,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: "test", Parameters: map[string]any{ "foo": "bar", @@ -242,7 +242,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", @@ -258,11 +258,11 @@ func TestToRecipeDataModel(t *testing.T) { func TestFromRecipeDataModel(t *testing.T) { testset := []struct { - DMResources []portableresources.LinkRecipe + DMResources []portableresources.ResourceRecipe VersionedResources []*Recipe }{ { - DMResources: []portableresources.LinkRecipe{{ + DMResources: []portableresources.ResourceRecipe{{ Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go index 5b7866472e..a0dd6af485 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/mongodatabase_conversion_test.go @@ -94,7 +94,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "testAccount.mongo.cosmos.azure.com", Port: 10255, - Recipe: portableresources.LinkRecipe{Name: "cosmosdb", Parameters: map[string]interface{}{"foo": "bar"}}, + Recipe: portableresources.ResourceRecipe{Name: "cosmosdb", Parameters: map[string]interface{}{"foo": "bar"}}, }, }, }, @@ -125,7 +125,7 @@ func TestMongoDatabase_ConvertVersionedToDataModel(t *testing.T) { ResourceProvisioning: portableresources.ResourceProvisioningRecipe, Host: "mynewhost.com", Port: 10256, - Recipe: portableresources.LinkRecipe{Name: portableresources.DefaultRecipeName, Parameters: nil}, + Recipe: portableresources.ResourceRecipe{Name: portableresources.DefaultRecipeName, Parameters: nil}, }, }, }, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go index 863c72de59..cbf576231c 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/rediscache_conversion_test.go @@ -56,7 +56,7 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { Port: 0, TLS: false, Username: "", - Recipe: portableresources.LinkRecipe{Name: "default"}, + Recipe: portableresources.ResourceRecipe{Name: "default"}, }, }, }, @@ -72,7 +72,7 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { Port: 0, TLS: false, Username: "", - Recipe: portableresources.LinkRecipe{Name: "redis-test"}, + Recipe: portableresources.ResourceRecipe{Name: "redis-test"}, }, }, }, @@ -88,7 +88,7 @@ func TestRedisCache_ConvertVersionedToDataModel(t *testing.T) { Port: 10255, TLS: false, Username: "", - Recipe: portableresources.LinkRecipe{Name: "redis-test", Parameters: map[string]any{"port": float64(6081)}}, + Recipe: portableresources.ResourceRecipe{Name: "redis-test", Parameters: map[string]any{"port": float64(6081)}}, }, }, }, diff --git a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go index 05c71ed1c8..ef60a87d85 100644 --- a/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go +++ b/pkg/datastoresrp/api/v20220315privatepreview/sqldatabase_conversion_test.go @@ -106,7 +106,7 @@ func TestSqlDatabase_ConvertVersionedToDataModel(t *testing.T) { Environment: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Core/environments/test-env", }, ResourceProvisioning: portableresources.ResourceProvisioningRecipe, - Recipe: portableresources.LinkRecipe{ + Recipe: portableresources.ResourceRecipe{ Name: "sql-test", Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/datastoresrp/datamodel/mongodatabase.go b/pkg/datastoresrp/datamodel/mongodatabase.go index 3882d0ab37..322996f187 100644 --- a/pkg/datastoresrp/datamodel/mongodatabase.go +++ b/pkg/datastoresrp/datamodel/mongodatabase.go @@ -30,8 +30,8 @@ import ( type MongoDatabase struct { v1.BaseResource - // LinkMetadata represents internal DataModel properties common to all portable resources. - pr_dm.LinkMetadata + // PortableResourceMetadata represents internal DataModel properties common to all portable resources. + pr_dm.PortableResourceMetadata // Properties is the properties of the resource. Properties MongoDatabaseProperties `json:"properties"` @@ -49,7 +49,7 @@ type MongoDatabaseProperties struct { // Database name of the target Mongo database Database string `json:"database,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Mongo database link - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` // List of the resource IDs that support the Mongo database resource Resources []*portableresources.ResourceReference `json:"resources,omitempty"` // Specifies how the underlying service/resource is provisioned and managed @@ -115,9 +115,9 @@ func (r *MongoDatabase) ResourceMetadata() *rpv1.BasicResourceProperties { return &r.Properties.BasicResourceProperties } -// Recipe returns the LinkRecipe associated with the Mongo database instance, or nil if the +// Recipe returns the ResourceRecipe associated with the Mongo database instance, or nil if the // ResourceProvisioning is set to Manual. -func (r *MongoDatabase) Recipe() *portableresources.LinkRecipe { +func (r *MongoDatabase) Recipe() *portableresources.ResourceRecipe { if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } diff --git a/pkg/datastoresrp/datamodel/rediscache.go b/pkg/datastoresrp/datamodel/rediscache.go index 1b9db8f07e..67790d7d06 100644 --- a/pkg/datastoresrp/datamodel/rediscache.go +++ b/pkg/datastoresrp/datamodel/rediscache.go @@ -33,8 +33,8 @@ type RedisCache struct { // Properties is the properties of the resource. Properties RedisCacheProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all link types. - pr_dm.LinkMetadata + // PortableResourceMetadata represents internal DataModel properties common to all resource types. + pr_dm.PortableResourceMetadata } // ApplyDeploymentOutput sets the Status, ComputedValues, SecretValues, Host, Port and Username properties of the @@ -58,9 +58,9 @@ func (redis *RedisCache) ResourceTypeName() string { return portableresources.RedisCachesResourceType } -// Recipe returns the LinkRecipe from the Redis cache Properties if ResourceProvisioning is not set to Manual, +// Recipe returns the ResourceRecipe from the Redis cache Properties if ResourceProvisioning is not set to Manual, // otherwise it returns nil. -func (redis *RedisCache) Recipe() *portableresources.LinkRecipe { +func (redis *RedisCache) Recipe() *portableresources.ResourceRecipe { if redis.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } @@ -115,7 +115,7 @@ type RedisCacheProperties struct { TLS bool `json:"tls,omitempty"` // The recipe used to automatically deploy underlying infrastructure for the Redis caches link - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` // Secrets provided by resource Secrets RedisCacheSecrets `json:"secrets,omitempty"` diff --git a/pkg/datastoresrp/datamodel/sqldatabase.go b/pkg/datastoresrp/datamodel/sqldatabase.go index 1bf003ff86..3cfad887af 100644 --- a/pkg/datastoresrp/datamodel/sqldatabase.go +++ b/pkg/datastoresrp/datamodel/sqldatabase.go @@ -26,9 +26,9 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) -// Recipe returns the LinkRecipe associated with the SQL database instance if the ResourceProvisioning is not +// Recipe returns the ResourceRecipe associated with the SQL database instance if the ResourceProvisioning is not // set to Manual, otherwise it returns nil. -func (sql *SqlDatabase) Recipe() *portableresources.LinkRecipe { +func (sql *SqlDatabase) Recipe() *portableresources.ResourceRecipe { if sql.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } @@ -42,8 +42,8 @@ type SqlDatabase struct { // Properties is the properties of the resource. Properties SqlDatabaseProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all portable resources. - pr_dm.LinkMetadata + // ResourceMetadata represents internal DataModel properties common to all portable resources. + pr_dm.PortableResourceMetadata } // ApplyDeploymentOutput updates the output resources of a SQL database resource with the output resources of a DeploymentOutput @@ -71,7 +71,7 @@ func (sql *SqlDatabase) ResourceTypeName() string { type SqlDatabaseProperties struct { rpv1.BasicResourceProperties // The recipe used to automatically deploy underlying infrastructure for the SQL database resource - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` // Database name of the target SQL database resource Database string `json:"database,omitempty"` // The fully qualified domain name of the SQL database resource diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go index 5ee5f719d1..fe1e1724b3 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util.go @@ -109,13 +109,13 @@ func fromSystemDataModel(s v1.SystemData) *SystemData { } } -func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { +func toRecipeDataModel(r *Recipe) portableresources.ResourceRecipe { if r == nil { - return portableresources.LinkRecipe{ + return portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, } } - recipe := portableresources.LinkRecipe{} + recipe := portableresources.ResourceRecipe{} if r.Name == nil { recipe.Name = portableresources.DefaultRecipeName } else { @@ -127,7 +127,7 @@ func toRecipeDataModel(r *Recipe) portableresources.LinkRecipe { return recipe } -func fromRecipeDataModel(r portableresources.LinkRecipe) *Recipe { +func fromRecipeDataModel(r portableresources.ResourceRecipe) *Recipe { return &Recipe{ Name: to.Ptr(r.Name), Parameters: r.Parameters, diff --git a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go index 4f886f97ef..e68b650625 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/datamodel_util_test.go @@ -116,11 +116,11 @@ func TestFromSystemDataModel(t *testing.T) { func TestToRecipeDataModel(t *testing.T) { testset := []struct { versioned *Recipe - datamodel portableresources.LinkRecipe + datamodel portableresources.ResourceRecipe }{ { nil, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, }, }, @@ -131,7 +131,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: "test", Parameters: map[string]any{ "foo": "bar", @@ -144,7 +144,7 @@ func TestToRecipeDataModel(t *testing.T) { "foo": "bar", }, }, - portableresources.LinkRecipe{ + portableresources.ResourceRecipe{ Name: portableresources.DefaultRecipeName, Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go index 899020a827..408ab20133 100644 --- a/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go +++ b/pkg/messagingrp/api/v20220315privatepreview/rabbitmq_conversion_test.go @@ -104,7 +104,7 @@ func TestRabbitMQQueue_ConvertVersionedToDataModel(t *testing.T) { }, ResourceProvisioning: portableresources.ResourceProvisioningRecipe, TLS: false, - Recipe: portableresources.LinkRecipe{ + Recipe: portableresources.ResourceRecipe{ Name: "rabbitmq", Parameters: map[string]any{ "foo": "bar", diff --git a/pkg/messagingrp/datamodel/rabbitmq.go b/pkg/messagingrp/datamodel/rabbitmq.go index a16b840a54..cbc8e833e9 100644 --- a/pkg/messagingrp/datamodel/rabbitmq.go +++ b/pkg/messagingrp/datamodel/rabbitmq.go @@ -33,8 +33,8 @@ type RabbitMQQueue struct { // Properties is the properties of the resource. Properties RabbitMQQueueProperties `json:"properties"` - // LinkMetadata represents internal DataModel properties common to all portable resource types. - pr_dm.LinkMetadata + // ResourceMetadata represents internal DataModel properties common to all portable resource types. + pr_dm.PortableResourceMetadata } // ApplyDeploymentOutput updates the RabbitMQQueue instance with the DeployedOutputResources from the @@ -67,7 +67,7 @@ type RabbitMQQueueProperties struct { VHost string `json:"vHost,omitempty"` Username string `json:"username,omitempty"` Resources []*portableresources.ResourceReference `json:"resources,omitempty"` - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` Secrets RabbitMQSecrets `json:"secrets,omitempty"` ResourceProvisioning portableresources.ResourceProvisioning `json:"resourceProvisioning,omitempty"` TLS bool `json:"tls,omitempty"` @@ -84,9 +84,9 @@ func (rabbitmq RabbitMQSecrets) ResourceTypeName() string { return portableresources.RabbitMQQueuesResourceType } -// Recipe returns the recipe for the RabbitMQQueue. It gets the LinkRecipe associated with the RabbitMQQueue instance +// Recipe returns the recipe for the RabbitMQQueue. It gets the ResourceRecipe associated with the RabbitMQQueue instance // if the ResourceProvisioning is not set to Manual, otherwise it returns nil. -func (r *RabbitMQQueue) Recipe() *portableresources.LinkRecipe { +func (r *RabbitMQQueue) Recipe() *portableresources.ResourceRecipe { if r.Properties.ResourceProvisioning == portableresources.ResourceProvisioningManual { return nil } diff --git a/pkg/portableresources/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go index f47a801e44..188bca0f75 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -49,8 +49,8 @@ const ( type TestResource struct { v1.BaseResource - // LinkMetadata represents internal DataModel properties common to all portable resource types. - datamodel.LinkMetadata + // ResourceMetadata represents internal DataModel properties common to all portable resource types. + datamodel.PortableResourceMetadata // Properties is the properties of the resource. Properties TestResourceProperties `json:"properties"` @@ -74,15 +74,15 @@ func (r *TestResource) ResourceMetadata() *rpv1.BasicResourceProperties { return &r.Properties.BasicResourceProperties } -// Recipe returns a pointer to the LinkRecipe stored in the Properties field of the TestResource struct. -func (t *TestResource) Recipe() *portableresources.LinkRecipe { +// Recipe returns a pointer to the ResourceRecipe stored in the Properties field of the TestResource struct. +func (t *TestResource) Recipe() *portableresources.ResourceRecipe { return &t.Properties.Recipe } type TestResourceProperties struct { rpv1.BasicResourceProperties - IsProcessed bool `json:"isProcessed"` - Recipe portableresources.LinkRecipe `json:"recipe,omitempty"` + IsProcessed bool `json:"isProcessed"` + Recipe portableresources.ResourceRecipe `json:"recipe,omitempty"` } type SuccessProcessor struct { diff --git a/pkg/portableresources/datamodel/linkmetadata.go b/pkg/portableresources/datamodel/metadata.go similarity index 66% rename from pkg/portableresources/datamodel/linkmetadata.go rename to pkg/portableresources/datamodel/metadata.go index 1282dd0f0e..c506915c29 100644 --- a/pkg/portableresources/datamodel/linkmetadata.go +++ b/pkg/portableresources/datamodel/metadata.go @@ -21,8 +21,13 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" ) -// LinkMetadata represents internal DataModel properties common to all portable resource types. -type LinkMetadata struct { +const ( + // RecipeContextParameter is the parameter context for recipe deployment + RecipeContextParameter string = "context" +) + +// PortableResourceMetadata represents internal DataModel properties common to all portable resource types. +type PortableResourceMetadata struct { // ComputedValues map is any resource values that will be needed for more operations. // For example; database name to generate secrets for cosmos DB. ComputedValues map[string]any `json:"computedValues,omitempty"` @@ -32,17 +37,3 @@ type LinkMetadata struct { RecipeData portableresources.RecipeData `json:"recipeData,omitempty"` } - -// LinkMode specifies how to build a portable resource. Options are to build automatically via ‘recipe’ or ‘resource’, or build manually via ‘values’. Selection determines which set of fields to additionally require. -type LinkMode string - -const ( - // LinkModeRecipe is the recipe mode for portable resource deployment - LinkModeRecipe LinkMode = "recipe" - // LinkModeResource is the resource mode for portable resource deployment - LinkModeResource LinkMode = "resource" - // LinkModeResource is the values mode for portable resource deployment - LinkModeValues LinkMode = "values" - // RecipeContextParameter is the parameter context for recipe deployment - RecipeContextParameter string = "context" -) diff --git a/pkg/portableresources/datamodel/recipes.go b/pkg/portableresources/datamodel/recipes.go index 6bf152a331..a39218fa80 100644 --- a/pkg/portableresources/datamodel/recipes.go +++ b/pkg/portableresources/datamodel/recipes.go @@ -27,5 +27,5 @@ import ( // RecipeDataModel should be implemented on the datamodel of types that support recipes. type RecipeDataModel interface { // Recipe provides access to the user-specified recipe configuration. Can return nil. - Recipe() *portableresources.LinkRecipe + Recipe() *portableresources.ResourceRecipe } diff --git a/pkg/portableresources/types.go b/pkg/portableresources/types.go index 68ef24ec90..c77c2c268c 100644 --- a/pkg/portableresources/types.go +++ b/pkg/portableresources/types.go @@ -58,7 +58,7 @@ const ( type RecipeData struct { RecipeProperties - // APIVersion is the API version to use to perform operations on resources supported by the link. + // APIVersion is the API version to use to perform operations on resources. // For example for Azure resources, every service has different REST API version that must be specified in the request. APIVersion string @@ -68,14 +68,14 @@ type RecipeData struct { // RecipeProperties represents the information needed to deploy a recipe type RecipeProperties struct { - LinkRecipe // LinkRecipe is the recipe of the resource to be deployed - LinkType string // LinkType represent the type of the link - TemplatePath string // TemplatePath represent the recipe location - EnvParameters map[string]any // EnvParameters represents the parameters set by the operator while linking the recipe to an environment + ResourceRecipe // ResourceRecipe is the recipe of the resource to be deployed + ResourceType string // ResourceType represent the type of the resource + TemplatePath string // TemplatePath represent the recipe location + EnvParameters map[string]any // EnvParameters represents the parameters set by the operator while linking the recipe to an environment } -// LinkRecipe is the recipe details used to automatically deploy underlying infrastructure for a link -type LinkRecipe struct { +// ResourceRecipe is the recipe details used to automatically deploy underlying infrastructure for a resource. +type ResourceRecipe struct { // Name of the recipe within the environment to use Name string `json:"name,omitempty"` // Parameters are key/value parameters to pass into the recipe at deployment @@ -100,7 +100,7 @@ type RecipeContext struct { } // Resource contains the information needed to deploy a recipe. -// In the case the resource is a Link, it represents the Link's id, name and type. +// In the case the resource is a portable resource, it represents the resource's id, name and type. type Resource struct { ResourceInfo Type string `json:"type"` diff --git a/pkg/recipes/recipecontext/context.go b/pkg/recipes/recipecontext/context.go index 0366a4728c..2e9fdea37e 100644 --- a/pkg/recipes/recipecontext/context.go +++ b/pkg/recipes/recipecontext/context.go @@ -30,7 +30,7 @@ var ( ErrParseFormat = "failed to parse %s: %q while building the recipe context parameter %w" ) -// New creates the context parameter for the recipe with the link, environment and application info +// New creates the context parameter for the recipe with the portable resource, environment, and application info func New(metadata *recipes.ResourceMetadata, config *recipes.Configuration) (*Context, error) { parsedResource, err := resources.ParseResource(metadata.ResourceID) if err != nil { diff --git a/pkg/recipes/recipecontext/types.go b/pkg/recipes/recipecontext/types.go index 20e11a9f8b..f905fbcb89 100644 --- a/pkg/recipes/recipecontext/types.go +++ b/pkg/recipes/recipecontext/types.go @@ -44,7 +44,7 @@ type Context struct { } // Resource contains the information needed to deploy a recipe. -// In the case the resource is a Link, it represents the Link's id, name and type. +// In the case the resource is a portable resource, it represents the resource's id, name and type. type Resource struct { // ResourceInfo represents name and id of the resource ResourceInfo diff --git a/pkg/rp/doc.go b/pkg/rp/doc.go index 3cd006fe3c..9caafd8a16 100644 --- a/pkg/rp/doc.go +++ b/pkg/rp/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// rp package includes common packages which are shared by corerp and linkrp. +// rp package includes common packages which are shared by corerp and portable resources rps (datastoresrp, messagingrp, daprrp). package rp diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json index 1e5300771d..d17ab65f66 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/examples/Environments_GetRecipeMetadata.json @@ -10,7 +10,7 @@ "responses": { "200": { "body": { - "linkType": "Applications.Datastores/mongoDatabases", + "resourceType": "Applications.Datastores/mongoDatabases", "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", "parameters": { diff --git a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json index d006909cbb..2cb9c48775 100644 --- a/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json +++ b/swagger/specification/applications/resource-manager/Applications.Core/preview/2022-03-15-privatepreview/openapi.json @@ -4460,9 +4460,9 @@ "type": "object", "description": "Represents the request body of the getmetadata action.", "properties": { - "linkType": { + "resourceType": { "type": "string", - "description": "Type of the link this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases'" + "description": "Type of the resource this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases'" }, "name": { "type": "string", @@ -4470,7 +4470,7 @@ } }, "required": [ - "linkType", + "resourceType", "name" ] }, diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json index de4215466c..ba3efe8c02 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_GetPlaneLocal.json @@ -15,7 +15,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Datastores": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json index 7a43a4d64e..2f22f7beb5 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_List.json @@ -15,7 +15,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Datastores": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443", "Microsoft.Resources": "http://bicep-de.radius-system:6443" }, diff --git a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json index 3376f3b537..1544d77af2 100644 --- a/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json +++ b/swagger/specification/ucp/resource-manager/UCP/preview/2022-09-01-privatepreview/examples/Planes_ListPlanesByType.json @@ -16,7 +16,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Datastores": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/test/functional/shared/cli/cli_test.go b/test/functional/shared/cli/cli_test.go index ac075f5ce5..a380184825 100644 --- a/test/functional/shared/cli/cli_test.go +++ b/test/functional/shared/cli/cli_test.go @@ -61,12 +61,12 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { recipeName := "recipeName" recipeTemplate := "testpublicrecipe.azurecr.io/bicep/modules/testTemplate:v1" templateKind := "bicep" - linkType := "Applications.Datastores/mongoDatabases" + resourceType := "Applications.Datastores/mongoDatabases" file := "testdata/corerp-redis-recipe.bicep" target := fmt.Sprintf("br:radiusdev.azurecr.io/test-bicep-recipes/redis-recipe:%s", generateUniqueTag()) t.Run("Validate rad recipe register", func(t *testing.T) { - output, err := cli.RecipeRegister(ctx, envName, recipeName, templateKind, recipeTemplate, linkType) + output, err := cli.RecipeRegister(ctx, envName, recipeName, templateKind, recipeTemplate, resourceType) require.NoError(t, err) require.Contains(t, output, "Successfully linked recipe") }) @@ -75,12 +75,12 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { output, err := cli.RecipeList(ctx, envName) require.NoError(t, err) require.Regexp(t, recipeName, output) - require.Regexp(t, linkType, output) + require.Regexp(t, resourceType, output) require.Regexp(t, recipeTemplate, output) }) t.Run("Validate rad recipe unregister", func(t *testing.T) { - output, err := cli.RecipeUnregister(ctx, envName, recipeName, linkType) + output, err := cli.RecipeUnregister(ctx, envName, recipeName, resourceType) require.NoError(t, err) require.Contains(t, output, "Successfully unregistered recipe") }) @@ -88,15 +88,15 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { t.Run("Validate rad recipe show", func(t *testing.T) { showRecipeName := "mongodbtest" showRecipeTemplate := "radiusdev.azurecr.io/recipes/functionaltest/parameters/mongodatabases/azure:1.0" - showRecipeLinkType := "Applications.Datastores/mongoDatabases" - output, err := cli.RecipeRegister(ctx, envName, showRecipeName, templateKind, showRecipeTemplate, showRecipeLinkType) + showRecipeResourceType := "Applications.Datastores/mongoDatabases" + output, err := cli.RecipeRegister(ctx, envName, showRecipeName, templateKind, showRecipeTemplate, showRecipeResourceType) require.NoError(t, err) require.Contains(t, output, "Successfully linked recipe") - output, err = cli.RecipeShow(ctx, envName, showRecipeName, linkType) + output, err = cli.RecipeShow(ctx, envName, showRecipeName, resourceType) require.NoError(t, err) require.Contains(t, output, showRecipeName) require.Contains(t, output, showRecipeTemplate) - require.Contains(t, output, showRecipeLinkType) + require.Contains(t, output, showRecipeResourceType) require.Contains(t, output, "mongodbName") require.Contains(t, output, "documentdbName") require.Contains(t, output, "location") @@ -111,15 +111,15 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { moduleServer = "http://localhost:8999" } showRecipeTemplate := fmt.Sprintf("%s/kubernetes-redis.zip", moduleServer) - showRecipeLinkType := "Applications.Datastores/redisCaches" - output, err := cli.RecipeRegister(ctx, envName, showRecipeName, "terraform", showRecipeTemplate, showRecipeLinkType) + showRecipeResourceType := "Applications.Datastores/redisCaches" + output, err := cli.RecipeRegister(ctx, envName, showRecipeName, "terraform", showRecipeTemplate, showRecipeResourceType) require.NoError(t, err) require.Contains(t, output, "Successfully linked recipe") - output, err = cli.RecipeShow(ctx, envName, showRecipeName, showRecipeLinkType) + output, err = cli.RecipeShow(ctx, envName, showRecipeName, showRecipeResourceType) require.NoError(t, err) require.Contains(t, output, showRecipeName) require.Contains(t, output, showRecipeTemplate) - require.Contains(t, output, showRecipeLinkType) + require.Contains(t, output, showRecipeResourceType) require.Contains(t, output, "redis_cache_name") require.Contains(t, output, "string") }) @@ -131,7 +131,7 @@ func verifyRecipeCLI(ctx context.Context, t *testing.T, test shared.RPTest) { }) t.Run("Validate rad recipe register with recipe name conflicting with dev recipe", func(t *testing.T) { - output, err := cli.RecipeRegister(ctx, envName, "mongo-azure", templateKind, recipeTemplate, linkType) + output, err := cli.RecipeRegister(ctx, envName, "mongo-azure", templateKind, recipeTemplate, resourceType) require.Contains(t, output, "Successfully linked recipe") require.NoError(t, err) output, err = cli.RecipeList(ctx, envName) diff --git a/test/radcli/cli.go b/test/radcli/cli.go index eb258a8d0f..4ba7989969 100644 --- a/test/radcli/cli.go +++ b/test/radcli/cli.go @@ -307,8 +307,8 @@ func (cli *CLI) RecipeList(ctx context.Context, envName string) (string, error) } // RecipeRegister runs a command to register a recipe with the given environment, template kind, template path and -// link type, and returns the output string or an error. -func (cli *CLI) RecipeRegister(ctx context.Context, envName, recipeName, templateKind, templatePath, linkType string) (string, error) { +// resource type, and returns the output string or an error. +func (cli *CLI) RecipeRegister(ctx context.Context, envName, recipeName, templateKind, templatePath, resourceType string) (string, error) { args := []string{ "recipe", "register", @@ -316,32 +316,32 @@ func (cli *CLI) RecipeRegister(ctx context.Context, envName, recipeName, templat "--environment", envName, "--template-kind", templateKind, "--template-path", templatePath, - "--link-type", linkType, + "--resource-type", resourceType, } return cli.RunCommand(ctx, args) } -// RecipeUnregister runs a command to unregister a recipe from an environment, given the recipe name and link type. +// RecipeUnregister runs a command to unregister a recipe from an environment, given the recipe name and resource type. // It returns a string and an error if the command fails. -func (cli *CLI) RecipeUnregister(ctx context.Context, envName, recipeName, linkType string) (string, error) { +func (cli *CLI) RecipeUnregister(ctx context.Context, envName, recipeName, resourceType string) (string, error) { args := []string{ "recipe", "unregister", recipeName, - "--link-type", linkType, + "--resource-type", resourceType, "--environment", envName, } return cli.RunCommand(ctx, args) } -// RecipeShow runs a command to show a recipe with the given environment name, recipe name and link type, and returns the +// RecipeShow runs a command to show a recipe with the given environment name, recipe name and resource type, and returns the // output string or an error. -func (cli *CLI) RecipeShow(ctx context.Context, envName, recipeName string, linkType string) (string, error) { +func (cli *CLI) RecipeShow(ctx context.Context, envName, recipeName string, resourceType string) (string, error) { args := []string{ "recipe", "show", recipeName, - "--link-type", linkType, + "--resource-type", resourceType, "--environment", envName, } return cli.RunCommand(ctx, args) diff --git a/typespec/Applications.Core/environments.tsp b/typespec/Applications.Core/environments.tsp index 0c7a2a7c8f..cb97def854 100644 --- a/typespec/Applications.Core/environments.tsp +++ b/typespec/Applications.Core/environments.tsp @@ -114,8 +114,8 @@ model TerraformRecipeProperties extends RecipeProperties { @doc("Represents the request body of the getmetadata action.") model RecipeGetMetadata { - @doc("Type of the link this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases'") - linkType: string; + @doc("Type of the resource this recipe can be consumed by. For example: 'Applications.Datastores/mongoDatabases'") + resourceType: string; @doc("The name of the recipe registered to the environment") name: string; diff --git a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json index 1e5300771d..d17ab65f66 100644 --- a/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json +++ b/typespec/Applications.Core/examples/2022-03-15-privatepreview/Environments_GetRecipeMetadata.json @@ -10,7 +10,7 @@ "responses": { "200": { "body": { - "linkType": "Applications.Datastores/mongoDatabases", + "resourceType": "Applications.Datastores/mongoDatabases", "templateKind": "bicep", "templatePath": "br:sampleregistry.azureacr.io/radius/recipes/cosmosdb", "parameters": { diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json index de4215466c..ba3efe8c02 100644 --- a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_GetPlaneLocal.json @@ -15,7 +15,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Datastores": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json index 7a43a4d64e..2f22f7beb5 100644 --- a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_List.json @@ -15,7 +15,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Datastores": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443", "Microsoft.Resources": "http://bicep-de.radius-system:6443" }, diff --git a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json index 3376f3b537..1544d77af2 100644 --- a/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json +++ b/typespec/UCP/examples/2022-09-01-privatepreview/Planes_ListPlanesByType.json @@ -16,7 +16,7 @@ "location": "global", "properties": { "resourceProviders": { - "Applications.Link": "http://applications-rp.radius-system:5444", + "Applications.Datastores": "http://applications-rp.radius-system:5444", "Applications.Core": "http://applications-rp.radius-system:5443" }, "kind": "UCPNative" From 88754fa6cdb21ed8a592211d17e55c6b0efed5af Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Thu, 7 Sep 2023 16:23:31 -0700 Subject: [PATCH 51/57] Fix inconsistency in connection prefix naming for container connections (#6235) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description This PR fixes a bug in the naming convention for connections to other containers. Instead of "CONNECTIONS_" it should be "CONNECTION". This PR also adds a unit test for this change. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at ba2d0ed ### Summary 🔧🚚🧪 This pull request adds a test case for container-to-container routing and refactors the environment variable keys for connection information in `render.go` and `render_test.go`. > _We forge the keys of connection_ > _With the power of `fmt.Sprintf`_ > _We test the routes of rendering_ > _With mock and assert in `render_test.go`_ ### Walkthrough * Refactor environment variable keys for connection information to use consistent format ([link](https://github.com/radius-project/radius/pull/6235/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L695-R702)) * Add variables for connection to containerB in test function Test_Render_PortConnectedToRoute ([link](https://github.com/radius-project/radius/pull/6235/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R500-R503)) * Pass connection entry for containerB to Render function in test function Test_Render_Connections ([link](https://github.com/radius-project/radius/pull/6235/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R515-R517)) * Assert expected environment variables for connection to containerB in test function Test_Render_Connections ([link](https://github.com/radius-project/radius/pull/6235/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R581-R592)) --- pkg/corerp/renderers/container/render.go | 10 +++++++--- pkg/corerp/renderers/container/render_test.go | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index cfac671c5f..a680a81af8 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -692,9 +692,13 @@ func getEnvVarsAndSecretData(resource *datamodel.ContainerResource, applicationN return map[string]corev1.EnvVar{}, map[string][]byte{}, fmt.Errorf("failed to parse source URL: %w", err) } - env["CONNECTIONS_"+name+"_SCHEME"] = corev1.EnvVar{Name: "CONNECTIONS_" + name + "_SCHEME", Value: scheme} - env["CONNECTIONS_"+name+"_HOSTNAME"] = corev1.EnvVar{Name: "CONNECTIONS_" + name + "_HOSTNAME", Value: hostname} - env["CONNECTIONS_"+name+"_PORT"] = corev1.EnvVar{Name: "CONNECTIONS_" + name + "_PORT", Value: port} + schemeKey := fmt.Sprintf("%s_%s_%s", "CONNECTION", strings.ToUpper(name), "SCHEME") + hostnameKey := fmt.Sprintf("%s_%s_%s", "CONNECTION", strings.ToUpper(name), "HOSTNAME") + portKey := fmt.Sprintf("%s_%s_%s", "CONNECTION", strings.ToUpper(name), "PORT") + + env[schemeKey] = corev1.EnvVar{Name: schemeKey, Value: scheme} + env[hostnameKey] = corev1.EnvVar{Name: hostnameKey, Value: hostname} + env[portKey] = corev1.EnvVar{Name: portKey, Value: port} continue } diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index 688151386e..de3673af7a 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -497,6 +497,10 @@ func Test_Render_PortConnectedToRoute(t *testing.T) { } func Test_Render_Connections(t *testing.T) { + containerConnectionHostname := "containerB" + containerConnectionScheme := "http" + containerConnectionPort := "80" + properties := datamodel.ContainerProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ Application: applicationResourceID, @@ -508,6 +512,9 @@ func Test_Render_Connections(t *testing.T) { Kind: datamodel.KindHTTP, }, }, + "containerB": { + Source: fmt.Sprintf("%s://%s:%s", containerConnectionScheme, containerConnectionHostname, containerConnectionPort), + }, }, Container: datamodel.Container{ Image: "someimage:latest", @@ -571,6 +578,18 @@ func Test_Render_Connections(t *testing.T) { }, }, }, + { + Name: "CONNECTION_CONTAINERB_HOSTNAME", + Value: containerConnectionHostname, + }, + { + Name: "CONNECTION_CONTAINERB_PORT", + Value: containerConnectionPort, + }, + { + Name: "CONNECTION_CONTAINERB_SCHEME", + Value: containerConnectionScheme, + }, {Name: envVarName1, Value: envVarValue1}, {Name: envVarName2, Value: envVarValue2}, } From e7d8971ecb61636df5d440fd45f288c5e88f12db Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Thu, 7 Sep 2023 17:28:08 -0700 Subject: [PATCH 52/57] Adding postDeleteVerify to the Dapr functional tests (#6195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description 1. Added `postDeleteVerify` steps to all the Dapr functional tests 2. Added NewDaprResource function to the functional test utils 3. Added a check of the Dapr components to the `K8Objects` 4. **!!! Added **Delete** to the **Processors** (We can talk about this one and if we feel like we don't need this, I can find another way for this)** ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at bffdd8e ### Summary 🧹🤔✅ This pull request enhances the functional tests for the Dapr resources by adding more validations and cleanup functions. It also fixes some missing imports and simplifies some code in the `list.go` file. Additionally, it adds a comment and a helper function for future work. > _We're testing Dapr resources on the Kubernetes sea_ > _We're checking pub/sub, secret store and state store with `K8sObject`s we create_ > _We're simplifying code and adding comments where we need_ > _We're heaving away on the count of three, we're the validation team_ ### Walkthrough * Simplify error handling in `WriteFormatted` method ([link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-260f1d886aae571f8487e5405785053daf07362bfef8b8bc6d9509900a3b3cc0L122-R122)) * Add `context` and `github.com/stretchr/testify/require` imports to Dapr resource tests ([link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-9a6c029550d1c5b3bf1ec0c77525e20f26fe1ebb980b54ee20f1aaf253965922L20-R29), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-3c241abe05a99967207db1d0d573c292bd35add20b631d86573315e5fb71911fL20-R28), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-175c643bec9a553b195d07b69769dc0b86188779f6ddbafa79f0fd569de1f0b1L20-R29)) * Add validations for Dapr components created by manual and recipe tests for Dapr pub/sub broker, secret store, and state store resources ([link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-9a6c029550d1c5b3bf1ec0c77525e20f26fe1ebb980b54ee20f1aaf253965922L59-R68), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-9a6c029550d1c5b3bf1ec0c77525e20f26fe1ebb980b54ee20f1aaf253965922L104-R124), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-3c241abe05a99967207db1d0d573c292bd35add20b631d86573315e5fb71911fR61-R64), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-3c241abe05a99967207db1d0d573c292bd35add20b631d86573315e5fb71911fL97-R115), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-175c643bec9a553b195d07b69769dc0b86188779f6ddbafa79f0fd569de1f0b1L61-R70), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-175c643bec9a553b195d07b69769dc0b86188779f6ddbafa79f0fd569de1f0b1L106-R126)) * Add `PostDeleteVerify` functions to check if Dapr resources are deleted after tests ([link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-9a6c029550d1c5b3bf1ec0c77525e20f26fe1ebb980b54ee20f1aaf253965922L66-R82), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-9a6c029550d1c5b3bf1ec0c77525e20f26fe1ebb980b54ee20f1aaf253965922L110-R138), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-3c241abe05a99967207db1d0d573c292bd35add20b631d86573315e5fb71911fL63-R78), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-3c241abe05a99967207db1d0d573c292bd35add20b631d86573315e5fb71911fL103-R129), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-175c643bec9a553b195d07b69769dc0b86188779f6ddbafa79f0fd569de1f0b1L68-R84), [link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-175c643bec9a553b195d07b69769dc0b86188779f6ddbafa79f0fd569de1f0b1L112-R140)) * Add helper function `NewDaprComponent` to create `K8sObject` for Dapr components in `test/validation/k8s.go` ([link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-a52153bfeb452a3dd497767a98db0dc1a0621e012f6e6d8dd9d4b5ec758b4dc2R596-R608)) * Add comment to question the logic of `CheckRequiredFeatures` function in `test/functional/shared/rptest.go` ([link](https://github.com/radius-project/radius/pull/6195/files?diff=unified&w=0#diff-f9ca7b9a91d5b71a3d9cbd29a179a8253f51f2755b89cceef405b46ecd03999bR199)) --- pkg/cli/cmd/group/list/list.go | 7 +- pkg/corerp/backend/service.go | 9 +- pkg/corerp/processors/extenders/processor.go | 5 + .../processors/pubsubbrokers/processor.go | 36 ++++++ .../pubsubbrokers/processor_test.go | 4 +- .../processors/secretstores/processor.go | 36 ++++++ .../processors/secretstores/processor_test.go | 4 +- .../processors/statestores/processor.go | 36 ++++++ .../processors/statestores/processor_test.go | 4 +- .../processors/mongodatabases/processor.go | 5 + .../processors/rediscaches/processor.go | 5 + .../processors/sqldatabases/processor.go | 5 + .../processors/rabbitmqqueues/processor.go | 5 + .../controller/createorupdateresource.go | 8 +- .../controller/createorupdateresource_test.go | 23 ++-- .../backend/controller/deleteresource.go | 96 +++++++-------- .../backend/controller/deleteresource_test.go | 70 ++++------- pkg/portableresources/backend/service.go | 116 +++++++++++++----- pkg/portableresources/processors/types.go | 3 + .../renderers/dapr/generic.go | 4 +- pkg/portableresources/renderers/dapr/types.go | 22 ++++ test/functional/daprrp/common.go | 53 ++++++++ test/functional/daprrp/dapr_pubsub_test.go | 28 ++++- .../daprrp/dapr_secretstore_test.go | 21 +++- .../functional/daprrp/dapr_statestore_test.go | 28 ++++- test/validation/k8s.go | 13 ++ 26 files changed, 482 insertions(+), 164 deletions(-) create mode 100644 pkg/portableresources/renderers/dapr/types.go create mode 100644 test/functional/daprrp/common.go diff --git a/pkg/cli/cmd/group/list/list.go b/pkg/cli/cmd/group/list/list.go index 4ea61f8507..6bad81515a 100644 --- a/pkg/cli/cmd/group/list/list.go +++ b/pkg/cli/cmd/group/list/list.go @@ -119,10 +119,5 @@ func (r *Runner) Run(ctx context.Context) error { return err } - err = r.Output.WriteFormatted(r.Format, resourceGroupDetails, objectformats.GetResourceGroupTableFormat()) - - if err != nil { - return err - } - return err + return r.Output.WriteFormatted(r.Format, resourceGroupDetails, objectformats.GetResourceGroupTableFormat()) } diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go index 931846bcbc..e072b609b2 100644 --- a/pkg/corerp/backend/service.go +++ b/pkg/corerp/backend/service.go @@ -142,19 +142,22 @@ func (w *Service) Run(ctx context.Context) error { processor := &extenders.Processor{} return pr_backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](processor, engine, client, configLoader, options) } + extenderDeleteController := func(options ctrl.Options) (ctrl.Controller, error) { + processor := &extenders.Processor{} + return pr_backend_ctrl.NewDeleteResource[*datamodel.Extender, datamodel.Extender](processor, engine, configLoader, options) + } // Register controllers to run backend processing for extenders. err = w.Controllers.Register(ctx, portableresources.ExtendersResourceType, v1.OperationPut, extenderCreateOrUpdateController, opts) if err != nil { return err } + err = w.Controllers.Register( ctx, portableresources.ExtendersResourceType, v1.OperationDelete, - func(options ctrl.Options) (ctrl.Controller, error) { - return pr_backend_ctrl.NewDeleteResource(options, engine) - }, + extenderDeleteController, opts) if err != nil { return err diff --git a/pkg/corerp/processors/extenders/processor.go b/pkg/corerp/processors/extenders/processor.go index 9a2efc855e..59b08831b0 100644 --- a/pkg/corerp/processors/extenders/processor.go +++ b/pkg/corerp/processors/extenders/processor.go @@ -48,6 +48,11 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.Extender, o return nil } +// Delete implements the processors.Processor interface for Extender resources. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.Extender, options processors.Options) error { + return nil +} + func mergeOutputValues(properties map[string]any, recipeOutput *recipes.RecipeOutput, secret bool) map[string]any { values := make(map[string]any) for k, val := range properties { diff --git a/pkg/daprrp/processors/pubsubbrokers/processor.go b/pkg/daprrp/processors/pubsubbrokers/processor.go index 38fb525c41..a095416ca9 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor.go @@ -29,7 +29,9 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" "github.com/radius-project/radius/pkg/ucp/resources" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -101,3 +103,37 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprPubSubB return nil } + +// Delete implements the processors.Processor interface for DaprPubSubBroker resources. If the resource is being +// provisioned manually, it deletes the Dapr component in Kubernetes. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.DaprPubSubBroker, options processors.Options) error { + if resource.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { + // If the resource was provisioned by recipe then we expect the recipe engine to delete the Dapr Component + // in Kubernetes. At this point we're done so we can just return. + return nil + } + + applicationID, err := resources.ParseResource(resource.Properties.Application) + if err != nil { + return err // This should already be validated by this point. + } + + component := unstructured.Unstructured{ + Object: map[string]any{ + "apiVersion": dapr.DaprAPIVersion, + "kind": dapr.DaprKind, + "metadata": map[string]any{ + "namespace": options.RuntimeConfiguration.Kubernetes.Namespace, + "name": kubernetes.NormalizeDaprResourceName(resource.Properties.ComponentName), + "labels": kubernetes.MakeDescriptiveDaprLabels(applicationID.Name(), resource.Name, portableresources.DaprPubSubBrokersResourceType), + }, + }, + } + + err = p.Client.Delete(ctx, &component) + if err != nil { + return &processors.ResourceError{Inner: err} + } + + return nil +} diff --git a/pkg/daprrp/processors/pubsubbrokers/processor_test.go b/pkg/daprrp/processors/pubsubbrokers/processor_test.go index 62df14eed6..c4397b46c4 100644 --- a/pkg/daprrp/processors/pubsubbrokers/processor_test.go +++ b/pkg/daprrp/processors/pubsubbrokers/processor_test.go @@ -166,8 +166,8 @@ func Test_Process(t *testing.T) { generated := &unstructured.Unstructured{ Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", + "apiVersion": dapr.DaprAPIVersion, + "kind": dapr.DaprKind, "metadata": map[string]any{ "namespace": "test-namespace", "name": "test-dapr-pubsub-broker", diff --git a/pkg/daprrp/processors/secretstores/processor.go b/pkg/daprrp/processors/secretstores/processor.go index b29fb7327b..7153006db2 100644 --- a/pkg/daprrp/processors/secretstores/processor.go +++ b/pkg/daprrp/processors/secretstores/processor.go @@ -29,7 +29,9 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" "github.com/radius-project/radius/pkg/ucp/resources" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -98,3 +100,37 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprSecretS return nil } + +// Delete implements the processors.Processor interface for DaprSecretStore resources. If the resource is being +// provisioned manually, it deletes the Dapr component in Kubernetes. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.DaprSecretStore, options processors.Options) error { + if resource.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { + // If the resource was provisioned by recipe then we expect the recipe engine to delete the Dapr Component + // in Kubernetes. At this point we're done so we can just return. + return nil + } + + applicationID, err := resources.ParseResource(resource.Properties.Application) + if err != nil { + return err // This should already be validated by this point. + } + + component := unstructured.Unstructured{ + Object: map[string]any{ + "apiVersion": dapr.DaprAPIVersion, + "kind": dapr.DaprKind, + "metadata": map[string]any{ + "namespace": options.RuntimeConfiguration.Kubernetes.Namespace, + "name": kubernetes.NormalizeDaprResourceName(resource.Properties.ComponentName), + "labels": kubernetes.MakeDescriptiveDaprLabels(applicationID.Name(), resource.Name, portableresources.DaprSecretStoresResourceType), + }, + }, + } + + err = p.Client.Delete(ctx, &component) + if err != nil { + return &processors.ResourceError{Inner: err} + } + + return nil +} diff --git a/pkg/daprrp/processors/secretstores/processor_test.go b/pkg/daprrp/processors/secretstores/processor_test.go index 2dfbdd785d..e5eedf30c5 100644 --- a/pkg/daprrp/processors/secretstores/processor_test.go +++ b/pkg/daprrp/processors/secretstores/processor_test.go @@ -150,8 +150,8 @@ func Test_Process(t *testing.T) { expectedSecrets := map[string]rpv1.SecretValueReference{} generated := &unstructured.Unstructured{ Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", + "apiVersion": dapr.DaprAPIVersion, + "kind": dapr.DaprKind, "metadata": map[string]any{ "namespace": "test-namespace", "name": "test-component", diff --git a/pkg/daprrp/processors/statestores/processor.go b/pkg/daprrp/processors/statestores/processor.go index 7b242d6934..5275e92864 100644 --- a/pkg/daprrp/processors/statestores/processor.go +++ b/pkg/daprrp/processors/statestores/processor.go @@ -29,7 +29,9 @@ import ( rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" "github.com/radius-project/radius/pkg/ucp/resources" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime_client "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -101,3 +103,37 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.DaprStateSt return nil } + +// Delete implements the processors.Processor interface for DaprStateStore resources. If the resource is being +// provisioned manually, it deletes the Dapr component in Kubernetes. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.DaprStateStore, options processors.Options) error { + if resource.Properties.ResourceProvisioning != portableresources.ResourceProvisioningManual { + // If the resource was provisioned by recipe then we expect the recipe engine to delete the Dapr Component + // in Kubernetes. At this point we're done so we can just return. + return nil + } + + applicationID, err := resources.ParseResource(resource.Properties.Application) + if err != nil { + return err // This should already be validated by this point. + } + + component := unstructured.Unstructured{ + Object: map[string]any{ + "apiVersion": dapr.DaprAPIVersion, + "kind": dapr.DaprKind, + "metadata": map[string]any{ + "namespace": options.RuntimeConfiguration.Kubernetes.Namespace, + "name": kubernetes.NormalizeDaprResourceName(resource.Properties.ComponentName), + "labels": kubernetes.MakeDescriptiveDaprLabels(applicationID.Name(), resource.Name, portableresources.DaprStateStoresResourceType), + }, + }, + } + + err = p.Client.Delete(ctx, &component) + if err != nil { + return &processors.ResourceError{Inner: err} + } + + return nil +} diff --git a/pkg/daprrp/processors/statestores/processor_test.go b/pkg/daprrp/processors/statestores/processor_test.go index 3c40e6b2ff..ddb228d04f 100644 --- a/pkg/daprrp/processors/statestores/processor_test.go +++ b/pkg/daprrp/processors/statestores/processor_test.go @@ -158,8 +158,8 @@ func Test_Process(t *testing.T) { generated := &unstructured.Unstructured{ Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", + "apiVersion": dapr.DaprAPIVersion, + "kind": dapr.DaprKind, "metadata": map[string]any{ "namespace": "test-namespace", "name": "test-component", diff --git a/pkg/datastoresrp/processors/mongodatabases/processor.go b/pkg/datastoresrp/processors/mongodatabases/processor.go index 2acce23c5e..3b54fbd52b 100644 --- a/pkg/datastoresrp/processors/mongodatabases/processor.go +++ b/pkg/datastoresrp/processors/mongodatabases/processor.go @@ -52,6 +52,11 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.MongoDataba return nil } +// Delete implements the processors.Processor interface for MongoDatabase resources. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.MongoDatabase, options processors.Options) error { + return nil +} + func (p *Processor) computeConnectionString(resource *datamodel.MongoDatabase) string { connectionString := "mongodb://" diff --git a/pkg/datastoresrp/processors/rediscaches/processor.go b/pkg/datastoresrp/processors/rediscaches/processor.go index 9c04d791a3..94f43bfdfb 100644 --- a/pkg/datastoresrp/processors/rediscaches/processor.go +++ b/pkg/datastoresrp/processors/rediscaches/processor.go @@ -65,6 +65,11 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.RedisCache, return nil } +// Delete implements the processors.Processor interface for RedisCache resources. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.RedisCache, options processors.Options) error { + return nil +} + func (p *Processor) computeSSL(resource *datamodel.RedisCache) bool { return resource.Properties.Port == RedisSSLPort } diff --git a/pkg/datastoresrp/processors/sqldatabases/processor.go b/pkg/datastoresrp/processors/sqldatabases/processor.go index 3b974d2b85..cd5e8768e4 100644 --- a/pkg/datastoresrp/processors/sqldatabases/processor.go +++ b/pkg/datastoresrp/processors/sqldatabases/processor.go @@ -41,6 +41,11 @@ func (p *Processor) Process(ctx context.Context, resource *datamodel.SqlDatabase return nil } +// Delete implements the processors.Processor interface for SQLDatabase resources. +func (p *Processor) Delete(ctx context.Context, resource *datamodel.SqlDatabase, options processors.Options) error { + return nil +} + func (p *Processor) computeConnectionString(resource *datamodel.SqlDatabase) string { var username, password string if resource.Properties.Username != "" { diff --git a/pkg/messagingrp/processors/rabbitmqqueues/processor.go b/pkg/messagingrp/processors/rabbitmqqueues/processor.go index 683ea9e9aa..093b50f8df 100644 --- a/pkg/messagingrp/processors/rabbitmqqueues/processor.go +++ b/pkg/messagingrp/processors/rabbitmqqueues/processor.go @@ -61,6 +61,11 @@ func (p *Processor) Process(ctx context.Context, resource *msg_dm.RabbitMQQueue, return nil } +// Delete implements the processors.Processor interface for RabbitMQQueue resources. +func (p *Processor) Delete(ctx context.Context, resource *msg_dm.RabbitMQQueue, options processors.Options) error { + return nil +} + func (p *Processor) computeURI(resource *msg_dm.RabbitMQQueue) string { rabbitMQProtocol := "amqp" if resource.Properties.TLS { diff --git a/pkg/portableresources/backend/controller/createorupdateresource.go b/pkg/portableresources/backend/controller/createorupdateresource.go index 24a77d94bf..d41de121d2 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource.go +++ b/pkg/portableresources/backend/controller/createorupdateresource.go @@ -48,7 +48,13 @@ func NewCreateOrUpdateResource[P interface { *T rpv1.RadiusResourceModel }, T any](processor processors.ResourceProcessor[P, T], eng engine.Engine, client processors.ResourceClient, configurationLoader configloader.ConfigurationLoader, opts ctrl.Options) (ctrl.Controller, error) { - return &CreateOrUpdateResource[P, T]{ctrl.NewBaseAsyncController(opts), processor, eng, client, configurationLoader}, nil + return &CreateOrUpdateResource[P, T]{ + ctrl.NewBaseAsyncController(opts), + processor, + eng, + client, + configurationLoader, + }, nil } // Run retrieves an existing resource, executes a recipe if needed, loads runtime configuration, diff --git a/pkg/portableresources/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go index 188bca0f75..6a15df3873 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -98,6 +98,11 @@ func (p *SuccessProcessor) Process(ctx context.Context, data *TestResource, opti return nil } +// Delete returns no error. +func (p *SuccessProcessor) Delete(ctx context.Context, data *TestResource, options processors.Options) error { + return nil +} + var successProcessorReference = processors.ResourceProcessor[*TestResource, TestResource](&SuccessProcessor{}) type ErrorProcessor struct { @@ -105,12 +110,16 @@ type ErrorProcessor struct { // Process always returns a processorErr. func (p *ErrorProcessor) Process(ctx context.Context, data *TestResource, options processors.Options) error { - return processorErr + return errProcessor +} + +func (p *ErrorProcessor) Delete(ctx context.Context, data *TestResource, options processors.Options) error { + return nil } var errorProcessorReference = processors.ResourceProcessor[*TestResource, TestResource](&ErrorProcessor{}) -var processorErr = errors.New("processor error") -var configurationErr = errors.New("configuration error") +var errProcessor = errors.New("processor error") +var errConfiguration = errors.New("configuration error") var oldOutputResourceResourceID = "/subscriptions/test-sub/resourceGroups/test-rg/providers/System.Test/testResources/test1" @@ -204,11 +213,11 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { nil, false, nil, - configurationErr, + errConfiguration, nil, nil, nil, - configurationErr, + errConfiguration, }, { "processor-err", @@ -219,10 +228,10 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { false, nil, nil, - processorErr, + errProcessor, nil, nil, - processorErr, + errProcessor, }, { "save-err", diff --git a/pkg/portableresources/backend/controller/deleteresource.go b/pkg/portableresources/backend/controller/deleteresource.go index c8cf805942..d33ed3ea4f 100644 --- a/pkg/portableresources/backend/controller/deleteresource.go +++ b/pkg/portableresources/backend/controller/deleteresource.go @@ -18,39 +18,45 @@ package controller import ( "context" - "fmt" - "strings" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" - ext_dm "github.com/radius-project/radius/pkg/corerp/datamodel" - dapr_dm "github.com/radius-project/radius/pkg/daprrp/datamodel" - ds_dm "github.com/radius-project/radius/pkg/datastoresrp/datamodel" - msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" - "github.com/radius-project/radius/pkg/portableresources" "github.com/radius-project/radius/pkg/portableresources/datamodel" + "github.com/radius-project/radius/pkg/portableresources/processors" "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" "github.com/radius-project/radius/pkg/recipes/engine" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/ucp/resources" ) -var _ ctrl.Controller = (*DeleteResource)(nil) - // DeleteResource is the async operation controller to delete a portable resource. -type DeleteResource struct { +type DeleteResource[P interface { + *T + rpv1.RadiusResourceModel +}, T any] struct { ctrl.BaseController - engine engine.Engine + processor processors.ResourceProcessor[P, T] + engine engine.Engine + configurationLoader configloader.ConfigurationLoader } // NewDeleteResource creates a new DeleteResource controller which is used to delete resources asynchronously. -func NewDeleteResource(opts ctrl.Options, engine engine.Engine) (ctrl.Controller, error) { - return &DeleteResource{ctrl.NewBaseAsyncController(opts), engine}, nil +func NewDeleteResource[P interface { + *T + rpv1.RadiusResourceModel +}, T any](processor processors.ResourceProcessor[P, T], eng engine.Engine, configurationLoader configloader.ConfigurationLoader, opts ctrl.Options) (ctrl.Controller, error) { + return &DeleteResource[P, T]{ + ctrl.NewBaseAsyncController(opts), + processor, + eng, + configurationLoader, + }, nil } // Run retrieves a resource from storage, parses the resource ID, gets the data model, deletes the output // resources, and deletes the resource from storage. It returns an error if any of these steps fail. -func (c *DeleteResource) Run(ctx context.Context, request *ctrl.Request) (ctrl.Result, error) { +func (c *DeleteResource[P, T]) Run(ctx context.Context, request *ctrl.Request) (ctrl.Result, error) { obj, err := c.StorageClient().Get(ctx, request.ResourceID) if err != nil { return ctrl.NewFailedResult(v1.ErrorDetails{Message: err.Error()}), err @@ -62,31 +68,22 @@ func (c *DeleteResource) Run(ctx context.Context, request *ctrl.Request) (ctrl.R return ctrl.Result{}, err } - dataModel, err := getDataModel(id) - if err != nil { - return ctrl.Result{}, err - } - - if err = obj.As(dataModel); err != nil { + data := P(new(T)) + if err = obj.As(data); err != nil { return ctrl.Result{}, err } - resourceDataModel, ok := dataModel.(rpv1.RadiusResourceModel) - if !ok { - return ctrl.NewFailedResult(v1.ErrorDetails{Message: "deployment data model conversion error"}), nil - } - - recipeDataModel, supportsRecipes := dataModel.(datamodel.RecipeDataModel) + recipeDataModel, supportsRecipes := any(data).(datamodel.RecipeDataModel) if supportsRecipes && recipeDataModel.Recipe() != nil { recipeData := recipes.ResourceMetadata{ Name: recipeDataModel.Recipe().Name, - EnvironmentID: resourceDataModel.ResourceMetadata().Environment, - ApplicationID: resourceDataModel.ResourceMetadata().Application, + EnvironmentID: data.ResourceMetadata().Environment, + ApplicationID: data.ResourceMetadata().Application, Parameters: recipeDataModel.Recipe().Parameters, ResourceID: id.String(), } - err = c.engine.Delete(ctx, recipeData, resourceDataModel.OutputResources()) + err = c.engine.Delete(ctx, recipeData, data.OutputResources()) if err != nil { if recipeError, ok := err.(*recipes.RecipeError); ok { return ctrl.NewFailedResult(recipeError.ErrorDetails), nil @@ -95,6 +92,19 @@ func (c *DeleteResource) Run(ctx context.Context, request *ctrl.Request) (ctrl.R } } + // Load details about the runtime for the processor to access. + runtimeConfiguration, err := c.loadRuntimeConfiguration(ctx, data.ResourceMetadata().Environment, data.ResourceMetadata().Application, data.GetBaseResource().ID) + if err != nil { + return ctrl.Result{}, err + } + + err = c.processor.Delete(ctx, data, processors.Options{ + RuntimeConfiguration: *runtimeConfiguration, + }) + if err != nil { + return ctrl.Result{}, err + } + err = c.StorageClient().Delete(ctx, request.ResourceID) if err != nil { return ctrl.Result{}, err @@ -103,26 +113,12 @@ func (c *DeleteResource) Run(ctx context.Context, request *ctrl.Request) (ctrl.R return ctrl.Result{}, err } -func getDataModel(id resources.ID) (v1.ResourceDataModel, error) { - resourceType := strings.ToLower(id.Type()) - switch resourceType { - case strings.ToLower(portableresources.MongoDatabasesResourceType): - return &ds_dm.MongoDatabase{}, nil - case strings.ToLower(portableresources.RedisCachesResourceType): - return &ds_dm.RedisCache{}, nil - case strings.ToLower(portableresources.SqlDatabasesResourceType): - return &ds_dm.SqlDatabase{}, nil - case strings.ToLower(portableresources.DaprStateStoresResourceType): - return &dapr_dm.DaprStateStore{}, nil - case strings.ToLower(portableresources.RabbitMQQueuesResourceType): - return &msg_dm.RabbitMQQueue{}, nil - case strings.ToLower(portableresources.DaprSecretStoresResourceType): - return &dapr_dm.DaprSecretStore{}, nil - case strings.ToLower(portableresources.DaprPubSubBrokersResourceType): - return &dapr_dm.DaprPubSubBroker{}, nil - case strings.ToLower(portableresources.ExtendersResourceType): - return &ext_dm.Extender{}, nil - default: - return nil, fmt.Errorf("async delete operation unsupported on resource type: %q. Resource ID: %q", resourceType, id.String()) +func (c *DeleteResource[P, T]) loadRuntimeConfiguration(ctx context.Context, environmentID string, applicationID string, resourceID string) (*recipes.RuntimeConfiguration, error) { + metadata := recipes.ResourceMetadata{EnvironmentID: environmentID, ApplicationID: applicationID, ResourceID: resourceID} + config, err := c.configurationLoader.LoadConfiguration(ctx, metadata) + if err != nil { + return nil, err } + + return &config.Runtime, nil } diff --git a/pkg/portableresources/backend/controller/deleteresource_test.go b/pkg/portableresources/backend/controller/deleteresource_test.go index a005bc3214..e101f56525 100644 --- a/pkg/portableresources/backend/controller/deleteresource_test.go +++ b/pkg/portableresources/backend/controller/deleteresource_test.go @@ -27,6 +27,7 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" "github.com/radius-project/radius/pkg/recipes/engine" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/to" @@ -43,11 +44,11 @@ var outputResource = rpv1.OutputResource{ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { resourceID := "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Datastores/mongoDatabases/mongo0" - setupTest := func(tb testing.TB) (func(tb testing.TB), *store.MockStorageClient, *ctrl.Request, *engine.MockEngine) { + setupTest := func(tb testing.TB) (func(tb testing.TB), *store.MockStorageClient, *ctrl.Request, *engine.MockEngine, *configloader.MockConfigurationLoader) { mctrl := gomock.NewController(t) - msc := store.NewMockStorageClient(mctrl) eng := engine.NewMockEngine(mctrl) + cfg := configloader.NewMockConfigurationLoader(mctrl) req := &ctrl.Request{ OperationID: uuid.New(), @@ -59,7 +60,7 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { return func(tb testing.TB) { mctrl.Finish() - }, msc, req, eng + }, msc, req, eng, cfg } t.Parallel() @@ -78,7 +79,7 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { for _, tt := range deleteCases { t.Run(tt.desc, func(t *testing.T) { - teardownTest, msc, req, eng := setupTest(t) + teardownTest, msc, req, eng, configLoader := setupTest(t) defer teardownTest(t) status := rpv1.ResourceStatus{ @@ -125,6 +126,21 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { Return(tt.engDelErr). Times(1) if tt.engDelErr == nil { + configLoader.EXPECT(). + LoadConfiguration(gomock.Any(), gomock.Any()). + Return( + &recipes.Configuration{ + Runtime: recipes.RuntimeConfiguration{ + Kubernetes: &recipes.KubernetesRuntime{ + Namespace: "test-namespace", + EnvironmentNamespace: "test-env-namespace", + }, + }, + }, + nil, + ). + Times(1) + msc.EXPECT(). Delete(gomock.Any(), gomock.Any()). Return(tt.scDelErr). @@ -135,7 +151,7 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { StorageClient: msc, } - ctrl, err := NewDeleteResource(opts, eng) + ctrl, err := NewDeleteResource(successProcessorReference, eng, configLoader, opts) require.NoError(t, err) _, err = ctrl.Run(context.Background(), req) @@ -148,47 +164,3 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { }) } } - -func TestDeleteResourceRunInvalidResourceType_20220315PrivatePreview(t *testing.T) { - - setupTest := func(tb testing.TB) (func(tb testing.TB), *store.MockStorageClient, *ctrl.Request, *gomock.Controller) { - mctrl := gomock.NewController(t) - - msc := store.NewMockStorageClient(mctrl) - - req := &ctrl.Request{ - OperationID: uuid.New(), - OperationType: "APPLICATIONS.DAPR/INVALID|DELETE", - ResourceID: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/invalidType/invalid", - CorrelationID: uuid.NewString(), - OperationTimeout: &ctrl.DefaultAsyncOperationTimeout, - } - - return func(tb testing.TB) { - mctrl.Finish() - }, msc, req, mctrl - } - - t.Parallel() - - t.Run("deleting-invalid-resource", func(t *testing.T) { - teardownTest, msc, req, mctrl := setupTest(t) - defer teardownTest(t) - - msc.EXPECT(). - Get(gomock.Any(), gomock.Any()). - Return(&store.Object{}, nil). - Times(1) - opts := ctrl.Options{ - StorageClient: msc, - } - - eng := engine.NewMockEngine(mctrl) - ctrl, err := NewDeleteResource(opts, eng) - require.NoError(t, err) - - _, err = ctrl.Run(context.Background(), req) - require.Error(t, err) - require.Equal(t, "async delete operation unsupported on resource type: \"applications.dapr/invalidtype\". Resource ID: \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/radius-test-rg/providers/Applications.Dapr/invalidType/invalid\"", err.Error()) - }) -} diff --git a/pkg/portableresources/backend/service.go b/pkg/portableresources/backend/service.go index 72e40542a4..440765cc94 100644 --- a/pkg/portableresources/backend/service.go +++ b/pkg/portableresources/backend/service.go @@ -103,37 +103,87 @@ func (s *Service) Run(ctx context.Context) error { // resourceTypes is the array that holds resource types that needs async processing. // We use this array to register backend controllers for each resource. resourceTypes := []struct { - TypeName string - CreatePutController func(options ctrl.Options) (ctrl.Controller, error) + TypeName string + CreatePutController func(options ctrl.Options) (ctrl.Controller, error) + CreateDeleteController func(options ctrl.Options) (ctrl.Controller, error) }{ - {portableresources.RabbitMQQueuesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &rabbitmqqueues.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, client, configLoader, options) - }}, - {portableresources.DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &statestores.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, client, configLoader, options) - }}, - {portableresources.DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &secretstores.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, client, configLoader, options) - }}, - {portableresources.DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &pubsubbrokers.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, client, configLoader, options) - }}, - {portableresources.MongoDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &mongo_prc.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](processor, engine, client, configLoader, options) - }}, - {portableresources.RedisCachesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &redis_prc.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.RedisCache, ds_dm.RedisCache](processor, engine, client, configLoader, options) - }}, - {portableresources.SqlDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &sql_prc.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](processor, engine, client, configLoader, options) - }}, + { + portableresources.RabbitMQQueuesResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &rabbitmqqueues.Processor{} + return backend_ctrl.NewCreateOrUpdateResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &rabbitmqqueues.Processor{} + return backend_ctrl.NewDeleteResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, configLoader, options) + }, + }, + { + portableresources.DaprStateStoresResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &statestores.Processor{Client: s.KubeClient} + return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &statestores.Processor{Client: s.KubeClient} + return backend_ctrl.NewDeleteResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, configLoader, options) + }, + }, + { + portableresources.DaprSecretStoresResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &secretstores.Processor{Client: s.KubeClient} + return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &secretstores.Processor{Client: s.KubeClient} + return backend_ctrl.NewDeleteResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, configLoader, options) + }, + }, + { + portableresources.DaprPubSubBrokersResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &pubsubbrokers.Processor{Client: s.KubeClient} + return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &pubsubbrokers.Processor{Client: s.KubeClient} + return backend_ctrl.NewDeleteResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, configLoader, options) + }, + }, + { + portableresources.MongoDatabasesResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &mongo_prc.Processor{} + return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &mongo_prc.Processor{} + return backend_ctrl.NewDeleteResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](processor, engine, configLoader, options) + }, + }, + { + portableresources.RedisCachesResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &redis_prc.Processor{} + return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.RedisCache, ds_dm.RedisCache](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &redis_prc.Processor{} + return backend_ctrl.NewDeleteResource[*ds_dm.RedisCache, ds_dm.RedisCache](processor, engine, configLoader, options) + }, + }, + { + portableresources.SqlDatabasesResourceType, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &sql_prc.Processor{} + return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](processor, engine, client, configLoader, options) + }, + func(options ctrl.Options) (ctrl.Controller, error) { + processor := &sql_prc.Processor{} + return backend_ctrl.NewDeleteResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](processor, engine, configLoader, options) + }, + }, } opts := ctrl.Options{ @@ -143,17 +193,17 @@ func (s *Service) Run(ctx context.Context) error { for _, rt := range resourceTypes { // Register controllers - err = s.Controllers.Register(ctx, rt.TypeName, v1.OperationDelete, func(options ctrl.Options) (ctrl.Controller, error) { - return backend_ctrl.NewDeleteResource(options, engine) - }, opts) + err = s.Controllers.Register(ctx, rt.TypeName, v1.OperationDelete, rt.CreateDeleteController, opts) if err != nil { return err } + err = s.Controllers.Register(ctx, rt.TypeName, v1.OperationPut, rt.CreatePutController, opts) if err != nil { return err } } + workerOpts := worker.Options{} if s.Options.Config.WorkerServer != nil { if s.Options.Config.WorkerServer.MaxOperationConcurrency != nil { diff --git a/pkg/portableresources/processors/types.go b/pkg/portableresources/processors/types.go index 56224318d2..78f9c1cb44 100644 --- a/pkg/portableresources/processors/types.go +++ b/pkg/portableresources/processors/types.go @@ -34,6 +34,9 @@ type ResourceProcessor[P interface { // Process is called to process the results of recipe execution or any other changes to the resource // data model. Process should modify the datamodel in place to perform updates. Process(ctx context.Context, resource P, options Options) error + + // Delete is called to delete all the resources created by the resource processor. + Delete(ctx context.Context, resource P, options Options) error } // Options defines the options passed to the resource processor. diff --git a/pkg/portableresources/renderers/dapr/generic.go b/pkg/portableresources/renderers/dapr/generic.go index 54106785e5..4fe26dbc9c 100644 --- a/pkg/portableresources/renderers/dapr/generic.go +++ b/pkg/portableresources/renderers/dapr/generic.go @@ -66,8 +66,8 @@ func ConstructDaprGeneric(daprGeneric DaprGeneric, namespace string, componentNa // Translate into Dapr State Store schema item := unstructured.Unstructured{ Object: map[string]any{ - "apiVersion": "dapr.io/v1alpha1", - "kind": "Component", + "apiVersion": DaprAPIVersion, + "kind": DaprKind, "metadata": map[string]any{ "namespace": namespace, "name": kubernetes.NormalizeDaprResourceName(componentName), diff --git a/pkg/portableresources/renderers/dapr/types.go b/pkg/portableresources/renderers/dapr/types.go new file mode 100644 index 0000000000..c5819752f7 --- /dev/null +++ b/pkg/portableresources/renderers/dapr/types.go @@ -0,0 +1,22 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dapr + +const ( + DaprAPIVersion = "dapr.io/v1alpha1" + DaprKind = "Component" +) diff --git a/test/functional/daprrp/common.go b/test/functional/daprrp/common.go new file mode 100644 index 0000000000..866a921d04 --- /dev/null +++ b/test/functional/daprrp/common.go @@ -0,0 +1,53 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package resource_test + +import ( + "context" + "testing" + + "github.com/radius-project/radius/pkg/cli/clients" + "github.com/radius-project/radius/pkg/cli/clients_new/generated" + "github.com/radius-project/radius/test/functional/shared" + + "github.com/stretchr/testify/require" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" +) + +func verifyDaprComponentsDeleted(ctx context.Context, t *testing.T, test shared.RPTest, resourceType, resourceName, namespace string) { + resource, err := test.Options.ManagementClient.ShowResource(ctx, resourceType, resourceName) + require.Error(t, err) + require.True(t, clients.Is404Error(err)) + require.Equal(t, generated.GenericResource{}, resource) + + dynamicClient, err := dynamic.NewForConfig(test.Options.K8sConfig) + require.NoError(t, err) + + gvr := schema.GroupVersionResource{ + Group: "dapr.io", + Version: "v1alpha1", + Resource: "components", + } + + resourceList, err := dynamicClient.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{ + LabelSelector: "radius.dev/resource=" + resourceName, + }) + require.NoError(t, err) + require.Equal(t, 0, len(resourceList.Items)) +} diff --git a/test/functional/daprrp/dapr_pubsub_test.go b/test/functional/daprrp/dapr_pubsub_test.go index 7b286c74ae..e06d2664bb 100644 --- a/test/functional/daprrp/dapr_pubsub_test.go +++ b/test/functional/daprrp/dapr_pubsub_test.go @@ -17,6 +17,7 @@ limitations under the License. package resource_test import ( + "context" "fmt" "testing" @@ -56,14 +57,25 @@ func Test_DaprPubSubBroker_Manual(t *testing.T) { Namespaces: map[string][]validation.K8sObject{ appNamespace: { validation.NewK8sPodForResource(name, "dpsb-manual-app-ctnr"), - validation.NewK8sPodForResource(name, "dpsb-manual-redis").ValidateLabels(false), - validation.NewK8sServiceForResource(name, "dpsb-manual-redis").ValidateLabels(false), + validation.NewK8sPodForResource(name, "dpsb-manual-redis"). + ValidateLabels(false), + validation.NewK8sServiceForResource(name, "dpsb-manual-redis"). + ValidateLabels(false), + + validation.NewDaprComponent(name, "dpsb-manual"). + ValidateLabels(false), }, }, }, }, }) + test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + verifyDaprComponentsDeleted(ctx, t, test, "Applications.Dapr/pubSubBrokers", "dpsb-manual", appNamespace) + } + test.Test(t) } @@ -101,12 +113,22 @@ func Test_DaprPubSubBroker_Recipe(t *testing.T) { K8sObjects: &validation.K8sObjectSet{ Namespaces: map[string][]validation.K8sObject{ appNamespace: { - validation.NewK8sPodForResource(name, "dpsb-recipe-ctnr").ValidateLabels(false), + validation.NewK8sPodForResource(name, "dpsb-recipe-ctnr"). + ValidateLabels(false), + + validation.NewDaprComponent(name, "dpsb-recipe"). + ValidateLabels(false), }, }, }, }, }) + test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + verifyDaprComponentsDeleted(ctx, t, test, "Applications.Dapr/pubSubBrokers", "dpsb-recipe", appNamespace) + } + test.Test(t) } diff --git a/test/functional/daprrp/dapr_secretstore_test.go b/test/functional/daprrp/dapr_secretstore_test.go index c7665acf31..490b182374 100644 --- a/test/functional/daprrp/dapr_secretstore_test.go +++ b/test/functional/daprrp/dapr_secretstore_test.go @@ -17,6 +17,7 @@ limitations under the License. package resource_test import ( + "context" "testing" "github.com/radius-project/radius/test/functional" @@ -55,13 +56,22 @@ func Test_DaprSecretStore_Manual(t *testing.T) { Namespaces: map[string][]validation.K8sObject{ appNamespace: { validation.NewK8sPodForResource(name, "gnrc-scs-ctnr"), + + // Not sure why we skip validating the labels + validation.NewDaprComponent(name, "gnrc-scs-manual"). + ValidateLabels(false), }, }, }, }, }, shared.K8sSecretResource(appNamespace, "mysecret", "", "fakekey", []byte("fakevalue"))) + test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + verifyDaprComponentsDeleted(ctx, t, test, "Applications.Dapr/secretStores", "gnrc-scs-manual", appNamespace) + } + test.Test(t) } @@ -94,13 +104,22 @@ func Test_DaprSecretStore_Recipe(t *testing.T) { K8sObjects: &validation.K8sObjectSet{ Namespaces: map[string][]validation.K8sObject{ appNamespace: { - validation.NewK8sPodForResource(name, "gnrc-scs-ctnr-recipe").ValidateLabels(false), + validation.NewK8sPodForResource(name, "gnrc-scs-ctnr-recipe"). + ValidateLabels(false), + + validation.NewDaprComponent(name, "gnrc-scs-recipe"). + ValidateLabels(false), }, }, }, }, }, shared.K8sSecretResource(appNamespace, "mysecret", "", "fakekey", []byte("fakevalue"))) + test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + verifyDaprComponentsDeleted(ctx, t, test, "Applications.Dapr/secretStores", "gnrc-scs-recipe", appNamespace) + } + test.Test(t) } diff --git a/test/functional/daprrp/dapr_statestore_test.go b/test/functional/daprrp/dapr_statestore_test.go index 4dc9a5282d..73efcb73d3 100644 --- a/test/functional/daprrp/dapr_statestore_test.go +++ b/test/functional/daprrp/dapr_statestore_test.go @@ -17,6 +17,7 @@ limitations under the License. package resource_test import ( + "context" "fmt" "testing" @@ -58,14 +59,25 @@ func Test_DaprStateStore_Manual(t *testing.T) { validation.NewK8sPodForResource(name, "dapr-sts-manual-ctnr"), // Deployed as supporting resources using Kubernetes Bicep extensibility. - validation.NewK8sPodForResource(name, "dapr-sts-manual-redis").ValidateLabels(false), - validation.NewK8sServiceForResource(name, "dapr-sts-manual-redis").ValidateLabels(false), + validation.NewK8sPodForResource(name, "dapr-sts-manual-redis"). + ValidateLabels(false), + validation.NewK8sServiceForResource(name, "dapr-sts-manual-redis"). + ValidateLabels(false), + + validation.NewDaprComponent(name, "dapr-sts-manual"). + ValidateLabels(false), }, }, }, }, }) + test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + verifyDaprComponentsDeleted(ctx, t, test, "Applications.Dapr/stateStores", "dapr-sts-manual", appNamespace) + } + test.Test(t) } @@ -103,12 +115,22 @@ func Test_DaprStateStore_Recipe(t *testing.T) { K8sObjects: &validation.K8sObjectSet{ Namespaces: map[string][]validation.K8sObject{ appNamespace: { - validation.NewK8sPodForResource(name, "dapr-sts-recipe-ctnr").ValidateLabels(false), + validation.NewK8sPodForResource(name, "dapr-sts-recipe-ctnr"). + ValidateLabels(false), + + validation.NewDaprComponent(name, "dapr-sts-recipe"). + ValidateLabels(false), }, }, }, }, }) + test.RequiredFeatures = []shared.RequiredFeature{shared.FeatureDapr} + + test.PostDeleteVerify = func(ctx context.Context, t *testing.T, test shared.RPTest) { + verifyDaprComponentsDeleted(ctx, t, test, "Applications.Dapr/stateStores", "dapr-sts-recipe", appNamespace) + } + test.Test(t) } diff --git a/test/validation/k8s.go b/test/validation/k8s.go index 0772efd7e1..a75c33d177 100644 --- a/test/validation/k8s.go +++ b/test/validation/k8s.go @@ -593,3 +593,16 @@ func labelsEqual(expectedLabels map[string]string, actualLabels map[string]strin } return true } + +// NewDaprComponent creates a K8sObject for a Dapr component with the Labels set to the application and name. +func NewDaprComponent(application string, name string) K8sObject { + return K8sObject{ + GroupVersionResource: schema.GroupVersionResource{ + Group: "dapr.io", + Version: "v1alpha1", + Resource: "components", + }, + Kind: "Component", + Labels: kuberneteskeys.MakeSelectorLabels(application, name), + } +} From bf98a6bdbc43c8bdef1b7c75f8f2eba73cd73df7 Mon Sep 17 00:00:00 2001 From: nithyatsu <98416062+nithyatsu@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:30:48 -0700 Subject: [PATCH 53/57] support servicePort different from containerPort (#6234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Add support for "port" in ``` ports: { web: { containerPort: 5000 port: 80 // optional: only needs to be set when a value different from containerPort is desired protocol: 'TCP' // optional: defaults to TCP scheme: 'http' // optional: used to build URLs, defaults to http or https based on port } } ``` ref: https://github.com/radius-project/radius/issues/3865 ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at 33de0af ### Summary 🧪🐛✨ This pull request adds support for service port values for container ports in the `corerp` package. It updates the `containerPorts` struct and the `generateService` function to render the `Port` and `TargetPort` fields in the service spec. It also modifies a test function in `render_test.go` to cover this feature. > _Sing, O Muse, of the skillful coder who devised_ > _A clever way to render service ports for containers_ > _And tested well his work with inputs and outputs wise_ > _To please the gods of Kubernetes, the cloud maintainers._ ### Walkthrough * Fix typo in error message for invalid ports definition ([link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L186-R197)) * Add service port values to container ports struct and append them from input map ([link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L245-R252), [link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636R259), [link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L275-R284)) * Use service port values instead of container port values for service port field in `generateService` function and add debug print ([link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-3da981bf20df07918a646eafcd867d6c95abac1f3aef1ed1b50a29f3f4cc8636L288-R299)) * Update test values and expected output for container port and service port in `Test_DNS_Service_Generation` function in `render_test.go` ([link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94L1522-R1523), [link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94R1534), [link](https://github.com/radius-project/radius/pull/6234/files?diff=unified&w=0#diff-6f1219f263ab06a1493ac76960e2ab8cbe647e83e926bff7d13988f393334f94L1549-R1552)) --- pkg/corerp/renderers/container/render.go | 44 ++++++++----------- pkg/corerp/renderers/container/render_test.go | 8 ++-- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/pkg/corerp/renderers/container/render.go b/pkg/corerp/renderers/container/render.go index a680a81af8..e93338f3c6 100644 --- a/pkg/corerp/renderers/container/render.go +++ b/pkg/corerp/renderers/container/render.go @@ -183,11 +183,16 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options } } - for _, port := range properties.Container.Ports { + for portName, port := range properties.Container.Ports { // if the container has an exposed port, note that down. // A single service will be generated for a container with one or more exposed ports. if port.ContainerPort == 0 { - return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid ports definition: must define a ContainerPort, but ContainerPort was: %d.", port.ContainerPort)) + return renderers.RendererOutput{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid ports definition: must define a ContainerPort, but ContainerPort is: %d.", port.ContainerPort)) + } + + if port.Port == 0 { + port.Port = port.ContainerPort + properties.Container.Ports[portName] = port } // if the container has an exposed port, but no 'provides' field, it requires DNS service generation. @@ -239,26 +244,27 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options outputResources = append(outputResources, r.makeSecret(ctx, *resource, appId.Name(), secretData, options)) } + var servicePorts []corev1.ServicePort + // If the container has an exposed port and uses DNS-SD, generate a service for it. if needsServiceGeneration { - containerPorts := containerPorts{ - values: []int32{}, - names: []string{}, - } - for portName, port := range resource.Properties.Container.Ports { // store portNames and portValues for use in service generation. - containerPorts.names = append(containerPorts.names, portName) - containerPorts.values = append(containerPorts.values, port.ContainerPort) + servicePort := corev1.ServicePort{ + Name: portName, + Port: port.Port, + TargetPort: intstr.FromInt(int(port.ContainerPort)), + Protocol: corev1.ProtocolTCP, + } + servicePorts = append(servicePorts, servicePort) } // if a container has an exposed port, then we need to create a service for it. basesrv := getServiceBase(baseManifest, appId.Name(), resource, &options) - serviceResource, err := r.makeService(basesrv, resource, options, ctx, containerPorts) + serviceResource, err := r.makeService(basesrv, resource, options, ctx, servicePorts) if err != nil { return renderers.RendererOutput{}, err } - outputResources = append(outputResources, serviceResource) } @@ -271,12 +277,7 @@ func (r Renderer) Render(ctx context.Context, dm v1.DataModelInterface, options }, nil } -type containerPorts struct { - values []int32 - names []string -} - -func (r Renderer) makeService(base *corev1.Service, resource *datamodel.ContainerResource, options renderers.RenderOptions, ctx context.Context, containerPorts containerPorts) (rpv1.OutputResource, error) { +func (r Renderer) makeService(base *corev1.Service, resource *datamodel.ContainerResource, options renderers.RenderOptions, ctx context.Context, servicePorts []corev1.ServicePort) (rpv1.OutputResource, error) { appId, err := resources.ParseResource(resource.Properties.Application) if err != nil { return rpv1.OutputResource{}, v1.NewClientErrInvalidRequest(fmt.Sprintf("invalid application id: %s. id: %s", err.Error(), resource.Properties.Application)) @@ -284,14 +285,7 @@ func (r Renderer) makeService(base *corev1.Service, resource *datamodel.Containe // Ensure that we don't have any duplicate ports. SKIPINSERT: - for i, port := range containerPorts.values { - newPort := corev1.ServicePort{ - Name: containerPorts.names[i], - Port: port, - TargetPort: intstr.FromInt(int(containerPorts.values[i])), - Protocol: corev1.ProtocolTCP, - } - + for _, newPort := range servicePorts { // Skip to add new port. Instead, upsert port if it already exists. for j, p := range base.Spec.Ports { if strings.EqualFold(p.Name, newPort.Name) || p.Port == newPort.Port || p.TargetPort.IntVal == newPort.TargetPort.IntVal { diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go index de3673af7a..6bb274415d 100644 --- a/pkg/corerp/renderers/container/render_test.go +++ b/pkg/corerp/renderers/container/render_test.go @@ -1538,7 +1538,8 @@ func Test_ParseURL(t *testing.T) { } func Test_DNS_Service_Generation(t *testing.T) { - var containerPortNumber int32 = 80 + var containerPortNumber int32 = 3000 + var servicePortNumber int32 = 80 t.Run("verify service generation", func(t *testing.T) { properties := datamodel.ContainerProperties{ BasicResourceProperties: rpv1.BasicResourceProperties{ @@ -1549,6 +1550,7 @@ func Test_DNS_Service_Generation(t *testing.T) { Ports: map[string]datamodel.ContainerPort{ "web": { ContainerPort: int32(containerPortNumber), + Port: int32(servicePortNumber), }, }, }, @@ -1565,8 +1567,8 @@ func Test_DNS_Service_Generation(t *testing.T) { expectedServicePort := corev1.ServicePort{ Name: "web", - Port: containerPortNumber, - TargetPort: intstr.FromInt(80), + Port: 80, + TargetPort: intstr.FromInt(int(containerPortNumber)), Protocol: "TCP", } From aeb267d0f50e89a98b3ca9c41644ab75e7c08241 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Fri, 8 Sep 2023 15:14:08 -0700 Subject: [PATCH 54/57] Move Dapr test files under daprrp/resources (#6240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Dapr _test.go files are under daprrp package instead of the daprrp/resources location. Moving these files so they are consistent with the other rp functional test structures. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 3a3aa6d ### Summary 🔧📁🚚 Moved and renamed test files and bicep files for Dapr resources to a new subdirectory and updated the references in the test code. This makes the test code more organized and consistent with the naming convention for Dapr resources. ### Walkthrough * Updated template paths to reflect new location of bicep files after moving test files to resources subdirectory ([link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-62351f7dd4881272041611c39fd5f275ac255529fe3ff99143232ae376e23605L29-R29), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-ff5eda5a82d6f745eb41d6b3c9fa5c8905ddf5a53afb464c04ae69b363186d6cL31-R31), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-ff5eda5a82d6f745eb41d6b3c9fa5c8905ddf5a53afb464c04ae69b363186d6cL83-R83), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-83abcb90756fde07a7163fb12a1c3418edd97afae0e6803e5d91fc72529db36dL30-R30), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-83abcb90756fde07a7163fb12a1c3418edd97afae0e6803e5d91fc72529db36dL79-R79), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-2b9e836ebf4b278de63298cd34643b88f6e6a9b4330daf2d1ba23967bb989b6dL29-R29), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-76b95c6cdc2b6c63edfb330450c6fe417de962651ae89502e88af3b31555272aL31-R31), [link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-76b95c6cdc2b6c63edfb330450c6fe417de962651ae89502e88af3b31555272aL85-R85)) * Renamed `common.go` to `resources/common.go` to match the new file structure ([link](https://github.com/radius-project/radius/pull/6240/files?diff=unified&w=0#diff-35782514faac29840c6692df8527f2d1b3717c78aaa5409bee25c72590a9a0fd)) --- test/functional/daprrp/{ => resources}/common.go | 0 .../{ => resources}/dapr_component_name_conflict_test.go | 2 +- test/functional/daprrp/{ => resources}/dapr_pubsub_test.go | 4 ++-- .../daprrp/{ => resources}/dapr_secretstore_test.go | 4 ++-- .../daprrp/{ => resources}/dapr_serviceinvocation_test.go | 2 +- .../functional/daprrp/{ => resources}/dapr_statestore_test.go | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename test/functional/daprrp/{ => resources}/common.go (100%) rename test/functional/daprrp/{ => resources}/dapr_component_name_conflict_test.go (95%) rename test/functional/daprrp/{ => resources}/dapr_pubsub_test.go (96%) rename test/functional/daprrp/{ => resources}/dapr_secretstore_test.go (96%) rename test/functional/daprrp/{ => resources}/dapr_serviceinvocation_test.go (96%) rename test/functional/daprrp/{ => resources}/dapr_statestore_test.go (96%) diff --git a/test/functional/daprrp/common.go b/test/functional/daprrp/resources/common.go similarity index 100% rename from test/functional/daprrp/common.go rename to test/functional/daprrp/resources/common.go diff --git a/test/functional/daprrp/dapr_component_name_conflict_test.go b/test/functional/daprrp/resources/dapr_component_name_conflict_test.go similarity index 95% rename from test/functional/daprrp/dapr_component_name_conflict_test.go rename to test/functional/daprrp/resources/dapr_component_name_conflict_test.go index b8f396552d..acdd7049a2 100644 --- a/test/functional/daprrp/dapr_component_name_conflict_test.go +++ b/test/functional/daprrp/resources/dapr_component_name_conflict_test.go @@ -26,7 +26,7 @@ import ( ) func Test_DaprComponentNameConflict(t *testing.T) { - template := "resources/testdata/daprrp-resources-component-name-conflict.bicep" + template := "testdata/daprrp-resources-component-name-conflict.bicep" name := "daprrp-rs-component-name-conflict" validate := step.ValidateSingleDetail("DeploymentFailed", step.DeploymentErrorDetail{ diff --git a/test/functional/daprrp/dapr_pubsub_test.go b/test/functional/daprrp/resources/dapr_pubsub_test.go similarity index 96% rename from test/functional/daprrp/dapr_pubsub_test.go rename to test/functional/daprrp/resources/dapr_pubsub_test.go index e06d2664bb..f53b039e5e 100644 --- a/test/functional/daprrp/dapr_pubsub_test.go +++ b/test/functional/daprrp/resources/dapr_pubsub_test.go @@ -28,7 +28,7 @@ import ( ) func Test_DaprPubSubBroker_Manual(t *testing.T) { - template := "resources/testdata/daprrp-resources-pubsub-broker-manual.bicep" + template := "testdata/daprrp-resources-pubsub-broker-manual.bicep" name := "dpsb-manual-app" appNamespace := "default-dpsb-manual-app" @@ -80,7 +80,7 @@ func Test_DaprPubSubBroker_Manual(t *testing.T) { } func Test_DaprPubSubBroker_Recipe(t *testing.T) { - template := "resources/testdata/daprrp-resources-pubsub-broker-recipe.bicep" + template := "testdata/daprrp-resources-pubsub-broker-recipe.bicep" name := "dpsb-recipe-app" appNamespace := "dpsb-recipe-env" diff --git a/test/functional/daprrp/dapr_secretstore_test.go b/test/functional/daprrp/resources/dapr_secretstore_test.go similarity index 96% rename from test/functional/daprrp/dapr_secretstore_test.go rename to test/functional/daprrp/resources/dapr_secretstore_test.go index 490b182374..a7ac14ed7a 100644 --- a/test/functional/daprrp/dapr_secretstore_test.go +++ b/test/functional/daprrp/resources/dapr_secretstore_test.go @@ -27,7 +27,7 @@ import ( ) func Test_DaprSecretStore_Manual(t *testing.T) { - template := "resources/testdata/daprrp-resources-secretstore-manual.bicep" + template := "testdata/daprrp-resources-secretstore-manual.bicep" name := "daprrp-rs-secretstore-manual" appNamespace := "default-daprrp-rs-secretstore-manual" @@ -76,7 +76,7 @@ func Test_DaprSecretStore_Manual(t *testing.T) { } func Test_DaprSecretStore_Recipe(t *testing.T) { - template := "resources/testdata/daprrp-resources-secretstore-recipe.bicep" + template := "testdata/daprrp-resources-secretstore-recipe.bicep" name := "daprrp-rs-secretstore-recipe" appNamespace := "daprrp-rs-secretstore-recipe" diff --git a/test/functional/daprrp/dapr_serviceinvocation_test.go b/test/functional/daprrp/resources/dapr_serviceinvocation_test.go similarity index 96% rename from test/functional/daprrp/dapr_serviceinvocation_test.go rename to test/functional/daprrp/resources/dapr_serviceinvocation_test.go index 0bea322e1a..b20f663922 100644 --- a/test/functional/daprrp/dapr_serviceinvocation_test.go +++ b/test/functional/daprrp/resources/dapr_serviceinvocation_test.go @@ -26,7 +26,7 @@ import ( ) func Test_DaprServiceInvocation(t *testing.T) { - template := "resources/testdata/daprrp-resources-serviceinvocation.bicep" + template := "testdata/daprrp-resources-serviceinvocation.bicep" name := "dapr-serviceinvocation" appNamespace := "default-dapr-serviceinvocation" diff --git a/test/functional/daprrp/dapr_statestore_test.go b/test/functional/daprrp/resources/dapr_statestore_test.go similarity index 96% rename from test/functional/daprrp/dapr_statestore_test.go rename to test/functional/daprrp/resources/dapr_statestore_test.go index 73efcb73d3..50b80d1e5b 100644 --- a/test/functional/daprrp/dapr_statestore_test.go +++ b/test/functional/daprrp/resources/dapr_statestore_test.go @@ -28,7 +28,7 @@ import ( ) func Test_DaprStateStore_Manual(t *testing.T) { - template := "resources/testdata/daprrp-resources-statestore-manual.bicep" + template := "testdata/daprrp-resources-statestore-manual.bicep" name := "daprrp-rs-statestore-manual" appNamespace := "default-daprrp-rs-statestore-manual" @@ -82,7 +82,7 @@ func Test_DaprStateStore_Manual(t *testing.T) { } func Test_DaprStateStore_Recipe(t *testing.T) { - template := "resources/testdata/daprrp-resources-statestore-recipe.bicep" + template := "testdata/daprrp-resources-statestore-recipe.bicep" name := "daprrp-rs-sts-recipe" appNamespace := "daprrp-env-recipes-env" From e58dbc7a05901e4026afefd1a31d25a6c37b80b5 Mon Sep 17 00:00:00 2001 From: Yetkin Timocin Date: Fri, 8 Sep 2023 17:25:51 -0700 Subject: [PATCH 55/57] Adding error codes as attributes to the Recipe Engine and Driver metrics (#6205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description Adding error codes as attributes to the Recipe Engine and Driver metrics ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary ### 🤖 Generated by Copilot at c046059 ### Summary 📊🚚🐛 This pull request improves the error handling and reporting in the `recipes` package by using consistent and descriptive error codes and metrics. It also updates the test cases and the `bicep` and `terraform` drivers to use the new error codes and metrics. > _`engine.go` changes_ > _better errors and metrics_ > _autumn of bugs ends_ ### Walkthrough * Add more descriptive and consistent error codes for recipe failures ([link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-4811c2c3581e1effba7ad029717fa82713a8e3a58b848b3845cfaf7d6a44fbacR37-R42), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L72-R79), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L117-R126), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L276-R276), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L438-R438)) * Use error codes from `GetRecipeErrorDetails` to record metrics in `engine.go` ([link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L58-R64), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L103-R111)) * Use `RecipeDownloadFailed` instead of `FailedOperationState` to record recipe download metrics in `bicep.go` and `execute.go` ([link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L81-R81), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482L295-R295)) --- grafana/radius-resource-provider-dashboard.json | 2 +- pkg/recipes/driver/bicep.go | 2 +- pkg/recipes/engine/engine.go | 6 ++++++ pkg/recipes/terraform/execute.go | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/grafana/radius-resource-provider-dashboard.json b/grafana/radius-resource-provider-dashboard.json index 0fa27e6c99..334ac2d942 100644 --- a/grafana/radius-resource-provider-dashboard.json +++ b/grafana/radius-resource-provider-dashboard.json @@ -1922,7 +1922,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "(sum(rate(recipe_operation_duration_count{operation_state=\"failed\"}[$__rate_interval])) by (recipe_template_path, operation_type)) / (sum(rate(recipe_operation_duration_count[$__rate_interval])) by (recipe_template_path, operation_type))", + "expr": "(sum(rate(recipe_operation_duration_count{operation_state!=\"success\"}[$__rate_interval])) by (recipe_template_path, operation_type)) / (sum(rate(recipe_operation_duration_count[$__rate_interval])) by (recipe_template_path, operation_type))", "format": "time_series", "instant": false, "interval": "", diff --git a/pkg/recipes/driver/bicep.go b/pkg/recipes/driver/bicep.go index c110194a7b..45fde7c048 100644 --- a/pkg/recipes/driver/bicep.go +++ b/pkg/recipes/driver/bicep.go @@ -78,7 +78,7 @@ func (d *bicepDriver) Execute(ctx context.Context, opts ExecuteOptions) (*recipe err := util.ReadFromRegistry(ctx, opts.Definition.TemplatePath, &recipeData) if err != nil { metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, - metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, opts.Recipe.Name, &opts.Definition, metrics.FailedOperationState)) + metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, opts.Recipe.Name, &opts.Definition, recipes.RecipeDownloadFailed)) return nil, recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, diff --git a/pkg/recipes/engine/engine.go b/pkg/recipes/engine/engine.go index 658b4b544b..100b58b7bd 100644 --- a/pkg/recipes/engine/engine.go +++ b/pkg/recipes/engine/engine.go @@ -55,6 +55,9 @@ func (e *engine) Execute(ctx context.Context, recipe recipes.ResourceMetadata, p recipeOutput, definition, err := e.executeCore(ctx, recipe, prevState) if err != nil { result = metrics.FailedOperationState + if recipes.GetRecipeErrorDetails(err) != nil { + result = recipes.GetRecipeErrorDetails(err).Code + } } metrics.DefaultRecipeEngineMetrics.RecordRecipeOperationDuration(ctx, executionStart, @@ -100,6 +103,9 @@ func (e *engine) Delete(ctx context.Context, recipe recipes.ResourceMetadata, ou definition, err := e.deleteCore(ctx, recipe, outputResources) if err != nil { result = metrics.FailedOperationState + if recipes.GetRecipeErrorDetails(err) != nil { + result = recipes.GetRecipeErrorDetails(err).Code + } } metrics.DefaultRecipeEngineMetrics.RecordRecipeOperationDuration(ctx, deletionStart, diff --git a/pkg/recipes/terraform/execute.go b/pkg/recipes/terraform/execute.go index 59075e5707..234df5ee71 100644 --- a/pkg/recipes/terraform/execute.go +++ b/pkg/recipes/terraform/execute.go @@ -292,7 +292,7 @@ func downloadAndInspect(ctx context.Context, workingDir string, execPath string, if err := downloadModule(ctx, workingDir, execPath); err != nil { metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, metrics.NewRecipeAttributes(metrics.RecipeEngineOperationDownloadRecipe, options.EnvRecipe.Name, - options.EnvRecipe, metrics.FailedOperationState)) + options.EnvRecipe, recipes.RecipeDownloadFailed)) return nil, recipes.NewRecipeError(recipes.RecipeDownloadFailed, err.Error(), recipes.GetRecipeErrorDetails(err)) } metrics.DefaultRecipeEngineMetrics.RecordRecipeDownloadDuration(ctx, downloadStartTime, From 2606ade7e2e0c687891629a76e943f7694503383 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Sat, 9 Sep 2023 19:33:31 -0700 Subject: [PATCH 56/57] Simplify API route registration (#5851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description * Goal: This PR introduces new abstraction layer to register frontend and backend controllers in the single place. * The abstraction layer is applied to only Core RP. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #6207 ## Auto-generated summary ### 🤖 Generated by Copilot at 012d647 ### Summary 🚀🛠️🌐 This pull request adds the core functionality and configuration for the radius resource provider service. It implements the data model converters, the main entry point, the service configuration files, the API and async worker services, and the resource type handlers and converters for the environments and containers resources. > _`radius` service_ > _configures and converts types_ > _spring cleaning code_ ### Walkthrough * Add the main.go file for the radius resource provider service ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-fa735479e022c6e49848540a0b9903622e3262f095d616e14bb7c04e50ebcab1R1-R132)) * Add the service configuration files for different environments ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-07e9a95e043dfbe94e4f390db189581952fd2b807d6661c30532c37e12f66ac8R1-R50), [link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-891f6c038d9a9192d8a42aa6f3a3a2256a23e5a0bea53e01e0bbc1fa185cb7f1R1-R37), [link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-17c9124727ad9ae141034516dae9a112fa19d262c8ed4a9cba43941394db0e2fR1-R41)) * Add the types and interfaces for the resource nodes, handlers, and converters ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-aabe1821e79e59f4024d20a4c4a12044b00234673d3056f1b4751f7e2dbab7a4R1-R125)) * Add the setup.go file for setting up the namespace and resource type handlers ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-c6b4dcdeb10a61179403c951a5128398c966e787eb8a429fd225527300c3275cR1-R74)) * Add the apiservice.go file for the API service of the service ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-4236d50bf5038163c457c84cd68eea9c4d6f58d9f3d74de4ff7662b823cc32afR1-R77)) * Add the asyncworker.go file for the async worker service of the service ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-0d8522466cd60aa335c74f53b18be7dfa7ba7cf052d3cd8deb44b3d08646af6bR1-R114)) * Add the wrapper functions for converting the container data model to and from the versioned model ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-595d43d19193d49cdcb642ef52b30c4a22a60bdb9714f0749cf1ff7b9a49990bR27-R30), [link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-595d43d19193d49cdcb642ef52b30c4a22a60bdb9714f0749cf1ff7b9a49990bR44-R47)) * Add the wrapper functions for converting the environment data model to and from the versioned model ([link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-24beaa42c10938adfeb96b798c5f16db5002b40b319d86d2080157b0b95e4d5bR28-R32), [link](https://github.com/project-radius/radius/pull/5851/files?diff=unified&w=0#diff-24beaa42c10938adfeb96b798c5f16db5002b40b319d86d2080157b0b95e4d5bR48-R52)) Co-authored-by: Ryan Nowak --- cmd/applications-rp/main.go | 114 ++-- cmd/applications-rp/portableresource-dev.yaml | 1 + .../portableresource-self-hosted.yaml | 1 + cmd/applications-rp/radius-cloud.yaml | 1 + cmd/applications-rp/radius-dev.yaml | 1 + cmd/applications-rp/radius-self-hosted.yaml | 1 + cmd/ucpd/ucp-self-hosted-dev.yaml | 1 + deploy/Chart/templates/rp/configmaps.yaml | 2 + deploy/Chart/templates/rp/deployment.yaml | 1 - deploy/Chart/templates/ucp/configmaps.yaml | 6 +- .../configSettings.md | 1 + pkg/armrpc/api/v1/types.go | 34 +- .../statusmanager/statusmanager.go | 51 +- .../statusmanager/statusmanager_test.go | 17 +- pkg/armrpc/asyncoperation/worker/registry.go | 2 +- pkg/armrpc/asyncoperation/worker/service.go | 52 +- pkg/armrpc/builder/builder.go | 184 +++++++ pkg/armrpc/builder/builder_test.go | 267 +++++++++ pkg/armrpc/builder/namespace.go | 84 +++ pkg/armrpc/builder/namespace_test.go | 445 +++++++++++++++ pkg/armrpc/builder/node.go | 73 +++ pkg/armrpc/builder/node_test.go | 47 ++ pkg/armrpc/builder/operation.go | 367 +++++++++++++ pkg/armrpc/builder/operation_test.go | 512 ++++++++++++++++++ pkg/armrpc/builder/types.go | 82 +++ pkg/armrpc/frontend/controller/controller.go | 2 +- .../getavailableoperations.go | 50 ++ .../defaultoperation/getoperationresult.go | 18 +- .../getoperationresult_test.go | 49 +- .../testdata/operationstatus_datamodel.json | 4 +- .../testdata/operationstatus_output.json | 4 +- pkg/armrpc/frontend/server/handler.go | 32 +- pkg/armrpc/frontend/server/handler_test.go | 28 + pkg/armrpc/frontend/server/server.go | 18 +- pkg/armrpc/frontend/server/service.go | 9 +- pkg/armrpc/rpctest/routers.go | 69 ++- pkg/armrpc/rpctest/testdatamodel.go | 166 ++++++ pkg/corerp/backend/service.go | 20 +- .../frontend/handler/getoperations_test.go | 78 --- pkg/corerp/frontend/handler/routes_test.go | 4 +- pkg/corerp/frontend/service.go | 98 ---- pkg/corerp/setup/operations.go | 262 +++++++++ pkg/corerp/setup/setup.go | 217 ++++++++ pkg/corerp/setup/setup_test.go | 253 +++++++++ pkg/kubeutil/client.go | 50 ++ pkg/middleware/logger.go | 24 +- .../controller/createorupdateresource.go | 2 +- .../controller/createorupdateresource_test.go | 43 +- .../backend/controller/deleteresource.go | 2 +- .../backend/controller/deleteresource_test.go | 2 +- pkg/portableresources/backend/service.go | 82 ++- .../frontend/handler/routes_test.go | 8 +- pkg/portableresources/frontend/service.go | 8 +- pkg/recipes/controllerconfig/config.go | 85 +++ pkg/server/apiservice.go | 89 +++ pkg/server/asyncworker.go | 97 ++++ pkg/ucp/frontend/api/server.go | 4 +- pkg/ucp/frontend/aws/module.go | 8 + pkg/ucp/frontend/aws/routes.go | 8 +- pkg/ucp/frontend/aws/routes_test.go | 4 +- pkg/ucp/integrationtests/testrp/async.go | 5 +- .../integrationtests/testserver/testserver.go | 5 +- pkg/ucp/queue/provider/factory.go | 10 +- pkg/ucp/queue/provider/options.go | 3 + pkg/ucp/queue/provider/provider.go | 7 +- pkg/ucp/queue/provider/provider_test.go | 6 +- pkg/ucp/server/server.go | 26 +- 67 files changed, 3756 insertions(+), 550 deletions(-) create mode 100644 pkg/armrpc/builder/builder.go create mode 100644 pkg/armrpc/builder/builder_test.go create mode 100644 pkg/armrpc/builder/namespace.go create mode 100644 pkg/armrpc/builder/namespace_test.go create mode 100644 pkg/armrpc/builder/node.go create mode 100644 pkg/armrpc/builder/node_test.go create mode 100644 pkg/armrpc/builder/operation.go create mode 100644 pkg/armrpc/builder/operation_test.go create mode 100644 pkg/armrpc/builder/types.go create mode 100644 pkg/armrpc/frontend/defaultoperation/getavailableoperations.go create mode 100644 pkg/armrpc/rpctest/testdatamodel.go delete mode 100644 pkg/corerp/frontend/handler/getoperations_test.go delete mode 100644 pkg/corerp/frontend/service.go create mode 100644 pkg/corerp/setup/operations.go create mode 100644 pkg/corerp/setup/setup.go create mode 100644 pkg/corerp/setup/setup_test.go create mode 100644 pkg/recipes/controllerconfig/config.go create mode 100644 pkg/server/apiservice.go create mode 100644 pkg/server/asyncworker.go diff --git a/cmd/applications-rp/main.go b/cmd/applications-rp/main.go index 076930b086..57b93a00a0 100644 --- a/cmd/applications-rp/main.go +++ b/cmd/applications-rp/main.go @@ -18,21 +18,25 @@ package main import ( "context" - "flag" "fmt" "log" "os" "os/signal" "syscall" + "github.com/go-logr/logr" + "github.com/spf13/pflag" + etcdclient "go.etcd.io/etcd/client/v3" + runtimelog "sigs.k8s.io/controller-runtime/pkg/log" + + "github.com/radius-project/radius/pkg/armrpc/builder" "github.com/radius-project/radius/pkg/armrpc/hostoptions" - "github.com/radius-project/radius/pkg/corerp/backend" - "github.com/radius-project/radius/pkg/corerp/frontend" metricsservice "github.com/radius-project/radius/pkg/metrics/service" profilerservice "github.com/radius-project/radius/pkg/profiler/service" + "github.com/radius-project/radius/pkg/recipes/controllerconfig" + "github.com/radius-project/radius/pkg/server" "github.com/radius-project/radius/pkg/trace" - "github.com/radius-project/radius/pkg/logging" pr_backend "github.com/radius-project/radius/pkg/portableresources/backend" pr_frontend "github.com/radius-project/radius/pkg/portableresources/frontend" "github.com/radius-project/radius/pkg/ucp/data" @@ -40,53 +44,31 @@ import ( "github.com/radius-project/radius/pkg/ucp/hosting" "github.com/radius-project/radius/pkg/ucp/ucplog" - "github.com/go-logr/logr" - etcdclient "go.etcd.io/etcd/client/v3" - runtimelog "sigs.k8s.io/controller-runtime/pkg/log" + corerp_setup "github.com/radius-project/radius/pkg/corerp/setup" ) -const serviceName = "applications.core" - -func newPortableResourceHosts(configFile string, enableAsyncWorker bool) ([]hosting.Service, *hostoptions.HostOptions, error) { - hostings := []hosting.Service{} - options, err := hostoptions.NewHostOptionsFromEnvironment(configFile) - if err != nil { - return nil, nil, err - } - hostings = append(hostings, pr_frontend.NewService(options)) - if enableAsyncWorker { - hostings = append(hostings, pr_backend.NewService(options)) - } - - return hostings, &options, nil -} +const serviceName = "radius" func main() { var configFile string - var enableAsyncWorker bool - - var runPortableResource bool - var portableResourceConfigFile string - defaultConfig := fmt.Sprintf("radius-%s.yaml", hostoptions.Environment()) - flag.StringVar(&configFile, "config-file", defaultConfig, "The service configuration file.") - flag.BoolVar(&enableAsyncWorker, "enable-asyncworker", true, "Flag to run async request process worker (for private preview and dev/test purpose).") - - flag.BoolVar(&runPortableResource, "run-portableresource", true, "Flag to run portable resources RPs(for private preview and dev/test purpose).") - defaultPortableRsConfig := fmt.Sprintf("portableresource-%s.yaml", hostoptions.Environment()) - flag.StringVar(&portableResourceConfigFile, "portableresource-config", defaultPortableRsConfig, "The service configuration file for portable resource providers.") - + pflag.StringVar(&configFile, "config-file", defaultConfig, "The service configuration file.") if configFile == "" { log.Fatal("config-file is empty.") //nolint:forbidigo // this is OK inside the main function. } - flag.Parse() + var portableResourceConfigFile string + defaultPortableRsConfig := fmt.Sprintf("portableresource-%s.yaml", hostoptions.Environment()) + pflag.StringVar(&portableResourceConfigFile, "portableresource-config", defaultPortableRsConfig, "The service configuration file for portable resource providers.") + + pflag.Parse() options, err := hostoptions.NewHostOptionsFromEnvironment(configFile) if err != nil { log.Fatal(err) //nolint:forbidigo // this is OK inside the main function. } - hostingSvc := []hosting.Service{frontend.NewService(options)} + + hostingSvc := []hosting.Service{} metricOptions := metricsservice.NewHostOptionsFromEnvironment(*options.Config) metricOptions.Config.ServiceName = serviceName @@ -99,7 +81,7 @@ func main() { hostingSvc = append(hostingSvc, profilerservice.NewService(profilerOptions)) } - logger, flush, err := ucplog.NewLogger(logging.AppCoreLoggerName, &options.Config.Logging) + logger, flush, err := ucplog.NewLogger(serviceName, &options.Config.Logging) if err != nil { log.Fatal(err) //nolint:forbidigo // this is OK inside the main function. } @@ -108,22 +90,10 @@ func main() { // Must set the logger before using controller-runtime. runtimelog.SetLogger(logger) - if enableAsyncWorker { - logger.Info("Enable AsyncRequestProcessWorker.") - hostingSvc = append(hostingSvc, backend.NewService(options)) - } - - // Configure Portable Resources to run it with Applications.Core RP. - var portableResourceOpts *hostoptions.HostOptions - if runPortableResource && portableResourceConfigFile != "" { - logger.Info("Run Service for Portable Resource Providers.") - var portableResourceSvcs []hosting.Service - var err error - portableResourceSvcs, portableResourceOpts, err = newPortableResourceHosts(portableResourceConfigFile, enableAsyncWorker) - if err != nil { - log.Fatal(err) //nolint:forbidigo // this is OK inside the main function. - } - hostingSvc = append(hostingSvc, portableResourceSvcs...) + // Load portable resource config. + prOptions, err := hostoptions.NewHostOptionsFromEnvironment(portableResourceConfigFile) + if err != nil { + log.Fatal(err) //nolint:forbidigo // this is OK inside the main function. } if options.Config.StorageProvider.Provider == dataprovider.TypeETCD && @@ -135,13 +105,31 @@ func main() { client := hosting.NewAsyncValue[etcdclient.Client]() options.Config.StorageProvider.ETCD.Client = client options.Config.SecretProvider.ETCD.Client = client - if portableResourceOpts != nil { - portableResourceOpts.Config.StorageProvider.ETCD.Client = client - portableResourceOpts.Config.SecretProvider.ETCD.Client = client - } + + // Portable resource options + prOptions.Config.StorageProvider.ETCD.Client = client + prOptions.Config.SecretProvider.ETCD.Client = client + hostingSvc = append(hostingSvc, data.NewEmbeddedETCDService(data.EmbeddedETCDServiceOptions{ClientConfigSink: client})) } + builders, err := builders(options) + if err != nil { + log.Fatal(err) //nolint:forbidigo // this is OK inside the main function. + } + + hostingSvc = append( + hostingSvc, + server.NewAPIService(options, builders), + server.NewAsyncWorker(options, builders), + + // Configure Portable Resources to run it with Applications.Core RP. + // + // This is temporary until we migrate these resources to use the new registration model. + pr_frontend.NewService(prOptions), + pr_backend.NewService(prOptions), + ) + loggerValues := []any{} host := &hosting.Host{ Services: hostingSvc, @@ -190,3 +178,15 @@ func main() { panic(err) } } + +func builders(options hostoptions.HostOptions) ([]builder.Builder, error) { + config, err := controllerconfig.New(options) + if err != nil { + return nil, err + } + + return []builder.Builder{ + corerp_setup.SetupNamespace(config).GenerateBuilder(), + // Add resource provider builders... + }, nil +} diff --git a/cmd/applications-rp/portableresource-dev.yaml b/cmd/applications-rp/portableresource-dev.yaml index 77c5a933b0..89fd579140 100644 --- a/cmd/applications-rp/portableresource-dev.yaml +++ b/cmd/applications-rp/portableresource-dev.yaml @@ -8,6 +8,7 @@ storageProvider: inmemory: true queueProvider: provider: inmemory + name: radiusportable profilerProvider: enabled: true port: 6060 diff --git a/cmd/applications-rp/portableresource-self-hosted.yaml b/cmd/applications-rp/portableresource-self-hosted.yaml index fdadd10dda..37c587e086 100644 --- a/cmd/applications-rp/portableresource-self-hosted.yaml +++ b/cmd/applications-rp/portableresource-self-hosted.yaml @@ -17,6 +17,7 @@ storageProvider: namespace: 'radius-testing' queueProvider: provider: "apiserver" + name: radiusportable apiserver: context: '' namespace: 'radius-testing' diff --git a/cmd/applications-rp/radius-cloud.yaml b/cmd/applications-rp/radius-cloud.yaml index 8555e931fa..66c36258a2 100644 --- a/cmd/applications-rp/radius-cloud.yaml +++ b/cmd/applications-rp/radius-cloud.yaml @@ -19,6 +19,7 @@ storageProvider: masterKey: set-me-in-a-different-way queueProvider: provider: inmemory + name: radius profilerProvider: enabled: true port: 6060 diff --git a/cmd/applications-rp/radius-dev.yaml b/cmd/applications-rp/radius-dev.yaml index a679384d92..3c64758fe6 100644 --- a/cmd/applications-rp/radius-dev.yaml +++ b/cmd/applications-rp/radius-dev.yaml @@ -8,6 +8,7 @@ storageProvider: inmemory: true queueProvider: provider: inmemory + name: radius profilerProvider: enabled: true port: 6060 diff --git a/cmd/applications-rp/radius-self-hosted.yaml b/cmd/applications-rp/radius-self-hosted.yaml index 63090e1448..b247043a15 100644 --- a/cmd/applications-rp/radius-self-hosted.yaml +++ b/cmd/applications-rp/radius-self-hosted.yaml @@ -17,6 +17,7 @@ storageProvider: namespace: 'radius-testing' queueProvider: provider: "apiserver" + name: radius apiserver: context: '' namespace: 'radius-testing' diff --git a/cmd/ucpd/ucp-self-hosted-dev.yaml b/cmd/ucpd/ucp-self-hosted-dev.yaml index 5f14d8a49b..8e73d30861 100644 --- a/cmd/ucpd/ucp-self-hosted-dev.yaml +++ b/cmd/ucpd/ucp-self-hosted-dev.yaml @@ -20,6 +20,7 @@ secretProvider: queueProvider: provider: "apiserver" + name: 'ucp' apiserver: context: '' namespace: 'radius-testing' diff --git a/deploy/Chart/templates/rp/configmaps.yaml b/deploy/Chart/templates/rp/configmaps.yaml index a66ed7437b..8dbecbc90e 100644 --- a/deploy/Chart/templates/rp/configmaps.yaml +++ b/deploy/Chart/templates/rp/configmaps.yaml @@ -20,6 +20,7 @@ data: namespace: "radius-system" queueProvider: provider: "apiserver" + name: "radius" apiserver: context: "" namespace: "radius-system" @@ -66,6 +67,7 @@ data: namespace: "radius-system" queueProvider: provider: "apiserver" + name: "radiusportable" apiserver: context: "" namespace: "radius-system" diff --git a/deploy/Chart/templates/rp/deployment.yaml b/deploy/Chart/templates/rp/deployment.yaml index 3da0d8dbe4..d3ee662bd9 100644 --- a/deploy/Chart/templates/rp/deployment.yaml +++ b/deploy/Chart/templates/rp/deployment.yaml @@ -32,7 +32,6 @@ spec: image: "{{ .Values.rp.image }}:{{ .Values.rp.tag | default $appversion }}" args: - --config-file=/etc/config/radius-self-host.yaml - - --run-portableresource - --portableresource-config=/etc/config/portableresource-self-host.yaml env: - name: SKIP_ARM diff --git a/deploy/Chart/templates/ucp/configmaps.yaml b/deploy/Chart/templates/ucp/configmaps.yaml index 7d9a8154cd..95b27be087 100644 --- a/deploy/Chart/templates/ucp/configmaps.yaml +++ b/deploy/Chart/templates/ucp/configmaps.yaml @@ -20,7 +20,11 @@ data: provider: kubernetes queueProvider: - provider: inmemory + provider: "apiserver" + name: "ucp" + apiserver: + context: "" + namespace: "radius-system" profilerProvider: enabled: true diff --git a/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md b/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md index 3d8723dafe..2043051d22 100644 --- a/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md +++ b/docs/contributing/contributing-code/contributing-code-control-plane/configSettings.md @@ -197,6 +197,7 @@ storageProvider: namespace: "radius-system" queueProvider: provider: "apiserver" + name: "radius" apiserver: context: "" namespace: "radius-system" diff --git a/pkg/armrpc/api/v1/types.go b/pkg/armrpc/api/v1/types.go index 5e4ed75020..623a2fafbc 100644 --- a/pkg/armrpc/api/v1/types.go +++ b/pkg/armrpc/api/v1/types.go @@ -44,17 +44,15 @@ var ( type OperationMethod string var operationMethodToHTTPMethod = map[OperationMethod]string{ - OperationList: http.MethodGet, - OperationGet: http.MethodGet, - OperationPut: http.MethodPut, - OperationPatch: http.MethodPatch, - OperationDelete: http.MethodDelete, + OperationPlaneScopeList: http.MethodGet, + OperationList: http.MethodGet, + OperationGet: http.MethodGet, + OperationPut: http.MethodPut, + OperationPatch: http.MethodPatch, + OperationDelete: http.MethodDelete, // ARM RPC specific operations. - OperationGetOperations: http.MethodGet, - OperationGetOperationStatuses: http.MethodGet, - OperationGetOperationResult: http.MethodGet, - OperationPutSubscriptions: http.MethodPut, + OperationPutSubscriptions: http.MethodPut, // Non-idempotent lifecycle operations. OperationGetImperative: http.MethodPost, @@ -80,16 +78,14 @@ func (o OperationMethod) HTTPMethod() string { const ( // Predefined Operation methods. - OperationList OperationMethod = "LIST" - OperationGet OperationMethod = "GET" - OperationPut OperationMethod = "PUT" - OperationPatch OperationMethod = "PATCH" - OperationDelete OperationMethod = "DELETE" - OperationGetOperations OperationMethod = "GETOPERATIONS" - OperationGetOperationStatuses OperationMethod = "GETOPERATIONSTATUSES" - OperationGetOperationResult OperationMethod = "GETOPERATIONRESULT" - OperationPutSubscriptions OperationMethod = "PUTSUBSCRIPTIONS" - OperationPost OperationMethod = "POST" + OperationPlaneScopeList OperationMethod = "LISTPLANESCOPE" + OperationList OperationMethod = "LIST" + OperationGet OperationMethod = "GET" + OperationPut OperationMethod = "PUT" + OperationPatch OperationMethod = "PATCH" + OperationDelete OperationMethod = "DELETE" + OperationPutSubscriptions OperationMethod = "PUTSUBSCRIPTIONS" + OperationPost OperationMethod = "POST" // Imperative operation methods for non-idempotent lifecycle operations. // UCP extends the ARM resource lifecycle to support using POST for non-idempotent resource types. diff --git a/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go b/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go index 954324b755..a51525c2ca 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go +++ b/pkg/armrpc/asyncoperation/statusmanager/statusmanager.go @@ -27,6 +27,7 @@ import ( ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" "github.com/radius-project/radius/pkg/metrics" "github.com/radius-project/radius/pkg/trace" + "github.com/radius-project/radius/pkg/ucp/dataprovider" queue "github.com/radius-project/radius/pkg/ucp/queue/client" "github.com/radius-project/radius/pkg/ucp/resources" "github.com/radius-project/radius/pkg/ucp/store" @@ -36,10 +37,9 @@ import ( // statusManager includes the necessary functions to manage asynchronous operations. type statusManager struct { - storeClient store.StorageClient - queue queue.Client - providerName string - location string + storeProvider dataprovider.DataStorageProvider + queue queue.Client + location string } // QueueOperationOptions is the options type provided when queueing an async operation. @@ -65,12 +65,11 @@ type StatusManager interface { } // New creates statusManager instance. -func New(storeClient store.StorageClient, q queue.Client, providerName, location string) StatusManager { +func New(dataProvider dataprovider.DataStorageProvider, q queue.Client, location string) StatusManager { return &statusManager{ - storeClient: storeClient, - queue: q, - providerName: providerName, - location: location, + storeProvider: dataProvider, + queue: q, + location: location, } } @@ -79,6 +78,10 @@ func (aom *statusManager) operationStatusResourceID(id resources.ID, operationID return fmt.Sprintf("%s/providers/%s/locations/%s/operationstatuses/%s", id.PlaneScope(), strings.ToLower(id.ProviderNamespace()), aom.location, operationID) } +func (aom *statusManager) getClient(ctx context.Context, id resources.ID) (store.StorageClient, error) { + return aom.storeProvider.GetStorageClient(ctx, id.ProviderNamespace()+"/operationstatuses") +} + // QueueAsyncOperation creates and saves a new status resource with the given parameters in datastore, and queues // a request message. If an error occurs, the status is deleted using the storeClient. func (aom *statusManager) QueueAsyncOperation(ctx context.Context, sCtx *v1.ARMRequestContext, options QueueOperationOptions) error { @@ -108,7 +111,12 @@ func (aom *statusManager) QueueAsyncOperation(ctx context.Context, sCtx *v1.ARMR ClientObjectID: sCtx.ClientObjectID, } - err := aom.storeClient.Save(ctx, &store.Object{ + storeClient, err := aom.getClient(ctx, sCtx.ResourceID) + if err != nil { + return err + } + + err = storeClient.Save(ctx, &store.Object{ Metadata: store.Metadata{ID: opID}, Data: aos, }) @@ -118,7 +126,7 @@ func (aom *statusManager) QueueAsyncOperation(ctx context.Context, sCtx *v1.ARMR } if err = aom.queueRequestMessage(ctx, sCtx, aos, options.OperationTimeout); err != nil { - delErr := aom.storeClient.Delete(ctx, opID) + delErr := storeClient.Delete(ctx, opID) if delErr != nil { return delErr } @@ -132,7 +140,12 @@ func (aom *statusManager) QueueAsyncOperation(ctx context.Context, sCtx *v1.ARMR // Get gets a status object from the datastore or an error if the retrieval fails. func (aom *statusManager) Get(ctx context.Context, id resources.ID, operationID uuid.UUID) (*Status, error) { - obj, err := aom.storeClient.Get(ctx, aom.operationStatusResourceID(id, operationID)) + storeClient, err := aom.getClient(ctx, id) + if err != nil { + return nil, err + } + + obj, err := storeClient.Get(ctx, aom.operationStatusResourceID(id, operationID)) if err != nil { return nil, err } @@ -149,8 +162,12 @@ func (aom *statusManager) Get(ctx context.Context, id resources.ID, operationID // given parameters, and saves it back to the store. func (aom *statusManager) Update(ctx context.Context, id resources.ID, operationID uuid.UUID, state v1.ProvisioningState, endTime *time.Time, opError *v1.ErrorDetails) error { opID := aom.operationStatusResourceID(id, operationID) + storeClient, err := aom.getClient(ctx, id) + if err != nil { + return err + } - obj, err := aom.storeClient.Get(ctx, opID) + obj, err := storeClient.Get(ctx, opID) if err != nil { return err } @@ -173,13 +190,17 @@ func (aom *statusManager) Update(ctx context.Context, id resources.ID, operation obj.Data = s - return aom.storeClient.Save(ctx, obj, store.WithETag(obj.ETag)) + return storeClient.Save(ctx, obj, store.WithETag(obj.ETag)) } // Delete deletes the operation status resource associated with the given ID and // operationID, and returns an error if unsuccessful. func (aom *statusManager) Delete(ctx context.Context, id resources.ID, operationID uuid.UUID) error { - return aom.storeClient.Delete(ctx, aom.operationStatusResourceID(id, operationID)) + storeClient, err := aom.getClient(ctx, id) + if err != nil { + return err + } + return storeClient.Delete(ctx, aom.operationStatusResourceID(id, operationID)) } // queueRequestMessage function is to put the async operation message to the queue to be worked on. diff --git a/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go b/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go index 8a3fa6b87a..43b88d0482 100644 --- a/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go +++ b/pkg/armrpc/asyncoperation/statusmanager/statusmanager_test.go @@ -26,6 +26,7 @@ import ( "github.com/google/uuid" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" queue "github.com/radius-project/radius/pkg/ucp/queue/client" "github.com/radius-project/radius/pkg/ucp/resources" "github.com/radius-project/radius/pkg/ucp/store" @@ -33,9 +34,10 @@ import ( ) type asyncOperationsManagerTest struct { - manager StatusManager - storeClient *store.MockStorageClient - queue *queue.MockClient + manager StatusManager + storeProvider *dataprovider.MockDataStorageProvider + storeClient *store.MockStorageClient + queue *queue.MockClient } const ( @@ -51,13 +53,16 @@ const ( func setup(tb testing.TB) (asyncOperationsManagerTest, *gomock.Controller) { ctrl := gomock.NewController(tb) + dp := dataprovider.NewMockDataStorageProvider(ctrl) sc := store.NewMockStorageClient(ctrl) + dp.EXPECT().GetStorageClient(gomock.Any(), "Applications.Core/operationstatuses").Return(sc, nil) enq := queue.NewMockClient(ctrl) - aom := New(sc, enq, "Test-AsyncOperationsManager", "test-location") - return asyncOperationsManagerTest{manager: aom, storeClient: sc, queue: enq}, ctrl + aom := New(dp, enq, "test-location") + return asyncOperationsManagerTest{manager: aom, storeProvider: dp, storeClient: sc, queue: enq}, ctrl } var reqCtx = &v1.ARMRequestContext{ + ResourceID: resources.MustParse("/planes/radius/local/resourceGroups/radius-test-rg/providers/Applications.Core/container/container0"), OperationID: uuid.Must(uuid.NewRandom()), HomeTenantID: "home-tenant-id", ClientObjectID: "client-object-id", @@ -99,7 +104,7 @@ func TestOperationStatusResourceID(t *testing.T) { }, } - sm := &statusManager{providerName: "applications.core", location: v1.LocationGlobal} + sm := &statusManager{location: v1.LocationGlobal} for _, tc := range resourceIDTests { t.Run(tc.resourceID, func(t *testing.T) { diff --git a/pkg/armrpc/asyncoperation/worker/registry.go b/pkg/armrpc/asyncoperation/worker/registry.go index 4a178e7b7f..814fc85b6d 100644 --- a/pkg/armrpc/asyncoperation/worker/registry.go +++ b/pkg/armrpc/asyncoperation/worker/registry.go @@ -49,7 +49,7 @@ func (h *ControllerRegistry) Register(ctx context.Context, resourceType string, ot := v1.OperationType{Type: resourceType, Method: method} - storageClient, err := opts.DataProvider.GetStorageClient(ctx, resourceType) + storageClient, err := h.sp.GetStorageClient(ctx, resourceType) if err != nil { return err } diff --git a/pkg/armrpc/asyncoperation/worker/service.go b/pkg/armrpc/asyncoperation/worker/service.go index d2ce0cec69..4a04a19384 100644 --- a/pkg/armrpc/asyncoperation/worker/service.go +++ b/pkg/armrpc/asyncoperation/worker/service.go @@ -21,18 +21,10 @@ import ( manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" "github.com/radius-project/radius/pkg/armrpc/hostoptions" - "github.com/radius-project/radius/pkg/kubeutil" "github.com/radius-project/radius/pkg/ucp/dataprovider" queue "github.com/radius-project/radius/pkg/ucp/queue/client" qprovider "github.com/radius-project/radius/pkg/ucp/queue/provider" "github.com/radius-project/radius/pkg/ucp/ucplog" - - "k8s.io/client-go/discovery" - "k8s.io/client-go/kubernetes" - - "k8s.io/client-go/dynamic" - - controller_runtime "sigs.k8s.io/controller-runtime/pkg/client" ) // Service is the base worker service implementation to initialize and start worker. @@ -49,58 +41,20 @@ type Service struct { Controllers *ControllerRegistry // RequestQueue is the queue client for async operation request message. RequestQueue queue.Client - // KubeClient is the Kubernetes controller runtime client. - KubeClient controller_runtime.Client - // KubeClientSet is the Kubernetes client. - KubeClientSet kubernetes.Interface - // KubeDiscoveryClient is the Kubernetes discovery client. - KubeDiscoveryClient discovery.ServerResourcesInterface - // KubeDynamicClientSet is the Kubernetes dynamic client. - KubeDynamicClientSet dynamic.Interface } // Init initializes worker service - it initializes the StorageProvider, RequestQueue, OperationStatusManager, Controllers, KubeClient and // returns an error if any of these operations fail. func (s *Service) Init(ctx context.Context) error { s.StorageProvider = dataprovider.NewStorageProvider(s.Options.Config.StorageProvider) - qp := qprovider.New(s.ProviderName, s.Options.Config.QueueProvider) - opSC, err := s.StorageProvider.GetStorageClient(ctx, s.ProviderName+"/operationstatuses") - if err != nil { - return err - } + qp := qprovider.New(s.Options.Config.QueueProvider) + var err error s.RequestQueue, err = qp.GetClient(ctx) if err != nil { return err } - s.OperationStatusManager = manager.New(opSC, s.RequestQueue, s.ProviderName, s.Options.Config.Env.RoleLocation) + s.OperationStatusManager = manager.New(s.StorageProvider, s.RequestQueue, s.Options.Config.Env.RoleLocation) s.Controllers = NewControllerRegistry(s.StorageProvider) - - if s.Options.K8sConfig != nil { - s.KubeClient, err = kubeutil.NewRuntimeClient(s.Options.K8sConfig) - if err != nil { - return err - } - - s.KubeClientSet, err = kubernetes.NewForConfig(s.Options.K8sConfig) - if err != nil { - return err - } - - discoveryClient, err := discovery.NewDiscoveryClientForConfig(s.Options.K8sConfig) - if err != nil { - return err - } - - // Use legacy discovery client to avoid the issue of the staled GroupVersion discovery(api.ucp.dev/v1alpha3). - // TODO: Disable UseLegacyDiscovery once https://github.com/radius-project/radius/issues/5974 is resolved. - discoveryClient.UseLegacyDiscovery = true - s.KubeDiscoveryClient = discoveryClient - - s.KubeDynamicClientSet, err = dynamic.NewForConfig(s.Options.K8sConfig) - if err != nil { - return err - } - } return nil } diff --git a/pkg/armrpc/builder/builder.go b/pkg/armrpc/builder/builder.go new file mode 100644 index 0000000000..3284b7968a --- /dev/null +++ b/pkg/armrpc/builder/builder.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "context" + "fmt" + "net/http" + "strings" + + "github.com/go-chi/chi/v5" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/validator" + "github.com/radius-project/radius/swagger" +) + +// Builder can be used to register operations and build HTTP routing paths and handlers for a resource namespace. +type Builder struct { + namespaceNode *Namespace + registrations []*OperationRegistration +} + +// defaultHandlerOptions returns HandlerOption for the default operations such as getting operationStatuses and +// operationResults. +func defaultHandlerOptions( + ctx context.Context, + rootRouter chi.Router, + rootScopePath string, + namespace string, + availableOperations []v1.Operation, + ctrlOpts apictrl.Options) []server.HandlerOptions { + namespace = strings.ToLower(namespace) + + handlers := []server.HandlerOptions{} + if len(availableOperations) > 0 { + // https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/proxy-api-reference.md#exposing-available-operations + handlers = append(handlers, server.HandlerOptions{ + ParentRouter: rootRouter, + Path: rootScopePath + "/providers/" + namespace + "/operations", + ResourceType: namespace + "/operations", + Method: v1.OperationGet, + ControllerFactory: func(op apictrl.Options) (apictrl.Controller, error) { + return defaultoperation.NewGetOperations(op, availableOperations) + }, + }) + } + + statusType := namespace + "/operationstatuses" + resultType := namespace + "/operationresults" + handlers = append(handlers, server.HandlerOptions{ + ParentRouter: rootRouter, + Path: fmt.Sprintf("%s/providers/%s/locations/{location}/operationstatuses/{operationId}", rootScopePath, namespace), + ResourceType: statusType, + Method: v1.OperationGet, + ControllerFactory: defaultoperation.NewGetOperationStatus, + }) + + handlers = append(handlers, server.HandlerOptions{ + ParentRouter: rootRouter, + Path: fmt.Sprintf("%s/providers/%s/locations/{location}/operationresults/{operationId}", rootScopePath, namespace), + ResourceType: resultType, + Method: v1.OperationGet, + ControllerFactory: defaultoperation.NewGetOperationResult, + }) + + return handlers +} + +func (b *Builder) Namespace() string { + return b.namespaceNode.Name +} + +const ( + UCPRootScopePath = "/planes/radius/{planeName}" + ResourceGroupPath = "/resourcegroups/{resourceGroupName}" +) + +// NewOpenAPIValidatorMiddleware creates a new OpenAPI validator middleware. +func NewOpenAPIValidator(ctx context.Context, base, namespace string) (func(h http.Handler) http.Handler, error) { + rootScopePath := base + UCPRootScopePath + + // URLs may use either the subscription/plane scope or resource group scope. + // These paths are order sensitive and the longer path MUST be registered first. + prefixes := []string{ + rootScopePath + ResourceGroupPath, + rootScopePath, + } + + specLoader, err := validator.LoadSpec(ctx, namespace, swagger.SpecFiles, prefixes, "rootScope") + if err != nil { + return nil, err + } + + return validator.APIValidator(validator.Options{ + SpecLoader: specLoader, + ResourceTypeGetter: validator.RadiusResourceTypeGetter, + }), nil +} + +// ApplyAPIHandlers builds HTTP routing paths and handlers for namespace. +func (b *Builder) ApplyAPIHandlers(ctx context.Context, r chi.Router, ctrlOpts apictrl.Options, middlewares ...func(h http.Handler) http.Handler) error { + rootScopePath := ctrlOpts.PathBase + UCPRootScopePath + + // Configure the default handlers. + handlerOptions := defaultHandlerOptions(ctx, r, rootScopePath, b.namespaceNode.Name, b.namespaceNode.availableOperations, ctrlOpts) + + routerMap := map[string]chi.Router{} + for _, h := range b.registrations { + if h == nil { + continue + } + + key := "" + route := "" + switch h.Method { + case v1.OperationPlaneScopeList: + route = fmt.Sprintf("%s/providers/%s", rootScopePath, strings.ToLower(h.ResourceType)) + key = "plane-" + h.ResourceType + case v1.OperationList: + route = fmt.Sprintf("%s/resourcegroups/{resourceGroupName}/providers/%s", rootScopePath, h.ResourceNamePattern) + key = "rg-" + h.ResourceType + default: + route = fmt.Sprintf("%s/resourcegroups/{resourceGroupName}/providers/%s", rootScopePath, h.ResourceNamePattern) + key = "resource-" + h.ResourceNamePattern + } + + if _, ok := routerMap[key]; !ok { + routerMap[key] = server.NewSubrouter(r, route, middlewares...) + } + + handlerOptions = append(handlerOptions, server.HandlerOptions{ + ParentRouter: routerMap[key], + Path: strings.ToLower(h.Path), + ResourceType: h.ResourceType, + Method: h.Method, + ControllerFactory: h.APIController, + }) + } + + for _, o := range handlerOptions { + if err := server.RegisterHandler(ctx, o, ctrlOpts); err != nil { + return err + } + } + + return nil +} + +// ApplyAsyncHandler registers asynchronous controllers from HandlerOutput. +func (b *Builder) ApplyAsyncHandler(ctx context.Context, registry *worker.ControllerRegistry, ctrlOpts asyncctrl.Options) error { + for _, h := range b.registrations { + if h == nil { + continue + } + + if h.AsyncController != nil { + err := registry.Register(ctx, h.ResourceType, h.Method, h.AsyncController, ctrlOpts) + if err != nil { + return err + } + } + } + return nil +} diff --git a/pkg/armrpc/builder/builder_test.go b/pkg/armrpc/builder/builder_test.go new file mode 100644 index 0000000000..480aa69765 --- /dev/null +++ b/pkg/armrpc/builder/builder_test.go @@ -0,0 +1,267 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "context" + "net/http" + "testing" + + "github.com/go-chi/chi/v5" + "github.com/golang/mock/gomock" + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testcontext" + "github.com/stretchr/testify/require" +) + +var handlerTests = []rpctest.HandlerTestSpec{ + // applications.compute/virtualMachines + { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.compute/virtualmachines", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines/vm0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines/vm0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines/vm0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines/vm0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: "ACTIONSTART"}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines/vm0/start", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: "ACTIONSTOP"}, + Path: "/resourcegroups/testrg/providers/applications.compute/virtualmachines/vm0/stop", + Method: http.MethodPost, + }, + // applications.compute/containers + { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.compute/containers", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers", Method: "ACTIONGETRESOURCE"}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0/getresource", + Method: http.MethodPost, + }, + // applications.compute/containers/secrets + { + OperationType: v1.OperationType{Type: "Applications.Compute/containers/secrets", Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0/secrets", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers/secrets", Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0/secrets/secret0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers/secrets", Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0/secrets/secret0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers/secrets", Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0/secrets/secret0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/containers/secrets", Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.compute/containers/container0/secrets/secret0", + Method: http.MethodDelete, + }, + // applications.compute/webassemblies + { + OperationType: v1.OperationType{Type: "Applications.Compute/webassemblies", Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.compute/webassemblies", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/webassemblies", Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.compute/webassemblies", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/webassemblies", Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.compute/webassemblies/wasm0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/webassemblies", Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.compute/webassemblies/wasm0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/webassemblies", Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.compute/webassemblies/wasm0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/webassemblies", Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.compute/webassemblies/wasm0", + Method: http.MethodDelete, + }, +} + +var defaultHandlerTests = []rpctest.HandlerTestSpec{ + { + OperationType: v1.OperationType{Type: "Applications.Compute/operations", Method: v1.OperationGet}, + Path: "/providers/applications.compute/operations", + Method: http.MethodGet, + }, + // default operations + { + OperationType: v1.OperationType{Type: "Applications.Compute/operationStatuses", Method: v1.OperationGet}, + Path: "/providers/applications.compute/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Compute/operationResults", Method: v1.OperationGet}, + Path: "/providers/applications.compute/locations/global/operationresults/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, +} + +func setup(t *testing.T) (*dataprovider.MockDataStorageProvider, *store.MockStorageClient) { + mctrl := gomock.NewController(t) + + mockSP := dataprovider.NewMockDataStorageProvider(mctrl) + mockSC := store.NewMockStorageClient(mctrl) + + mockSC.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.Object{}, nil).AnyTimes() + mockSC.EXPECT().Save(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + mockSC.EXPECT().Delete(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + mockSC.EXPECT().Query(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.ObjectQueryResult{}, nil).AnyTimes() + mockSP.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Return(store.StorageClient(mockSC), nil).AnyTimes() + + return mockSP, mockSC +} + +func TestApplyAPIHandlers(t *testing.T) { + mockSP, _ := setup(t) + + runTests := func(t *testing.T, testSpecs []rpctest.HandlerTestSpec, b *Builder) { + rpctest.AssertRequests(t, testSpecs, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { + r := chi.NewRouter() + return r, b.ApplyAPIHandlers(ctx, r, apictrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}) + }) + } + + t.Run("custom handlers", func(t *testing.T) { + ns := newTestNamespace(t) + builder := ns.GenerateBuilder() + runTests(t, handlerTests, &builder) + }) + + t.Run("default handlers", func(t *testing.T) { + ns := newTestNamespace(t) + builder := ns.GenerateBuilder() + ns.SetAvailableOperations([]v1.Operation{ + { + Name: "Applications.Compute/operations/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Compute", + Resource: "operations", + Operation: "Get operations", + Description: "Get the list of operations", + }, + IsDataAction: false, + }, + }) + runTests(t, defaultHandlerTests, &builder) + }) +} + +func TestApplyAPIHandlers_AvailableOperations(t *testing.T) { + mockSP, _ := setup(t) + ns := newTestNamespace(t) + + ns.SetAvailableOperations([]v1.Operation{ + { + Name: "Applications.Compute/operations/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Compute", + Resource: "operations", + Operation: "Get operations", + Description: "Get the list of operations", + }, + IsDataAction: false, + }, + }) + + builder := ns.GenerateBuilder() + rpctest.AssertRequests(t, handlerTests, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { + r := chi.NewRouter() + return r, builder.ApplyAPIHandlers(ctx, r, apictrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}) + }) +} + +func TestApplyAsyncHandler(t *testing.T) { + mockSP, _ := setup(t) + ns := newTestNamespace(t) + builder := ns.GenerateBuilder() + registry := worker.NewControllerRegistry(mockSP) + ctx := testcontext.New(t) + err := builder.ApplyAsyncHandler(ctx, registry, asyncctrl.Options{}) + require.NoError(t, err) + + expectedOperations := []v1.OperationType{ + {Type: "Applications.Compute/virtualMachines", Method: v1.OperationPut}, + {Type: "Applications.Compute/virtualMachines", Method: v1.OperationPatch}, + {Type: "Applications.Compute/virtualMachines", Method: "ACTIONSTART"}, + {Type: "Applications.Compute/virtualMachines/disks", Method: v1.OperationPut}, + {Type: "Applications.Compute/virtualMachines/disks", Method: v1.OperationPatch}, + {Type: "Applications.Compute/webAssemblies", Method: v1.OperationPut}, + {Type: "Applications.Compute/webAssemblies", Method: v1.OperationPatch}, + } + + for _, op := range expectedOperations { + jobCtrl := registry.Get(op) + require.NotNil(t, jobCtrl) + } +} diff --git a/pkg/armrpc/builder/namespace.go b/pkg/armrpc/builder/namespace.go new file mode 100644 index 0000000000..e0791e04a0 --- /dev/null +++ b/pkg/armrpc/builder/namespace.go @@ -0,0 +1,84 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "strings" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" +) + +// Namespace represents the namespace of UCP. +type Namespace struct { + ResourceNode + + // availableOperations is the list of available operations for the namespace. + availableOperations []v1.Operation +} + +// NewNamespace creates a new namespace. +func NewNamespace(namespace string) *Namespace { + return &Namespace{ + ResourceNode: ResourceNode{ + Kind: NamespaceResourceKind, + Name: namespace, + children: make(map[string]*ResourceNode), + }, + } +} + +// SetAvailableOperations sets the available operations for the namespace. +func (p *Namespace) SetAvailableOperations(operations []v1.Operation) { + p.availableOperations = operations +} + +// GenerateBuilder Builder object by traversing resource nodes from namespace. +func (p *Namespace) GenerateBuilder() Builder { + return Builder{ + namespaceNode: p, + registrations: p.resolve(&p.ResourceNode, p.Name, strings.ToLower(p.Name)), + } +} + +func (p *Namespace) resolve(node *ResourceNode, qualifiedType string, qualifiedPattern string) []*OperationRegistration { + outputs := []*OperationRegistration{} + + newType := qualifiedType + newPattern := qualifiedPattern + + if node.Kind != NamespaceResourceKind { + newType = qualifiedType + "/" + node.Name + newPattern = qualifiedPattern + "/" + strings.ToLower(node.Name) + newParamName := "{" + node.option.ParamName() + "}" + + // This builds the handler outputs for each resource type. + ctrls := node.option.BuildHandlerOutputs(BuildOptions{ + ResourceType: newType, + ParameterName: newParamName, + ResourceNamePattern: newPattern, + }) + + newPattern += "/" + newParamName + outputs = append(outputs, ctrls...) + } + + for _, child := range node.children { + outputs = append(outputs, p.resolve(child, newType, newPattern)...) + } + + return outputs +} diff --git a/pkg/armrpc/builder/namespace_test.go b/pkg/armrpc/builder/namespace_test.go new file mode 100644 index 0000000000..b247c72810 --- /dev/null +++ b/pkg/armrpc/builder/namespace_test.go @@ -0,0 +1,445 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "context" + "net/http" + "testing" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/store" + "github.com/stretchr/testify/require" +) + +type testAPIController struct { + apictrl.Operation[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel] +} + +func (e *testAPIController) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { + return nil, nil +} + +type testAsyncController struct { +} + +func (c *testAsyncController) Run(ctx context.Context, request *asyncctrl.Request) (asyncctrl.Result, error) { + return asyncctrl.Result{}, nil +} + +func (c *testAsyncController) StorageClient() store.StorageClient { + return nil +} + +func newTestController(opts apictrl.Options) (apictrl.Controller, error) { + return &testAPIController{ + apictrl.NewOperation(opts, + apictrl.ResourceOptions[rpctest.TestResourceDataModel]{ + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + }, + ), + }, nil +} + +func newTestNamespace(t *testing.T) *Namespace { + ns := NewNamespace("Applications.Compute") + require.Equal(t, NamespaceResourceKind, ns.Kind) + require.Equal(t, "Applications.Compute", ns.Name) + + asyncFunc := func(opts asyncctrl.Options) (asyncctrl.Controller, error) { + return &testAsyncController{}, nil + } + + // register virtualMachines resource + vmResource := ns.AddResource("virtualMachines", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + ResourceParamName: "virtualMachineName", + + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + Custom: map[string]Operation[rpctest.TestResourceDataModel]{ + "start": { + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + "stop": { + APIController: newTestController, + }, + }, + }) + + require.NotNil(t, vmResource) + + // register virtualMachines/disks child resource + _ = vmResource.AddResource("disks", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + Custom: map[string]Operation[rpctest.TestResourceDataModel]{ + "replace": { + APIController: newTestController, + }, + }, + }) + + // register virtualMachines/networks child resource + _ = vmResource.AddResource("networks", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + }, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + }, + Custom: map[string]Operation[rpctest.TestResourceDataModel]{ + "connect": { + APIController: newTestController, + }, + }, + }) + + // register containers resource + containerResource := ns.AddResource("containers", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + }, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + }, + Custom: map[string]Operation[rpctest.TestResourceDataModel]{ + "getresource": { + APIController: newTestController, + }, + }, + }) + + require.NotNil(t, containerResource) + + // register containers/secrets child resource + _ = containerResource.AddResource("secrets", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + }, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + }, + }) + + // register webAssemblies resource + wasmResource := ns.AddResource("webAssemblies", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + ResourceParamName: "webAssemblyName", + RequestConverter: rpctest.TestResourceDataModelFromVersioned, + ResponseConverter: rpctest.TestResourceDataModelToVersioned, + + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: newTestController, + AsyncJobController: asyncFunc, + }, + }) + + require.NotNil(t, wasmResource) + + return ns +} + +func TestNamespaceBuild(t *testing.T) { + ns := newTestNamespace(t) + builders := ns.GenerateBuilder() + require.NotNil(t, builders) + + builderTests := []struct { + resourceType string + resourceNamePattern string + path string + method v1.OperationMethod + found bool + }{ + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines", + path: "", + method: "LISTPLANESCOPE", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines", + path: "", + method: "LIST", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + path: "", + method: "GET", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + path: "", + method: "PUT", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + path: "", + method: "PATCH", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + path: "", + method: "DELETE", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + path: "/start", + method: "ACTIONSTART", + }, + { + resourceType: "Applications.Compute/virtualMachines", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + path: "/stop", + method: "ACTIONSTOP", + }, + { + resourceType: "Applications.Compute/virtualMachines/networks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/networks", + path: "", + method: "LIST", + }, + { + resourceType: "Applications.Compute/virtualMachines/networks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/networks/{networkName}", + path: "", + method: "GET", + }, + { + resourceType: "Applications.Compute/virtualMachines/networks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/networks/{networkName}", + path: "", + method: "PUT", + }, + { + resourceType: "Applications.Compute/virtualMachines/networks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/networks/{networkName}", + path: "", + method: "PATCH", + }, + { + resourceType: "Applications.Compute/virtualMachines/networks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/networks/{networkName}", + path: "", + method: "DELETE", + }, + { + resourceType: "Applications.Compute/virtualMachines/networks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/networks/{networkName}", + path: "/connect", + method: "ACTIONCONNECT", + }, + { + resourceType: "Applications.Compute/virtualMachines/disks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/disks", + path: "", + method: "LIST", + }, + { + resourceType: "Applications.Compute/virtualMachines/disks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/disks/{diskName}", + path: "", + method: "GET", + }, + { + resourceType: "Applications.Compute/virtualMachines/disks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/disks/{diskName}", + path: "", + method: "PUT", + }, + { + resourceType: "Applications.Compute/virtualMachines/disks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/disks/{diskName}", + path: "", + method: "PATCH", + }, + { + resourceType: "Applications.Compute/virtualMachines/disks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/disks/{diskName}", + path: "", + method: "DELETE", + }, + { + resourceType: "Applications.Compute/virtualMachines/disks", + resourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}/disks/{diskName}", + path: "/replace", + method: "ACTIONREPLACE", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers", + path: "", + method: "LISTPLANESCOPE", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers", + path: "", + method: "LIST", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers/{containerName}", + path: "", + method: "GET", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers/{containerName}", + path: "", + method: "PUT", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers/{containerName}", + path: "", + method: "PATCH", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers/{containerName}", + path: "", + method: "DELETE", + }, + { + resourceType: "Applications.Compute/containers", + resourceNamePattern: "applications.compute/containers/{containerName}", + path: "/getresource", + method: "ACTIONGETRESOURCE", + }, + { + resourceType: "Applications.Compute/containers/secrets", + resourceNamePattern: "applications.compute/containers/{containerName}/secrets", + path: "", + method: "LIST", + }, + { + resourceType: "Applications.Compute/containers/secrets", + resourceNamePattern: "applications.compute/containers/{containerName}/secrets/{secretName}", + path: "", + method: "GET", + }, + { + resourceType: "Applications.Compute/containers/secrets", + resourceNamePattern: "applications.compute/containers/{containerName}/secrets/{secretName}", + path: "", + method: "PUT", + }, + { + resourceType: "Applications.Compute/containers/secrets", + resourceNamePattern: "applications.compute/containers/{containerName}/secrets/{secretName}", + path: "", + method: "PATCH", + }, + { + resourceType: "Applications.Compute/containers/secrets", + resourceNamePattern: "applications.compute/containers/{containerName}/secrets/{secretName}", + path: "", + method: "DELETE", + }, + { + resourceType: "Applications.Compute/webAssemblies", + resourceNamePattern: "applications.compute/webassemblies", + path: "", + method: "LISTPLANESCOPE", + }, + { + resourceType: "Applications.Compute/webAssemblies", + resourceNamePattern: "applications.compute/webassemblies", + path: "", + method: "LIST", + }, + { + resourceType: "Applications.Compute/webAssemblies", + resourceNamePattern: "applications.compute/webassemblies/{webAssemblyName}", + path: "", + method: "GET", + }, + { + resourceType: "Applications.Compute/webAssemblies", + resourceNamePattern: "applications.compute/webassemblies/{webAssemblyName}", + path: "", + method: "PUT", + }, + { + resourceType: "Applications.Compute/webAssemblies", + resourceNamePattern: "applications.compute/webassemblies/{webAssemblyName}", + path: "", + method: "PATCH", + }, + { + resourceType: "Applications.Compute/webAssemblies", + resourceNamePattern: "applications.compute/webassemblies/{webAssemblyName}", + path: "", + method: "DELETE", + }, + } + + for _, b := range builders.registrations { + for i, bt := range builderTests { + if bt.resourceType == b.ResourceType && bt.resourceNamePattern == b.ResourceNamePattern && bt.path == b.Path && bt.method == b.Method { + builderTests[i].found = true + } + } + } + + for _, bt := range builderTests { + require.True(t, bt.found, "resource not found: %s %s %s %s", bt.resourceType, bt.resourceNamePattern, bt.path, bt.method) + } +} diff --git a/pkg/armrpc/builder/node.go b/pkg/armrpc/builder/node.go new file mode 100644 index 0000000000..06c54a493c --- /dev/null +++ b/pkg/armrpc/builder/node.go @@ -0,0 +1,73 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "errors" + "strings" +) + +var ( + // ErrResourceAlreadyExists represents an error when a resource already exists. + ErrResourceAlreadyExists = errors.New("resource already exists") +) + +// ResourceNode is a node in the resource tree. +type ResourceNode struct { + // Kind is the resource kind. + Kind ResourceKind + + // Name is the resource name. + Name string + + // option includes the resource handlers. + option ResourceOptionBuilder + + // children includes the child resources and custom actions of this resource. + children map[string]*ResourceNode +} + +// AddResource adds a new child resource type and API handlers and returns new resource node. +func (r *ResourceNode) AddResource(name string, option ResourceOptionBuilder) *ResourceNode { + normalized := strings.ToLower(name) + + if _, ok := r.children[normalized]; ok { + panic(ErrResourceAlreadyExists) + } + + child := &ResourceNode{ + Name: name, + children: make(map[string]*ResourceNode), + option: option, + } + + switch r.Kind { + case NamespaceResourceKind: + child.Kind = TrackedResourceKind + + case TrackedResourceKind: + child.Kind = ProxyResourceKind + + default: + child.Kind = ProxyResourceKind + } + + option.LinkResource(child) + r.children[normalized] = child + + return child +} diff --git a/pkg/armrpc/builder/node_test.go b/pkg/armrpc/builder/node_test.go new file mode 100644 index 0000000000..865f404198 --- /dev/null +++ b/pkg/armrpc/builder/node_test.go @@ -0,0 +1,47 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "testing" + + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/stretchr/testify/require" +) + +func TestAddResource(t *testing.T) { + r := &ResourceNode{ + Name: "Applications.Core", + Kind: NamespaceResourceKind, + children: make(map[string]*ResourceNode), + } + + child := r.AddResource("virtualMachines", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{}) + require.Equal(t, "virtualMachines", child.Name) + require.Equal(t, TrackedResourceKind, child.Kind, "child resource of namespace should be a tracked resource") + require.Len(t, r.children, 1, "should have one child resource") + + require.Panics(t, func() { + _ = r.AddResource("virtualMachines", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{}) + }, "panic when adding a resource with the same name") + + nested := child.AddResource("disks", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{}) + _ = child.AddResource("cpus", &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{}) + require.Equal(t, "disks", nested.Name) + require.Equal(t, ProxyResourceKind, nested.Kind, "nested resource should be a proxy resource") + require.Len(t, child.children, 2, "should have 2 child resource") +} diff --git a/pkg/armrpc/builder/operation.go b/pkg/armrpc/builder/operation.go new file mode 100644 index 0000000000..b491604525 --- /dev/null +++ b/pkg/armrpc/builder/operation.go @@ -0,0 +1,367 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "strings" + "time" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" +) + +const customActionPrefix = "ACTION" + +// Operation defines converters for request and response, update and delete filters, +// asynchronous operation controller, and the options for API operation. +type Operation[T any] struct { + // Disabled indicates that the operation is disabled. By default, all operations are enabled. + Disabled bool + + // UpdateFilters is a slice of filters that execute prior to updating a resource. + UpdateFilters []controller.UpdateFilter[T] + + // DeleteFilters is a slice of filters that execute prior to deleting a resource. + DeleteFilters []controller.DeleteFilter[T] + + // APIController is the controller function for the API controller frontend. + APIController server.ControllerFactoryFunc + + // AsyncJobController is the controller function for the async job worker. + AsyncJobController worker.ControllerFactoryFunc + + // AsyncOperationTimeout is the default timeout duration of async operations for the operation. + AsyncOperationTimeout time.Duration + + // AsyncOperationRetryAfter is the value of the Retry-After header that will be used for async operations. + // If this is 0 then the default value of v1.DefaultRetryAfter will be used. Consider setting this to a smaller + // value like 5 seconds if your operations will complete quickly. + AsyncOperationRetryAfter time.Duration +} + +// ResourceOption is the option for ResourceNode. It defines model converters for request and response +// and configures operation for each CRUDL and custom actions. +type ResourceOption[P interface { + *T + v1.ResourceDataModel +}, T any] struct { + // linkedNode references to ResourceNode linked to this option. + linkedNode *ResourceNode + + // ResourceParamName is the parameter name of the resource. This is optional. + // If not set, the parameter name will be generated by adding "Name" suffix to the resource name. + ResourceParamName string + + // RequestConverter is the request converter. + RequestConverter v1.ConvertToDataModel[T] + + // ResponseConverter is the response converter. + ResponseConverter v1.ConvertToAPIModel[T] + + // ListPlane defines the operation for listing resources by plane scope. + ListPlane Operation[T] + + // List defines the operation for listing resources by resource group scope. + List Operation[T] + + // Get defines the operation for getting a resource. + Get Operation[T] + + // Put defines the operation for creating or updating a resource. + Put Operation[T] + + // Patch defines the operation for updating a resource. + Patch Operation[T] + + // Delete defines the operation for deleting a resource. + Delete Operation[T] + + // Custom defines the custom actions. + Custom map[string]Operation[T] +} + +// LinkResource links the resource node to the resource option. +func (r *ResourceOption[P, T]) LinkResource(node *ResourceNode) { + r.linkedNode = node +} + +// ParamName returns the parameter name of the resource. +// If ResourceParamName is not set, the parameter name will be generated by adding "Name" suffix to the resource name. +func (r *ResourceOption[P, T]) ParamName() string { + if r.ResourceParamName == "" { + typeName := r.linkedNode.Name + if strings.HasSuffix(typeName, "s") { + return typeName[:len(typeName)-1] + "Name" + } else { + return typeName + "Name" + } + } + + return r.ResourceParamName +} + +// BuildHandlerOutputs builds the handler outputs for each operation. +func (r *ResourceOption[P, T]) BuildHandlerOutputs(opts BuildOptions) []*OperationRegistration { + handlerFuncs := []func(opts BuildOptions) *OperationRegistration{ + r.listPlaneOutput, + r.listOutput, + r.getOutput, + r.putOutput, + r.patchOutput, + r.deleteOutput, + } + + hs := []*OperationRegistration{} + for _, h := range handlerFuncs { + if out := h(opts); out != nil { + hs = append(hs, out) + } + } + + return append(hs, r.customActionOutputs(opts)...) +} + +func (r *ResourceOption[P, T]) listPlaneOutput(opts BuildOptions) *OperationRegistration { + if r.ListPlane.Disabled || r.linkedNode.Kind != TrackedResourceKind { + return nil + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern, + Method: v1.OperationPlaneScopeList, + } + + if r.ListPlane.APIController != nil { + h.APIController = r.ListPlane.APIController + } else { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewListResources[P, T](opt, + controller.ResourceOptions[T]{ + ResponseConverter: r.ResponseConverter, + ListRecursiveQuery: true, + }, + ) + } + } + + return h +} + +func (r *ResourceOption[P, T]) listOutput(opts BuildOptions) *OperationRegistration { + if r.List.Disabled { + return nil + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern, + Method: v1.OperationList, + } + + if r.List.APIController != nil { + h.APIController = r.List.APIController + } else { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewListResources[P, T](opt, + controller.ResourceOptions[T]{ + ResponseConverter: r.ResponseConverter, + }, + ) + } + } + + return h +} + +func (r *ResourceOption[P, T]) getOutput(opts BuildOptions) *OperationRegistration { + if r.Get.Disabled { + return nil + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern + "/" + opts.ParameterName, + Method: v1.OperationGet, + } + + if r.Get.APIController != nil { + h.APIController = r.Get.APIController + } else { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewGetResource[P, T](opt, + controller.ResourceOptions[T]{ + ResponseConverter: r.ResponseConverter, + }, + ) + } + } + + return h +} + +func getOrDefaultAsyncOperationTimeout(d time.Duration) time.Duration { + if d == 0 { + return asyncctrl.DefaultAsyncOperationTimeout + } + return d +} + +func getOrDefaultRetryAfter(d time.Duration) time.Duration { + if d == 0 { + return v1.DefaultRetryAfterDuration + } + return d +} + +func (r *ResourceOption[P, T]) putOutput(opts BuildOptions) *OperationRegistration { + if r.Put.Disabled { + return nil + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern + "/" + opts.ParameterName, + Method: v1.OperationPut, + AsyncController: r.Delete.AsyncJobController, + } + + if r.Put.APIController != nil { + h.APIController = r.Put.APIController + } else { + ro := controller.ResourceOptions[T]{ + RequestConverter: r.RequestConverter, + ResponseConverter: r.ResponseConverter, + UpdateFilters: r.Put.UpdateFilters, + AsyncOperationTimeout: getOrDefaultAsyncOperationTimeout(r.Put.AsyncOperationTimeout), + AsyncOperationRetryAfter: getOrDefaultRetryAfter(r.Put.AsyncOperationRetryAfter), + } + + if r.Put.AsyncJobController == nil { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewDefaultSyncPut[P, T](opt, ro) + } + } else { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewDefaultAsyncPut[P, T](opt, ro) + } + } + } + h.AsyncController = r.Put.AsyncJobController + + return h +} + +func (r *ResourceOption[P, T]) patchOutput(opts BuildOptions) *OperationRegistration { + if r.Patch.Disabled { + return nil + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern + "/" + opts.ParameterName, + Method: v1.OperationPatch, + AsyncController: r.Patch.AsyncJobController, + } + + if r.Patch.APIController != nil { + h.APIController = r.Patch.APIController + } else { + ro := controller.ResourceOptions[T]{ + RequestConverter: r.RequestConverter, + ResponseConverter: r.ResponseConverter, + UpdateFilters: r.Patch.UpdateFilters, + AsyncOperationTimeout: getOrDefaultAsyncOperationTimeout(r.Patch.AsyncOperationTimeout), + AsyncOperationRetryAfter: getOrDefaultRetryAfter(r.Patch.AsyncOperationRetryAfter), + } + + if r.Patch.AsyncJobController == nil { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewDefaultSyncPut[P, T](opt, ro) + } + } else { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewDefaultAsyncPut[P, T](opt, ro) + } + } + } + + return h +} + +func (r *ResourceOption[P, T]) deleteOutput(opts BuildOptions) *OperationRegistration { + if r.Delete.Disabled { + return nil + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern + "/" + opts.ParameterName, + Method: v1.OperationDelete, + AsyncController: r.Delete.AsyncJobController, + } + + if r.Delete.APIController != nil { + h.APIController = r.Delete.APIController + } else { + ro := controller.ResourceOptions[T]{ + RequestConverter: r.RequestConverter, + ResponseConverter: r.ResponseConverter, + DeleteFilters: r.Delete.DeleteFilters, + AsyncOperationTimeout: getOrDefaultAsyncOperationTimeout(r.Delete.AsyncOperationTimeout), + AsyncOperationRetryAfter: getOrDefaultRetryAfter(r.Delete.AsyncOperationRetryAfter), + } + + if r.Delete.AsyncJobController == nil { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewDefaultSyncDelete[P, T](opt, ro) + } + } else { + h.APIController = func(opt controller.Options) (controller.Controller, error) { + return defaultoperation.NewDefaultAsyncDelete[P, T](opt, ro) + } + } + } + + return h +} + +func (r *ResourceOption[P, T]) customActionOutputs(opts BuildOptions) []*OperationRegistration { + handlers := []*OperationRegistration{} + + for name, handle := range r.Custom { + if handle.APIController == nil { + panic("APIController is required for custom action") + } + + h := &OperationRegistration{ + ResourceType: opts.ResourceType, + ResourceNamePattern: opts.ResourceNamePattern + "/" + opts.ParameterName, + Path: "/" + strings.ToLower(name), + Method: v1.OperationMethod(customActionPrefix + strings.ToUpper(name)), + APIController: handle.APIController, + AsyncController: handle.AsyncJobController, + } + handlers = append(handlers, h) + } + + return handlers +} diff --git a/pkg/armrpc/builder/operation_test.go b/pkg/armrpc/builder/operation_test.go new file mode 100644 index 0000000000..4c8141fe19 --- /dev/null +++ b/pkg/armrpc/builder/operation_test.go @@ -0,0 +1,512 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + "errors" + "testing" + "time" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/stretchr/testify/require" +) + +var ( + testBuildOptions = BuildOptions{ + ResourceType: "Applications.Compute/virtualMachines", + ResourceNamePattern: "applications.compute/virtualmachines", + } + + testBuildOptionsWithName = BuildOptions{ + ResourceType: "Applications.Compute/virtualMachines", + ResourceNamePattern: "applications.compute/virtualmachines", + ParameterName: "{virtualMachineName}", + } +) + +func TestGetOrDefaultAsyncOperationTimeout(t *testing.T) { + var zeroDuration time.Duration + require.Equal(t, time.Duration(120)*time.Second, getOrDefaultAsyncOperationTimeout(zeroDuration)) + require.Equal(t, time.Duration(1)*time.Minute, getOrDefaultAsyncOperationTimeout(time.Duration(1)*time.Minute)) +} + +func TestGetOrDefaultRetryAfter(t *testing.T) { + var zeroDuration time.Duration + require.Equal(t, time.Duration(60)*time.Second, getOrDefaultRetryAfter(zeroDuration)) + require.Equal(t, time.Duration(1)*time.Minute, getOrDefaultRetryAfter(time.Duration(1)*time.Minute)) +} + +func TestResourceOption_LinkResource(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{} + option.LinkResource(node) + require.Equal(t, node, option.linkedNode) +} + +func TestResourceOption_ParamName(t *testing.T) { + t.Run("custom parameter name", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + ResourceParamName: "virtualMachineName", + } + require.Equal(t, "virtualMachineName", option.ParamName()) + }) + + t.Run("plural resource type name", func(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{} + option.LinkResource(node) + require.Equal(t, "virtualMachineName", option.ParamName()) + }) + + t.Run("plural resource type name without s", func(t *testing.T) { + node := &ResourceNode{Name: "dice", Kind: TrackedResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{} + option.LinkResource(node) + require.Equal(t, "diceName", option.ParamName()) + }) +} + +func TestResourceOption_ListPlaneOutput(t *testing.T) { + t.Run("disabled is true", func(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + ListPlane: Operation[rpctest.TestResourceDataModel]{ + Disabled: true, + }, + } + require.Nil(t, option.listPlaneOutput(BuildOptions{})) + }) + + t.Run("non tracked resource disabled operation", func(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: ProxyResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + ListPlane: Operation[rpctest.TestResourceDataModel]{}, + } + require.Nil(t, option.listPlaneOutput(BuildOptions{})) + }) + + t.Run("custom controller", func(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + ListPlane: Operation[rpctest.TestResourceDataModel]{ + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, errors.New("ok") + }, + }, + } + h := option.listPlaneOutput(testBuildOptions) + require.NotNil(t, h) + _, err := h.APIController(controller.Options{}) + require.EqualError(t, err, "ok") + require.Equal(t, v1.OperationPlaneScopeList, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default controller", func(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + ListPlane: Operation[rpctest.TestResourceDataModel]{}, + } + h := option.listPlaneOutput(testBuildOptions) + require.NotNil(t, h) + require.NotNil(t, h.APIController) + require.Equal(t, v1.OperationPlaneScopeList, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) +} + +func TestResourceOption_ListOutput(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + t.Run("disabled is true", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + List: Operation[rpctest.TestResourceDataModel]{ + Disabled: true, + }, + } + require.Nil(t, option.listOutput(BuildOptions{})) + }) + + t.Run("custom controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + List: Operation[rpctest.TestResourceDataModel]{ + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, errors.New("ok") + }, + }, + } + h := option.listOutput(testBuildOptions) + require.NotNil(t, h) + _, err := h.APIController(controller.Options{}) + require.EqualError(t, err, "ok") + require.Equal(t, v1.OperationList, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + List: Operation[rpctest.TestResourceDataModel]{}, + } + h := option.listOutput(testBuildOptions) + require.NotNil(t, h) + require.NotNil(t, h.APIController) + require.Equal(t, v1.OperationList, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) +} + +func TestResourceOption_GetOutput(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + + t.Run("disabled is true", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Get: Operation[rpctest.TestResourceDataModel]{ + Disabled: true, + }, + } + require.Nil(t, option.getOutput(BuildOptions{})) + }) + + t.Run("custom controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Get: Operation[rpctest.TestResourceDataModel]{ + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, errors.New("ok") + }, + }, + } + h := option.getOutput(testBuildOptionsWithName) + require.NotNil(t, h) + _, err := h.APIController(controller.Options{}) + require.EqualError(t, err, "ok") + require.Equal(t, v1.OperationGet, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Get: Operation[rpctest.TestResourceDataModel]{}, + } + h := option.getOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.NotNil(t, h.APIController) + require.Equal(t, v1.OperationGet, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) +} + +func TestResourceOption_PutOutput(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + + t.Run("disabled is true", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Put: Operation[rpctest.TestResourceDataModel]{ + Disabled: true, + }, + } + require.Nil(t, option.putOutput(BuildOptions{})) + }) + + t.Run("custom controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Put: Operation[rpctest.TestResourceDataModel]{ + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, errors.New("ok") + }, + }, + } + h := option.putOutput(testBuildOptionsWithName) + require.NotNil(t, h) + _, err := h.APIController(controller.Options{}) + require.EqualError(t, err, "ok") + require.Equal(t, v1.OperationPut, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default sync controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Put: Operation[rpctest.TestResourceDataModel]{}, + } + h := option.putOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.Equal(t, v1.OperationPut, h.Method) + + api, err := h.APIController(controller.Options{}) + require.NoError(t, err) + _, ok := api.(*defaultoperation.DefaultSyncPut[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]) + require.True(t, ok) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default async controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Put: Operation[rpctest.TestResourceDataModel]{ + AsyncJobController: func(opts asyncctrl.Options) (asyncctrl.Controller, error) { + return nil, nil + }, + }, + } + h := option.putOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.Equal(t, v1.OperationPut, h.Method) + + api, err := h.APIController(controller.Options{}) + require.NoError(t, err) + _, ok := api.(*defaultoperation.DefaultAsyncPut[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]) + require.True(t, ok) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) +} + +func TestResourceOption_PatchOutput(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + + t.Run("disabled is true", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Patch: Operation[rpctest.TestResourceDataModel]{ + Disabled: true, + }, + } + require.Nil(t, option.patchOutput(BuildOptions{})) + }) + + t.Run("custom controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Patch: Operation[rpctest.TestResourceDataModel]{ + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, errors.New("ok") + }, + }, + } + h := option.patchOutput(testBuildOptionsWithName) + require.NotNil(t, h) + _, err := h.APIController(controller.Options{}) + require.EqualError(t, err, "ok") + require.Equal(t, v1.OperationPatch, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default sync controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Patch: Operation[rpctest.TestResourceDataModel]{}, + } + h := option.patchOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.Equal(t, v1.OperationPatch, h.Method) + + api, err := h.APIController(controller.Options{}) + require.NoError(t, err) + _, ok := api.(*defaultoperation.DefaultSyncPut[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]) + require.True(t, ok) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default async controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Patch: Operation[rpctest.TestResourceDataModel]{ + AsyncJobController: func(opts asyncctrl.Options) (asyncctrl.Controller, error) { + return nil, nil + }, + }, + } + h := option.patchOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.Equal(t, v1.OperationPatch, h.Method) + + api, err := h.APIController(controller.Options{}) + require.NoError(t, err) + _, ok := api.(*defaultoperation.DefaultAsyncPut[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]) + require.True(t, ok) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) +} + +func TestResourceOption_DeleteOutput(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + + t.Run("disabled is true", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Delete: Operation[rpctest.TestResourceDataModel]{ + Disabled: true, + }, + } + require.Nil(t, option.deleteOutput(BuildOptions{})) + }) + + t.Run("custom controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Delete: Operation[rpctest.TestResourceDataModel]{ + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, errors.New("ok") + }, + }, + } + h := option.deleteOutput(testBuildOptionsWithName) + require.NotNil(t, h) + _, err := h.APIController(controller.Options{}) + require.EqualError(t, err, "ok") + require.Equal(t, v1.OperationDelete, h.Method) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default sync controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Delete: Operation[rpctest.TestResourceDataModel]{}, + } + h := option.deleteOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.Equal(t, v1.OperationDelete, h.Method) + + api, err := h.APIController(controller.Options{}) + require.NoError(t, err) + _, ok := api.(*defaultoperation.DefaultSyncDelete[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]) + require.True(t, ok) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) + + t.Run("default async controller", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Delete: Operation[rpctest.TestResourceDataModel]{ + AsyncJobController: func(opts asyncctrl.Options) (asyncctrl.Controller, error) { + return nil, nil + }, + }, + } + h := option.deleteOutput(testBuildOptionsWithName) + require.NotNil(t, h) + require.Equal(t, v1.OperationDelete, h.Method) + + api, err := h.APIController(controller.Options{}) + require.NoError(t, err) + _, ok := api.(*defaultoperation.DefaultAsyncDelete[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]) + require.True(t, ok) + require.Equal(t, "Applications.Compute/virtualMachines", h.ResourceType) + require.Equal(t, "applications.compute/virtualmachines/{virtualMachineName}", h.ResourceNamePattern) + require.Empty(t, h.Path) + }) +} + +func TestResourceOption_CustomActionOutput(t *testing.T) { + node := &ResourceNode{Name: "virtualMachines", Kind: TrackedResourceKind} + t.Run("valid custom action", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Custom: map[string]Operation[rpctest.TestResourceDataModel]{ + "start": { + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, nil + }, + }, + "stop": { + APIController: func(opt controller.Options) (controller.Controller, error) { + return nil, nil + }, + }, + }, + } + + hs := option.customActionOutputs(testBuildOptionsWithName) + require.Len(t, hs, 2) + + require.NotNil(t, hs[0].APIController) + require.NotNil(t, hs[1].APIController) + + // Reset APIController to nil for comparison + hs[0].APIController = nil + hs[1].APIController = nil + + require.ElementsMatch(t, []*OperationRegistration{ + { + ResourceType: "Applications.Compute/virtualMachines", + ResourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + Path: "/start", + Method: "ACTIONSTART", + }, + { + ResourceType: "Applications.Compute/virtualMachines", + ResourceNamePattern: "applications.compute/virtualmachines/{virtualMachineName}", + Path: "/stop", + Method: "ACTIONSTOP", + }, + }, hs) + }) + + t.Run("APIController is not defined", func(t *testing.T) { + option := &ResourceOption[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel]{ + linkedNode: node, + Custom: map[string]Operation[rpctest.TestResourceDataModel]{ + "start": {}, + }, + } + require.Panics(t, func() { + _ = option.customActionOutputs(testBuildOptionsWithName) + }) + }) +} diff --git a/pkg/armrpc/builder/types.go b/pkg/armrpc/builder/types.go new file mode 100644 index 0000000000..4b265c964d --- /dev/null +++ b/pkg/armrpc/builder/types.go @@ -0,0 +1,82 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package builder + +import ( + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" +) + +// ResourceKind represents the kind of resource. +type ResourceKind string + +const ( + // NamespaceResourceKind represents the namespace resource kind. + NamespaceResourceKind ResourceKind = "Namespace" + + // TrackedResourceKind represents the tracked resource kind. + TrackedResourceKind ResourceKind = "TrackedResource" + + // ProxyResourceKind represents the proxy resource kind. + ProxyResourceKind ResourceKind = "ProxyResource" +) + +// ResourceOptionBuilder is the interface for resource option. +type ResourceOptionBuilder interface { + // LinkResource links the resource node to the resource option. + LinkResource(*ResourceNode) + + // ParamName gets the resource name for resource type. + ParamName() string + + // BuildHandlerOutputs builds the resource outputs which constructs the API routing path and handlers. + BuildHandlerOutputs(BuildOptions) []*OperationRegistration +} + +// BuildOptions is the options for building resource outputs. +type BuildOptions struct { + // ResourceType represents the resource type. + ResourceType string + + // ParameterName represents the resource name for resource type. + ParameterName string + + // ResourceNamePattern represents the resource name pattern used for HTTP routing path. + ResourceNamePattern string +} + +// OperationRegistration is the output for building resource outputs. +type OperationRegistration struct { + // ResourceType represents the resource type. + ResourceType string + + // ResourceNamePattern represents the resource name pattern used for HTTP routing path. + ResourceNamePattern string + + // Path represents additional custom action path after resource name. + Path string + + // Method represents the operation method. + Method v1.OperationMethod + + // APIController represents the API controller handler. + APIController server.ControllerFactoryFunc + + // AsyncController represents the async controller handler. + AsyncController worker.ControllerFactoryFunc +} diff --git a/pkg/armrpc/frontend/controller/controller.go b/pkg/armrpc/frontend/controller/controller.go index cea4130853..d7c8bab554 100644 --- a/pkg/armrpc/frontend/controller/controller.go +++ b/pkg/armrpc/frontend/controller/controller.go @@ -61,7 +61,7 @@ type Options struct { // KubeClient is the Kubernetes controller runtime client. KubeClient runtimeclient.Client - // ResourceType is the string that represents the resource type. May be empty of the controller + // ResourceType is the string that represents the resource type. May be empty if the controller // does not represent a single type of resource. ResourceType string diff --git a/pkg/armrpc/frontend/defaultoperation/getavailableoperations.go b/pkg/armrpc/frontend/defaultoperation/getavailableoperations.go new file mode 100644 index 0000000000..6dcc1bab5b --- /dev/null +++ b/pkg/armrpc/frontend/defaultoperation/getavailableoperations.go @@ -0,0 +1,50 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package defaultoperation + +import ( + "context" + "net/http" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" +) + +var _ ctrl.Controller = (*GetOperations)(nil) + +// GetOperations is the controller implementation to get arm rpc available operations. +type GetOperations struct { + ctrl.BaseController + + availableOperations []any +} + +// NewGetOperations creates a new GetOperations controller and returns it, or returns an error if one occurs. +func NewGetOperations(opts ctrl.Options, opsList []v1.Operation) (ctrl.Controller, error) { + ops := []any{} + for _, o := range opsList { + ops = append(ops, o) + } + return &GetOperations{ctrl.NewBaseController(opts), ops}, nil +} + +// Run returns the list of available operations/permission for the resource provider at tenant level. +// Spec: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/proxy-api-reference.md#exposing-available-operations +func (opctrl *GetOperations) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { + return rest.NewOKResponse(&v1.PaginatedList{Value: opctrl.availableOperations}), nil +} diff --git a/pkg/armrpc/frontend/defaultoperation/getoperationresult.go b/pkg/armrpc/frontend/defaultoperation/getoperationresult.go index bf2abbc946..e5f64effd8 100644 --- a/pkg/armrpc/frontend/defaultoperation/getoperationresult.go +++ b/pkg/armrpc/frontend/defaultoperation/getoperationresult.go @@ -56,12 +56,24 @@ func (e *GetOperationResult) Run(ctx context.Context, w http.ResponseWriter, req return rest.NewBadRequestResponse(err.Error()), nil } - os := &manager.Status{} - _, err = e.GetResource(ctx, id.String(), os) - if err != nil && errors.Is(&store.ErrNotFound{ID: id.String()}, err) { + // Avoid using GetResource or e.StorageClient since they will use a different + // storage client than the one we want. + storageClient, err := e.DataProvider().GetStorageClient(ctx, id.ProviderNamespace()+"/operationstatuses") + if err != nil { + return nil, err + } + + obj, err := storageClient.Get(ctx, id.String()) + if errors.Is(&store.ErrNotFound{ID: id.String()}, err) { return rest.NewNotFoundResponse(id), nil } + os := &manager.Status{} + err = obj.As(os) + if err != nil { + return nil, err + } + if !os.Status.IsTerminal() { headers := map[string]string{ "Location": req.URL.String(), diff --git a/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go b/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go index e9276d806c..978e9f42aa 100644 --- a/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go +++ b/pkg/armrpc/frontend/defaultoperation/getoperationresult_test.go @@ -28,7 +28,9 @@ import ( manager "github.com/radius-project/radius/pkg/armrpc/asyncoperation/statusmanager" ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/ucp/dataprovider" "github.com/radius-project/radius/pkg/ucp/store" + "github.com/radius-project/radius/test/testcontext" "github.com/radius-project/radius/test/testutil" "github.com/golang/mock/gomock" @@ -36,27 +38,34 @@ import ( ) func TestGetOperationResultRun(t *testing.T) { - mctrl := gomock.NewController(t) - defer mctrl.Finish() - - mStorageClient := store.NewMockStorageClient(mctrl) - ctx := context.Background() - rawDataModel := testutil.ReadFixture("operationstatus_datamodel.json") osDataModel := &manager.Status{} - _ = json.Unmarshal(rawDataModel, osDataModel) + err := json.Unmarshal(rawDataModel, osDataModel) + require.NoError(t, err) rawExpectedOutput := testutil.ReadFixture("operationstatus_output.json") expectedOutput := &v1.AsyncOperationStatus{} - _ = json.Unmarshal(rawExpectedOutput, expectedOutput) + err = json.Unmarshal(rawExpectedOutput, expectedOutput) + require.NoError(t, err) t.Run("get non-existing resource", func(t *testing.T) { + mctrl := gomock.NewController(t) + + operationResultStoreClient := store.NewMockStorageClient(mctrl) + operationStatusStoreClient := store.NewMockStorageClient(mctrl) + + dataProvider := dataprovider.NewMockDataStorageProvider(mctrl) + dataProvider.EXPECT(). + GetStorageClient(gomock.Any(), "Applications.Core/operationstatuses"). + Return(operationStatusStoreClient, nil). + Times(1) + w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, operationStatusTestHeaderFile, nil) + req, err := rpctest.NewHTTPRequestFromJSON(testcontext.New(t), http.MethodGet, operationStatusTestHeaderFile, nil) require.NoError(t, err) ctx := rpctest.NewARMRequestContext(req) - mStorageClient. + operationStatusStoreClient. EXPECT(). Get(gomock.Any(), gomock.Any()). DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { @@ -64,7 +73,8 @@ func TestGetOperationResultRun(t *testing.T) { }) ctl, err := NewGetOperationResult(ctrl.Options{ - StorageClient: mStorageClient, + DataProvider: dataProvider, + StorageClient: operationResultStoreClient, // Will not be used. }) require.NoError(t, err) @@ -114,15 +124,25 @@ func TestGetOperationResultRun(t *testing.T) { for _, tt := range opResTestCases { t.Run(tt.desc, func(t *testing.T) { + mctrl := gomock.NewController(t) + operationResultStoreClient := store.NewMockStorageClient(mctrl) + operationStatusStoreClient := store.NewMockStorageClient(mctrl) + + dataProvider := dataprovider.NewMockDataStorageProvider(mctrl) + dataProvider.EXPECT(). + GetStorageClient(gomock.Any(), "Applications.Core/operationstatuses"). + Return(operationStatusStoreClient, nil). + Times(1) + w := httptest.NewRecorder() - req, err := rpctest.NewHTTPRequestFromJSON(ctx, http.MethodGet, operationStatusTestHeaderFile, nil) + req, err := rpctest.NewHTTPRequestFromJSON(testcontext.New(t), http.MethodGet, operationStatusTestHeaderFile, nil) require.NoError(t, err) ctx := rpctest.NewARMRequestContext(req) osDataModel.Status = tt.provisioningState osDataModel.RetryAfter = time.Second * 5 - mStorageClient. + operationStatusStoreClient. EXPECT(). Get(gomock.Any(), gomock.Any()). DoAndReturn(func(ctx context.Context, id string, _ ...store.GetOptions) (*store.Object, error) { @@ -133,7 +153,8 @@ func TestGetOperationResultRun(t *testing.T) { }) ctl, err := NewGetOperationResult(ctrl.Options{ - StorageClient: mStorageClient, + DataProvider: dataProvider, + StorageClient: operationResultStoreClient, // Will not be used. }) require.NoError(t, err) diff --git a/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_datamodel.json b/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_datamodel.json index 95731f8d21..83bfbf97a2 100644 --- a/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_datamodel.json +++ b/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_datamodel.json @@ -5,8 +5,8 @@ "operationType": "PUT", "location": "West US", "status": "Succeeded", - "startTime": "2022-05-16T10:24:58+0000", - "endTime": "2022-05-16T17:24:58+0000", + "startTime": "2022-05-16T10:24:58.000000Z", + "endTime": "2022-05-16T17:24:58.000000Z", "percentComplete": "100", "properties": { "provisioningState": "Succeeded" diff --git a/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_output.json b/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_output.json index 65785327d9..42602e8d6f 100644 --- a/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_output.json +++ b/pkg/armrpc/frontend/defaultoperation/testdata/operationstatus_output.json @@ -5,8 +5,8 @@ "operationType": "PUT", "location": "West US", "status": "Succeeded", - "startTime": "2022-05-16T10:24:58+0000", - "endTime": "2022-05-16T17:24:58+0000", + "startTime": "2022-05-16T10:24:58.000000Z", + "endTime": "2022-05-16T17:24:58.000000Z", "percentComplete": "100", "properties": { "provisioningState": "Succeeded" diff --git a/pkg/armrpc/frontend/server/handler.go b/pkg/armrpc/frontend/server/handler.go index 612c150bd2..a32279f734 100644 --- a/pkg/armrpc/frontend/server/handler.go +++ b/pkg/armrpc/frontend/server/handler.go @@ -29,7 +29,6 @@ import ( ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" "github.com/radius-project/radius/pkg/armrpc/rest" - "github.com/radius-project/radius/pkg/armrpc/servicecontext" "github.com/radius-project/radius/pkg/ucp/ucplog" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.opentelemetry.io/otel/attribute" @@ -47,7 +46,7 @@ var ( ErrInvalidOperationTypeOption = errors.New("the resource type and method must be specified if the operation type is not specified") ) -type ControllerFunc func(ctrl.Options) (ctrl.Controller, error) +type ControllerFactoryFunc func(ctrl.Options) (ctrl.Controller, error) // HandlerOptions represents a controller to be registered with the server. // @@ -85,7 +84,7 @@ type HandlerOptions struct { OperationType *v1.OperationType // ControllerFactory is a function invoked to create the controller. Will be invoked once during server startup. - ControllerFactory ControllerFunc + ControllerFactory ControllerFactoryFunc // Middlewares are the middlewares to apply to the handler. Middlewares []func(http.Handler) http.Handler @@ -101,10 +100,16 @@ func NewSubrouter(parent chi.Router, path string, middlewares ...func(http.Handl // HandlerForController creates a http.HandlerFunc function that runs resource provider frontend controller, renders a // http response from the returned rest.Response, and handles the error as a default internal error if this controller returns error. -func HandlerForController(controller ctrl.Controller) http.HandlerFunc { +func HandlerForController(controller ctrl.Controller, operationType v1.OperationType) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { ctx := req.Context() - addRequestAttributes(ctx, req) + + rpcCtx := v1.ARMRequestContextFromContext(ctx) + // Set the operation type in the context. + rpcCtx.OperationType = operationType + + // Add OTEL labels for the telemetry. + withOtelLabelsForRequest(req) response, err := controller.Run(ctx, w, req) if err != nil { @@ -159,9 +164,8 @@ func RegisterHandler(ctx context.Context, opts HandlerOptions, ctrlOpts ctrl.Opt return nil } - middlewares := append(opts.Middlewares, servicecontext.WithOperationType(*opts.OperationType)) - handler := HandlerForController(ctrl) - namedRouter := opts.ParentRouter.With(middlewares...) + handler := HandlerForController(ctrl, *opts.OperationType) + namedRouter := opts.ParentRouter.With(opts.Middlewares...) if opts.Path == CatchAllPath { namedRouter.HandleFunc(opts.Path, handler) } else { @@ -171,13 +175,13 @@ func RegisterHandler(ctx context.Context, opts HandlerOptions, ctrlOpts ctrl.Opt return nil } -func addRequestAttributes(ctx context.Context, req *http.Request) { - labeler, ok := otelhttp.LabelerFromContext(ctx) +func withOtelLabelsForRequest(req *http.Request) { + labeler, ok := otelhttp.LabelerFromContext(req.Context()) if !ok { return } - armContext := v1.ARMRequestContextFromContext(ctx) + armContext := v1.ARMRequestContextFromContext(req.Context()) resourceID := armContext.ResourceID if resourceID.IsResource() || resourceID.IsResourceCollection() { @@ -193,7 +197,7 @@ func ConfigureDefaultHandlers( rootScopePath string, isAzureProvider bool, providerNamespace string, - operationCtrlFactory ControllerFunc, + operationCtrlFactory ControllerFactoryFunc, ctrlOpts ctrl.Options) error { providerNamespace = strings.ToLower(providerNamespace) rt := providerNamespace + "/providers" @@ -230,7 +234,7 @@ func ConfigureDefaultHandlers( ParentRouter: rootRouter, Path: opStatus, ResourceType: statusRT, - Method: v1.OperationGetOperationStatuses, + Method: v1.OperationGet, ControllerFactory: defaultoperation.NewGetOperationStatus, }, ctrlOpts) if err != nil { @@ -242,7 +246,7 @@ func ConfigureDefaultHandlers( ParentRouter: rootRouter, Path: opResult, ResourceType: statusRT, - Method: v1.OperationGetOperationResult, + Method: v1.OperationGet, ControllerFactory: defaultoperation.NewGetOperationResult, }, ctrlOpts) if err != nil { diff --git a/pkg/armrpc/frontend/server/handler_test.go b/pkg/armrpc/frontend/server/handler_test.go index db7b005f24..d052c0be40 100644 --- a/pkg/armrpc/frontend/server/handler_test.go +++ b/pkg/armrpc/frontend/server/handler_test.go @@ -17,6 +17,7 @@ limitations under the License. package server import ( + "bytes" "context" "encoding/json" "errors" @@ -29,6 +30,8 @@ import ( "github.com/golang/mock/gomock" v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rest" + "github.com/radius-project/radius/pkg/armrpc/rpctest" "github.com/radius-project/radius/pkg/middleware" "github.com/radius-project/radius/pkg/ucp/dataprovider" "github.com/radius-project/radius/test/testcontext" @@ -261,3 +264,28 @@ func Test_HandlerErrInternal(t *testing.T) { require.Equal(t, v1.CodeInternal, armerr.Error.Code) require.Equal(t, armerr.Error.Message, "Internal error") } + +type testAPIController struct { + ctrl.Operation[*rpctest.TestResourceDataModel, rpctest.TestResourceDataModel] +} + +func (e *testAPIController) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { + return nil, nil +} + +func Test_HandlerForController_OperationType(t *testing.T) { + expectedType := v1.OperationType{Type: "Applications.Compute/virtualMachines", Method: "GET"} + + handler := HandlerForController(&testAPIController{}, expectedType) + w := httptest.NewRecorder() + + req, err := http.NewRequest(http.MethodGet, "", bytes.NewBuffer([]byte{})) + require.NoError(t, err) + + rCtx := &v1.ARMRequestContext{} + req = req.WithContext(v1.WithARMRequestContext(context.Background(), rCtx)) + + handler.ServeHTTP(w, req) + + require.Equal(t, expectedType.String(), rCtx.OperationType.String()) +} diff --git a/pkg/armrpc/frontend/server/server.go b/pkg/armrpc/frontend/server/server.go index b69895580a..95e5550333 100644 --- a/pkg/armrpc/frontend/server/server.go +++ b/pkg/armrpc/frontend/server/server.go @@ -38,13 +38,13 @@ const ( ) type Options struct { - ProviderNamespace string - Location string - Address string - PathBase string - EnableArmAuth bool - Configure func(chi.Router) error - ArmCertMgr *authentication.ArmCertManager + ServiceName string + Location string + Address string + PathBase string + EnableArmAuth bool + Configure func(chi.Router) error + ArmCertMgr *authentication.ArmCertManager } // New creates a frontend server that can listen on the provided address and serve requests - it creates an HTTP server with a router, @@ -54,7 +54,7 @@ func New(ctx context.Context, options Options) (*http.Server, error) { r := chi.NewRouter() r.Use(middleware.Recoverer) - r.Use(middleware.WithLogger(options.ProviderNamespace)) + r.Use(middleware.WithLogger) r.NotFound(validator.APINotFoundHandler()) r.MethodNotAllowed(validator.APIMethodNotAllowedHandler()) @@ -77,7 +77,7 @@ func New(ctx context.Context, options Options) (*http.Server, error) { handlerFunc := otelhttp.NewHandler( middleware.LowercaseURLPath(r), - options.ProviderNamespace, + options.ServiceName, otelhttp.WithMeterProvider(otel.GetMeterProvider()), otelhttp.WithTracerProvider(otel.GetTracerProvider())) diff --git a/pkg/armrpc/frontend/server/service.go b/pkg/armrpc/frontend/server/service.go index 9a51ac2dc3..f46244cfbe 100644 --- a/pkg/armrpc/frontend/server/service.go +++ b/pkg/armrpc/frontend/server/service.go @@ -58,17 +58,12 @@ func (s *Service) Init(ctx context.Context) error { logger := ucplog.FromContextOrDiscard(ctx) s.StorageProvider = dataprovider.NewStorageProvider(s.Options.Config.StorageProvider) - qp := qprovider.New(s.ProviderName, s.Options.Config.QueueProvider) - opSC, err := s.StorageProvider.GetStorageClient(ctx, s.ProviderName+"/operationstatuses") - if err != nil { - return err - } + qp := qprovider.New(s.Options.Config.QueueProvider) reqQueueClient, err := qp.GetClient(ctx) if err != nil { return err } - s.OperationStatusManager = manager.New(opSC, reqQueueClient, s.ProviderName, s.Options.Config.Env.RoleLocation) - + s.OperationStatusManager = manager.New(s.StorageProvider, reqQueueClient, s.Options.Config.Env.RoleLocation) s.KubeClient, err = kubeutil.NewRuntimeClient(s.Options.K8sConfig) if err != nil { return err diff --git a/pkg/armrpc/rpctest/routers.go b/pkg/armrpc/rpctest/routers.go index 73300eb1f1..4838eed556 100644 --- a/pkg/armrpc/rpctest/routers.go +++ b/pkg/armrpc/rpctest/routers.go @@ -52,9 +52,9 @@ func AssertRouters(t *testing.T, tests []HandlerTestSpec, pathBase, rootScope st r, err := configureRouter(ctx) require.NoError(t, err) - t.Log("Avaiable routes:") + t.Log("Available routes:") err = chi.Walk(r, func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error { - t.Logf("Method: %s, Path: %s", method, route) + t.Logf("Method: %s, Path: %s, Middlewares: %+v", method, route, middlewares) return nil }) require.NoError(t, err) @@ -86,35 +86,48 @@ func AssertRouters(t *testing.T, tests []HandlerTestSpec, pathBase, rootScope st if tt.SkipOperationTypeValidation { return } + }) + } +} + +// AssertRequests asserts that the restful APIs matches the routes and its operation type matches the given test cases. +// This is working only for test controllers. If you want to validate the routes for the real controllers, use AssertRouters. +func AssertRequests(t *testing.T, tests []HandlerTestSpec, pathBase, rootScope string, configureRouter func(context.Context) (chi.Router, error)) { + ctx := testcontext.New(t) + r, err := configureRouter(ctx) + require.NoError(t, err) + + t.Log("Available routes:") + err = chi.Walk(r, func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error { + t.Logf("Method: %s, Path: %s, Middlewares: %+v", method, route, middlewares) + return nil + }) + require.NoError(t, err) + + for _, tt := range tests { + pb := "" + if !tt.SkipPathBase { + pb = pathBase + } - err = chi.Walk(r, func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error { - if tctx.RoutePattern() == route && tt.Method == method { - found := false - for _, m := range middlewares { - w := httptest.NewRecorder() - - // It will not validate body. - req, err := http.NewRequest(tt.Method, uri, bytes.NewBuffer([]byte{})) - require.NoError(t, err) - - rCtx := &v1.ARMRequestContext{} - req = req.WithContext(v1.WithARMRequestContext(context.Background(), rCtx)) - - // Pass empty router to validate operation type. - testr := chi.NewRouter() - m(testr).ServeHTTP(w, req) - if tt.OperationType.String() == rCtx.OperationType.String() { - t.Log("Found operation type") - found = true - break - } - } - require.True(t, found, "operation type not found") - } - return nil - }) + uri := pb + rootScope + tt.Path + if tt.WithoutRootScope { + uri = pb + tt.Path + } + + t.Run(tt.Method+"|"+tt.Path, func(t *testing.T) { + w := httptest.NewRecorder() + // It will not validate body. + req, err := http.NewRequest(tt.Method, uri, bytes.NewBuffer([]byte{})) require.NoError(t, err) + + rCtx := &v1.ARMRequestContext{} + req = req.WithContext(v1.WithARMRequestContext(context.Background(), rCtx)) + + r.ServeHTTP(w, req) + require.NotEqual(t, 404, w.Result().StatusCode) + require.Equal(t, tt.OperationType.String(), rCtx.OperationType.String(), "operation type not found: %s %s %s", uri, tt.Method, rCtx.OperationType.String()) }) } } diff --git a/pkg/armrpc/rpctest/testdatamodel.go b/pkg/armrpc/rpctest/testdatamodel.go new file mode 100644 index 0000000000..bc6183bec0 --- /dev/null +++ b/pkg/armrpc/rpctest/testdatamodel.go @@ -0,0 +1,166 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rpctest + +import ( + "encoding/json" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/to" +) + +const ( + TestAPIVersion = "2022-03-15-privatepreview" +) + +// TestResourceDataModel represents test resource. +type TestResourceDataModel struct { + v1.BaseResource + + // Properties is the properties of the resource. + Properties *TestResourceDataModelProperties `json:"properties"` +} + +// ResourceTypeName returns the qualified name of the resource +func (r *TestResourceDataModel) ResourceTypeName() string { + return "Applications.Core/resources" +} + +// TestResourceDataModelProperties represents the properties of TestResourceDataModel. +type TestResourceDataModelProperties struct { + Application string `json:"application"` + Environment string `json:"environment"` + PropertyA string `json:"propertyA,omitempty"` + PropertyB string `json:"propertyB,omitempty"` +} + +// TestResource represents test resource for api version. +type TestResource struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SystemData *v1.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Properties *TestResourceProperties `json:"properties,omitempty"` + Tags map[string]*string `json:"tags,omitempty"` +} + +// TestResourceProperties - HTTP Route properties +type TestResourceProperties struct { + ProvisioningState *v1.ProvisioningState `json:"provisioningState,omitempty"` + Environment *string `json:"environment,omitempty"` + Application *string `json:"application,omitempty"` + PropertyA *string `json:"propertyA,omitempty"` + PropertyB *string `json:"propertyB,omitempty"` +} + +// # Function Explanation +// +// ConvertTo converts a version specific TestResource into a version-agnostic resource, TestResourceDataModel. +func (src *TestResource) ConvertTo() (v1.DataModelInterface, error) { + converted := &TestResourceDataModel{ + BaseResource: v1.BaseResource{ + TrackedResource: v1.TrackedResource{ + ID: to.String(src.ID), + Name: to.String(src.Name), + Type: to.String(src.Type), + Location: to.String(src.Location), + Tags: to.StringMap(src.Tags), + }, + InternalMetadata: v1.InternalMetadata{ + UpdatedAPIVersion: TestAPIVersion, + AsyncProvisioningState: toProvisioningStateDataModel(src.Properties.ProvisioningState), + }, + }, + Properties: &TestResourceDataModelProperties{ + Application: to.String(src.Properties.Application), + Environment: to.String(src.Properties.Environment), + PropertyA: to.String(src.Properties.PropertyA), + PropertyB: to.String(src.Properties.PropertyB), + }, + } + return converted, nil +} + +// # Function Explanation +// +// ConvertFrom converts src version agnostic model to versioned model, TestResource. +func (dst *TestResource) ConvertFrom(src v1.DataModelInterface) error { + dm, ok := src.(*TestResourceDataModel) + if !ok { + return v1.ErrInvalidModelConversion + } + + dst.ID = to.Ptr(dm.ID) + dst.Name = to.Ptr(dm.Name) + dst.Type = to.Ptr(dm.Type) + dst.SystemData = &dm.SystemData + dst.Location = to.Ptr(dm.Location) + dst.Tags = *to.StringMapPtr(dm.Tags) + dst.Properties = &TestResourceProperties{ + ProvisioningState: fromProvisioningStateDataModel(dm.InternalMetadata.AsyncProvisioningState), + Environment: to.Ptr(dm.Properties.Environment), + Application: to.Ptr(dm.Properties.Application), + PropertyA: to.Ptr(dm.Properties.PropertyA), + PropertyB: to.Ptr(dm.Properties.PropertyB), + } + + return nil +} + +func toProvisioningStateDataModel(state *v1.ProvisioningState) v1.ProvisioningState { + if state == nil { + return v1.ProvisioningStateAccepted + } + return *state +} + +func fromProvisioningStateDataModel(state v1.ProvisioningState) *v1.ProvisioningState { + converted := v1.ProvisioningStateAccepted + if state != "" { + converted = state + } + + return &converted +} + +func TestResourceDataModelToVersioned(model *TestResourceDataModel, version string) (v1.VersionedModelInterface, error) { + switch version { + case TestAPIVersion: + versioned := &TestResource{} + err := versioned.ConvertFrom(model) + return versioned, err + + default: + return nil, v1.ErrUnsupportedAPIVersion + } +} + +func TestResourceDataModelFromVersioned(content []byte, version string) (*TestResourceDataModel, error) { + switch version { + case TestAPIVersion: + am := &TestResource{} + if err := json.Unmarshal(content, am); err != nil { + return nil, err + } + dm, err := am.ConvertTo() + return dm.(*TestResourceDataModel), err + + default: + return nil, v1.ErrUnsupportedAPIVersion + } +} diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go index e072b609b2..6b5dbc5986 100644 --- a/pkg/corerp/backend/service.go +++ b/pkg/corerp/backend/service.go @@ -30,6 +30,7 @@ import ( "github.com/radius-project/radius/pkg/corerp/datamodel" "github.com/radius-project/radius/pkg/corerp/model" "github.com/radius-project/radius/pkg/corerp/processors/extenders" + "github.com/radius-project/radius/pkg/kubeutil" "github.com/radius-project/radius/pkg/portableresources" pr_backend_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" "github.com/radius-project/radius/pkg/portableresources/processors" @@ -84,16 +85,21 @@ func (w *Service) Run(ctx context.Context) error { return err } - coreAppModel, err := model.NewApplicationModel(w.Options.Arm, w.KubeClient, w.KubeClientSet, w.KubeDiscoveryClient, w.KubeDynamicClientSet) + k8s, err := kubeutil.NewClients(w.Options.K8sConfig) + if err != nil { + return fmt.Errorf("failed to initialize kubernetes clients: %w", err) + } + + coreAppModel, err := model.NewApplicationModel(w.Options.Arm, k8s.RuntimeClient, k8s.ClientSet, k8s.DiscoveryClient, k8s.DynamicClient) if err != nil { return fmt.Errorf("failed to initialize application model: %w", err) } opts := ctrl.Options{ DataProvider: w.StorageProvider, - KubeClient: w.KubeClient, + KubeClient: k8s.RuntimeClient, GetDeploymentProcessor: func() deployment.DeploymentProcessor { - return deployment.NewDeploymentProcessor(coreAppModel, w.StorageProvider, w.KubeClient, w.KubeClientSet) + return deployment.NewDeploymentProcessor(coreAppModel, w.StorageProvider, k8s.RuntimeClient, k8s.ClientSet) }, } @@ -113,7 +119,7 @@ func (w *Service) Run(ctx context.Context) error { } } - client := processors.NewResourceClient(w.Options.Arm, w.Options.UCPConnection, w.KubeClient, w.KubeDiscoveryClient) + client := processors.NewResourceClient(w.Options.Arm, w.Options.UCPConnection, k8s.RuntimeClient, k8s.DiscoveryClient) clientOptions := sdk.NewClientOptions(w.Options.UCPConnection) deploymentEngineClient, err := clients.NewResourceDeploymentsClient(&clients.Options{ @@ -133,18 +139,18 @@ func (w *Service) Run(ctx context.Context) error { recipes.TemplateKindTerraform: driver.NewTerraformDriver(w.Options.UCPConnection, provider.NewSecretProvider(w.Options.Config.SecretProvider), driver.TerraformOptions{ Path: w.Options.Config.Terraform.Path, - }, w.KubeClientSet), + }, k8s.ClientSet), }, }) opts.GetDeploymentProcessor = nil extenderCreateOrUpdateController := func(options ctrl.Options) (ctrl.Controller, error) { processor := &extenders.Processor{} - return pr_backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](processor, engine, client, configLoader, options) + return pr_backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](options, processor, engine, client, configLoader) } extenderDeleteController := func(options ctrl.Options) (ctrl.Controller, error) { processor := &extenders.Processor{} - return pr_backend_ctrl.NewDeleteResource[*datamodel.Extender, datamodel.Extender](processor, engine, configLoader, options) + return pr_backend_ctrl.NewDeleteResource[*datamodel.Extender, datamodel.Extender](options, processor, engine, configLoader) } // Register controllers to run backend processing for extenders. diff --git a/pkg/corerp/frontend/handler/getoperations_test.go b/pkg/corerp/frontend/handler/getoperations_test.go deleted file mode 100644 index d43066d618..0000000000 --- a/pkg/corerp/frontend/handler/getoperations_test.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "context" - "net/http/httptest" - "testing" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" - "github.com/radius-project/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" - "github.com/stretchr/testify/require" -) - -func TestRunWith20220315PrivatePreview(t *testing.T) { - // arrange - opts := ctrl.Options{} - op, err := NewGetOperations(opts) - require.NoError(t, err) - ctx := v1.WithARMRequestContext(context.Background(), &v1.ARMRequestContext{ - APIVersion: v20220315privatepreview.Version, - }) - w := httptest.NewRecorder() - - // act - resp, err := op.Run(ctx, w, nil) - - // assert - require.NoError(t, err) - switch v := resp.(type) { - case *rest.OKResponse: - pagination, ok := v.Body.(*v1.PaginatedList) - require.True(t, ok) - require.Equal(t, 24, len(pagination.Value)) - default: - require.Truef(t, false, "should not return error") - } -} - -func TestRunWithUnsupportedAPIVersion(t *testing.T) { - // arrange - opts := ctrl.Options{} - op, err := NewGetOperations(opts) - require.NoError(t, err) - ctx := v1.WithARMRequestContext(context.Background(), &v1.ARMRequestContext{ - APIVersion: "unknownversion", - }) - w := httptest.NewRecorder() - - // act - resp, err := op.Run(ctx, w, nil) - - // assert - require.NoError(t, err) - switch v := resp.(type) { - case *rest.NotFoundResponse: - armerr := v.Body - require.Equal(t, v1.CodeInvalidResourceType, armerr.Error.Code) - default: - require.Truef(t, false, "should not return error") - } -} diff --git a/pkg/corerp/frontend/handler/routes_test.go b/pkg/corerp/frontend/handler/routes_test.go index 22ab8b1392..735b57091d 100644 --- a/pkg/corerp/frontend/handler/routes_test.go +++ b/pkg/corerp/frontend/handler/routes_test.go @@ -217,11 +217,11 @@ var handlerTests = []rpctest.HandlerTestSpec{ Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", Method: http.MethodDelete, }, { - OperationType: v1.OperationType{Type: "Applications.Core/operationStatuses", Method: v1.OperationGetOperationStatuses}, + OperationType: v1.OperationType{Type: "Applications.Core/operationStatuses", Method: v1.OperationGet}, Path: "/providers/applications.core/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", Method: http.MethodGet, }, { - OperationType: v1.OperationType{Type: "Applications.Core/operationStatuses", Method: v1.OperationGetOperationResult}, + OperationType: v1.OperationType{Type: "Applications.Core/operationResults", Method: v1.OperationGet}, Path: "/providers/applications.core/locations/global/operationresults/00000000-0000-0000-0000-000000000000", Method: http.MethodGet, }, diff --git a/pkg/corerp/frontend/service.go b/pkg/corerp/frontend/service.go deleted file mode 100644 index 07125565ab..0000000000 --- a/pkg/corerp/frontend/service.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package frontend - -import ( - "context" - "fmt" - - "github.com/go-chi/chi/v5" - ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" - "github.com/radius-project/radius/pkg/armrpc/frontend/server" - "github.com/radius-project/radius/pkg/armrpc/hostoptions" - "github.com/radius-project/radius/pkg/corerp/frontend/handler" - "github.com/radius-project/radius/pkg/recipes" - "github.com/radius-project/radius/pkg/recipes/driver" - "github.com/radius-project/radius/pkg/recipes/engine" - "github.com/radius-project/radius/pkg/sdk" - "github.com/radius-project/radius/pkg/ucp/secret/provider" -) - -type Service struct { - server.Service -} - -// NewService creates a new Service instance with the given options. -func NewService(options hostoptions.HostOptions) *Service { - return &Service{ - server.Service{ - Options: options, - ProviderName: handler.ProviderNamespaceName, - }, - } -} - -// Name returns the namespace of the resource provider. -func (s *Service) Name() string { - return handler.ProviderNamespaceName -} - -// Run initializes the service and starts the server with the specified options. -func (s *Service) Run(ctx context.Context) error { - if err := s.Init(ctx); err != nil { - return err - } - - // Creates a new engine with the drivers. The engine will be used to fetch Recipe parameter information from the template path. - clientOptions := sdk.NewClientOptions(s.Options.UCPConnection) - engine := engine.NewEngine(engine.Options{ - Drivers: map[string]driver.Driver{ - recipes.TemplateKindBicep: driver.NewBicepDriver(clientOptions, nil, nil), - recipes.TemplateKindTerraform: driver.NewTerraformDriver(s.Options.UCPConnection, provider.NewSecretProvider(s.Options.Config.SecretProvider), - driver.TerraformOptions{ - Path: s.Options.Config.Terraform.Path, - }, nil), - }, - }) - - opts := ctrl.Options{ - Address: fmt.Sprintf("%s:%d", s.Options.Config.Server.Host, s.Options.Config.Server.Port), - PathBase: s.Options.Config.Server.PathBase, - DataProvider: s.StorageProvider, - KubeClient: s.KubeClient, - StatusManager: s.OperationStatusManager, - } - - err := s.Start(ctx, server.Options{ - Address: opts.Address, - ProviderNamespace: s.ProviderName, - Location: s.Options.Config.Env.RoleLocation, - PathBase: s.Options.Config.Server.PathBase, - // set the arm cert manager for managing client certificate - ArmCertMgr: s.ARMCertManager, - EnableArmAuth: s.Options.Config.Server.EnableArmAuth, // when enabled the client cert validation will be done - Configure: func(router chi.Router) error { - err := handler.AddRoutes(ctx, router, !hostoptions.IsSelfHosted(), opts, engine) - if err != nil { - return err - } - - return nil - }}, - ) - return err -} diff --git a/pkg/corerp/setup/operations.go b/pkg/corerp/setup/operations.go new file mode 100644 index 0000000000..d132ae4800 --- /dev/null +++ b/pkg/corerp/setup/operations.go @@ -0,0 +1,262 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package setup + +import v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + +var operationList = []v1.Operation{ + { + Name: "Applications.Core/operations/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "operations", + Operation: "Get operations", + Description: "Get the list of operations", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/environments/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "environments", + Operation: "List environments", + Description: "Get the list of environments.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/environments/write", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "environments", + Operation: "Create/Update environment", + Description: "Create or update an environment.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/environments/delete", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "environments", + Operation: "Delete environment", + Description: "Delete an environment.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/environments/getmetadata/action", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "environments", + Operation: "Get recipe metadata", + Description: "Get recipe metadata.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/environments/join/action", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "environments", + Operation: "Join environment", + Description: "Join to application environment.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/register/action", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "Applications.Core", + Operation: "Register Applications.Core", + Description: "Register the subscription for Applications.Core.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/unregister/action", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "Applications.Core", + Operation: "Unregister Applications.Core", + Description: "Unregister the subscription for Applications.Core.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/httproutes/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "httproutes", + Operation: "List httproutes", + Description: "Get the list of httproutes.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/httproutes/write", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "httproutes", + Operation: "Create/Update httproute", + Description: "Create or update an httproute.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/httproutes/delete", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "httproutes", + Operation: "Delete httproute", + Description: "Delete an httproute.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/applications/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "applications", + Operation: "List applications", + Description: "Get the list of applications.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/applications/write", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "applications", + Operation: "Create/Update application", + Description: "Create or update an application.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/applications/delete", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "applications", + Operation: "Delete application", + Description: "Delete an application.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/gateways/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "gateways", + Operation: "List gateways", + Description: "Get the list of gateways.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/gateways/write", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "gateways", + Operation: "Create/Update gateway", + Description: "Create or Update a gateway.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/gateways/delete", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "gateways", + Operation: "delete gateway", + Description: "Delete a gateway.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/containers/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "containers", + Operation: "List containers", + Description: "Get the list of containers.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/containers/write", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "containers", + Operation: "Create/Update container", + Description: "Create or update a container.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/containers/delete", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "containers", + Operation: "Delete container", + Description: "Delete a container.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/extenders/read", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "extenders", + Operation: "Get/List extenders", + Description: "Gets/Lists extender link(s).", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/extenders/write", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "extenders", + Operation: "Create/Update extenders", + Description: "Creates or updates a extender resource.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/extenders/delete", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "extenders", + Operation: "Delete extender", + Description: "Deletes a extender resource.", + }, + IsDataAction: false, + }, + { + Name: "Applications.Core/extenders/listsecrets/action", + Display: &v1.OperationDisplayProperties{ + Provider: "Applications.Core", + Resource: "extenders", + Operation: "List secrets", + Description: "Lists extender secrets.", + }, + IsDataAction: false, + }, +} diff --git a/pkg/corerp/setup/setup.go b/pkg/corerp/setup/setup.go new file mode 100644 index 0000000000..b4884fa5ad --- /dev/null +++ b/pkg/corerp/setup/setup.go @@ -0,0 +1,217 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package setup + +import ( + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/builder" + apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/corerp/datamodel" + "github.com/radius-project/radius/pkg/corerp/datamodel/converter" + "github.com/radius-project/radius/pkg/recipes/controllerconfig" + + backend_ctrl "github.com/radius-project/radius/pkg/corerp/backend/controller" + app_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/applications" + ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" + env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" + ext_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/extenders" + gw_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" + secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" + vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" + rp_frontend "github.com/radius-project/radius/pkg/rp/frontend" + + ext_processor "github.com/radius-project/radius/pkg/corerp/processors/extenders" + pr_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" +) + +// SetupNamespace builds the namespace for core resource provider. +func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerConfig) *builder.Namespace { + ns := builder.NewNamespace("Applications.Core") + + _ = ns.AddResource("environments", &builder.ResourceOption[*datamodel.Environment, datamodel.Environment]{ + RequestConverter: converter.EnvironmentDataModelFromVersioned, + ResponseConverter: converter.EnvironmentDataModelToVersioned, + + Put: builder.Operation[datamodel.Environment]{ + APIController: env_ctrl.NewCreateOrUpdateEnvironment, + }, + Patch: builder.Operation[datamodel.Environment]{ + APIController: env_ctrl.NewCreateOrUpdateEnvironment, + }, + Custom: map[string]builder.Operation[datamodel.Environment]{ + "getmetadata": { + APIController: func(opt apictrl.Options) (apictrl.Controller, error) { + return env_ctrl.NewGetRecipeMetadata(opt, recipeControllerConfig.Engine) + }, + }, + }, + }) + + _ = ns.AddResource("applications", &builder.ResourceOption[*datamodel.Application, datamodel.Application]{ + RequestConverter: converter.ApplicationDataModelFromVersioned, + ResponseConverter: converter.ApplicationDataModelToVersioned, + + Put: builder.Operation[datamodel.Application]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.Application]{ + rp_frontend.PrepareRadiusResource[*datamodel.Application], + app_ctrl.CreateAppScopedNamespace, + }, + }, + Patch: builder.Operation[datamodel.Application]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.Application]{ + rp_frontend.PrepareRadiusResource[*datamodel.Application], + app_ctrl.CreateAppScopedNamespace, + }, + }, + }) + + _ = ns.AddResource("httpRoutes", &builder.ResourceOption[*datamodel.HTTPRoute, datamodel.HTTPRoute]{ + RequestConverter: converter.HTTPRouteDataModelFromVersioned, + ResponseConverter: converter.HTTPRouteDataModelToVersioned, + + Put: builder.Operation[datamodel.HTTPRoute]{ + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + Patch: builder.Operation[datamodel.HTTPRoute]{ + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + }) + + _ = ns.AddResource("containers", &builder.ResourceOption[*datamodel.ContainerResource, datamodel.ContainerResource]{ + RequestConverter: converter.ContainerDataModelFromVersioned, + ResponseConverter: converter.ContainerDataModelToVersioned, + + Put: builder.Operation[datamodel.ContainerResource]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.ContainerResource]{ + rp_frontend.PrepareRadiusResource[*datamodel.ContainerResource], + ctr_ctrl.ValidateAndMutateRequest, + }, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + Patch: builder.Operation[datamodel.ContainerResource]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.ContainerResource]{ + rp_frontend.PrepareRadiusResource[*datamodel.ContainerResource], + ctr_ctrl.ValidateAndMutateRequest, + }, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + }) + + _ = ns.AddResource("gateways", &builder.ResourceOption[*datamodel.Gateway, datamodel.Gateway]{ + RequestConverter: converter.GatewayDataModelFromVersioned, + ResponseConverter: converter.GatewayDataModelToVersioned, + + Put: builder.Operation[datamodel.Gateway]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.Gateway]{ + rp_frontend.PrepareRadiusResource[*datamodel.Gateway], + gw_ctrl.ValidateAndMutateRequest, + }, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + Patch: builder.Operation[datamodel.Gateway]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.Gateway]{ + rp_frontend.PrepareRadiusResource[*datamodel.Gateway], + gw_ctrl.ValidateAndMutateRequest, + }, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + }) + + _ = ns.AddResource("volumes", &builder.ResourceOption[*datamodel.VolumeResource, datamodel.VolumeResource]{ + RequestConverter: converter.VolumeResourceModelFromVersioned, + ResponseConverter: converter.VolumeResourceModelToVersioned, + + Put: builder.Operation[datamodel.VolumeResource]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.VolumeResource]{ + rp_frontend.PrepareRadiusResource[*datamodel.VolumeResource], + vol_ctrl.ValidateRequest, + }, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + Patch: builder.Operation[datamodel.VolumeResource]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.VolumeResource]{ + rp_frontend.PrepareRadiusResource[*datamodel.VolumeResource], + vol_ctrl.ValidateRequest, + }, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + }, + }) + + _ = ns.AddResource("secretStores", &builder.ResourceOption[*datamodel.SecretStore, datamodel.SecretStore]{ + RequestConverter: converter.SecretStoreModelFromVersioned, + ResponseConverter: converter.SecretStoreModelToVersioned, + + Put: builder.Operation[datamodel.SecretStore]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.SecretStore]{ + rp_frontend.PrepareRadiusResource[*datamodel.SecretStore], + secret_ctrl.ValidateAndMutateRequest, + secret_ctrl.UpsertSecret, + }, + }, + Patch: builder.Operation[datamodel.SecretStore]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.SecretStore]{ + rp_frontend.PrepareRadiusResource[*datamodel.SecretStore], + secret_ctrl.ValidateAndMutateRequest, + secret_ctrl.UpsertSecret, + }, + }, + Delete: builder.Operation[datamodel.SecretStore]{ + DeleteFilters: []apictrl.DeleteFilter[datamodel.SecretStore]{ + secret_ctrl.DeleteRadiusSecret, + }, + }, + Custom: map[string]builder.Operation[datamodel.SecretStore]{ + "listsecrets": { + APIController: secret_ctrl.NewListSecrets, + }, + }, + }) + + _ = ns.AddResource("extenders", &builder.ResourceOption[*datamodel.Extender, datamodel.Extender]{ + RequestConverter: converter.ExtenderDataModelFromVersioned, + ResponseConverter: converter.ExtenderDataModelToVersioned, + + Put: builder.Operation[datamodel.Extender]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.Extender]{ + rp_frontend.PrepareRadiusResource[*datamodel.Extender], + }, + AsyncJobController: func(options asyncctrl.Options) (asyncctrl.Controller, error) { + return pr_ctrl.NewCreateOrUpdateResource(options, &ext_processor.Processor{}, recipeControllerConfig.Engine, recipeControllerConfig.ResourceClient, recipeControllerConfig.ConfigLoader) + }, + }, + Patch: builder.Operation[datamodel.Extender]{ + UpdateFilters: []apictrl.UpdateFilter[datamodel.Extender]{ + rp_frontend.PrepareRadiusResource[*datamodel.Extender], + }, + }, + Delete: builder.Operation[datamodel.Extender]{ + AsyncJobController: func(options asyncctrl.Options) (asyncctrl.Controller, error) { + return pr_ctrl.NewDeleteResource(options, &ext_processor.Processor{}, recipeControllerConfig.Engine, recipeControllerConfig.ConfigLoader) + }, + }, + Custom: map[string]builder.Operation[datamodel.Extender]{ + "listsecrets": { + APIController: ext_ctrl.NewListSecretsExtender, + }, + }, + }) + + // Optional + ns.SetAvailableOperations(operationList) + + return ns +} diff --git a/pkg/corerp/setup/setup_test.go b/pkg/corerp/setup/setup_test.go new file mode 100644 index 0000000000..f6817359e0 --- /dev/null +++ b/pkg/corerp/setup/setup_test.go @@ -0,0 +1,253 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package setup + +import ( + "context" + "net/http" + "testing" + + "github.com/go-chi/chi/v5" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + + v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" + "github.com/radius-project/radius/pkg/armrpc/builder" + apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/rpctest" + "github.com/radius-project/radius/pkg/recipes/controllerconfig" + "github.com/radius-project/radius/pkg/ucp/dataprovider" + "github.com/radius-project/radius/pkg/ucp/store" + + app_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/applications" + ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" + env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" + gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" + hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes" + secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" + vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" +) + +var handlerTests = []rpctest.HandlerTestSpec{ + { + OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/applications", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/applications", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/containers", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/containers", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/environments", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/environments", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: "ACTIONGETMETADATA"}, + Path: "/resourcegroups/testrg/providers/applications.core/environments/env0/getmetadata", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/gateways", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/gateways", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/httproutes", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/httproutes", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/secretstores", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/secretstores", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: "ACTIONLISTSECRETS"}, + Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0/listsecrets", + Method: http.MethodPost, + }, { + OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationPlaneScopeList}, + Path: "/providers/applications.core/volumes", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationList}, + Path: "/resourcegroups/testrg/providers/applications.core/volumes", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationGet}, + Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationPut}, + Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", + Method: http.MethodPut, + }, { + OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationPatch}, + Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", + Method: http.MethodPatch, + }, { + OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationDelete}, + Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", + Method: http.MethodDelete, + }, { + OperationType: v1.OperationType{Type: "Applications.Core/operationStatuses", Method: v1.OperationGet}, + Path: "/providers/applications.core/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, { + OperationType: v1.OperationType{Type: "Applications.Core/operationStatuses", Method: v1.OperationGet}, + Path: "/providers/applications.core/locations/global/operationresults/00000000-0000-0000-0000-000000000000", + Method: http.MethodGet, + }, +} + +func TestRouter(t *testing.T) { + mctrl := gomock.NewController(t) + + mockSP := dataprovider.NewMockDataStorageProvider(mctrl) + mockSC := store.NewMockStorageClient(mctrl) + + mockSC.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.Object{}, nil).AnyTimes() + mockSC.EXPECT().Save(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + mockSP.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Return(store.StorageClient(mockSC), nil).AnyTimes() + + cfg := &controllerconfig.RecipeControllerConfig{} + ns := SetupNamespace(cfg) + nsBuilder := ns.GenerateBuilder() + + rpctest.AssertRouters(t, handlerTests, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { + r := chi.NewRouter() + validator, err := builder.NewOpenAPIValidator(ctx, "/api.ucp.dev", "applications.core") + require.NoError(t, err) + return r, nsBuilder.ApplyAPIHandlers(ctx, r, apictrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}, validator) + }) +} diff --git a/pkg/kubeutil/client.go b/pkg/kubeutil/client.go index 9b83219ff3..593a9269c5 100644 --- a/pkg/kubeutil/client.go +++ b/pkg/kubeutil/client.go @@ -21,12 +21,62 @@ import ( apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/client-go/discovery" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" csidriver "sigs.k8s.io/secrets-store-csi-driver/apis/v1alpha1" ) +// Clients is a collection of Kubernetes clients. +type Clients struct { + // RuntimeClient is the Kubernetes controller runtime client. + RuntimeClient runtimeclient.Client + + // ClientSet is the Kubernetes client-go strongly-typed client. + ClientSet *kubernetes.Clientset + + // DiscoveryClient is the Kubernetes client-go discovery client. + DiscoveryClient *discovery.DiscoveryClient + + // DynamicClient is the Kubernetes client-go dynamic client. + DynamicClient dynamic.Interface +} + +// NewClients creates a new Kubernetes client set and controller runtime client using the given config. +func NewClients(config *rest.Config) (*Clients, error) { + c := &Clients{} + + var err error + c.RuntimeClient, err = NewRuntimeClient(config) + if err != nil { + return nil, err + } + + c.ClientSet, err = kubernetes.NewForConfig(config) + if err != nil { + return nil, err + } + + c.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(config) + if err != nil { + return nil, err + } + + // Use legacy discovery client to avoid the issue of the staled GroupVersion discovery(api.ucp.dev/v1alpha3). + // TODO: Disable UseLegacyDiscovery once https://github.com/radius-project/radius/issues/5974 is resolved. + c.DiscoveryClient.UseLegacyDiscovery = true + + c.DynamicClient, err = dynamic.NewForConfig(config) + if err != nil { + return nil, err + } + + return c, nil +} + // NewRuntimeClient creates a new runtime client using the given config and adds the // required resource schemes to the client. func NewRuntimeClient(config *rest.Config) (runtimeclient.Client, error) { diff --git a/pkg/middleware/logger.go b/pkg/middleware/logger.go index 427384ab29..ac5e5a9f87 100644 --- a/pkg/middleware/logger.go +++ b/pkg/middleware/logger.go @@ -24,20 +24,16 @@ import ( ) // WithLogger adds logger to the context based on the Resource ID (if present). -func WithLogger(serviceName string) func(h http.Handler) http.Handler { - return func(h http.Handler) http.Handler { - fn := func(w http.ResponseWriter, r *http.Request) { - id, err := resources.Parse(r.URL.Path) - if err != nil { - // This just means the request is for an ARM resource. Not an error. - h.ServeHTTP(w, r) - return - } - - ctx := ucplog.WrapLogContext(r.Context(), ucplog.LogFieldResourceID, id.String()) - h.ServeHTTP(w, r.WithContext(ctx)) +func WithLogger(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + id, err := resources.Parse(r.URL.Path) + if err != nil { + // This just means the request is for an ARM resource. Not an error. + h.ServeHTTP(w, r) + return } - return http.HandlerFunc(fn) - } + ctx := ucplog.WrapLogContext(r.Context(), ucplog.LogFieldResourceID, id.String()) + h.ServeHTTP(w, r.WithContext(ctx)) + }) } diff --git a/pkg/portableresources/backend/controller/createorupdateresource.go b/pkg/portableresources/backend/controller/createorupdateresource.go index d41de121d2..05aad4e8a4 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource.go +++ b/pkg/portableresources/backend/controller/createorupdateresource.go @@ -47,7 +47,7 @@ type CreateOrUpdateResource[P interface { func NewCreateOrUpdateResource[P interface { *T rpv1.RadiusResourceModel -}, T any](processor processors.ResourceProcessor[P, T], eng engine.Engine, client processors.ResourceClient, configurationLoader configloader.ConfigurationLoader, opts ctrl.Options) (ctrl.Controller, error) { +}, T any](opts ctrl.Options, processor processors.ResourceProcessor[P, T], eng engine.Engine, client processors.ResourceClient, configurationLoader configloader.ConfigurationLoader) (ctrl.Controller, error) { return &CreateOrUpdateResource[P, T]{ ctrl.NewBaseAsyncController(opts), processor, diff --git a/pkg/portableresources/backend/controller/createorupdateresource_test.go b/pkg/portableresources/backend/controller/createorupdateresource_test.go index 6a15df3873..ea65a55a08 100644 --- a/pkg/portableresources/backend/controller/createorupdateresource_test.go +++ b/pkg/portableresources/backend/controller/createorupdateresource_test.go @@ -33,6 +33,7 @@ import ( "github.com/radius-project/radius/pkg/portableresources/processors" "github.com/radius-project/radius/pkg/recipes" "github.com/radius-project/radius/pkg/recipes/configloader" + "github.com/radius-project/radius/pkg/recipes/controllerconfig" "github.com/radius-project/radius/pkg/recipes/engine" rpv1 "github.com/radius-project/radius/pkg/rp/v1" "github.com/radius-project/radius/pkg/ucp/resources" @@ -139,7 +140,7 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { cases := []struct { description string - factory func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) + factory func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) getErr error conversionFailure bool recipeErr error @@ -151,8 +152,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }{ { "get-not-found", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(errorProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, errorProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, &store.ErrNotFound{ID: TestResourceID}, false, @@ -165,8 +166,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "get-error", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(errorProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, errorProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, &store.ErrInvalid{}, false, @@ -179,8 +180,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "conversion-failure", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(errorProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, errorProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, nil, true, @@ -193,8 +194,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "recipe-err", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(errorProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, errorProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, nil, false, @@ -207,8 +208,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "runtime-configuration-err", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(errorProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, errorProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, nil, false, @@ -221,8 +222,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "processor-err", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(errorProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, errorProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, nil, false, @@ -235,8 +236,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "save-err", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(successProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, successProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, nil, false, @@ -249,8 +250,8 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { }, { "success", - func(eng engine.Engine, client processors.ResourceClient, cfg configloader.ConfigurationLoader, options ctrl.Options) (ctrl.Controller, error) { - return NewCreateOrUpdateResource(successProcessorReference, eng, client, cfg, options) + func(recipeCfg *controllerconfig.RecipeControllerConfig, options ctrl.Options) (ctrl.Controller, error) { + return NewCreateOrUpdateResource(options, successProcessorReference, recipeCfg.Engine, recipeCfg.ResourceClient, recipeCfg.ConfigLoader) }, nil, false, @@ -403,7 +404,13 @@ func TestCreateOrUpdateResource_Run(t *testing.T) { StorageClient: msc, } - genCtrl, err := tt.factory(eng, client, cfg, opts) + recipeCfg := &controllerconfig.RecipeControllerConfig{ + Engine: eng, + ResourceClient: client, + ConfigLoader: cfg, + } + + genCtrl, err := tt.factory(recipeCfg, opts) require.NoError(t, err) res, err := genCtrl.Run(context.Background(), req) diff --git a/pkg/portableresources/backend/controller/deleteresource.go b/pkg/portableresources/backend/controller/deleteresource.go index d33ed3ea4f..67d374b25a 100644 --- a/pkg/portableresources/backend/controller/deleteresource.go +++ b/pkg/portableresources/backend/controller/deleteresource.go @@ -45,7 +45,7 @@ type DeleteResource[P interface { func NewDeleteResource[P interface { *T rpv1.RadiusResourceModel -}, T any](processor processors.ResourceProcessor[P, T], eng engine.Engine, configurationLoader configloader.ConfigurationLoader, opts ctrl.Options) (ctrl.Controller, error) { +}, T any](opts ctrl.Options, processor processors.ResourceProcessor[P, T], eng engine.Engine, configurationLoader configloader.ConfigurationLoader) (ctrl.Controller, error) { return &DeleteResource[P, T]{ ctrl.NewBaseAsyncController(opts), processor, diff --git a/pkg/portableresources/backend/controller/deleteresource_test.go b/pkg/portableresources/backend/controller/deleteresource_test.go index e101f56525..2fc612b3da 100644 --- a/pkg/portableresources/backend/controller/deleteresource_test.go +++ b/pkg/portableresources/backend/controller/deleteresource_test.go @@ -151,7 +151,7 @@ func TestDeleteResourceRun_20220315PrivatePreview(t *testing.T) { StorageClient: msc, } - ctrl, err := NewDeleteResource(successProcessorReference, eng, configLoader, opts) + ctrl, err := NewDeleteResource(opts, successProcessorReference, eng, configLoader) require.NoError(t, err) _, err = ctrl.Run(context.Background(), req) diff --git a/pkg/portableresources/backend/service.go b/pkg/portableresources/backend/service.go index 440765cc94..808fed7e60 100644 --- a/pkg/portableresources/backend/service.go +++ b/pkg/portableresources/backend/service.go @@ -23,7 +23,6 @@ import ( v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" "github.com/radius-project/radius/pkg/armrpc/hostoptions" - aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" dapr_dm "github.com/radius-project/radius/pkg/daprrp/datamodel" "github.com/radius-project/radius/pkg/daprrp/processors/pubsubbrokers" "github.com/radius-project/radius/pkg/daprrp/processors/secretstores" @@ -32,23 +31,16 @@ import ( mongo_prc "github.com/radius-project/radius/pkg/datastoresrp/processors/mongodatabases" redis_prc "github.com/radius-project/radius/pkg/datastoresrp/processors/rediscaches" sql_prc "github.com/radius-project/radius/pkg/datastoresrp/processors/sqldatabases" + "github.com/radius-project/radius/pkg/kubeutil" msg_dm "github.com/radius-project/radius/pkg/messagingrp/datamodel" "github.com/radius-project/radius/pkg/messagingrp/processors/rabbitmqqueues" "github.com/radius-project/radius/pkg/portableresources" "github.com/radius-project/radius/pkg/portableresources/frontend/handler" - "github.com/radius-project/radius/pkg/portableresources/processors" - "github.com/radius-project/radius/pkg/recipes" - "github.com/radius-project/radius/pkg/recipes/configloader" - "github.com/radius-project/radius/pkg/recipes/driver" - "github.com/radius-project/radius/pkg/recipes/engine" - "github.com/radius-project/radius/pkg/sdk" - "github.com/radius-project/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/recipes/controllerconfig" ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" backend_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" - - "github.com/radius-project/radius/pkg/ucp/secret/provider" ) type Service struct { @@ -76,29 +68,19 @@ func (s *Service) Run(ctx context.Context) error { return err } - client := processors.NewResourceClient(s.Options.Arm, s.Options.UCPConnection, s.KubeClient, s.KubeDiscoveryClient) - clientOptions := sdk.NewClientOptions(s.Options.UCPConnection) + k8s, err := kubeutil.NewClients(s.Options.K8sConfig) + if err != nil { + return fmt.Errorf("failed to initialize kubernetes client: %w", err) + } - deploymentEngineClient, err := clients.NewResourceDeploymentsClient(&clients.Options{ - Cred: &aztoken.AnonymousCredential{}, - BaseURI: s.Options.UCPConnection.Endpoint(), - ARMClientOptions: clientOptions, - }) + recipeControllerConfig, err := controllerconfig.New(s.Options) if err != nil { return err } - configLoader := configloader.NewEnvironmentLoader(clientOptions) - engine := engine.NewEngine(engine.Options{ - ConfigurationLoader: configLoader, - Drivers: map[string]driver.Driver{ - recipes.TemplateKindBicep: driver.NewBicepDriver(clientOptions, deploymentEngineClient, client), - recipes.TemplateKindTerraform: driver.NewTerraformDriver(s.Options.UCPConnection, provider.NewSecretProvider(s.Options.Config.SecretProvider), - driver.TerraformOptions{ - Path: s.Options.Config.Terraform.Path, - }, s.KubeClientSet), - }, - }) + engine := recipeControllerConfig.Engine + client := recipeControllerConfig.ResourceClient + configLoader := recipeControllerConfig.ConfigLoader // resourceTypes is the array that holds resource types that needs async processing. // We use this array to register backend controllers for each resource. @@ -111,84 +93,84 @@ func (s *Service) Run(ctx context.Context) error { portableresources.RabbitMQQueuesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &rabbitmqqueues.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, client, configLoader, options) + return backend_ctrl.NewCreateOrUpdateResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { processor := &rabbitmqqueues.Processor{} - return backend_ctrl.NewDeleteResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](processor, engine, configLoader, options) + return backend_ctrl.NewDeleteResource[*msg_dm.RabbitMQQueue, msg_dm.RabbitMQQueue](options, processor, engine, configLoader) }, }, { portableresources.DaprStateStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &statestores.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, client, configLoader, options) + processor := &statestores.Processor{Client: k8s.RuntimeClient} + return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &statestores.Processor{Client: s.KubeClient} - return backend_ctrl.NewDeleteResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](processor, engine, configLoader, options) + processor := &statestores.Processor{Client: k8s.RuntimeClient} + return backend_ctrl.NewDeleteResource[*dapr_dm.DaprStateStore, dapr_dm.DaprStateStore](options, processor, engine, configLoader) }, }, { portableresources.DaprSecretStoresResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &secretstores.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, client, configLoader, options) + processor := &secretstores.Processor{Client: k8s.RuntimeClient} + return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &secretstores.Processor{Client: s.KubeClient} - return backend_ctrl.NewDeleteResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](processor, engine, configLoader, options) + processor := &secretstores.Processor{Client: k8s.RuntimeClient} + return backend_ctrl.NewDeleteResource[*dapr_dm.DaprSecretStore, dapr_dm.DaprSecretStore](options, processor, engine, configLoader) }, }, { portableresources.DaprPubSubBrokersResourceType, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &pubsubbrokers.Processor{Client: s.KubeClient} - return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, client, configLoader, options) + processor := &pubsubbrokers.Processor{Client: k8s.RuntimeClient} + return backend_ctrl.NewCreateOrUpdateResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { - processor := &pubsubbrokers.Processor{Client: s.KubeClient} - return backend_ctrl.NewDeleteResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](processor, engine, configLoader, options) + processor := &pubsubbrokers.Processor{Client: k8s.RuntimeClient} + return backend_ctrl.NewDeleteResource[*dapr_dm.DaprPubSubBroker, dapr_dm.DaprPubSubBroker](options, processor, engine, configLoader) }, }, { portableresources.MongoDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &mongo_prc.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](processor, engine, client, configLoader, options) + return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { processor := &mongo_prc.Processor{} - return backend_ctrl.NewDeleteResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](processor, engine, configLoader, options) + return backend_ctrl.NewDeleteResource[*ds_dm.MongoDatabase, ds_dm.MongoDatabase](options, processor, engine, configLoader) }, }, { portableresources.RedisCachesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &redis_prc.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.RedisCache, ds_dm.RedisCache](processor, engine, client, configLoader, options) + return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.RedisCache, ds_dm.RedisCache](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { processor := &redis_prc.Processor{} - return backend_ctrl.NewDeleteResource[*ds_dm.RedisCache, ds_dm.RedisCache](processor, engine, configLoader, options) + return backend_ctrl.NewDeleteResource[*ds_dm.RedisCache, ds_dm.RedisCache](options, processor, engine, configLoader) }, }, { portableresources.SqlDatabasesResourceType, func(options ctrl.Options) (ctrl.Controller, error) { processor := &sql_prc.Processor{} - return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](processor, engine, client, configLoader, options) + return backend_ctrl.NewCreateOrUpdateResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](options, processor, engine, client, configLoader) }, func(options ctrl.Options) (ctrl.Controller, error) { processor := &sql_prc.Processor{} - return backend_ctrl.NewDeleteResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](processor, engine, configLoader, options) + return backend_ctrl.NewDeleteResource[*ds_dm.SqlDatabase, ds_dm.SqlDatabase](options, processor, engine, configLoader) }, }, } opts := ctrl.Options{ DataProvider: s.StorageProvider, - KubeClient: s.KubeClient, + KubeClient: k8s.RuntimeClient, } for _, rt := range resourceTypes { @@ -197,13 +179,11 @@ func (s *Service) Run(ctx context.Context) error { if err != nil { return err } - err = s.Controllers.Register(ctx, rt.TypeName, v1.OperationPut, rt.CreatePutController, opts) if err != nil { return err } } - workerOpts := worker.Options{} if s.Options.Config.WorkerServer != nil { if s.Options.Config.WorkerServer.MaxOperationConcurrency != nil { diff --git a/pkg/portableresources/frontend/handler/routes_test.go b/pkg/portableresources/frontend/handler/routes_test.go index 29802a4bf4..ccc8f96a65 100644 --- a/pkg/portableresources/frontend/handler/routes_test.go +++ b/pkg/portableresources/frontend/handler/routes_test.go @@ -219,20 +219,20 @@ var handlerTests = []rpctest.HandlerTestSpec{ Path: "/resourcegroups/testrg/providers/applications.datastores/sqldatabases/sql/listsecrets", Method: http.MethodPost, }, { - OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGetOperationStatuses}, + OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGet}, Path: "/providers/applications.messaging/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", Method: http.MethodGet, }, { - OperationType: v1.OperationType{Type: "Applications.Messaging/operationStatuses", Method: v1.OperationGetOperationResult}, + OperationType: v1.OperationType{Type: "Applications.Messaging/operationResults", Method: v1.OperationGet}, Path: "/providers/applications.messaging/locations/global/operationresults/00000000-0000-0000-0000-000000000000", Method: http.MethodGet, }, { - OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGetOperationStatuses}, + OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGet}, Path: "/providers/applications.dapr/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", Method: http.MethodGet, }, { - OperationType: v1.OperationType{Type: "Applications.Dapr/operationStatuses", Method: v1.OperationGetOperationResult}, + OperationType: v1.OperationType{Type: "Applications.Dapr/operationResults", Method: v1.OperationGet}, Path: "/providers/applications.dapr/locations/global/operationresults/00000000-0000-0000-0000-000000000000", Method: http.MethodGet, }, diff --git a/pkg/portableresources/frontend/service.go b/pkg/portableresources/frontend/service.go index b83a0f4027..eb35116912 100644 --- a/pkg/portableresources/frontend/service.go +++ b/pkg/portableresources/frontend/service.go @@ -61,10 +61,10 @@ func (s *Service) Run(ctx context.Context) error { } err := s.Start(ctx, server.Options{ - Address: opts.Address, - ProviderNamespace: s.ProviderName, - Location: s.Options.Config.Env.RoleLocation, - PathBase: s.Options.Config.Server.PathBase, + Address: opts.Address, + ServiceName: s.ProviderName, + Location: s.Options.Config.Env.RoleLocation, + PathBase: s.Options.Config.Server.PathBase, // set the arm cert manager for managing client certificate ArmCertMgr: s.ARMCertManager, EnableArmAuth: s.Options.Config.Server.EnableArmAuth, // when enabled the client cert validation will be done diff --git a/pkg/recipes/controllerconfig/config.go b/pkg/recipes/controllerconfig/config.go new file mode 100644 index 0000000000..e40b93cf87 --- /dev/null +++ b/pkg/recipes/controllerconfig/config.go @@ -0,0 +1,85 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package controllerconfig + +import ( + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" + "github.com/radius-project/radius/pkg/kubeutil" + "github.com/radius-project/radius/pkg/portableresources/processors" + "github.com/radius-project/radius/pkg/recipes" + "github.com/radius-project/radius/pkg/recipes/configloader" + "github.com/radius-project/radius/pkg/recipes/driver" + "github.com/radius-project/radius/pkg/recipes/engine" + "github.com/radius-project/radius/pkg/sdk" + "github.com/radius-project/radius/pkg/sdk/clients" + "github.com/radius-project/radius/pkg/ucp/secret/provider" +) + +// RecipeControllerConfig is the configuration for the controllers which uses recipe. +type RecipeControllerConfig struct { + // K8sClients is the collections of Kubernetes clients. + K8sClients *kubeutil.Clients + + // ResourceClient is a client used by resource processors for interacting with UCP resources. + ResourceClient processors.ResourceClient + + // ConfigLoader is the configuration loader. + ConfigLoader configloader.ConfigurationLoader + + // DeploymentEngineClient is the client for interacting with the deployment engine. + DeploymentEngineClient *clients.ResourceDeploymentsClient + + // Engine is the engine for executing recipes. + Engine engine.Engine +} + +// New creates a new RecipeControllerConfig instance with the given host options. +func New(options hostoptions.HostOptions) (*RecipeControllerConfig, error) { + cfg := &RecipeControllerConfig{} + var err error + cfg.K8sClients, err = kubeutil.NewClients(options.K8sConfig) + if err != nil { + return nil, err + } + + cfg.ResourceClient = processors.NewResourceClient(options.Arm, options.UCPConnection, cfg.K8sClients.RuntimeClient, cfg.K8sClients.DiscoveryClient) + clientOptions := sdk.NewClientOptions(options.UCPConnection) + + cfg.DeploymentEngineClient, err = clients.NewResourceDeploymentsClient(&clients.Options{ + Cred: &aztoken.AnonymousCredential{}, + BaseURI: options.UCPConnection.Endpoint(), + ARMClientOptions: sdk.NewClientOptions(options.UCPConnection), + }) + if err != nil { + return nil, err + } + + cfg.ConfigLoader = configloader.NewEnvironmentLoader(clientOptions) + cfg.Engine = engine.NewEngine(engine.Options{ + ConfigurationLoader: cfg.ConfigLoader, + Drivers: map[string]driver.Driver{ + recipes.TemplateKindBicep: driver.NewBicepDriver(clientOptions, cfg.DeploymentEngineClient, cfg.ResourceClient), + recipes.TemplateKindTerraform: driver.NewTerraformDriver(options.UCPConnection, provider.NewSecretProvider(options.Config.SecretProvider), + driver.TerraformOptions{ + Path: options.Config.Terraform.Path, + }, cfg.K8sClients.ClientSet), + }, + }) + + return cfg, nil +} diff --git a/pkg/server/apiservice.go b/pkg/server/apiservice.go new file mode 100644 index 0000000000..b92d6fe2f2 --- /dev/null +++ b/pkg/server/apiservice.go @@ -0,0 +1,89 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package server + +import ( + "context" + "fmt" + + "github.com/go-chi/chi/v5" + + "github.com/radius-project/radius/pkg/armrpc/builder" + apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" + "github.com/radius-project/radius/pkg/armrpc/frontend/server" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" +) + +// APIService is the restful API server for Radius Resource Provider. +type APIService struct { + server.Service + + handlerBuilder []builder.Builder +} + +// NewAPIService creates a new instance of APIService. +func NewAPIService(options hostoptions.HostOptions, builder []builder.Builder) *APIService { + return &APIService{ + Service: server.Service{ + ProviderName: "radius", + Options: options, + }, + handlerBuilder: builder, + } +} + +// Name returns the name of the service. +func (s *APIService) Name() string { + return "radiusapi" +} + +// Run starts the service. +func (s *APIService) Run(ctx context.Context) error { + if err := s.Init(ctx); err != nil { + return err + } + + address := fmt.Sprintf("%s:%d", s.Options.Config.Server.Host, s.Options.Config.Server.Port) + return s.Start(ctx, server.Options{ + Location: s.Options.Config.Env.RoleLocation, + Address: address, + PathBase: s.Options.Config.Server.PathBase, + Configure: func(r chi.Router) error { + for _, b := range s.handlerBuilder { + opts := apictrl.Options{ + PathBase: s.Options.Config.Server.PathBase, + DataProvider: s.StorageProvider, + KubeClient: s.KubeClient, + StatusManager: s.OperationStatusManager, + } + + validator, err := builder.NewOpenAPIValidator(ctx, opts.PathBase, b.Namespace()) + if err != nil { + panic(err) + } + + if err := b.ApplyAPIHandlers(ctx, r, opts, validator); err != nil { + panic(err) + } + } + return nil + }, + // set the arm cert manager for managing client certificate + ArmCertMgr: s.ARMCertManager, + EnableArmAuth: s.Options.Config.Server.EnableArmAuth, // when enabled the client cert validation will be done + }) +} diff --git a/pkg/server/asyncworker.go b/pkg/server/asyncworker.go new file mode 100644 index 0000000000..15dfb3850d --- /dev/null +++ b/pkg/server/asyncworker.go @@ -0,0 +1,97 @@ +/* +Copyright 2023 The Radius Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package server + +import ( + "context" + "fmt" + + ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" + "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" + "github.com/radius-project/radius/pkg/armrpc/builder" + "github.com/radius-project/radius/pkg/armrpc/hostoptions" + "github.com/radius-project/radius/pkg/corerp/backend/deployment" + "github.com/radius-project/radius/pkg/corerp/model" + "github.com/radius-project/radius/pkg/kubeutil" +) + +// AsyncWorker is a service to run AsyncReqeustProcessWorker. +type AsyncWorker struct { + worker.Service + + handlerBuilder []builder.Builder +} + +// NewAsyncWorker creates new service instance to run AsyncReqeustProcessWorker. +func NewAsyncWorker(options hostoptions.HostOptions, builder []builder.Builder) *AsyncWorker { + return &AsyncWorker{ + Service: worker.Service{ + ProviderName: "radius", + Options: options, + }, + handlerBuilder: builder, + } +} + +// Name represents the service name. +func (w *AsyncWorker) Name() string { + return "radiusasyncworker" +} + +// Run starts the service and worker. +func (w *AsyncWorker) Run(ctx context.Context) error { + if err := w.Init(ctx); err != nil { + return err + } + + k8s, err := kubeutil.NewClients(w.Options.K8sConfig) + if err != nil { + return fmt.Errorf("failed to initialize kubernetes clients: %w", err) + } + + appModel, err := model.NewApplicationModel(w.Options.Arm, k8s.RuntimeClient, k8s.ClientSet, k8s.DiscoveryClient, k8s.DynamicClient) + if err != nil { + return fmt.Errorf("failed to initialize application model: %w", err) + } + + for _, b := range w.handlerBuilder { + opts := ctrl.Options{ + DataProvider: w.StorageProvider, + KubeClient: k8s.RuntimeClient, + GetDeploymentProcessor: func() deployment.DeploymentProcessor { + return deployment.NewDeploymentProcessor(appModel, w.StorageProvider, k8s.RuntimeClient, k8s.ClientSet) + }, + } + + err := b.ApplyAsyncHandler(ctx, w.Controllers, opts) + if err != nil { + panic(err) + } + } + + workerOpts := worker.Options{} + if w.Options.Config.WorkerServer != nil { + if w.Options.Config.WorkerServer.MaxOperationConcurrency != nil { + workerOpts.MaxOperationConcurrency = *w.Options.Config.WorkerServer.MaxOperationConcurrency + } + if w.Options.Config.WorkerServer.MaxOperationRetryCount != nil { + workerOpts.MaxOperationRetryCount = *w.Options.Config.WorkerServer.MaxOperationRetryCount + } + } + + return w.Start(ctx, workerOpts) +} diff --git a/pkg/ucp/frontend/api/server.go b/pkg/ucp/frontend/api/server.go index 7c3fa20045..78f88b04a6 100644 --- a/pkg/ucp/frontend/api/server.go +++ b/pkg/ucp/frontend/api/server.go @@ -117,7 +117,7 @@ func (s *Service) Initialize(ctx context.Context) (*http.Server, error) { r := chi.NewRouter() s.storageProvider = dataprovider.NewStorageProvider(s.options.StorageProviderOptions) - s.queueProvider = queueprovider.New(s.options.ProviderName, s.options.QueueProviderOptions) + s.queueProvider = queueprovider.New(s.options.QueueProviderOptions) s.secretProvider = secretprovider.NewSecretProvider(s.options.SecretProviderOptions) specLoader, err := validator.LoadSpec(ctx, "ucp", swagger.SpecFilesUCP, []string{s.options.PathBase}, "") @@ -154,7 +154,7 @@ func (s *Service) Initialize(ctx context.Context) (*http.Server, error) { app := http.Handler(r) app = servicecontext.ARMRequestCtx(s.options.PathBase, "global")(app) - app = middleware.WithLogger("ucp")(app) + app = middleware.WithLogger(app) app = otelhttp.NewHandler( middleware.NormalizePath(app), diff --git a/pkg/ucp/frontend/aws/module.go b/pkg/ucp/frontend/aws/module.go index 49e5f31646..676b4d0966 100644 --- a/pkg/ucp/frontend/aws/module.go +++ b/pkg/ucp/frontend/aws/module.go @@ -23,6 +23,14 @@ import ( "github.com/radius-project/radius/pkg/validator" ) +const ( + // OperationTypeAWSResource is the operation status type for AWS resources. + OperationStatusResourceType = "System.AWS/operationStatuses" + + // OperationTypeAWSResource is the operation result type for AWS resources. + OperationResultsResourceType = "System.AWS/operationResults" +) + // NewModule creates a new AWS module. func NewModule(options modules.Options) *Module { m := Module{options: options} diff --git a/pkg/ucp/frontend/aws/routes.go b/pkg/ucp/frontend/aws/routes.go index 85cc8e609a..2c780c07b1 100644 --- a/pkg/ucp/frontend/aws/routes.go +++ b/pkg/ucp/frontend/aws/routes.go @@ -84,8 +84,8 @@ func (m *Module) Initialize(ctx context.Context) (http.Handler, error) { { // URLs for standard UCP resource async status result. ParentRouter: server.NewSubrouter(baseRouter, operationResultsPath), - Method: v1.OperationGetOperationResult, - OperationType: &v1.OperationType{Type: OperationTypeAWSResource, Method: v1.OperationGetOperationResult}, + Method: v1.OperationGet, + OperationType: &v1.OperationType{Type: OperationResultsResourceType, Method: v1.OperationGet}, ControllerFactory: func(opt controller.Options) (controller.Controller, error) { return awsproxy_ctrl.NewGetAWSOperationResults(opt, m.AWSClients) }, @@ -93,8 +93,8 @@ func (m *Module) Initialize(ctx context.Context) (http.Handler, error) { { // URLs for standard UCP resource async status. ParentRouter: server.NewSubrouter(baseRouter, operationStatusesPath), - Method: v1.OperationGetOperationStatuses, - OperationType: &v1.OperationType{Type: OperationTypeAWSResource, Method: v1.OperationGetOperationStatuses}, + Method: v1.OperationGet, + OperationType: &v1.OperationType{Type: OperationStatusResourceType, Method: v1.OperationGet}, ControllerFactory: func(opts controller.Options) (controller.Controller, error) { return awsproxy_ctrl.NewGetAWSOperationStatuses(opts, m.AWSClients) }, diff --git a/pkg/ucp/frontend/aws/routes_test.go b/pkg/ucp/frontend/aws/routes_test.go index 0549bc3387..7642d2cc3d 100644 --- a/pkg/ucp/frontend/aws/routes_test.go +++ b/pkg/ucp/frontend/aws/routes_test.go @@ -83,11 +83,11 @@ func Test_Routes(t *testing.T) { Method: http.MethodPost, Path: "/planes/aws/aws/accounts/0000000/regions/some-region/providers/AWS.Kinesis/Stream/:delete", }, { - OperationType: v1.OperationType{Type: OperationTypeAWSResource, Method: v1.OperationGetOperationResult}, + OperationType: v1.OperationType{Type: OperationResultsResourceType, Method: v1.OperationGet}, Method: http.MethodGet, Path: "/planes/aws/aws/accounts/0000000/regions/some-region/providers/AWS.Kinesis/locations/global/operationResults/00000000-0000-0000-0000-000000000000", }, { - OperationType: v1.OperationType{Type: OperationTypeAWSResource, Method: v1.OperationGetOperationStatuses}, + OperationType: v1.OperationType{Type: OperationStatusResourceType, Method: v1.OperationGet}, Method: http.MethodGet, Path: "/planes/aws/aws/accounts/0000000/regions/some-region/providers/AWS.Kinesis/locations/global/operationStatuses/00000000-0000-0000-0000-000000000000", }, diff --git a/pkg/ucp/integrationtests/testrp/async.go b/pkg/ucp/integrationtests/testrp/async.go index 6bf7249c52..4723b359e6 100644 --- a/pkg/ucp/integrationtests/testrp/async.go +++ b/pkg/ucp/integrationtests/testrp/async.go @@ -58,13 +58,10 @@ func AsyncResource(t *testing.T, ts *testserver.TestServer, rootScope string, pu resourceType := "System.Test/testResources" - operationStoreClient, err := ts.Clients.StorageProvider.GetStorageClient(ctx, "System.Test/operationStatuses") - require.NoError(t, err) - queueClient, err := ts.Clients.QueueProvider.GetClient(ctx) require.NoError(t, err) - statusManager := statusmanager.New(operationStoreClient, queueClient, "System.Test", v1.LocationGlobal) + statusManager := statusmanager.New(ts.Clients.StorageProvider, queueClient, v1.LocationGlobal) backendOpts := backend_ctrl.Options{ DataProvider: ts.Clients.StorageProvider, diff --git a/pkg/ucp/integrationtests/testserver/testserver.go b/pkg/ucp/integrationtests/testserver/testserver.go index 5fd3830d64..ecc862d00e 100644 --- a/pkg/ucp/integrationtests/testserver/testserver.go +++ b/pkg/ucp/integrationtests/testserver/testserver.go @@ -149,7 +149,7 @@ func StartWithMocks(t *testing.T, configureModules func(options modules.Options) AnyTimes() queueClient := queue.NewMockClient(ctrl) - queueProvider := queueprovider.New("System.Resources", queueprovider.QueueProviderOptions{}) + queueProvider := queueprovider.New(queueprovider.QueueProviderOptions{Name: "System.Resources"}) queueProvider.SetClient(queueClient) secretClient := secret.NewMockClient(ctrl) @@ -254,6 +254,7 @@ func StartWithETCD(t *testing.T, configureModules func(options modules.Options) ETCD: storageOptions.ETCD, } queueOptions := queueprovider.QueueProviderOptions{ + Name: "System.Resources", Provider: queueprovider.TypeInmemory, InMemory: &queueprovider.InMemoryQueueOptions{}, } @@ -262,7 +263,7 @@ func StartWithETCD(t *testing.T, configureModules func(options modules.Options) pathBase := "/" + uuid.New().String() dataProvider := dataprovider.NewStorageProvider(storageOptions) secretProvider := secretprovider.NewSecretProvider(secretOptions) - queueProvider := queueprovider.New("System.Resources", queueOptions) + queueProvider := queueprovider.New(queueOptions) router := chi.NewRouter() router.Use(servicecontext.ARMRequestCtx(pathBase, "global")) diff --git a/pkg/ucp/queue/provider/factory.go b/pkg/ucp/queue/provider/factory.go index 7cf1bc4efd..d3e9b3923d 100644 --- a/pkg/ucp/queue/provider/factory.go +++ b/pkg/ucp/queue/provider/factory.go @@ -30,18 +30,18 @@ import ( runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" ) -type factoryFunc func(context.Context, string, QueueProviderOptions) (queue.Client, error) +type factoryFunc func(context.Context, QueueProviderOptions) (queue.Client, error) var clientFactory = map[QueueProviderType]factoryFunc{ TypeInmemory: initInMemory, TypeAPIServer: initAPIServer, } -func initInMemory(ctx context.Context, name string, opt QueueProviderOptions) (queue.Client, error) { - return qinmem.NewNamedQueue(name), nil +func initInMemory(ctx context.Context, opt QueueProviderOptions) (queue.Client, error) { + return qinmem.NewNamedQueue(opt.Name), nil } -func initAPIServer(ctx context.Context, name string, opt QueueProviderOptions) (queue.Client, error) { +func initAPIServer(ctx context.Context, opt QueueProviderOptions) (queue.Client, error) { if opt.APIServer.Namespace == "" { return nil, errors.New("failed to initialize APIServer client: namespace is required") } @@ -76,7 +76,7 @@ func initAPIServer(ctx context.Context, name string, opt QueueProviderOptions) ( } return apiserver.New(rc, apiserver.Options{ - Name: name, + Name: opt.Name, Namespace: opt.APIServer.Namespace, }) } diff --git a/pkg/ucp/queue/provider/options.go b/pkg/ucp/queue/provider/options.go index 8c06d01985..116313d03a 100644 --- a/pkg/ucp/queue/provider/options.go +++ b/pkg/ucp/queue/provider/options.go @@ -21,6 +21,9 @@ type QueueProviderOptions struct { // Provider configures the storage provider. Provider QueueProviderType `yaml:"provider"` + // Name represents the unique name of queue. + Name string `yaml:"name"` + // InMemory represents inmemory queue client options. (Optional) InMemory *InMemoryQueueOptions `yaml:"inMemoryQueue,omitempty"` diff --git a/pkg/ucp/queue/provider/provider.go b/pkg/ucp/queue/provider/provider.go index 7d331e3dc6..b22418800c 100644 --- a/pkg/ucp/queue/provider/provider.go +++ b/pkg/ucp/queue/provider/provider.go @@ -22,7 +22,6 @@ import ( "sync" queue "github.com/radius-project/radius/pkg/ucp/queue/client" - "github.com/radius-project/radius/pkg/ucp/util" ) var ( @@ -31,7 +30,6 @@ var ( // QueueProvider is the provider to create and manage queue client. type QueueProvider struct { - name string options QueueProviderOptions queueClient queue.Client @@ -39,9 +37,8 @@ type QueueProvider struct { } // New creates new QueueProvider instance. -func New(name string, opts QueueProviderOptions) *QueueProvider { +func New(opts QueueProviderOptions) *QueueProvider { return &QueueProvider{ - name: util.NormalizeStringToLower(name), queueClient: nil, options: opts, } @@ -56,7 +53,7 @@ func (p *QueueProvider) GetClient(ctx context.Context) (queue.Client, error) { err := ErrUnsupportedStorageProvider p.once.Do(func() { if fn, ok := clientFactory[p.options.Provider]; ok { - p.queueClient, err = fn(ctx, p.name, p.options) + p.queueClient, err = fn(ctx, p.options) } }) diff --git a/pkg/ucp/queue/provider/provider_test.go b/pkg/ucp/queue/provider/provider_test.go index 839108557d..1a1bb49320 100644 --- a/pkg/ucp/queue/provider/provider_test.go +++ b/pkg/ucp/queue/provider/provider_test.go @@ -24,7 +24,8 @@ import ( ) func TestGetClient_ValidQueue(t *testing.T) { - p := New("Applications.Core", QueueProviderOptions{ + p := New(QueueProviderOptions{ + Name: "Applications.Core", Provider: TypeInmemory, InMemory: &InMemoryQueueOptions{}, }) @@ -38,7 +39,8 @@ func TestGetClient_ValidQueue(t *testing.T) { } func TestGetClient_InvalidQueue(t *testing.T) { - p := New("Applications.Core", QueueProviderOptions{ + p := New(QueueProviderOptions{ + Name: "Applications.Core", Provider: QueueProviderType("undefined"), }) diff --git a/pkg/ucp/server/server.go b/pkg/ucp/server/server.go index b13f2d1e93..85d9f6eab1 100644 --- a/pkg/ucp/server/server.go +++ b/pkg/ucp/server/server.go @@ -18,7 +18,6 @@ package server import ( "errors" - "flag" "fmt" "os" "strings" @@ -151,9 +150,6 @@ func NewServerOptionsFromEnvironment() (Options, error) { // NewServer creates a new hosting.Host instance with services for API, EmbeddedETCD, Metrics, Profiler and Backend (if // enabled) based on the given Options. func NewServer(options *Options) (*hosting.Host, error) { - var enableAsyncWorker bool - flag.BoolVar(&enableAsyncWorker, "enable-asyncworker", true, "Flag to run async request process worker (for private preview and dev/test purpose).") - hostingServices := []hosting.Service{ api.NewService(api.ServiceOptions{ ProviderName: UCPProviderName, @@ -191,19 +187,17 @@ func NewServer(options *Options) (*hosting.Host, error) { hostingServices = append(hostingServices, profilerservice.NewService(profilerOptions)) } - if enableAsyncWorker { - backendServiceOptions := hostOpts.HostOptions{ - Config: &hostOpts.ProviderConfig{ - StorageProvider: options.StorageProviderOptions, - SecretProvider: options.SecretProviderOptions, - QueueProvider: options.QueueProviderOptions, - MetricsProvider: options.MetricsProviderOptions, - TracerProvider: options.TracerProviderOptions, - ProfilerProvider: options.ProfilerProviderOptions, - }, - } - hostingServices = append(hostingServices, backend.NewService(backendServiceOptions)) + backendServiceOptions := hostOpts.HostOptions{ + Config: &hostOpts.ProviderConfig{ + StorageProvider: options.StorageProviderOptions, + SecretProvider: options.SecretProviderOptions, + QueueProvider: options.QueueProviderOptions, + MetricsProvider: options.MetricsProviderOptions, + TracerProvider: options.TracerProviderOptions, + ProfilerProvider: options.ProfilerProviderOptions, + }, } + hostingServices = append(hostingServices, backend.NewService(backendServiceOptions)) return &hosting.Host{ Services: hostingServices, From eaee2607b983ede453e80fbeacabb0b25ce10273 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Sun, 10 Sep 2023 20:59:20 -0700 Subject: [PATCH 57/57] Add missing async job controller for corerp and delete dead code. (#6243) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description * Add deployment processor for corerp resource deletion * Delete dead code in corerp ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Auto-generated summary ### 🤖 Generated by Copilot at 0c13b30 ### Summary 🗑️🛣️📦 This pull request implements delete functionality for custom resources in the Radius core package. It also removes two unused files from the `pkg/corerp/backend` directory. > _Oh, we're the crew of the Radius ship, and we sail the code sea_ > _We create and update our resources, but sometimes we must delete_ > _So we pull on the rope and we sing this song, as we heave on the count of three_ > _`HTTPRoute`, `ContainerResource`, `Gateway`, and `VolumeResource`, goodbye to ye_ ### Walkthrough * Add delete operations for custom resources ([link](https://github.com/radius-project/radius/pull/6243/files?diff=unified&w=0#diff-1dfecb9519c9002f569daea7fb61bbb0b1f22e34d49ac2d03eeb3bc64e858c8fR92-R94), [link](https://github.com/radius-project/radius/pull/6243/files?diff=unified&w=0#diff-1dfecb9519c9002f569daea7fb61bbb0b1f22e34d49ac2d03eeb3bc64e858c8fR115-R117), [link](https://github.com/radius-project/radius/pull/6243/files?diff=unified&w=0#diff-1dfecb9519c9002f569daea7fb61bbb0b1f22e34d49ac2d03eeb3bc64e858c8fR138-R140), [link](https://github.com/radius-project/radius/pull/6243/files?diff=unified&w=0#diff-1dfecb9519c9002f569daea7fb61bbb0b1f22e34d49ac2d03eeb3bc64e858c8fR161-R163)) * Remove unused files ([link](https://github.com/radius-project/radius/pull/6243/files?diff=unified&w=0#diff-5d6b976ca1401aa4b4ea6fdaf8142700ada0d6ddd9690bb7eed8797f91d33466), [link](https://github.com/radius-project/radius/pull/6243/files?diff=unified&w=0#diff-0fb3b9f2c9139180171c66e076eacdb9f6ea1b44e8a3356a8dbc688436614535)) --- pkg/corerp/backend/service.go | 183 ---- pkg/corerp/backend/systemservice.go | 86 -- pkg/corerp/frontend/handler/getoperations.go | 299 ------- pkg/corerp/frontend/handler/routes.go | 855 ------------------- pkg/corerp/frontend/handler/routes_test.go | 265 ------ pkg/corerp/setup/setup.go | 56 +- 6 files changed, 48 insertions(+), 1696 deletions(-) delete mode 100644 pkg/corerp/backend/service.go delete mode 100644 pkg/corerp/backend/systemservice.go delete mode 100644 pkg/corerp/frontend/handler/getoperations.go delete mode 100644 pkg/corerp/frontend/handler/routes.go delete mode 100644 pkg/corerp/frontend/handler/routes_test.go diff --git a/pkg/corerp/backend/service.go b/pkg/corerp/backend/service.go deleted file mode 100644 index 6b5dbc5986..0000000000 --- a/pkg/corerp/backend/service.go +++ /dev/null @@ -1,183 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package backend - -import ( - "context" - "fmt" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - ctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" - "github.com/radius-project/radius/pkg/armrpc/asyncoperation/worker" - "github.com/radius-project/radius/pkg/armrpc/hostoptions" - aztoken "github.com/radius-project/radius/pkg/azure/tokencredentials" - backend_ctrl "github.com/radius-project/radius/pkg/corerp/backend/controller" - "github.com/radius-project/radius/pkg/corerp/backend/deployment" - "github.com/radius-project/radius/pkg/corerp/datamodel" - "github.com/radius-project/radius/pkg/corerp/model" - "github.com/radius-project/radius/pkg/corerp/processors/extenders" - "github.com/radius-project/radius/pkg/kubeutil" - "github.com/radius-project/radius/pkg/portableresources" - pr_backend_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" - "github.com/radius-project/radius/pkg/portableresources/processors" - "github.com/radius-project/radius/pkg/recipes" - "github.com/radius-project/radius/pkg/recipes/configloader" - "github.com/radius-project/radius/pkg/recipes/driver" - "github.com/radius-project/radius/pkg/recipes/engine" - "github.com/radius-project/radius/pkg/sdk" - "github.com/radius-project/radius/pkg/sdk/clients" - "github.com/radius-project/radius/pkg/ucp/secret/provider" -) - -const ( - providerName = "Applications.Core" -) - -var ( - // ResourceTypeNames is the array that holds resource types that needs async processing. - // We use this array to generate generic backend controller for each resource. - ResourceTypeNames = []string{ - "Applications.Core/containers", - "Applications.Core/gateways", - "Applications.Core/httpRoutes", - "Applications.Core/volumes", - } -) - -// Service is a service to run AsyncReqeustProcessWorker. -type Service struct { - worker.Service -} - -// NewService creates a new Service instance to run AsyncReqeustProcessWorker. -func NewService(options hostoptions.HostOptions) *Service { - return &Service{ - worker.Service{ - ProviderName: providerName, - Options: options, - }, - } -} - -// Name returns a string containing the service name. -func (w *Service) Name() string { - return fmt.Sprintf("%s async worker", providerName) -} - -// Run initializes the application model, registers controllers for different resource types, and starts the worker with -// the given options. -func (w *Service) Run(ctx context.Context) error { - if err := w.Init(ctx); err != nil { - return err - } - - k8s, err := kubeutil.NewClients(w.Options.K8sConfig) - if err != nil { - return fmt.Errorf("failed to initialize kubernetes clients: %w", err) - } - - coreAppModel, err := model.NewApplicationModel(w.Options.Arm, k8s.RuntimeClient, k8s.ClientSet, k8s.DiscoveryClient, k8s.DynamicClient) - if err != nil { - return fmt.Errorf("failed to initialize application model: %w", err) - } - - opts := ctrl.Options{ - DataProvider: w.StorageProvider, - KubeClient: k8s.RuntimeClient, - GetDeploymentProcessor: func() deployment.DeploymentProcessor { - return deployment.NewDeploymentProcessor(coreAppModel, w.StorageProvider, k8s.RuntimeClient, k8s.ClientSet) - }, - } - - for _, rt := range ResourceTypeNames { - // Register controllers - err = w.Controllers.Register(ctx, rt, v1.OperationPut, backend_ctrl.NewCreateOrUpdateResource, opts) - if err != nil { - panic(err) - } - err = w.Controllers.Register(ctx, rt, v1.OperationPatch, backend_ctrl.NewCreateOrUpdateResource, opts) - if err != nil { - panic(err) - } - err = w.Controllers.Register(ctx, rt, v1.OperationDelete, backend_ctrl.NewDeleteResource, opts) - if err != nil { - panic(err) - } - } - - client := processors.NewResourceClient(w.Options.Arm, w.Options.UCPConnection, k8s.RuntimeClient, k8s.DiscoveryClient) - clientOptions := sdk.NewClientOptions(w.Options.UCPConnection) - - deploymentEngineClient, err := clients.NewResourceDeploymentsClient(&clients.Options{ - Cred: &aztoken.AnonymousCredential{}, - BaseURI: w.Options.UCPConnection.Endpoint(), - ARMClientOptions: sdk.NewClientOptions(w.Options.UCPConnection), - }) - if err != nil { - return err - } - - configLoader := configloader.NewEnvironmentLoader(clientOptions) - engine := engine.NewEngine(engine.Options{ - ConfigurationLoader: configLoader, - Drivers: map[string]driver.Driver{ - recipes.TemplateKindBicep: driver.NewBicepDriver(clientOptions, deploymentEngineClient, client), - recipes.TemplateKindTerraform: driver.NewTerraformDriver(w.Options.UCPConnection, provider.NewSecretProvider(w.Options.Config.SecretProvider), - driver.TerraformOptions{ - Path: w.Options.Config.Terraform.Path, - }, k8s.ClientSet), - }, - }) - - opts.GetDeploymentProcessor = nil - extenderCreateOrUpdateController := func(options ctrl.Options) (ctrl.Controller, error) { - processor := &extenders.Processor{} - return pr_backend_ctrl.NewCreateOrUpdateResource[*datamodel.Extender, datamodel.Extender](options, processor, engine, client, configLoader) - } - extenderDeleteController := func(options ctrl.Options) (ctrl.Controller, error) { - processor := &extenders.Processor{} - return pr_backend_ctrl.NewDeleteResource[*datamodel.Extender, datamodel.Extender](options, processor, engine, configLoader) - } - - // Register controllers to run backend processing for extenders. - err = w.Controllers.Register(ctx, portableresources.ExtendersResourceType, v1.OperationPut, extenderCreateOrUpdateController, opts) - if err != nil { - return err - } - - err = w.Controllers.Register( - ctx, - portableresources.ExtendersResourceType, - v1.OperationDelete, - extenderDeleteController, - opts) - if err != nil { - return err - } - - workerOpts := worker.Options{} - if w.Options.Config.WorkerServer != nil { - if w.Options.Config.WorkerServer.MaxOperationConcurrency != nil { - workerOpts.MaxOperationConcurrency = *w.Options.Config.WorkerServer.MaxOperationConcurrency - } - if w.Options.Config.WorkerServer.MaxOperationRetryCount != nil { - workerOpts.MaxOperationRetryCount = *w.Options.Config.WorkerServer.MaxOperationRetryCount - } - } - - return w.Start(ctx, workerOpts) -} diff --git a/pkg/corerp/backend/systemservice.go b/pkg/corerp/backend/systemservice.go deleted file mode 100644 index d2fec5e57f..0000000000 --- a/pkg/corerp/backend/systemservice.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package backend - -import ( - "context" - "fmt" - "net" - "net/http" - - "github.com/radius-project/radius/pkg/armrpc/hostoptions" - "github.com/radius-project/radius/pkg/ucp/ucplog" - "github.com/radius-project/radius/pkg/version" -) - -// SystemService represents the service which provides the basic health status and metric server. -type SystemService struct { - options hostoptions.HostOptions -} - -// NewSystemService creates a new SystemService instance with the given options. -func NewSystemService(options hostoptions.HostOptions) *SystemService { - return &SystemService{ - options: options, - } -} - -// Name returns the name of the system service. -func (s *SystemService) Name() string { - return "system service" -} - -// Run sets up an HTTP server to handle requests on the given port and handles shutdown based on the -// context. It returns an error if the server fails to start. -func (s *SystemService) Run(ctx context.Context) error { - logger := ucplog.FromContextOrDiscard(ctx) - - mux := http.NewServeMux() - mux.HandleFunc("/version", version.ReportVersionHandler) - mux.HandleFunc("/healthz", version.ReportVersionHandler) - - // TODO: Add prometheus metric later. - - address := fmt.Sprintf(":%d", *s.options.Config.WorkerServer.Port) - - server := &http.Server{ - Addr: address, - Handler: mux, - BaseContext: func(ln net.Listener) context.Context { - return ctx - }, - } - - // Handle shutdown based on the context - go func() { - <-ctx.Done() - // We don't care about shutdown errors - _ = server.Shutdown(ctx) - }() - - logger.Info(fmt.Sprintf("System service endpoint on: '%s'...", address)) - if err := server.ListenAndServe(); err == http.ErrServerClosed { - // We expect this, safe to ignore. - logger.Info("Server stopped...") - return nil - } else if err != nil { - return err - } - - logger.Info("Server stopped...") - return nil -} diff --git a/pkg/corerp/frontend/handler/getoperations.go b/pkg/corerp/frontend/handler/getoperations.go deleted file mode 100644 index 18bc4dc937..0000000000 --- a/pkg/corerp/frontend/handler/getoperations.go +++ /dev/null @@ -1,299 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "context" - "net/http" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" - "github.com/radius-project/radius/pkg/armrpc/rest" - v20220315privatepreview "github.com/radius-project/radius/pkg/corerp/api/v20220315privatepreview" -) - -var _ ctrl.Controller = (*GetOperations)(nil) - -// GetOperations is the controller implementation to get arm rpc available operations. -type GetOperations struct { - ctrl.BaseController -} - -// NewGetOperations creates a new GetOperations controller with the given options. -func NewGetOperations(opts ctrl.Options) (ctrl.Controller, error) { - return &GetOperations{ctrl.NewBaseController(opts)}, nil -} - -// Run checks the API version of the request and returns the available operations for the resource provider at tenant level. -// Spec: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/proxy-api-reference.md#exposing-available-operations -func (opctrl *GetOperations) Run(ctx context.Context, w http.ResponseWriter, req *http.Request) (rest.Response, error) { - sCtx := v1.ARMRequestContextFromContext(ctx) - - switch sCtx.APIVersion { - case v20220315privatepreview.Version: - return rest.NewOKResponse(opctrl.availableOperationsV1()), nil - } - - return rest.NewNotFoundAPIVersionResponse("operations", ProviderNamespaceName, sCtx.APIVersion), nil -} - -func (opctrl *GetOperations) availableOperationsV1() *v1.PaginatedList { - return &v1.PaginatedList{ - Value: []any{ - &v1.Operation{ - Name: "Applications.Core/operations/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "operations", - Operation: "Get operations", - Description: "Get the list of operations", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/environments/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "environments", - Operation: "List environments", - Description: "Get the list of environments.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/environments/write", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "environments", - Operation: "Create/Update environment", - Description: "Create or update an environment.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/environments/delete", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "environments", - Operation: "Delete environment", - Description: "Delete an environment.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/environments/getmetadata/action", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "environments", - Operation: "Get recipe metadata", - Description: "Get recipe metadata.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/environments/join/action", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "environments", - Operation: "Join environment", - Description: "Join to application environment.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/register/action", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: ProviderNamespaceName, - Operation: "Register Applications.Core", - Description: "Register the subscription for Applications.Core.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/unregister/action", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: ProviderNamespaceName, - Operation: "Unregister Applications.Core", - Description: "Unregister the subscription for Applications.Core.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/httproutes/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "httproutes", - Operation: "List httproutes", - Description: "Get the list of httproutes.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/httproutes/write", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "httproutes", - Operation: "Create/Update httproute", - Description: "Create or update an httproute.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/httproutes/delete", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "httproutes", - Operation: "Delete httproute", - Description: "Delete an httproute.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/applications/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "applications", - Operation: "List applications", - Description: "Get the list of applications.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/applications/write", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "applications", - Operation: "Create/Update application", - Description: "Create or update an application.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/applications/delete", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "applications", - Operation: "Delete application", - Description: "Delete an application.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/gateways/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "gateways", - Operation: "List gateways", - Description: "Get the list of gateways.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/gateways/write", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "gateways", - Operation: "Create/Update gateway", - Description: "Create or Updateg a gateway.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/gateways/delete", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "gateways", - Operation: "delete gateway", - Description: "Delete a gateway.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/containers/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "containers", - Operation: "List containers", - Description: "Get the list of containers.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/containers/write", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "containers", - Operation: "Create/Update container", - Description: "Create or update a container.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/containers/delete", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "containers", - Operation: "Delete container", - Description: "Delete a container.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/extenders/read", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "extenders", - Operation: "Get/List extenders", - Description: "Gets/Lists extender link(s).", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/extenders/write", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "extenders", - Operation: "Create/Update extenders", - Description: "Creates or updates a extender resource.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/extenders/delete", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "extenders", - Operation: "Delete extender", - Description: "Deletes a extender resource.", - }, - IsDataAction: false, - }, - &v1.Operation{ - Name: "Applications.Core/extenders/listsecrets/action", - Display: &v1.OperationDisplayProperties{ - Provider: ProviderNamespaceName, - Resource: "extenders", - Operation: "List secrets", - Description: "Lists extender secrets.", - }, - IsDataAction: false, - }, - }, - } -} diff --git a/pkg/corerp/frontend/handler/routes.go b/pkg/corerp/frontend/handler/routes.go deleted file mode 100644 index 8c7051b80f..0000000000 --- a/pkg/corerp/frontend/handler/routes.go +++ /dev/null @@ -1,855 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "context" - "time" - - "github.com/go-chi/chi/v5" - - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - frontend_ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" - "github.com/radius-project/radius/pkg/armrpc/frontend/defaultoperation" - "github.com/radius-project/radius/pkg/armrpc/frontend/server" - "github.com/radius-project/radius/pkg/recipes/engine" - rp_frontend "github.com/radius-project/radius/pkg/rp/frontend" - "github.com/radius-project/radius/pkg/validator" - "github.com/radius-project/radius/swagger" - - "github.com/radius-project/radius/pkg/corerp/datamodel" - converter "github.com/radius-project/radius/pkg/corerp/datamodel/converter" - - app_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/applications" - ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" - env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" - ext_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/extenders" - gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" - hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes" - secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" - vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" -) - -const ( - ProviderNamespaceName = "Applications.Core" - - // AsyncOperationRetryAfter is polling interval for async create/update or delete resource operations. - AsyncOperationRetryAfter = time.Duration(5) * time.Second -) - -// AddRoutes registers handlers for Container, Application, Gateway, Volume and Secret Store resources, allowing for -// operations such as List, Get, Put, Patch and Delete. -func AddRoutes(ctx context.Context, r chi.Router, isARM bool, ctrlOpts frontend_ctrl.Options, engine engine.Engine) error { - rootScopePath := ctrlOpts.PathBase - if isARM { - rootScopePath += "/subscriptions/{subscriptionID}" - } else { - rootScopePath += "/planes/radius/{planeName}" - } - - resourceGroupPath := "/resourcegroups/{resourceGroupName}" - - // Configure the default ARM handlers. - err := server.ConfigureDefaultHandlers(ctx, r, rootScopePath, isARM, ProviderNamespaceName, NewGetOperations, ctrlOpts) - if err != nil { - return err - } - - // URLs may use either the subscription/plane scope or resource group scope. - // - // These paths are order sensitive and the longer path MUST be registered first. - prefixes := []string{ - rootScopePath + resourceGroupPath, - rootScopePath, - } - - specLoader, err := validator.LoadSpec(ctx, ProviderNamespaceName, swagger.SpecFiles, prefixes, "rootScope") - if err != nil { - return err - } - - validator := validator.APIValidator(validator.Options{ - SpecLoader: specLoader, - ResourceTypeGetter: validator.RadiusResourceTypeGetter, - }) - - // Register resource routers. - // - // Note: We have to follow the below rules to enable API validators: - // 1. For collection scope routers (xxxPlaneRouter and xxxResourceGroupRouter), register validator at HandlerOptions.Middlewares. - // 2. For resource scopes (xxxResourceRouter), register validator at Subrouter. - - // Environments resource routers. - envPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/environments", validator) - envResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/environments", validator) - envResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/environments/{environmentName}", validator) - - handlerOptions := []server.HandlerOptions{ - // Environments resource handler registration. - { - ParentRouter: envPlaneRouter, - ResourceType: env_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources( - opt, - frontend_ctrl.ResourceOptions[datamodel.Environment]{ - ResponseConverter: converter.EnvironmentDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: envResourceGroupRouter, - ResourceType: env_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Environment]{ - ResponseConverter: converter.EnvironmentDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: envResourceRouter, - ResourceType: env_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.Environment]{ - ResponseConverter: converter.EnvironmentDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: envResourceRouter, - ResourceType: env_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: env_ctrl.NewCreateOrUpdateEnvironment, - }, - { - ParentRouter: envResourceRouter, - ResourceType: env_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: env_ctrl.NewCreateOrUpdateEnvironment, - }, - { - ParentRouter: envResourceRouter, - ResourceType: env_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.Environment]{ - RequestConverter: converter.EnvironmentDataModelFromVersioned, - ResponseConverter: converter.EnvironmentDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: envResourceRouter, - Path: "/getmetadata", - ResourceType: env_ctrl.ResourceTypeName, - Method: env_ctrl.OperationGetRecipeMetadata, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return env_ctrl.NewGetRecipeMetadata(opt, engine) - }, - }, - } - - // httpRoute resource handler registration. - httpRoutePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/httproutes", validator) - httpRouteResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/httproutes", validator) - httpRouteResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/httproutes/{httpRouteName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: httpRoutePlaneRouter, - ResourceType: hrt_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.HTTPRoute]{ - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - ListRecursiveQuery: true, - }, - ) - }, - }, - { - ParentRouter: httpRouteResourceGroupRouter, - ResourceType: hrt_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.HTTPRoute]{ - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: httpRouteResourceRouter, - ResourceType: hrt_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.HTTPRoute]{ - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: httpRouteResourceRouter, - ResourceType: hrt_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.HTTPRoute]{ - RequestConverter: converter.HTTPRouteDataModelFromVersioned, - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: httpRouteResourceRouter, - ResourceType: hrt_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.HTTPRoute]{ - RequestConverter: converter.HTTPRouteDataModelFromVersioned, - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: httpRouteResourceRouter, - ResourceType: hrt_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.HTTPRoute]{ - RequestConverter: converter.HTTPRouteDataModelFromVersioned, - ResponseConverter: converter.HTTPRouteDataModelToVersioned, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - // Container resource handlers. - containerPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/containers", validator) - containerResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/containers", validator) - containerResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/containers/{containerName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: containerPlaneRouter, - ResourceType: ctr_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.ContainerResource]{ - ResponseConverter: converter.ContainerDataModelToVersioned, - ListRecursiveQuery: true, - }, - ) - }, - }, - { - ParentRouter: containerResourceGroupRouter, - ResourceType: ctr_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.ContainerResource]{ - ResponseConverter: converter.ContainerDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: containerResourceRouter, - ResourceType: ctr_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.ContainerResource]{ - ResponseConverter: converter.ContainerDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: containerResourceRouter, - ResourceType: ctr_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.ContainerResource]{ - RequestConverter: converter.ContainerDataModelFromVersioned, - ResponseConverter: converter.ContainerDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.ContainerResource]{ - rp_frontend.PrepareRadiusResource[*datamodel.ContainerResource], - ctr_ctrl.ValidateAndMutateRequest, - }, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: containerResourceRouter, - ResourceType: ctr_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.ContainerResource]{ - RequestConverter: converter.ContainerDataModelFromVersioned, - ResponseConverter: converter.ContainerDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.ContainerResource]{ - rp_frontend.PrepareRadiusResource[*datamodel.ContainerResource], - ctr_ctrl.ValidateAndMutateRequest, - }, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: containerResourceRouter, - ResourceType: ctr_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.ContainerResource]{ - RequestConverter: converter.ContainerDataModelFromVersioned, - ResponseConverter: converter.ContainerDataModelToVersioned, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - // Container resource handlers. - appPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/applications", validator) - appResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/applications", validator) - appResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/applications/{applicationName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - // Applications resource handler registration. - { - ParentRouter: appPlaneRouter, - ResourceType: app_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Application]{ - ResponseConverter: converter.ApplicationDataModelToVersioned, - ListRecursiveQuery: true, - }, - ) - }, - }, - { - ParentRouter: appResourceGroupRouter, - ResourceType: app_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Application]{ - ResponseConverter: converter.ApplicationDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: appResourceRouter, - ResourceType: app_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.Application]{ - ResponseConverter: converter.ApplicationDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: appResourceRouter, - ResourceType: app_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Application]{ - RequestConverter: converter.ApplicationDataModelFromVersioned, - ResponseConverter: converter.ApplicationDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Application]{ - rp_frontend.PrepareRadiusResource[*datamodel.Application], - app_ctrl.CreateAppScopedNamespace, - }, - }, - ) - }, - }, - { - ParentRouter: appResourceRouter, - ResourceType: app_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Application]{ - RequestConverter: converter.ApplicationDataModelFromVersioned, - ResponseConverter: converter.ApplicationDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Application]{ - rp_frontend.PrepareRadiusResource[*datamodel.Application], - app_ctrl.CreateAppScopedNamespace, - }, - }, - ) - }, - }, - { - ParentRouter: appResourceRouter, - ResourceType: app_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.Application]{ - RequestConverter: converter.ApplicationDataModelFromVersioned, - ResponseConverter: converter.ApplicationDataModelToVersioned, - }, - ) - }, - }, - }...) - - // Gateway resource handler registration. - gwPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/gateways", validator) - gwResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/gateways", validator) - gwResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/gateways/{gatewayName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: gwPlaneRouter, - ResourceType: gtwy_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Gateway]{ - ResponseConverter: converter.GatewayDataModelToVersioned, - ListRecursiveQuery: true, - }, - ) - }, - }, - { - ParentRouter: gwResourceGroupRouter, - ResourceType: gtwy_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Gateway]{ - ResponseConverter: converter.GatewayDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: gwResourceRouter, - ResourceType: gtwy_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.Gateway]{ - ResponseConverter: converter.GatewayDataModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: gwResourceRouter, - ResourceType: gtwy_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Gateway]{ - RequestConverter: converter.GatewayDataModelFromVersioned, - ResponseConverter: converter.GatewayDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Gateway]{ - rp_frontend.PrepareRadiusResource[*datamodel.Gateway], - gtwy_ctrl.ValidateAndMutateRequest, - }, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: gwResourceRouter, - ResourceType: gtwy_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Gateway]{ - RequestConverter: converter.GatewayDataModelFromVersioned, - ResponseConverter: converter.GatewayDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Gateway]{ - rp_frontend.PrepareRadiusResource[*datamodel.Gateway], - gtwy_ctrl.ValidateAndMutateRequest, - }, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: gwResourceRouter, - ResourceType: gtwy_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.Gateway]{ - RequestConverter: converter.GatewayDataModelFromVersioned, - ResponseConverter: converter.GatewayDataModelToVersioned, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - // Volumes resource handler registration. - volPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/volumes", validator) - volResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/volumes", validator) - volRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/volumes/{volumeName}", validator) - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: volPlaneRouter, - ResourceType: vol_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.VolumeResource]{ - RequestConverter: converter.VolumeResourceModelFromVersioned, - ResponseConverter: converter.VolumeResourceModelToVersioned, - ListRecursiveQuery: true, - }, - ) - }, - }, - { - ParentRouter: volResourceGroupRouter, - ResourceType: vol_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.VolumeResource]{ - RequestConverter: converter.VolumeResourceModelFromVersioned, - ResponseConverter: converter.VolumeResourceModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: volRouter, - ResourceType: vol_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.VolumeResource]{ - RequestConverter: converter.VolumeResourceModelFromVersioned, - ResponseConverter: converter.VolumeResourceModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: volRouter, - ResourceType: vol_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.VolumeResource]{ - RequestConverter: converter.VolumeResourceModelFromVersioned, - ResponseConverter: converter.VolumeResourceModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.VolumeResource]{ - rp_frontend.PrepareRadiusResource[*datamodel.VolumeResource], - vol_ctrl.ValidateRequest, - }, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: volRouter, - ResourceType: vol_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.VolumeResource]{ - RequestConverter: converter.VolumeResourceModelFromVersioned, - ResponseConverter: converter.VolumeResourceModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.VolumeResource]{ - rp_frontend.PrepareRadiusResource[*datamodel.VolumeResource], - vol_ctrl.ValidateRequest, - }, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: volRouter, - ResourceType: vol_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.VolumeResource]{ - RequestConverter: converter.VolumeResourceModelFromVersioned, - ResponseConverter: converter.VolumeResourceModelToVersioned, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - }...) - - // Secret Store resource handler. - secretStorePlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/secretstores", validator) - secretStoreResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/secretstores", validator) - secretStoreResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/secretstores/{secretStoreName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: secretStorePlaneRouter, - ResourceType: secret_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.SecretStore]{ - ResponseConverter: converter.SecretStoreModelToVersioned, - ListRecursiveQuery: true, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceGroupRouter, - ResourceType: secret_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.SecretStore]{ - ResponseConverter: converter.SecretStoreModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: secret_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.SecretStore]{ - ResponseConverter: converter.SecretStoreModelToVersioned, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: secret_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.SecretStore]{ - RequestConverter: converter.SecretStoreModelFromVersioned, - ResponseConverter: converter.SecretStoreModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.SecretStore]{ - rp_frontend.PrepareRadiusResource[*datamodel.SecretStore], - secret_ctrl.ValidateAndMutateRequest, - secret_ctrl.UpsertSecret, - }, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: secret_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.SecretStore]{ - RequestConverter: converter.SecretStoreModelFromVersioned, - ResponseConverter: converter.SecretStoreModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.SecretStore]{ - rp_frontend.PrepareRadiusResource[*datamodel.SecretStore], - secret_ctrl.ValidateAndMutateRequest, - secret_ctrl.UpsertSecret, - }, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - ResourceType: secret_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultSyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.SecretStore]{ - ResponseConverter: converter.SecretStoreModelToVersioned, - DeleteFilters: []frontend_ctrl.DeleteFilter[datamodel.SecretStore]{ - secret_ctrl.DeleteRadiusSecret, - }, - }, - ) - }, - }, - { - ParentRouter: secretStoreResourceRouter, - Path: "/listsecrets", - ResourceType: secret_ctrl.ResourceTypeName, - Method: secret_ctrl.OperationListSecrets, - ControllerFactory: secret_ctrl.NewListSecrets, - }, - }...) - - extPlaneRouter := server.NewSubrouter(r, rootScopePath+"/providers/applications.core/extenders", validator) - extResourceGroupRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/extenders", validator) - extResourceRouter := server.NewSubrouter(r, rootScopePath+resourceGroupPath+"/providers/applications.core/extenders/{extenderName}", validator) - - handlerOptions = append(handlerOptions, []server.HandlerOptions{ - { - ParentRouter: extPlaneRouter, - ResourceType: ext_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - ListRecursiveQuery: true, - }) - }, - }, - { - ParentRouter: extResourceGroupRouter, - ResourceType: ext_ctrl.ResourceTypeName, - Method: v1.OperationList, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewListResources(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - }) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: ext_ctrl.ResourceTypeName, - Method: v1.OperationGet, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewGetResource(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - }) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: ext_ctrl.ResourceTypeName, - Method: v1.OperationPut, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Extender]{ - rp_frontend.PrepareRadiusResource[*datamodel.Extender], - }, - AsyncOperationTimeout: ext_ctrl.AsyncCreateOrUpdateExtenderTimeout, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: ext_ctrl.ResourceTypeName, - Method: v1.OperationPatch, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncPut(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - UpdateFilters: []frontend_ctrl.UpdateFilter[datamodel.Extender]{ - rp_frontend.PrepareRadiusResource[*datamodel.Extender], - }, - AsyncOperationTimeout: ext_ctrl.AsyncCreateOrUpdateExtenderTimeout, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: extResourceRouter, - ResourceType: ext_ctrl.ResourceTypeName, - Method: v1.OperationDelete, - ControllerFactory: func(opt frontend_ctrl.Options) (frontend_ctrl.Controller, error) { - return defaultoperation.NewDefaultAsyncDelete(opt, - frontend_ctrl.ResourceOptions[datamodel.Extender]{ - RequestConverter: converter.ExtenderDataModelFromVersioned, - ResponseConverter: converter.ExtenderDataModelToVersioned, - AsyncOperationTimeout: ext_ctrl.AsyncDeleteExtenderTimeout, - AsyncOperationRetryAfter: AsyncOperationRetryAfter, - }, - ) - }, - }, - { - ParentRouter: extResourceRouter, - Path: "/listsecrets", - ResourceType: ext_ctrl.ResourceTypeName, - Method: ext_ctrl.OperationListSecrets, - ControllerFactory: ext_ctrl.NewListSecretsExtender, - }, - }...) - - for _, h := range handlerOptions { - if err := server.RegisterHandler(ctx, h, ctrlOpts); err != nil { - return err - } - } - - return nil -} diff --git a/pkg/corerp/frontend/handler/routes_test.go b/pkg/corerp/frontend/handler/routes_test.go deleted file mode 100644 index 735b57091d..0000000000 --- a/pkg/corerp/frontend/handler/routes_test.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -Copyright 2023 The Radius Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package handler - -import ( - "context" - "net/http" - "testing" - - "github.com/go-chi/chi/v5" - "github.com/golang/mock/gomock" - v1 "github.com/radius-project/radius/pkg/armrpc/api/v1" - ctrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" - "github.com/radius-project/radius/pkg/armrpc/rpctest" - "github.com/radius-project/radius/pkg/recipes/engine" - "github.com/radius-project/radius/pkg/ucp/dataprovider" - "github.com/radius-project/radius/pkg/ucp/store" - - app_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/applications" - ctr_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/containers" - env_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/environments" - gtwy_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/gateways" - hrt_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/httproutes" - secret_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/secretstores" - vol_ctrl "github.com/radius-project/radius/pkg/corerp/frontend/controller/volumes" -) - -var handlerTests = []rpctest.HandlerTestSpec{ - { - OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/applications", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/applications", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: app_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/applications/app0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/containers", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/containers", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: ctr_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/containers/ctr0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/environments", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/environments", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/environments/env0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: env_ctrl.ResourceTypeName, Method: env_ctrl.OperationGetRecipeMetadata}, - Path: "/resourcegroups/testrg/providers/applications.core/environments/env0/getmetadata", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/gateways", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/gateways", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: gtwy_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/gateways/gateway0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/httproutes", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: hrt_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/httproutes/hrt0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/secretstores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/secretstores", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: secret_ctrl.ResourceTypeName, Method: secret_ctrl.OperationListSecrets}, - Path: "/resourcegroups/testrg/providers/applications.core/secretstores/secret0/listsecrets", - Method: http.MethodPost, - }, { - OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/providers/applications.core/volumes", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationList}, - Path: "/resourcegroups/testrg/providers/applications.core/volumes", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationGet}, - Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationPut}, - Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", - Method: http.MethodPut, - }, { - OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationPatch}, - Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", - Method: http.MethodPatch, - }, { - OperationType: v1.OperationType{Type: vol_ctrl.ResourceTypeName, Method: v1.OperationDelete}, - Path: "/resourcegroups/testrg/providers/applications.core/volumes/volume0", - Method: http.MethodDelete, - }, { - OperationType: v1.OperationType{Type: "Applications.Core/operationStatuses", Method: v1.OperationGet}, - Path: "/providers/applications.core/locations/global/operationstatuses/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, { - OperationType: v1.OperationType{Type: "Applications.Core/operationResults", Method: v1.OperationGet}, - Path: "/providers/applications.core/locations/global/operationresults/00000000-0000-0000-0000-000000000000", - Method: http.MethodGet, - }, -} - -func TestHandlers(t *testing.T) { - mctrl := gomock.NewController(t) - - mockSP := dataprovider.NewMockDataStorageProvider(mctrl) - mockSC := store.NewMockStorageClient(mctrl) - mockEngine := engine.NewMockEngine(mctrl) - - mockSC.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(&store.Object{}, nil).AnyTimes() - mockSC.EXPECT().Save(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() - mockSP.EXPECT().GetStorageClient(gomock.Any(), gomock.Any()).Return(store.StorageClient(mockSC), nil).AnyTimes() - - t.Run("UCP", func(t *testing.T) { - // Test handlers for UCP resources. - rpctest.AssertRouters(t, handlerTests, "/api.ucp.dev", "/planes/radius/local", func(ctx context.Context) (chi.Router, error) { - r := chi.NewRouter() - return r, AddRoutes(ctx, r, false, ctrl.Options{PathBase: "/api.ucp.dev", DataProvider: mockSP}, mockEngine) - }) - }) - - t.Run("Azure", func(t *testing.T) { - // Add azure specific handlers. - azureHandlerTests := append(handlerTests, - rpctest.HandlerTestSpec{ - OperationType: v1.OperationType{Type: "Applications.Core/providers", Method: v1.OperationGet}, - Path: "/providers/applications.core/operations", - Method: http.MethodGet, - WithoutRootScope: true, - SkipOperationTypeValidation: true, - }) - // Test handlers for Azure resources - rpctest.AssertRouters(t, azureHandlerTests, "", "/subscriptions/00000000-0000-0000-0000-000000000000", func(ctx context.Context) (chi.Router, error) { - r := chi.NewRouter() - return r, AddRoutes(ctx, r, true, ctrl.Options{PathBase: "", DataProvider: mockSP}, mockEngine) - }) - }) -} diff --git a/pkg/corerp/setup/setup.go b/pkg/corerp/setup/setup.go index b4884fa5ad..83549c668e 100644 --- a/pkg/corerp/setup/setup.go +++ b/pkg/corerp/setup/setup.go @@ -17,6 +17,8 @@ limitations under the License. package setup import ( + "time" + asyncctrl "github.com/radius-project/radius/pkg/armrpc/asyncoperation/controller" "github.com/radius-project/radius/pkg/armrpc/builder" apictrl "github.com/radius-project/radius/pkg/armrpc/frontend/controller" @@ -38,6 +40,11 @@ import ( pr_ctrl "github.com/radius-project/radius/pkg/portableresources/backend/controller" ) +const ( + // AsyncOperationRetryAfter is polling interval for async create/update or delete resource operations. + AsyncOperationRetryAfter = time.Duration(5) * time.Second +) + // SetupNamespace builds the namespace for core resource provider. func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerConfig) *builder.Namespace { ns := builder.NewNamespace("Applications.Core") @@ -84,10 +91,16 @@ func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerCon ResponseConverter: converter.HTTPRouteDataModelToVersioned, Put: builder.Operation[datamodel.HTTPRoute]{ - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Patch: builder.Operation[datamodel.HTTPRoute]{ - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + Delete: builder.Operation[datamodel.HTTPRoute]{ + AsyncJobController: backend_ctrl.NewDeleteResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, }) @@ -100,14 +113,20 @@ func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerCon rp_frontend.PrepareRadiusResource[*datamodel.ContainerResource], ctr_ctrl.ValidateAndMutateRequest, }, - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Patch: builder.Operation[datamodel.ContainerResource]{ UpdateFilters: []apictrl.UpdateFilter[datamodel.ContainerResource]{ rp_frontend.PrepareRadiusResource[*datamodel.ContainerResource], ctr_ctrl.ValidateAndMutateRequest, }, - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + Delete: builder.Operation[datamodel.ContainerResource]{ + AsyncJobController: backend_ctrl.NewDeleteResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, }) @@ -120,14 +139,20 @@ func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerCon rp_frontend.PrepareRadiusResource[*datamodel.Gateway], gw_ctrl.ValidateAndMutateRequest, }, - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Patch: builder.Operation[datamodel.Gateway]{ UpdateFilters: []apictrl.UpdateFilter[datamodel.Gateway]{ rp_frontend.PrepareRadiusResource[*datamodel.Gateway], gw_ctrl.ValidateAndMutateRequest, }, - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + Delete: builder.Operation[datamodel.Gateway]{ + AsyncJobController: backend_ctrl.NewDeleteResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, }) @@ -140,14 +165,20 @@ func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerCon rp_frontend.PrepareRadiusResource[*datamodel.VolumeResource], vol_ctrl.ValidateRequest, }, - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Patch: builder.Operation[datamodel.VolumeResource]{ UpdateFilters: []apictrl.UpdateFilter[datamodel.VolumeResource]{ rp_frontend.PrepareRadiusResource[*datamodel.VolumeResource], vol_ctrl.ValidateRequest, }, - AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncJobController: backend_ctrl.NewCreateOrUpdateResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, + }, + Delete: builder.Operation[datamodel.VolumeResource]{ + AsyncJobController: backend_ctrl.NewDeleteResource, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, }) @@ -192,16 +223,25 @@ func SetupNamespace(recipeControllerConfig *controllerconfig.RecipeControllerCon AsyncJobController: func(options asyncctrl.Options) (asyncctrl.Controller, error) { return pr_ctrl.NewCreateOrUpdateResource(options, &ext_processor.Processor{}, recipeControllerConfig.Engine, recipeControllerConfig.ResourceClient, recipeControllerConfig.ConfigLoader) }, + AsyncOperationTimeout: ext_ctrl.AsyncCreateOrUpdateExtenderTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Patch: builder.Operation[datamodel.Extender]{ UpdateFilters: []apictrl.UpdateFilter[datamodel.Extender]{ rp_frontend.PrepareRadiusResource[*datamodel.Extender], }, + AsyncJobController: func(options asyncctrl.Options) (asyncctrl.Controller, error) { + return pr_ctrl.NewCreateOrUpdateResource(options, &ext_processor.Processor{}, recipeControllerConfig.Engine, recipeControllerConfig.ResourceClient, recipeControllerConfig.ConfigLoader) + }, + AsyncOperationTimeout: ext_ctrl.AsyncCreateOrUpdateExtenderTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Delete: builder.Operation[datamodel.Extender]{ AsyncJobController: func(options asyncctrl.Options) (asyncctrl.Controller, error) { return pr_ctrl.NewDeleteResource(options, &ext_processor.Processor{}, recipeControllerConfig.Engine, recipeControllerConfig.ConfigLoader) }, + AsyncOperationTimeout: ext_ctrl.AsyncDeleteExtenderTimeout, + AsyncOperationRetryAfter: AsyncOperationRetryAfter, }, Custom: map[string]builder.Operation[datamodel.Extender]{ "listsecrets": {